[lts-active] Turbopack: backport Pages Router dev module graph chaining (#98823,…
[lts-active] Turbopack: backport Pages Router dev module graph chaining (#98823, #99910, #100091) (#100008) ## Summary Backports these canary commits to `releases/lts/active`: | PR | Commit | Change | | --- | --- | --- | | #98823 | `6dd4b27b` | Chain the Pages Router dev client module graphs to fix `_app` availability (#99789). | | #99910 | `1e1f9e69` | Add Pages Router availability coverage and restore the import-order assertion. | | #100091 | `5eec1d9d` | Fix `_app` `next/dynamic` preload 404s introduced by #98823, and preload those imports in production too. | The third commit must ship with #98823: chaining the page and `_app` graphs made pages preload `_app`'s dynamic imports with the **page's** availability, unlike `_app`'s own async loader. #100091 chunks those imports with `_app`'s own graph and availability, then merges them with the page's imports. The generic collector and App Router are untouched. The regression was reproduced with [dcheng1290/next-loadable-404](https://github.com/dcheng1290/next-loadable-404). All three backports retain cherry-pick provenance. #100091 had an import-only conflict in `pages.rs` because LTS lacks an unrelated `smallvec` import; the resolution adds only `FxHashSet`. The added/removed lines and test files match upstream. Existing branch history is preserved; the merged GTM test fix (#100011) remains included. Fixes #99789 on the LTS line. ## Verification With a native binary rebuilt from this LTS backport branch: - `pages-app-next-dynamic-preload`: **5/5 pass** in Turbopack dev and build/start. The suite checks every referenced static asset returns 200, the dynamic component renders, and both pages preload the same non-empty chunk set. - Before applying #100091, the same suite fails **2/5** in Turbopack dev on this branch: a non-200 asset and the preload assertion. - `pages-app-availability-boundary` and `app-document-import-order`: **3 pass, 1 existing skip** in Turbopack dev. The upstream gated deduplication assertion remains unchanged. - `pnpm build-all --env-mode=loose`, `cargo check -p next-api`, `cargo fmt -p next-api --check`, scoped Prettier and ESLint pass. The initial full bootstrap ran out of sandbox disk during native compilation; after clearing disposable artifacts and passing the Cargo environment through Turbo, the full build passed. Earlier verification, before adding #100091, also covered the #99910 suites in Turbopack start and webpack dev. The new LTS backport has not been tested locally in deploy mode, on other platforms, or with full workspace type-checking; CI will provide that coverage. <!-- NEXT_JS_LLM --> <!-- fleet 652922cb-dc34-493d-9be5-c241a5164cad --> --------- Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment