fix(app-router): align dynamic-on-hover prefetches#2464
Conversation
|
/bigbonk review for issues |
commit: |
|
|
UnknownError: ProviderInitError |
|
@james-elicx Bonk workflow failed. Check the logs for details. View workflow run · To retry, trigger Bonk again. |
|
/bigbonk review for issues |
1 similar comment
|
/bigbonk review for issues |
|
|
Review posted to PR #2464. SummaryI reviewed PR #2464 ( Verdict: no blocking issues. It's a well-scoped, well-tested change. Key things I verified as correct:
Non-blocking notes raised:
|
NathanDrake2406
left a comment
There was a problem hiding this comment.
Requesting changes on two structural issues: the Link prefetch mode now bypasses the existing route eligibility boundary, and the server skip disposition reuses a cache-proof contract for a different shell-delta invariant.
| : mode === "full-after-shell" | ||
| ? { cacheForNavigation: true, prefetchShellFirst: true, shouldPrefetch: true } | ||
| : resolveFullAppRoutePrefetch(); | ||
| : mode === "auto-shell" |
There was a problem hiding this comment.
This adds auto-shell as an unconditional prefetch plan, which bypasses the route-manifest eligibility check that normal auto gets through resolveAutoAppRoutePrefetch(). Since visible unstable_dynamicOnHover links are switched to this mode, any same-origin App-runtime link can now issue a shell RSC prefetch even when it has no __VINEXT_LINK_PREFETCH_ROUTES__ match. This is exactly the kind of mode-string branching that makes link.tsx harder to reason about. Can we push this back into a single typed prefetch-plan helper that always does route eligibility first, then chooses shell-only vs navigation-cache behavior for matched routes?
| return plan.skipDisposition; | ||
| } | ||
|
|
||
| function createDynamicPrefetchAfterShellSkipDisposition(input: { |
There was a problem hiding this comment.
This reuses ClientReuseManifestSkipDisposition and returns SKIP_STATIC_LAYOUT_VERIFIED directly from current layoutFlags, but this path is not the same invariant as the existing manifest/cache-proof verifier in skip-cache-proof.ts; it depends on the client having a fresh shell payload, not on server-side cache proof. Reusing the verified disposition muddies the boundary and makes later readers think the normal proof pipeline ran. Can we add an explicit shell-delta skip model/code, or move this behind a helper in the skip/cache-proof layer with a name that states the prerequisite?
…he-dynamic-on-hover-28478866791 # Conflicts: # packages/vinext/src/shims/link.tsx # tests/link-navigation.test.ts
…he-dynamic-on-hover-28478866791
…he-dynamic-on-hover-28478866791
…he-dynamic-on-hover-28478866791 # Conflicts: # tests/link-navigation.test.ts
…he-dynamic-on-hover-28478866791
|
Deploy-suite run 28478866791 / report job 84413308650 triage: this PR appears to cover the App Router hover-prefetch behavior row from Exact row:
Since this PR is already James-owned, I am skipping duplicate implementation work for this row. |
…866791 # Conflicts: # packages/vinext/src/plugins/rsc-reference-validation-normalizer.ts # packages/vinext/src/shims/link.tsx
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
Summary
Next.js parity
Targets the App Router Segment Cache behavior covered by:
test/e2e/app-dir/segment-cache/dynamic-on-hover/dynamic-on-hover.test.tsValidation
vp test run tests/link-navigation.test.ts -t "loading-shell prefetch|shell prefetch fails|dynamic-on-hover"vp test run tests/app-page-render.test.ts tests/app-page-route-wiring.test.ts -t "dynamic-on-hover|loading-shell prefetches without|omits static layouts"vp test run tests/link-navigation.test.ts tests/app-page-render.test.ts tests/app-page-route-wiring.test.tsvp checkon touched filesREPO="$(pwd)" NEXTJS_DIR="/Users/jamesanderson/Developer/vinext/.nextjs-ref" NEXT_TEST_CONCURRENCY=1 ./scripts/run-targeted-nextjs-e2e.sh test/e2e/app-dir/segment-cache/dynamic-on-hover/dynamic-on-hover.test.ts(1/1 passed)Review
Independent review found one issue before PR: hover dynamic-after-shell could proceed after a failed/stale shell prefetch and cache a payload missing static layouts. This branch includes the follow-up guard and regression test.