Skip to content

feat(build): add transport-neutral worker stages - #3083

Closed
james-elicx wants to merge 66 commits into
codex/cdn-stack-toolingfrom
codex/cdn-stack-core
Closed

james-elicx wants to merge 66 commits into
codex/cdn-stack-toolingfrom
codex/cdn-stack-core

Conversation

@james-elicx

@james-elicx james-elicx commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

  • split App and Pages Worker handling into transport-neutral request and response stages
  • keep middleware, config routing, and request-specific response composition in the uncached request stage
  • preserve reusable rendering and ISR beneath that boundary without changing legacy single-stage behavior
  • bypass shared stages for valid and stale Pages preview cookies; stale-cookie cleanup is deliberately private/no-store as an edge-cache safeguard
  • suppress middleware and conditional next.config cacheability vetoes only when the staged request boundary owns them
  • carry matched positive config policy, Vary identity, pregenerated paths, and authenticated readiness across stage transports
  • keep generated entries thin and lazy so adapters can choose RPC or independently deployed HTTP stages

This layer contains no Cloudflare RPC, Worker export, Wrangler, Workers Cache, or HTTP transport implementation.

Stack

  1. tooling baseline (chore(deps): update Cloudflare Workers tooling #3082)
  2. This PR: transport-neutral worker stages (feat(build): add transport-neutral worker stages #3083)
  3. Cloudflare Workers Cache entrypoint isolation (feat(cloudflare): isolate Workers Cache with staged entrypoints #3079)
  4. independently deployed HTTP stages (feat(build): support independently deployed worker stages #3084)
  5. Workers Cache tag parity (fix(cloudflare): preserve Workers Cache tag parity #3085)

Validation

  • focused Pages stage/finalization tests: 83 passed
  • invalid preview-cookie deployed fixture regression: passed
  • guarded dynamic-request regression: passed
  • full vp check and Knip: passed
  • vinext build: passed

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3083
npm i https://pkg.pr.new/create-vinext-app@3083
npm i https://pkg.pr.new/@vinext/types@3083
npm i https://pkg.pr.new/vinext@3083

commit: 9e5d0c2

@james-elicx
james-elicx force-pushed the codex/cdn-stack-core branch from e242325 to 2a1a9d5 Compare August 25, 2026 23:15
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
workers-cache preview production
static-export preview production
web preview production

@james-elicx
james-elicx force-pushed the codex/cdn-stack-core branch from 2a1a9d5 to eacb78d Compare August 25, 2026 23:19
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 9e5d0c2 against base 1bd47c0 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 4 regressed · 2 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.3 KB 142.4 KB ⚫ +0.0%
Client entry size (gzip) vinext 129.6 KB 129.6 KB ⚫ +0.0%
Dev server cold start vinext 3.24 s 3.39 s 🔴 +4.8%
Production build time vinext 3.60 s 3.69 s 🔴 +2.5%
RSC entry closure size (gzip) vinext 119.2 KB 125.7 KB 🔴 +5.5%
Server bundle size (gzip) vinext 202.8 KB 216.4 KB 🔴 +6.7%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

Comment thread packages/vinext/src/server/pages-router-entry.ts
Comment thread packages/vinext/src/server/pages-api-route.ts
Comment thread packages/vinext/src/server/pages-node-compat.ts
Comment thread packages/vinext/src/server/app-rsc-response-stage.ts
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Posted 4 actionable inline findings on exact head 61b9b1b.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please use an 8 minute time limit and review exact head ef41ed0. The preceding exact-head run was cancelled by workflow concurrency; this is the retry.

Comment thread packages/vinext/src/build/prerender-paths.ts Outdated
Comment thread packages/vinext/src/server/app-request-stage-independent-entry.ts
Comment thread packages/vinext/src/server/pages-request-stage-entry.ts Outdated
Comment thread packages/vinext/src/server/pages-response-stage-entry.ts
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Posted 4 actionable inline findings on exact head ef41ed0.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please use an 8 minute time limit and review exact head 029e396. The earlier run targeted a superseded head and was cancelled.

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please use an 8 minute time limit and review exact head e6b2271. This includes the ASCII-safe encoding fix for Unicode probe route metadata.

Comment thread packages/vinext/src/server/multi-stage.ts Outdated
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Posted 1 actionable inline finding on exact head e6b227120. Unicode probe encoding tests pass.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please review exact head 5b65155. Time limit: 8 minutes. Focus on correctness against current main prewarming behavior, Next.js routing/cache parity, and the staged transport fixes.

Comment thread packages/vinext/src/server/app-request-stage-independent-entry.ts
Comment thread packages/vinext/src/build/prerender-paths.ts
@ask-bonk

ask-bonk Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Posted 2 actionable inline findings on exact head 5b651557.

github run

@james-elicx

Copy link
Copy Markdown
Member Author

/bigbonk review for issues

Please review exact head 9e5d0c2. Time limit: 8 minutes. Focus on faithful integration with the merged pre-warming refactor, staged-only middleware and next.config cacheability behavior, draft/preview bypasses, and regressions to legacy single-stage behavior.

@james-elicx

Copy link
Copy Markdown
Member Author

Superseded by the focused staged implementation in #3142 through #3156.

@james-elicx james-elicx closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant