fix(app-router): align navigation prefetch commits#2104
Open
NathanDrake2406 wants to merge 2 commits into
Open
fix(app-router): align navigation prefetch commits#2104NathanDrake2406 wants to merge 2 commits into
NathanDrake2406 wants to merge 2 commits into
Conversation
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This ports the relevant behaviour from Next.js's
test/e2e/app-dir/navigation/navigation.test.tsand fixes the App Router navigation lifecycle issues that surfaced in the deploy harness:Upstream references
PrefetchKind.AUTO/FULLsemantics: https://github.com/vercel/next.js/blob/ee6e79b1792a4d401ddf2480f40a83549fe8e722/packages/next/src/client/components/router-reducer/router-reducer-types.ts#L131-L146Test notes
The local Playwright port keeps the same observable contracts as the upstream file. The hash fixture uses the same link structure and RSC-request assertions; target scroll positions are computed from the rendered fixture because
app-basichas a different root/template offset than Next.js's upstream fixture. The async metadata fixture preserves the 5s metadata delay and fallback/content/title assertions. The upstream deploy-suite run remains the exact file-scope parity check.Verification
vp test run tests/app-browser-entry.test.ts -t "same-path search and hash|stays pending until NavigationCommitSignal|authoritative payload"PLAYWRIGHT_PROJECT=app-router pnpm exec playwright test tests/e2e/app-router/nextjs-compat/navigation.spec.ts --grep "hash|navigating to a page with async metadata"vp test run tests/app-page-route-wiring.test.ts tests/prefetch-cache.test.ts tests/app-browser-entry.test.ts tests/link-navigation.test.ts tests/link.test.ts tests/navigation-planner-prefetch-reuse.test.tsvp checkvp env exec --node 24 ./scripts/run-nextjs-deploy-suite.sh /Users/nathan/Projects/vinext/.refs/nextjs-v16.2.6 --retries 0 -c 1 --debug test/e2e/app-dir/navigation/navigation.test.ts