Skip to content

fix(build): support trailing-slash static exports - #3081

Merged
james-elicx merged 4 commits into
mainfrom
codex/static-export-example
Aug 26, 2026
Merged

fix(build): support trailing-slash static exports#3081
james-elicx merged 4 commits into
mainfrom
codex/static-export-example

Conversation

@james-elicx

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

Copy link
Copy Markdown
Member

Summary

  • add a comprehensive hybrid App Router and Pages Router static-export example
  • deploy the generated dist/client artifact through Cloudflare Static Assets with no Worker entry point
  • fix canonical trailing-slash prerender requests for App Router routes, Pages Router routes, RSC payloads, and generated 404s
  • emit both 404.html and 404/index.html for trailing-slash parity with Next.js
  • add artifact verification, deployed smoke coverage, preview links, and trailing-slash regression coverage

Example coverage

The new examples/static-export app demonstrates Server and Client Components, generateStaticParams, catch-all params, generateMetadata, browser hydration, localStorage, useSearchParams, custom 404 and metadata files, getStaticProps, and getStaticPaths.

The example documents the request-time features that are intentionally unavailable to static exports. It also calls out the remaining parity gap for explicitly static App Router GET Route Handlers.

Validation

  • vp test run tests/app-router-static-export.test.ts tests/static-export.test.ts tests/prerender.test.ts
  • vp test run tests/pages-router.test.ts -t "Static export"
  • PLAYWRIGHT_PROJECT=static-export VINEXT_E2E_BASE_URL=http://127.0.0.1:4181 vp run test:e2e -- tests/e2e/static-export/app-router.spec.ts tests/e2e/static-export/pages-router.spec.ts
  • vp check
  • pnpm build && pnpm verify in examples/static-export
  • pnpm exec wrangler deploy --config deploy/wrangler.jsonc --dry-run
  • browser probes for hydration, persisted client state, query state, Pages Router SSG, and generated 404 handling

The focused Vitest runs passed 123 prerender/static-export tests plus 7 Pages Router static-export tests. The static-export Playwright project passed 19 tests, and the artifact verifier checked 16 representative files across a 50-file export.

@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@3081
npm i https://pkg.pr.new/create-vinext-app@3081
npm i https://pkg.pr.new/@vinext/types@3081
npm i https://pkg.pr.new/vinext@3081

commit: e9dd99d

@github-actions

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
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared e9dd99d against base c812639 using alternating same-runner rounds.

1 improved · 0 regressed · 8 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) Next.js 185.6 KB 185.6 KB ⚫ 0.0%
Client bundle size (gzip) vinext 142.2 KB 142.2 KB ⚫ +0.0%
Client entry size (gzip) vinext 129.5 KB 129.5 KB ⚫ 0.0%
Dev server cold start Next.js 2.39 s 2.39 s ⚫ -0.1%
Dev server cold start vinext 3.05 s 3.01 s ⚫ -1.2%
Production build time Next.js 4.32 s 4.23 s 🟢 -1.9%
Production build time vinext 3.31 s 3.28 s ⚫ -0.8%
RSC entry closure size (gzip) vinext 116.6 KB 116.6 KB ⚫ +0.0%
Server bundle size (gzip) vinext 198.1 KB 198.1 KB ⚫ +0.0%

View detailed results and traces

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

@james-elicx
james-elicx marked this pull request as ready for review August 26, 2026 13:58
@james-elicx
james-elicx merged commit c1a78a7 into main Aug 26, 2026
84 of 85 checks passed
@james-elicx
james-elicx deleted the codex/static-export-example branch August 26, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant