-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[go_router_builder] Change mixin name #9626
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
Conversation
|
Works for me for the moment. :) |
chunhtai
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.
change makes sense to me. we should also update the readme
@chunhtai, so are you ok with the approach where the mixin will be public /private based on the routes configuration? or does it seem too inconsistent for you? If you are ok with the current approach, I will add a note in the readme |
chunhtai
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.
I think let's just make this a breaking change. I see no reason to not make this a public mixin. WDYT?
| String get _mixinName { | ||
| // If the routeDataClass is in a different file, we need to make the mixin public | ||
| final Uri routeUri = routeDataClass.source.uri; | ||
| return routeUri != targetUri ? '\$$_className' : '_\$$_className'; |
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.
thinking about it more, let's just do a breaking change and make this a public class. having dealing with cases in both seems counter intuitive since we are maintaining a versioned package.
@chunhtai My ideal scenario would be to improve the Generator to be able track the routes in different files without an annotation in every route file in my ideal scenario, the generator would be able to generate I looked into this, and it seems that it will require so much work and possibly getting rid of |
|
any update? |
|
|
My concern is that developer need to be aware of 2 option,
That will work as well
How so? |
|
any update? |
chunhtai
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.
LGTM, can you write a breaking change doc?
Sure. How can I do that? |
|
breaking change for go_router_builder v4.0.0 Preparing for [#9626](flutter/packages#9626) ## Presubmit checklist - [x] If you are unwilling, or unable, to sign the CLA, even for a _tiny_, one-word PR, please file an issue instead of a PR. - [x] If this PR is not meant to land until a future stable release, mark it as draft with an explanation. - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style)—for example, it doesn't use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first-person pronouns). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.
chunhtai
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.
LGTM
|
autosubmit label was removed for flutter/packages/9626, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
|
@chunhtai The submit label got removed |
|
waiting for another review |
hannah-hyj
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.
LGTM
flutter/packages@a3f09e5...3db5adc 2025-08-29 [email protected] [go_router_builder] Change mixin name (flutter/packages#9626) 2025-08-29 [email protected] [go_router] Add state restoration topic to documentation (flutter/packages#9867) 2025-08-29 [email protected] [camera_avfoundation] Implementation swift migration - part 12 (flutter/packages#9781) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
flutter/packages@a3f09e5...3db5adc 2025-08-29 [email protected] [go_router_builder] Change mixin name (flutter/packages#9626) 2025-08-29 [email protected] [go_router] Add state restoration topic to documentation (flutter/packages#9867) 2025-08-29 [email protected] [camera_avfoundation] Implementation swift migration - part 12 (flutter/packages#9781) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
flutter/packages@a3f09e5...3db5adc 2025-08-29 [email protected] [go_router_builder] Change mixin name (flutter/packages#9626) 2025-08-29 [email protected] [go_router] Add state restoration topic to documentation (flutter/packages#9867) 2025-08-29 [email protected] [camera_avfoundation] Implementation swift migration - part 12 (flutter/packages#9781) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
flutter/packages@a3f09e5...3db5adc 2025-08-29 [email protected] [go_router_builder] Change mixin name (flutter/packages#9626) 2025-08-29 [email protected] [go_router] Add state restoration topic to documentation (flutter/packages#9867) 2025-08-29 [email protected] [camera_avfoundation] Implementation swift migration - part 12 (flutter/packages#9781) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
flutter/packages@a3f09e5...3db5adc 2025-08-29 [email protected] [go_router_builder] Change mixin name (flutter/packages#9626) 2025-08-29 [email protected] [go_router] Add state restoration topic to documentation (flutter/packages#9867) 2025-08-29 [email protected] [camera_avfoundation] Implementation swift migration - part 12 (flutter/packages#9781) 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-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
Fixes #170650
This PR fixes workflows that relied on putting child routes in files different than parent files, which resulted in the (private) mixin being generated in a different file than the route itself.
To avoid releasing a new major version in such a short period, this PR makes the mixin public only if needed. Admittedly makes the behavior somewhat unexpected for the user. @chunhtai @hannah-hyj I will leave that decision for you, whether that's ok or I should make it always public and release a major version instead.
Since this change just fixes a use-case that already didn't compile in 3.x.x, this PR doesn't bump the major version.
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3