Commit Graph

1980 Commits

Author SHA1 Message Date
James Anderson f702d16126 refactor(middleware): remove dead resolver wrapper (#2972) 2026-08-18 09:56:27 +00:00
James Anderson 0fcb7e1771 refactor(app-router): remove dead intercept match helper (#2971) 2026-08-18 09:55:30 +00:00
James Anderson 3a021ced6b refactor(dev): remove dead stack-line wrapper (#2974) 2026-08-18 10:52:44 +01:00
James Anderson 932116c997 refactor(server): remove dead encoding helper (#2973) 2026-08-18 10:52:26 +01:00
James Anderson c84af82482 refactor(cache): remove dead revalidate duration registry (#2967) 2026-08-18 09:51:27 +00:00
James Anderson 794b04e75c refactor(pages): remove superseded helper wrappers (#2970) 2026-08-18 10:51:13 +01:00
James Anderson 22d2d38033 refactor(app-router): remove superseded helper wrappers (#2969) 2026-08-18 10:50:55 +01:00
James Anderson 5eb21da2a0 fix(security): validate supplemental interception selectors (#2976)
* fix(security): verify interception cache identities

* fix(security): bypass caches for interception selectors

* fix(security): preserve caching for verified interception selectors

* fix(cache): delegate selector policy to CDN adapter
2026-08-18 10:48:04 +01:00
James Anderson 2dcd9f2b5a fix(test): version duplicate ESM fixture packages (#2979) 2026-08-18 08:36:23 +00:00
James Anderson b653aaf52b fix(build): preserve bundled ESM module identity (#2942)
* fix(build): preserve bundled ESM module identity

* fix(build): harden bundled ESM identity

* test(pages): allow parity route table growth
2026-08-18 02:35:44 +01:00
James Anderson 1c05615159 fix(build): preserve portable CommonJS module identity (#2826)
* fix(pages): preserve CJS globals in bundled dependencies

* fix(pages): use portable emitted CJS module identity

* test(build): expect emitted proxy module identity

* fix(build): support linked CommonJS package identity

* fix(build): harden linked CommonJS transforms

* fix(build): harden emitted CommonJS identity

* test(pages): account for fixture route table growth

* refactor(plugins): reuse shared module utilities

* test(cloudflare): cover Pages bundled CJS globals

* test(cloudflare): tolerate unmounted dev source identity

* fix(build): preserve nested Cloudflare module identity

* refactor(build): resolve deployed module filenames explicitly
2026-08-18 02:35:44 +01:00
James Anderson fbf77b17dc fix(router): refresh retained parallel routes (#2880)
* fix(router): refresh retained parallel routes

* fix(router): harden supplemental parallel refreshes

* fix(router): preserve refreshed nested source routes

* fix(router): skip retained descendant refreshes

* fix(router): canonicalize supplemental refresh paths

* fix(app-router): preserve superseded flight streams
2026-08-18 02:04:38 +01:00
James Anderson 68cf0af31c refactor(app-router): remove dead RSC chunk subscriber (#2964) 2026-08-18 00:59:10 +00:00
James Anderson 1e0cc50323 refactor(dynamic): remove dead preload queue (#2968) 2026-08-18 00:46:40 +00:00
James Anderson ace7a1f7a2 fix(pages-router): emit dev build ID in next data (#2962) 2026-08-18 01:18:27 +01:00
James Anderson 46eb2f031c refactor(app-router): remove dead RSC nav global (#2961) 2026-08-18 00:10:32 +00:00
Jerry Zhao 257ec22cc7 test(dynamic-requests-build): raise the build/dev-server case timeout on Windows (#2959) 2026-08-18 01:01:07 +01:00
Jerry Zhao c540097948 test(tsconfig-paths): assert canonical forward-slash alias paths (#2957) 2026-08-18 01:00:43 +01:00
Jerry Zhao 800cb8b324 test(worker-image-imports): assert the canonical forward-slash metadata path (#2956) 2026-08-18 01:00:38 +01:00
Jerry Zhao 7c340c3a2e test(routing): raise the App Router graph suite timeout on Windows (#2955) 2026-08-18 01:00:27 +01:00
James Anderson f3355fbec3 fix(cache): reject unserializable use cache results (#2954) 2026-08-18 00:55:39 +01:00
James Anderson 92ff5b4cbd fix(app-router): preserve static hydration search params (#2944) 2026-08-17 23:00:40 +01:00
James Anderson efa916579b fix(app-router): settle optimistic search navigations (#2952)
* test(app-router): reproduce deployed optimistic search navigation stall

Add a production-shaped provider filter that combines useOptimistic with same-path search navigation and streamed server results. Cover local controls and run a bounded provider cycle against the deployed Workers example, where the intermittent commit failure occurs.\n\nRefs #2865.

* test(app-router): reproduce local optimistic navigation stall

* fix(app-router): settle optimistic search navigations

* fix(app-router): preserve streaming during optimistic recovery

---------

Co-authored-by: Nathan Nguyen <146415969+NathanDrake2406@users.noreply.github.com>
2026-08-17 14:23:57 +01:00
James Anderson 83d3d1147e refactor(plugins): share common Vite plugin utilities (#2953) 2026-08-17 14:20:50 +01:00
James Anderson 1ca8763fec fix(build): preserve require export conditions (#2881)
* fix(build): preserve require export conditions

* fix(build): resolve require conditions in dev

* test(build): assert visible conditional export output

* fix(build): harden require condition resolution

* perf(build): skip ineligible require condition scans

* test(build): cover require conditions on Workers
2026-08-17 10:59:34 +00:00
James Anderson c296ad34db fix(app-router): retain shared layouts across loading shells (#2940)
* test(app-router): reproduce shared layout teardown on soft navigation

Add a `/layout-identity` fixture to the app-router-cloudflare example and
e2e coverage showing that a shared `[slug]` layout is discarded during a
soft navigation that only changes segments below it.

The fixture pairs the shared layout with a `loading.tsx` boundary above
it, a parallel slot beside `children`, and a nested dynamic segment with
its own layout, matching the shape a real app has. Removing the
`loading.tsx` boundary makes every assertion pass, which isolates it as
the trigger.

The five layout-identity assertions fail on main; the soft-navigation
control passes, so the teardown is the router discarding a layout it
should have retained rather than a full document load.

* fix(app-router): retain shared layouts across loading shells

* fix(app-router): preserve omitted slot segment identity

* test(app-router): follow shared param canonicalizer
2026-08-17 11:28:26 +01:00
Elias Shieh 7591622d93 docs: align README cache claims with the implementation (#2945) 2026-08-16 19:09:45 +01:00
James Anderson a5f0bb44cb fix(app-router): match current navigation identity (#2876)
* fix(app-router): match soft navigation identity

* fix(app-router): refresh exact links behind basePath

* fix(app-router): preserve navigation URL spaces

* fix(app-router): preserve raw navigation identity

* fix(app-router): preserve licensed history cache reuse

* fix(app-router): replace visited route aliases

* fix(app-router): preserve exact hash cache bypass

* test(navigation): cover cache bypass runtime argument
2026-08-16 15:43:57 +01:00
James Anderson 1f43ba32a1 fix(app-router): retain loading shell prefetches (#2938) 2026-08-16 15:02:40 +01:00
James Anderson e65e70e2e7 fix(pages): align GSSP client transitions (#2240)
* fix(pages): align gssp not-found data parity

* fix(router): preserve route state for gssp not-found

* fix(pages): preserve GSSP notFound client navigation

* fix(pages): limit dev notFound source metadata

* fix(router): render error fallback for data notFound
2026-08-16 14:33:37 +01:00
James Anderson c2362842c9 fix(build): support deployed web worker graphs (#2314)
* fix(build): support deployed web worker graphs

* fix(build): address worker parity review findings

* fix(build): preserve web worker URL origins

* test(e2e): cover deployed web workers

* test(e2e): port upstream Cloudflare worker suite

* fix(build): preserve worker asset semantics

* fix(build): tolerate minimal resolved config mocks

* test(worker): classify Vite-equivalent coverage
2026-08-16 01:06:42 +01:00
James Anderson 3d0ac71e4f fix(fonts): normalize self-hosted URLs on Windows (#2934) 2026-08-16 00:28:14 +01:00
James Anderson 086e53f013 test(build): relax hybrid client assets timeout (#2931) 2026-08-15 22:16:17 +00:00
James Bithell f5b10dfb21 fix(build): make vinext shim chunk rule reachable for installed copies (#2795) 2026-08-15 17:57:11 +01:00
Norcleeh cfa85b6556 fix(rsc): web crypto subtle api is unavailable in non-secure contexts (#2929) 2026-08-15 15:47:01 +01:00
github-actions[bot] 365c604032 chore: version packages (beta) (#2844)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@vinext/cloudflare@1.0.0-beta.6 vinext@1.0.0-beta.6
2026-08-15 09:49:29 +00:00
James Anderson 3ec5bdc68a fix(build): support Pages Router ESM externals (#2877)
* fix(build): support Pages ESM externals

* fix(build): isolate Pages ESM external ownership

* fix(build): track aliased dynamic Pages imports

* fix(build): track static template Pages imports

* fix(dev): keep Pages ESM dependencies internal

* test(build): serialize ESM externals coverage

* perf(build): skip Pages ownership in App-only builds

* refactor(build): split process.browser compatibility

* fix(build): preserve server conditions in Workers

* fix(build): preserve server dependency conditions

* test(worker): cover ESM externals parity in workerd

* perf(build): omit Pages externals from App-only graphs

* test(worker): preserve ESM externals tripwires

* test(build): cover adapter-independent server conditions

* test(build): find renamed server conditions plugin

* test(worker): isolate ESM package coverage

* test(build): use checked-in ESM externals fixture
2026-08-15 02:33:17 +01:00
James Anderson 965750bbd7 fix(build): preserve server export conditions (#2918)
* fix(build): preserve server conditions on Workers

* fix(build): filter browser from all server graphs

* refactor(build): rename server conditions plugin
2026-08-15 02:33:16 +01:00
James Anderson bdbb322f97 test(navigation): stabilize queued prefetch promotion (#2920) 2026-08-15 01:23:36 +01:00
MaxtuneLee 88ea15a05d fix(headers): preserve config Link headers alongside React preload links (#2791)
* fix(headers): preserve config Link headers alongside React preload links

* fix: vp check error

* fix(headers): preserve Link header precedence

* test(headers): expect framework Link after middleware

* fix(headers): preserve Link provenance across response paths

---------

Co-authored-by: James <james@eli.cx>
2026-08-15 00:26:10 +01:00
Elias Shieh d1fb2ebf53 fix(pages): keep charset first in custom document heads (#2909)
* fix(pages): keep charset first in custom document heads

* fix(pages): preserve complete head ordering parity

* test(pages): assert dev document head ordering

* fix(pages): preserve head order across Fast Refresh

* fix(pages): align trace metadata head ordering in dev

* fix(pages): match Next head manager updates

* fix(pages): order unknown head tags last

---------

Co-authored-by: James <james@eli.cx>
2026-08-15 00:20:37 +01:00
James Anderson a3d1d1d18f fix(build): bundle image-size in vinext (#2913) 2026-08-14 10:16:05 +01:00
Nathan Nguyen ee1d8571f8 fix(app-router): reject unverified Worker prerender params (#2901) 2026-08-13 20:34:55 +01:00
Norcleeh 98fd69cc6f fix(font): not emitting 400 as default value when font weight is omitted (#2796) 2026-08-13 20:14:07 +01:00
James Anderson 92c57b992b fix(build): define process.browser per environment (#2899)
* fix(build): define process.browser per environment

* fix(build): keep environment condition filter linear

* perf(build): narrow environment condition filtering

* perf(build): filter process browser syntax locally
2026-08-13 11:49:06 +01:00
Nathan Nguyen fefc8e21d1 fix(app-router): preserve request.cf in route handlers (#2886)
* fix(app-router): preserve request.cf in route handlers

Cloudflare Workers attaches request.cf at the inbound request boundary, but App Router dispatch rebuilt Route Handler requests with the standard Request constructor and discarded that runtime metadata.\n\nUse the existing metadata-preserving URL clone boundary so both Node and Edge Route Handlers retain cf while keeping their current URL normalization semantics.

* fix(app-router): preserve request.cf through runtime wrapping

Route Handler request tracking can rebuild an already-normalized request when restoring basePath or applying middleware header overrides. Those reconstructions discarded Cloudflare metadata before the final NextRequest reached user code.\n\nPreserve cf at both reconstruction points while retaining the existing body-transfer and RequestInit behavior, with runtime-level coverage for each path.

* fix(app-router): treat request.cf as dynamic state

Preserving Cloudflare request metadata makes request.cf observable to Route Handlers, but the request proxy did not classify reads as dynamic. Geo-dependent responses could therefore enter the route-wide ISR cache, while static route modes exposed request-specific metadata.\n\nApply the existing ip and geo policy to cf: track reads in automatic mode, hide it under force-static, and reject it under dynamic error mode.

* fix(app-router): preserve request.cf across clones

Tracked Route Handler requests inherit the standard Request clone implementation, which omits Cloudflare request metadata. A handler that cloned before reading cf therefore lost the metadata even though the original tracked request retained it.\n\nCentralize tracked request cloning so cf is reattached before the clone is recursively wrapped with the same dynamic request policy.

* fix(app-router): track reflective request.cf access

Tracked Route Handler requests enforced dynamic policy only through the Proxy get trap. Descriptor, membership, and key-enumeration reads could expose Cloudflare metadata without marking the handler dynamic or respecting static modes.

Route explicit cf reflection through the same policy, filtering configurable cf keys under force-static and rejecting reflective access under dynamic error mode.

* fix(app-router): retain request proxy through valueOf

Binding every Request method to the underlying NextRequest let valueOf return the raw target. Subsequent request.cf reads could then bypass dynamic tracking and static-mode policy.

Bind valueOf to the proxy receiver while leaving branded Request methods on the underlying target, and cover the escape in all three request modes.

* fix(app-router): bind reflection to request proxy

Inherited Object reflection helpers were still bound to the raw NextRequest, allowing ownership checks to bypass request.cf dynamic policy.

Bind exact Object.prototype methods to the proxy receiver while preserving the branded target for Web Request methods, and cover ownership and enumerability checks in every request mode.

* fix(app-router): preserve proxy for request extensions

Binding unknown request properties to the raw NextRequest let user-defined methods and getters bypass request.cf policy.

Snapshot the runtime's built-in Request surface for branded target access while keeping own and unknown extensions on the proxy receiver. Cover both method and accessor escapes in every request mode.

* fix(app-router): hide cf before locking requests

Force-static proxies filtered request.cf from reflective operations, but a non-extensible target made that omission violate Proxy invariants.

Remove the configurable metadata before preventing extensions, and cover preventExtensions, seal, and freeze while preserving force-static policy.

* fix(app-router): bind Worker request members correctly

Cloudflare may expose Web IDL Request members as own properties, so classifying every own member as a user extension caused illegal invocation errors in Workers.

Use the captured built-in API surface regardless of property placement, while keeping unknown extension names on the proxy receiver. Add coverage for an own branded accessor.

* fix(app-router): distinguish request member shadows

Name-only branded member detection fixed Workers own-property layouts but treated post-wrap user shadows as runtime Web IDL members, allowing their this-based reads to escape the proxy.

Snapshot runtime-owned descriptors before route code receives the request and bind only unchanged implementations to the target. Later shadows retain the proxy receiver in every request mode.

* fix(app-router): detect request prototype shadows

Own-descriptor snapshots still treated replaced inherited Request members as branded, allowing prototype getters to bypass request.cf policy.

Snapshot each resolved built-in implementation and compare the currently resolved descriptor before selecting the raw target. Own and prototype shadows now retain the tracked receiver.

* fix(app-router): snapshot request built-ins before routes

* fix(app-router): preserve branded Worker request methods

* fix(app-router): preserve reflected cf after locking

* refactor(app-router): contain request.cf policy on its target

Route handlers need Workers metadata to follow static-generation policy without changing the semantics of every Request property. Use the configurable cf accessor copied onto NextRequest as the single policy boundary, and delegate request reconstruction to the canonical clone helpers.

* fix(app-router): avoid synthesizing absent request.cf

Ordinary requests should not gain an own cf property merely because route-handler dynamic tracking is active. Install the target accessor only when Workers metadata exists, while keeping direct absent reads subject to automatic, force-static, and error policy.

* fix(app-router): harden request.cf tracking

* chore(test): register worker route fixtures

* chore(app-router): deduplicate request.cf descriptor

---------

Co-authored-by: James <james@eli.cx>
2026-08-13 11:39:47 +01:00
Norcleeh eb092be208 fix(use-cache): allow literal exports from use-cache files (#2906)
* fix(use-cache): allow literal exports from use-cache files (#2896)

* fix(use-cache): preserve class export validation

* fix(use-cache): reject default literal exports

---------

Co-authored-by: James <james@eli.cx>
2026-08-13 10:19:06 +01:00
James Anderson 486653bdb5 fix(router): preserve basePath in Pages Router events (#2888)
* fix(router): preserve basePath in router events

* fix(router): align popstate event timing

* fix(router): cancel superseded navigation work

* fix(router): defer history until route load

* fix(router): preserve redirect destination state

* fix(router): normalize followed redirect paths

* fix(router): pin double-slash redirect fetches

* fix(router): normalize relative redirect origins

* test(router): await popstate completion

* docs(router): clarify internal redirect flow

* fix(router): follow redirects reached by popstate

* fix(router): preserve query-only rewrite history

* fix(router): preserve middleware hard-navigation history
2026-08-13 10:17:42 +01:00
MaxtuneLee fb7c22f3a1 test(app-router): remove nested document tags from interception fixtures (#2790) 2026-08-13 09:36:03 +01:00
yyh 848f413a9d fix(rsc): preserve BOM bytes in embedded Flight chunks (#2905) 2026-08-13 09:27:25 +01:00