Skip to content

Conversation

@alestiago
Copy link
Contributor

@alestiago alestiago commented Jun 27, 2024

The Pull Request changes the dartSdkVersionBounds value, which gets templated into the pubspec.yaml from the flutter create:

As from the Dart dependencies "Best practices" section of the documentation:

Use caret syntax
Specify dependencies using the 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.

Additional context

Pre-launch Checklist

@flutter-dashboard
Copy link

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.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jun 27, 2024
@kevmoo kevmoo requested a review from gspencergoog June 27, 2024 20:52
Copy link
Contributor

@gspencergoog gspencergoog left a 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).

@alestiago alestiago requested a review from gspencergoog June 28, 2024 11:17
@alestiago
Copy link
Contributor Author

alestiago commented Jun 28, 2024

Thanks @gspencergoog for taking a look!


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.

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.


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).

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 VersionConstraint doesn't offer a way to check if the syntax the version was declared was with a caret syntax or a traditional syntax without evaluating its string representation. The test structure mimics a very similar test in the same file named "should escape ":" in project description".

Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@gspencergoog
Copy link
Contributor

I can take care of the change if you wish, is there a tracking issue we can make for that effort?

There's no issue that I know of. Feel free to create one and assign yourself.

Copy link
Member

@loic-sharma loic-sharma left a 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!

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 28, 2024
@auto-submit auto-submit bot merged commit 47e65e8 into flutter:master Jun 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 28, 2024
@alestiago alestiago deleted the alestiago/create-command-to-use-caret-syntax branch June 28, 2024 18:29
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 28, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jun 29, 2024
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
victorsanni pushed a commit to victorsanni/flutter that referenced this pull request Jul 8, 2024
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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants