-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use caret syntax with flutter create command #150920
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
Use caret syntax with flutter create command #150920
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Early versions of Dart didn't use the caret syntax, but that was a while ago, and the output of flutter create has changed enough that it wouldn't work with those versions anyhow, so this is fine.
If you felt extra ambitious, you might also modify all of the pubspec.yaml files in the rest of the repo, since they also use this notation.
You will need to provide a test before this can be merged, of course. I think the right place for the test is packages/flutter_tools/test/commands.shard/permeable/create_test.dart, or you can request a test exemption (which might be appropriate, as this is really just a semantic change).
|
Thanks @gspencergoog for taking a look!
I can take care of the change if you wish, is there a tracking issue we can make for that effort? If so, let me know and we can get me assigned there. When so, I might be able to perform those changes in additional Pull Requests.
I provided a test on c132651, I kept it quite simple by checking the start of the SDK version definition starts with a caret symbol. As far as I am aware the |
gspencergoog
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no issue that I know of. Feel free to create one and assign yourself. |
loic-sharma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thanks for the contribution!
Manual roll requested by [email protected] flutter/flutter@15f95ce...651a17d 2024-06-28 [email protected] Roll Flutter Engine from a78f5ce743ce to 2f7e9ab27493 (11 revisions) (flutter/flutter#151002) 2024-06-28 [email protected] Draggable feedback positioning (flutter/flutter#149040) 2024-06-28 [email protected] Add support for type-safe plugin apply (flutter/flutter#150958) 2024-06-28 [email protected] Use caret syntax with flutter create command (flutter/flutter#150920) 2024-06-28 [email protected] Roll Packages from 03f5f6d to 412ec46 (12 revisions) (flutter/flutter#150985) 2024-06-28 [email protected] [flutter_tools] Include more details in structured errors sent to a DAP client (flutter/flutter#150698) 2024-06-28 [email protected] Roll Flutter Engine from 94591ffb20df to a78f5ce743ce (1 revision) (flutter/flutter#150972) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The Pull Request changes the `dartSdkVersionBounds` value, which gets templated into the `pubspec.yaml` from the `flutter create`: https://github.com/flutter/flutter/blob/ffdeaa1995efc1fe7d759e13b92eba1ec57beea6/packages/flutter_tools/templates/app/pubspec.yaml.tmpl#L8 As from the Dart dependencies ["Best practices"](https://dart.dev/tools/pub/dependencies#use-caret-syntax) section of the documentation: > Use caret syntax Specify dependencies using the [caret syntax](https://dart.dev/tools/pub/dependencies#caret-syntax). This allows the pub tool to select newer versions of the package when they become available. Further, it places an upper bound on the allowed version. To learn more about the Caret syntax, refer to the [Caret syntax documentation](https://github.com/flutter/flutter/blob/ffdeaa1995efc1fe7d759e13b92eba1ec57beea6/packages/flutter_tools/templates/app/pubspec.yaml.tmpl#L8). **Additional context** - VGVentures/io_crossword#592 (comment) (cc: @kevmoo) - [Very Good Templates](https://github.com/VeryGoodOpenSource/very_good_templates) relies on the Caret syntax when templating the Dart SDK

The Pull Request changes the
dartSdkVersionBoundsvalue, which gets templated into thepubspec.yamlfrom theflutter create:flutter/packages/flutter_tools/templates/app/pubspec.yaml.tmpl
Line 8 in ffdeaa1
As from the Dart dependencies "Best practices" section of the documentation:
To learn more about the Caret syntax, refer to the Caret syntax documentation.
Additional context
^syntax for SDK VGVentures/io_crossword#592 (comment) (cc: @kevmoo)Pre-launch Checklist
///).