-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Provide mechanism to mark API as deprecated by a particular Dart SDK version #49545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The high-level idea here is that this would enable us to do something like:
Later this would also enable things like pub.dev to add "Dart 3 compatible" (combined with a check for no use of legacy null mode). Does that make sense? |
We should not have any deprecated APIs that survive a major version increment, so would it suffice to simply consider all deprecated declarations as errors? We can definitely put an extra (optional) field on It would not really make sense to have SDK-version dependencies in non-platform libraries. Another option is to not use a language version as the "tag", but provide a unique tag string instead. We can use "3.0" for that if we want to, but we can also use "DART_SDK_3_0_UPDATE" or whatever we want, and other people's packages can use their own string tags, for their own changes. We still need to allow some uses of the deprecated members, inside the declaring library/package, since it hasn't actually removed it yet. So, we can't just compile as if the code wasn't there. |
Historically we've had a gap between "should not" and "won't". I do think customers should still treat deprecations as if they will be removed in the next major version. I think the filter we want is for the location of the deprecated definition. Something like |
I like the idea of making it per-package. I'd even drop a having a special flag for the SDK, and just treat it as a package named |
We already know that this is the case.
@natebosch @lrhn can you clarify why you think we need the ability to filter by package? What would we use that for? |
If this feature is useful to us, it's probably useful to others as well. You'd be able to test that by saying For the SDK, we'd do |
Closing as we didn't end up needing this |
We'd like to track readiness of code for upcoming API deprecations. E.g, if an API is slated to be removed in Dart 3.0, we'd like to be able to mark that and trigger warnings.
Would adding an optional sdk version named param to
Deprecated
make sense?@lrhn @mit-mit @natebosch @leafpetersen
The text was updated successfully, but these errors were encountered: