Repository navigation
[go_router_builder] Support conditional redirect-only typed parents - #13122
kaluli123123 wants to merge 3 commits into
Conversation
Detect redirect-only routes without installing default page builders, and preserve generated output when the resolved core helper lacks support. Closes flutter/flutter#192358 Co-authored-by: Codex <noreply@openai.com>
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Preserve upstream 18.1.0 and use the batch-release pending changelog for the additive helper API planned for 18.2.0. Keep builder documentation and development dependencies aligned with that helper release.
|
Updated in 1693cec5af with a normal upstream-main merge; no history was rewritten.
This remains a draft pending contributor/maintainer review, the maintainer-controlled CICD label, and applicable upstream checks. Local tests are not evidence of upstream CI or native-device validation. |
|
Updated in 60faee2b67 with a normal merge of upstream main
This remains a draft pending contributor/maintainer review, the maintainer-controlled CICD label, and required upstream checks. The historical Codex co-author CLA finding is not claimed resolved; normal merges retain that ancestry. Local checks do not establish upstream CI or native-device validation. |
[go_router_builder] Conditional redirects on typed parent routes currently reach the default
build/buildPagecallbacks and throwUnimplementedErrorwhen a descendant should render. This also affects parents of nested stateful shells.Closes flutter/flutter#192358.
Summary
redirectOnlyargument to the generated-code helpers ingo_router. It omits builders and the defaultonExitcallback, matching the existing manualGoRouteredirect-only behavior.redirectand inherit both default page methods. Resolve inherited and mixed-in implementations; rejectonExiton redirect-only routes, as manual routes already do.go_router, preserve the previous generated output and diagnostics so a builder patch upgrade does not break existing always-redirecting applications.The earlier discussion in flutter/flutter#103368 predates manual redirect-only support added by #4315. This change brings the typed generator onto that existing behavior rather than changing matching or navigation policy.
Original validation (before the current main sync)
MaterialApp.routercases failed with the reportedUnimplementedErrorbefore the fix. The final router suite passes, covering root redirects, descendant navigation, relative routes, and two nested stateful shells.go_router17.3.0 and uses this local builder.build_runnergenerates no unsupportedredirectOnlyargument, fatal analysis passes, and four real widget navigation tests pass for absolute/relative always-redirecting routes with and withoutonExit.Current refresh validation (2026-10-19)
Synced upstream main
0259ad7e515b74f6855c4c72d81abe2231fe31d3with a normal merge in1693cec5afc6e57705ff7cd96eab625b3a3328bb. The changelog conflict is resolved by retaining upstream's released 18.1.0 content and moving the additive helper entry topending_changelogs/conditional_redirect_only_typed_routes.yamlwithversion: minor, as required by the current core batch-release validator.On Flutter 3.47.0, using temporary local path overrides to test the unpublished core helper with the builder:
go_router ^18.2.0because that future core release is not yet published. The pending helper minor must be integrated and released before publishing the builder.Local passing checks do not establish upstream CI, native-device validation, maintainer approval, or resolution of the historical CLA finding. This PR remains a draft.
Current refresh validation (2026-10-21)
Updated in 60faee2b67 with a normal merge of upstream main
1383427519099a5aae10ca2e1c5c232a6fd88901; no history was rewritten.dart analyze --fatal-infos. Committed-tree repository validation againstorigin/main, license check, formatting, and both locally linked publish dry runs passed; both packages had zero publish warnings.go_router ^18.2.0is not published. The core helper release must precede the builder release; this is not waived by a linked dry run.This remains a draft pending contributor/maintainer review, the maintainer-controlled CICD label, and required upstream checks. The historical Codex co-author CLA finding is not claimed resolved; normal merges retain that ancestry. Local checks do not establish upstream CI or native-device validation.
Readiness
This contribution was developed with Codex assistance. It remains a draft for contributor and maintainer review; human understanding of the full change has not been asserted. The detailed
cla/googleoutput confirms that the submitting author is covered. Its failure is the commit's Codex co-author trailer, which the check treats as an additional uncovered contributor. The historical co-author remains in the original commit, which is retained as an ancestor of the current head. A normal merge cannot remove that contributor from PR history. No history rewrite or force-push was performed, and the historical CLA finding is not claimed resolved. Package CI is also awaiting the maintainer-controlledCICDlabel. No issue closure, merge, release, or repository configuration change was performed.Pre-Review Checklist