mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-15 14:57:43 +02:00
2.4 KiB
2.4 KiB
packages/frontend-frameworks/fixtures/nextjs
E2e fixture for @alchemy.run/frontend-frameworks/nextjs — the wrangler-free Next.js
(OpenNext-based) framework integration.
The app exercises the OpenNext long tail:
- an SSR app-router page (
/,force-dynamic) - an API route (
/api/hello) - an API route reading a
Textbinding viagetCloudflareContext()(/api/binding) - an ISR page (
/isr) — asserts the prerendered payload serves from the read-only static-assets incremental cache (revalidation writes are a known dev-v1 gap; a writable local cache backend is a later phase) - an edge middleware rewrite (
/mw-rewrite→/api/hello) plus a response header on/api/* - static assets (
public/static.txtand_next/static/*client chunks) - a client-interactive page (
/counter) proving hydration
Commands
bun run build # e2e build — OpenNext pipeline + final bundle pass -> dist/build.json
bun run preview # e2e preview — miniflare over dist/build.json
bun run dev # e2e dev --port 3104 — built worker under cloudflare-runtime (workerd)
bun run test # build + playwright (live = miniflare, dev = cloudflare-runtime)
Notes
wranglerresolves to the inert stub inpackages/frontend-frameworks/src/nextjs/wrangler-stub— only itspackage.jsonversion field is ever read (OpenNext'sensureNextjsVersionSupported); no wrangler code is installed or executed.- The OpenNext pipeline runs
npx next buildinternally (the fixture's ownbuildscript ise2e build, which would recurse). - Dev (default
"preview"mode) is production parity: the built worker served by workerd withASSETS(run-worker-first),WORKER_SELF_REFERENCE(self service binding), and the same-script SQLiteDOQueueHandlerdurable object. No HMR. test/hmr.test.tsexercises dev v2 (dev: { mode: "hmr" }): the realnext dev(Turbopack HMR) in Node with theTEST_TEXTbinding proxied from cloudflare-runtime onto OpenNext'sgetCloudflareContext()contract — noinitOpenNextCloudflareForDev(), no wrangler. The spec builds its ownFrameworklayer (the harnessdevfixture stays wired to preview mode);scripts/hmr-repro.mjsis a minimal manual runner for the same path. App code runs in Node in this mode — CF-specific behavior and ISR/caching semantics still need preview (seepackages/nextjs/README.md).