Repository navigation
[analyzer/meta] Proposal: Work towards package:meta next major release #54389
Copy link
Copy link
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-pkg-metaIssues related to package:metaIssues related to package:metatype-taskA well-defined stand-alone taskA well-defined stand-alone task
Description
There are a few annotations that exist in package:meta that don't make sense in either a Dart 2 or Dart 3 world. To reduce API surface area and potentially misleading or confusing suggestions, work towards the next breaking major release (3.x.x) should be made.
To reduce any potential impact on the ecosystem which is used quite widely, a three step plan similar to the following could be used to get there:
1. Prepare for deprecation
- Keep the
^2.12.0SDK constraint for now - Indicate through API comments and changelog expected deprecations, to give another chance to adapt.
- Make a
1.xrelease with these changes, likely1.12.0unless a new release is made before this point.
https://dart-review.googlesource.com/c/sdk/+/342281
2. Increase SDK constraint and deprecate
- Increase SDK constraint to
^3.0.0as language versions before 2.12 are no longer supported at that point. - Deprecate
@sealed(Deprecate@sealedannotation #53310)- If the other uses of the annotation are desired to be maintained, it should likely be a new annotation for clarity (Explain how to write mocks for classes using the new class modifiers site-www#5143 (comment))
- Deprecate
@requiredand@Required(Should pkg/meta's @required be deprecated for Dart v3? #49568)- If it's desired to add an annotation that indicates an argument will be required in the future, it should likely be a new annotation (Analyzer, treat
@requiredin null-safe code as a deprecation notice. #49066). This could be part of this release if determined as essential.
- If it's desired to add an annotation that indicates an argument will be required in the future, it should likely be a new annotation (Analyzer, treat
- Make any other desired deprecations, such as any annotations currently marked as experimental.
- An example: Do consider deprecating the
meta_dart2jsannotations if they aren't providing the value they hoped for.
- An example: Do consider deprecating the
- Make a final
1.xrelease, perhaps will be1.13.0with these deprecations.
3. Update to next major version and begin implementing breaking changes
- Update pubspec version to
3.0.0-wipto begin work on the breaking changes.3.0.0is needed instead of2.0.0due to an accidental release of2.0.0previously.
- Remove all deprecated annotations
- This currently includes:
@alwaysThrows,@checked,@virtual, and likely@required,@Required,@sealed.
- This currently includes:
- Mark all classes as
finalas the classes inpackage:metaare not intended to be subclassed. - Clearly document all breaking changes in the package in the changelog.
- Publish the major release :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-pkg-metaIssues related to package:metaIssues related to package:metatype-taskA well-defined stand-alone taskA well-defined stand-alone task
Activity
[-][analyzer/meta] Work towards `package:meta` next major release[/-][+][analyzer/meta] Proposal: Work towards `package:meta` next major release[/+][meta] Cleanup API docs and clarify superseded annotation status