Commit Graph

1503 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>
@vinext/cloudflare@0.2.0 vinext@0.2.0
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
Nathan Nguyen 25f3d09332 test(e2e): wait for hydration before dev overlay recovery click (#2410)
The dev overlay recovery spec armed its reload canary after only confirming that the navigation runtime existed. That was not enough to prove the app-router client tree had hydrated the Link handler, so CI could occasionally follow the anchor as a hard navigation before the soft-nav path was ready.

Reuse the shared app-router hydration helper before setting the canary and clicking the recovery link. The test still exercises the real browser click path, but no longer races client hydration.
2026-06-29 17:44:28 +01:00
Nathan Nguyen 8ad5e5be32 fix(ci): resolve setup-vp version from catalog (#2406)
* fix(ci): resolve setup-vp version from catalog

* ci: retry app-router e2e

* fix(ci): avoid heredoc in setup version resolver

* fix(ci): anchor setup resolver to workspace root

* chore: rerun ci

* chore: rerun ci
2026-06-29 17:44:05 +01:00
Nathan Nguyen 23ed801656 fix(e2e): stabilize nav regression suspense window (#2408)
* fix(e2e): stabilize nav regression suspense window

* test(e2e): strengthen nav regression flake guard
2026-06-29 16:57:29 +01: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
Boy Steven 0a9eb33a50 docs(nextjs-compat): refresh resolved OpenNext tracking (#2403) 2026-06-29 15:37:57 +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 6cbe7cdd18 fix(ci): handle npm-pinned deploy fixtures (#2400) 2026-06-29 11:12:05 +01:00
James Anderson 3de7c93dc3 ci: smoke test create-next-app Cloudflare deploy (#2398) 2026-06-29 10:35:02 +01:00
Nathan Nguyen 4a88a9c9e9 fix(ci): avoid loading commit diffs in benchmark validation (#2397)
The trusted benchmark publisher validates measuredAt by fetching commit metadata with gh api. Using the repository commit endpoint also returns commit diff files and stats, which can exceed Node's default child process output buffer for large merge commits.

Fetch the raw Git commit object instead, which still exposes committer.date without diff payloads. Update the validator tests to expect the lighter Git Database endpoint and response shape.
2026-06-29 09:55:55 +01:00
James Anderson b9322bc950 feat(web): use new cache (#2337) 2026-06-29 08:41:06 +00: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
Nathan Nguyen 9382007bce test(perf): pin benchmark validator repository in fork CI (#2387)
Benchmark validator tests mock GitHub API paths for cloudflare/vinext, but fork CI sets GITHUB_REPOSITORY to the fork owner.

Pin the spawned validator process to cloudflare/vinext so the test remains hermetic across upstream and fork push runs.
2026-06-28 16:51:31 +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 13c093926c fix(test): stop autoscroll fixture servers correctly (#2384) 2026-06-26 23:03:46 +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 592a50b76d fix(test): pin deploy suite init to node (#2383) 2026-06-26 20:26:04 +00: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