-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[go_router] Add GoRouterState parameters to GoRouterData and rename replace methods #2848
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
[go_router] Add GoRouterState parameters to GoRouterData and rename replace methods #2848
Conversation
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
packages/go_router/CHANGELOG.md
Outdated
## 5.3.0 | ||
|
||
- Adds `redirectWithState` to `GoRouteData`. | ||
- `GoRouteData.redirect` is now deprecated in favor of `GoRouteData.redirectWithState`. |
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.
- `GoRouteData.redirect` is now deprecated in favor of `GoRouteData.redirectWithState`. | |
- Deprecates `GoRouteData.redirect` in favor of `GoRouteData.redirectWithState`. |
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've updated it in ✏️ Better changelog
Is it possible to keep the name |
I agree with @johnpryan that we should probably just break it, but I am not sure if we can merge this without breaking the go_router_builder's build. It we can't we would need some sort of soft transition. |
yes it looks like we will probably be fine, all the reference in go_router_builder is doc. Let's just do a breaking change and write a migration guide and bump major version |
@chunhtai @johnpryan Sure I can make it a breaking change.
|
We should definitrly remove buildPage, but I am not sure if we should rename it back, it feels it defeat the purpose of the @deprecated. WDYT @johnpryan
yes I think we may as well do all of these at once. |
…eter to all GoRouteData callbacks
I've introduced the breaking changes in
Yes, that is quite true haha. But since we are introducing breaking changes, why not? It also feels a bit weird that we are okay with breaking changes when there is no deprecation warning. But we are not when there was one (even if it was not really correct in this context).
For this, do you mean I should write a migration guide like this one? https://flutter.dev/go/go-router-v5-1-2-breaking-changes |
@ValentinVignal you can make a copy of flutter.dev/go/template and follow the instruction above. once the doc is available through flutter.dev/go, you can then link the flutter.dev/go link to the go_router readme as part of this pr |
you can also use something like kodify to format code block |
also since you are doing it now, might as well consider including renaming in #2846 |
…with-state # Conflicts: # packages/go_router/CHANGELOG.md # packages/go_router/pubspec.yaml
@chunhtai I've create a migration guide (see flutter/website#7910) I've included the breaking change |
…with-state # Conflicts: # packages/go_router/CHANGELOG.md # packages/go_router/pubspec.yaml
…with-state # Conflicts: # packages/go_router/CHANGELOG.md # packages/go_router/pubspec.yaml
@chunhtai @johnpryan Is there anything else you want me to do on this PR ? |
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 add the migration guide to the readme?
09a2ecb
to
6e6afbf
Compare
Sorry I forgot to do that. |
redirectWithState
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
Resolves flutter/flutter#115955
After this is merged, I'll make another PR on [go_router_builder] to replace all the references of the deprecated
redirect
toredirectWithState
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.