Commit Graph

1229 Commits

Author SHA1 Message Date
github-actions[bot] a399fc55e2 chore: version packages (#2293)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-29 19:46:44 +01:00
James Anderson bcd4e44d96 feat(build): support prerender vite config (#2415)
* feat(build): support prerender vite config

* feat(init): offer prerender config opt-in

* fix(cloudflare): export prerender deploy helper

* fix(cloudflare): avoid redundant prerender config load

* fix(build): quiet adapter fallback warnings
2026-06-29 19:16:08 +01:00
James Anderson a3910e7aa9 feat(cloudflare): add unified worker entry (#2416)
* feat(cloudflare): add default pages router worker entry

* feat(cloudflare): add unified worker entry

* chore(web): use unified worker entry

* chore(examples): use built-in workers-cache entry

* chore(examples): keep hackernews on app router entry

* chore(cloudflare): rename unified entry to fetch handler

* chore(cloudflare): keep pages entry source helper test-local
2026-06-29 17:33:51 +00:00
James Anderson 0a48f0f7fb feat(cloudflare): move deploy command to cloudflare package (#2405)
* feat(cloudflare): move deploy command to cloudflare package

* fix(cloudflare): expose deploy cli bin
2026-06-29 16:47:28 +00:00
Boy Steven 94ea837cfc fix(init): only detect pnpm approve-builds failures from pnpm-specific output (#2404) 2026-06-29 15:41:24 +01:00
James Anderson 31e87439df fix(pages-router): retain prefetched SSG data (#2366)
* fix(pages-router): retain prefetched SSG data

* fix(pages-router): align SSG export detection

* fix(pages-router): skip data prefetch for non-SSG routes

* fix(pages-router): align data navigation with Next.js

* chore: avoid exporting middleware matcher helper type

* fix(pages-router): preserve client navigation effects

* fix(pages-router): preserve query rewrite history timing

* fix(pages-router): keep data fetch startup synchronous

* fix(pages-router): keep superseded data fetches alive

* fix(pages-router): skip nonmatching redirect matcher awaits

* fix(pages-router): reuse middleware SSR prefetch data

* Fix pages data prefetch CI regressions

* fix(pages-router): evict middleware prefetch cache
2026-06-29 14:52:35 +01:00
James Anderson 4f5ab7b46b fix(pages): pass req res to document initial props (#2402) 2026-06-29 12:17:13 +01:00
James Anderson 69e0051cf7 fix(pages): expose parsed cookies on request objects (#2401) 2026-06-29 11:29:35 +01:00
James Anderson 011349b858 fix(app-router): match generated params case-insensitively (#2351)
* fix(app-router): match generated params case-insensitively

* test(app-router): preserve requested static param casing
2026-06-28 23:14:14 +00:00
James Anderson 56772ed310 fix(build): resolve framework-owned SWC helpers (#2357)
* fix(build): resolve framework-owned SWC helpers

* fix(test): preserve shared node_modules during deploy prepare
2026-06-29 00:11:42 +01:00
James Anderson 8fccb026e5 fix(app-router): honor basePath opt-out rewrites (#2362)
* fix(app-router): honor basepath opt-out rewrites

* fix(app-router): preserve basePath opt-out redirects

* fix(app-router): harden basePath opt-out routing

* fix(app-router): admit basePath middleware requests

* fix(app-router): reject untouched basePath misses

* fix(app-router): scope pages fallback rewrites
2026-06-29 00:11:29 +01:00
James Anderson 0ea90fdbaa fix(app-router): preserve layouts across soft navigation (#2316)
* test(app-router): reproduce server layout identity reset

* fix(app-router): preserve soft navigation layout identity

* test(app-router): model bfcache identities in reducer fixtures

* fix(app-router): refresh layouts after revalidating actions

* fix(navigation): balance history restore snapshots

* fix(app-router): refresh layout elements during HMR commits
2026-06-28 23:07:55 +00:00
James Anderson 18e618c53e fix(app-router): preserve primary parallel route slot (#2347)
* fix(app-router): preserve primary parallel route slot

* test(app-router): match parallel default layout parity

* fix(app-router): prefer nearest parallel children owner

* fix(app-router): preserve mounted slot state after HMR

* test(app-router): wait for selected parallel slot before HMR
2026-06-28 22:59:48 +00:00
James Anderson f67f872b88 fix(app-router): preserve named parallel slot state (#2246)
* fix(app-router): preserve named layout segments

* fix(app-router): preserve named slots on replace

* fix(app-router): preserve named slots through hmr

* fix(app-router): settle named slot review races

* fix(app-router): reject superseded hmr payloads

* fix(app-router): preserve committed named segments

* fix(app-router): resolve intercepted named slot segments

* fix(app-router): preserve unmatched named segments

* fix(app-router): prioritize navigation over pending hmr

* fix(app-router): keep navigation authority over hmr

* fix(app-router): preserve hmr authority for stale lanes

* fix(app-router): preserve page segment marker
2026-06-28 22:35:23 +00:00
James Anderson ad14e9b039 fix(app-router): avoid repeated hover prefetches (#2396)
* fix(app-router): avoid repeated hover prefetches

* fix(app-router): floor prefetch fallback stale time
2026-06-28 23:24:30 +01:00
James Anderson f0ba7b4afe fix(app-router): reuse committed client cache payloads (#2251)
* fix(app-router): seed client navigation cache

* fix(cache): parse prerender cache metadata marker

* test(cache): cover prerender metadata done marker

* fix(cache): preserve static committed stale time

* fix(link): honor dynamic stale time for auto prefetches

* fix(router): retain committed client cache state

* fix(router): publish client cache after commit

* fix(router): gate hydration cache publication

* fix(router): guard late client cache publication

* fix(router): isolate client cache parity coverage

* fix(router): preserve authoritative navigation commits

* fix(router): preserve committed navigation streams
2026-06-28 22:01:58 +00:00
James Anderson 89ab891bb1 fix(build): keep dynamic third-party imports bare in published dist (#2395)
The published `dist/shims/link.js` baked an absolute build-machine path into
the lazy Pages Router import:

    loadRouter: async () =>
      (await import("/<build-host>/node_modules/.pnpm/next@.../next/router.js"))

That path only exists on the machine that built vinext, so every consumer (and
CI) build fails with:

    [UNRESOLVED_IMPORT] Could not resolve '/.../next/router.js'

Root cause: #2279 replaced `deps.skipNodeModulesBundle: true` with a
`deps.neverBundle` predicate that keys off the *resolved* id
(`id.includes("node_modules")`). Rolldown resolves a dynamic `import()` literal
to an absolute path *before* `neverBundle` runs, so the bare specifier is lost
for dynamic imports (static imports were unaffected).

Restore the pre-#2279 behaviour by externalizing on the *unresolved* bare
specifier via `inputOptions.external`, so dynamic imports stay bare like static
ones. First-party `vinext`/`@vinext/*` self-imports and the `alwaysBundle`
packages (`am-i-vibing`, `process-ancestry`) are excluded so they keep being
bundled/relative-rewritten.

Verified the emitted `dist` is byte-identical to the current build except the
single fixed `next/router` line, and the `am-i-vibing` bundle is unchanged.
2026-06-28 22:43:13 +01:00
MaxtuneLee c602026b6d fix(app-router): normalize trailing slash in implicit cache tags (#2390)
* fix(app-router): normalize trailing slash in implicit cache tags for revalidatePath

* docs: remove unnecessary comments

* style: format files
2026-06-28 20:50:18 +01:00
Yunfei He 2b61f3fd29 perf(metadata): cache scanMetadataFiles to skip the redundant 2nd per-build app-tree walk (#2394)
* perf(metadata): cache the per-build app metadata-file scan

* fix(metadata): invalidate cache on opengraph/twitter alt-text sidecars

scanMetadataFiles folds `*.alt.txt` sidecars into a static social image
route's altFilePath via an existsSync probe, but isMetadataRouteFile did
not treat them as route files. With the new per-appDir scan cache, adding
or removing an alt sidecar in dev no longer triggered invalidation, so
the cached scan kept a stale altFilePath. Match the sidecars in the dev
invalidation predicate so the metadata cache clears and re-scans.

---------

Co-authored-by: James Anderson <james@eli.cx>
2026-06-28 19:30:38 +00:00
Yunfei He 91c9c18f6e perf(plugins): skip dynamic-request AST parse for static-import-only modules — 5000-route build −21% (#2392) 2026-06-28 19:55:29 +01:00
Yunfei He ae43973395 perf(routing): cache app-route-graph directory reads — 5000-route build −32% (#2389)
discoverInheritedParallelSlots reads every ancestor directory of each route with fs.readdirSync to find @slot dirs. Because routes share ancestors, a directory with N sibling routes is read once per descendant route, making the scan super-linear in route-directory width. Memoize the reads in a per-scan WeakMap<matcher, Map<dir, Dirent[]>> (same pattern as findFileProbeCache/findSlotSubPagesCache), scoped to one scan so it's collected afterwards. On a 10k-route fixture this cuts build wall time ~52% (~86s -> ~42s) and syscall time ~61%, output byte-identical.
2026-06-28 19:52:11 +01:00
James Anderson da086c0d65 Revert flaky "fix(link): start viewport prefetches immediately" (#2386)
This reverts commit 06775d3694.
2026-06-27 00:23:40 +01:00
James Anderson 1593d4ce93 fix(app-router): scroll past existing hoisted styles (#2356)
* fix(app-router): scroll past existing hoisted styles

* test(app-router): restore document descriptor
2026-06-26 21:46:01 +01:00
James Anderson 9faa43e148 fix(app-router): include page segment in flight state (#2359)
* fix(app-router): include page segment in flight state

* fix(app-router): keep page marker internal
2026-06-26 21:44:20 +01:00
James Anderson a21667fd09 fix(app-router): discover nested leaf slot routes (#2350)
* fix(app-router): discover nested leaf slot routes

* test(routing): align nested leaf slot expectation

* test(routing): assert nested leaf route match

* fix(app-router): scope nested leaf slot discovery
2026-06-26 21:42:15 +01:00
James Anderson cab6622ce8 fix(app-router): restore intercepted history slots (#2363)
* fix(app-router): restore intercepted history slots

* fix(app-router): scope interception restore proof
2026-06-26 21:41:12 +01:00
James Anderson 7cad67080e fix(server): restore client trace metadata parity (#2371)
* fix(server): restore client trace metadata parity

* fix(server): use recorded spans for trace metadata

* test(server): cover active trace metadata spans

* fix(server): fail open for trace metadata propagation

* docs(server): clarify trace metadata lifecycle
2026-06-26 21:40:19 +01:00
James Anderson 4edd1e1b1c fix(css): support namespace CSS Module imports (#2345)
* fix(css): support namespace CSS Module imports

* fix(css): preserve CSS Module query semantics

* fix(css): parse JavaScript components as JSX

* fix(css): harden CSS Module import compatibility

* fix(css): order compiled MDX compatibility last
2026-06-26 21:39:12 +01:00
James Anderson 06775d3694 fix(link): start viewport prefetches immediately (#2229)
* fix(link): start viewport prefetches immediately

* fix(navigation): skip client prefetches for bots
2026-06-26 20:38:28 +00:00
James Anderson 737532aaa8 fix(app-router): preserve interception across middleware rewrites (#2342) 2026-06-26 21:36:48 +01:00
James Anderson e4f5a0e56b fix(app-router): honor global not found opt-in (#2340)
* fix(app-router): honor global not found opt-in

* fix(app-router): render default global 404 standalone

* test(app-router): avoid fixture workspace lockfile entry

* test(app-router): keep fixture esm outside workspace

* fix(app-router): add default global 404 shell

* test(app-router): cover client not found boundary

* fix(app-router): gate global not found discovery
2026-06-26 21:34:25 +01:00
James Anderson 5c1e870ace fix(router): honor middleware app rewrites for page links (#2339)
* fix(router): honor middleware app rewrites for page links

* fix(router): preserve masked page data targets

* fix(router): keep non-middleware data fetch timing

* docs(router): explain middleware data handoff invariants
2026-06-26 21:33:23 +01:00
James Anderson 0c18c9f20a fix(app-router): replay prerendered preload headers (#2333)
* fix(app-router): replay prerendered preload headers

* fix(app-router): retain preload headers during ISR

* fix(app-router): reuse ISR font preload snapshot
2026-06-26 21:32:22 +01:00
James Anderson 859a0aac15 fix(app-router): bind layout-only children defaults (#2335)
* fix(app-router): bind layout-only children defaults

* fix(app-router): preserve standalone slot owners

* fix(app-router): ghost fallback catch-all owners
2026-06-26 21:31:02 +01:00
James Anderson 50e2385986 fix(form): match Next.js navigation parity (#2245)
* fix(form): match Next.js navigation parity

* fix(form): block dangerous navigation schemes

* fix(form): address Pages navigation review

* fix(form): preserve native and hard navigation fallbacks
2026-06-26 19:56:06 +00:00
James Anderson 70c500bf65 fix(app-router): scope static params across parallel routes (#2317)
* fix(app-router): scope static params across parallel routes

* fix(app-router): collect static params from parallel layouts

* style(app-router): format parallel route fixtures

* fix(app-router): scope parallel segment params
2026-06-26 20:52:20 +01:00
James Anderson feb27e8422 fix(client): isolate Pages Router module graph (#2380)
* fix(client): isolate Pages Router module graph

* fix(client): trim hybrid route ownership graph

* fix(router): preserve document-only hard navigation
2026-06-26 20:52:13 +01:00
James Anderson 4bc2dd3235 fix(image): match App Router deploy parity (#2310)
* fix(image): restore app router deploy parity

* test(image): expect configured optimizer widths

* fix(image): match responsive width selection
2026-06-26 20:36:27 +01:00
James Anderson c5bd7b33c2 fix(app-router): skip prefetches for bots (#2323)
* fix(app-router): skip prefetches for bots

* fix(link): scope bot suppression to app prefetch

* fix(app-router): skip form prefetches for bots
2026-06-26 19:59:29 +01:00
James Anderson 77d67a98c4 fix(cache): bypass unstable cache in draft mode (#2319)
* fix(cache): bypass unstable cache in draft mode

* fix(cache): preserve draft state during action rerenders
2026-06-26 19:58:36 +01:00
James Anderson 89036154cc fix(pages-router): unify client asset bootstrap (#2378)
* fix(pages-router): hydrate worker-backed dev pages

* refactor(pages-router): unify client asset bootstrap

* fix(app): preinitialize bootstrap dependencies

* test(app): distinguish preinit scripts from bootstrap

* fix(app): root-anchor bootstrap preinit modules

* test(app): cover bootstrap preinitialization in browsers

* fix(app): share client assets with nested SSR modules

* test(app): verify bootstrap preinit CSP nonces

* test(app): serve CSP nonce in worker fixture

* fix(test): read CSP script nonce property

* fix(cloudflare): emit client assets beside final workers

* fix(build): resolve pages client assets from source

* fix(app): register client assets in ssr graph

* fix(pages-router): harden client bootstrap resolution

* fix(build): emit client assets for node outputs

* fix(build): package client assets in standalone output

* test(app): reference worker nonce fixture explicitly

* fix(build): preserve client assets across environments

* refactor(build): unify client asset outputs

* fix(build): stabilize custom client asset outputs

* fix(build): finalize client assets after app builds

* fix(build): reuse client assets in hybrid builds

* fix(build): scope hybrid client assets metadata

* test(e2e): colocate Cloudflare worker fixture
2026-06-26 19:48:26 +01:00
James Anderson 41185327f3 fix(cli): respect Vite dev server config (#2379)
* fix(cli): respect Vite dev server config

* docs(cli): clarify Vite config hook ordering
2026-06-26 18:46:25 +01:00
James Anderson 25a3c26f7a feat(init): scaffold for cloudflare and node (#2279)
* feat(init): select deployment platform

* refactor(init): AST-update deployment config

* feat(init): configure Cloudflare cache and images

* fix(init): avoid backtracking in config updates

* fix(init): cover packaged Cloudflare setup

* ci: allow Cloudflare init smoke builds

* ci: fix packaged Cloudflare dependency install

* test(e2e): isolate browser fixture servers

* chore: allow Windows taskkill binary

* fix(init): configure Cloudflare image adapter

* fix(init): address platform setup review

* fix(init): address cache setup review

* fix(init): hide workers cache option

* fix(init): align generated config indentation

* fix(init): validate cloudflare setup before mutation

* fix(init): preserve additive config syntax

* fix(init): tidy interactive prompt spacing

* fix(images): rename Cloudflare optimizer builder

* refactor(images): remove draft name migration

* fix(init): install dependencies after setup

* fix(init): clarify setup recovery steps

* fix(init): ignore Wrangler state for Cloudflare

* fix lockfile
2026-06-26 17:09:19 +01:00
James Anderson da179857dc fix(app-router): render templates with children only (#2322)
* fix(app-router): render templates with children only

* test(app-router): correct server template navigation parity

* LGTM: template fix matches Next.js

Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>

* chore(test): remove fixture symlink noise

* LGTM: template fix matches Next.js

Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>

* fix(app-router): preserve template children-only fix

---------

Co-authored-by: ask-bonk[bot] <ask-bonk[bot]@users.noreply.github.com>
Co-authored-by: james-elicx <james-elicx@users.noreply.github.com>
2026-06-26 14:51:46 +01:00
James Anderson 618cd66b30 fix(app-router): align static dynamic params parity (#2321)
* fix(app-router): align static dynamic params parity

* fix(app-router): preserve dynamic error fallback params

* chore(test): format force-static fixture
2026-06-26 14:45:37 +01:00
James Anderson 427609f5e0 fix(app-router): avoid probing client references (#2313) 2026-06-26 14:44:29 +01:00
James Anderson f05eeb8dde fix(cache): throw updateTag context errors synchronously (#2311) 2026-06-26 14:42:40 +01:00
James Anderson 126856cdc4 fix(config): match trailing-slash route sources (#2255)
* fix(routing): match slashed rewrite sources

* fix(routing): align redirect slash matching
2026-06-26 14:42:04 +01:00
James Anderson ffd28c133f fix(app-router): match dynamic request analysis parity (#2253)
* fix(app-router): ignore fully dynamic requests

* fix(app-router): match dynamic request analysis semantics

* fix(app-router): complete dynamic request analysis

* fix(app-router): complete dynamic request analysis

* fix(app-router): avoid unsafe dynamic request folding

* fix(build): respect static block request bindings

* fix(build): scope static block var bindings

* fix(build): scope dynamic request parameter defaults

* fix(build): honor dynamic request ignore comments

* fix(build): parse dynamic request comments safely

* perf(build): skip irrelevant dynamic request modules

* refactor(build): scope dynamic request analysis

* fix(build): track TypeScript value bindings

* fix(build): preserve bounded concat requests

* fix(build): harden dynamic request analysis

* fix(build): harden dynamic request analysis

* fix(build): preserve switch discriminant scope

* fix(build): resolve constant dynamic request expressions

* fix(build): align unary dynamic requests

* fix(build): preserve negative numeric dynamic requests

* fix(build): align remaining dynamic request analysis

* fix(build): align dynamic request sequence analysis

* fix(build): resolve constant string predicates

* fix(build): bound dynamic request alias resolution

* fix(build): resolve dynamic request aliases lexically

* fix(build): align dynamic request global constants

* fix(build): align NaN dynamic request predicates

* fix(build): include optimized transpile packages

* fix(build): align Turbopack package classification

* fix(build): align server transpile precedence
2026-06-24 19:24:10 +01:00
Jerry Zhao 6e5a30e21a docs(routing): document findFileWithExts' forward-slash contract (#2298) 2026-06-24 09:50:56 +01:00