user@gryczka.dev: ~/garden/cloudflare-nextjs-compatibility-demo
$ cat ~/garden/cloudflare-nextjs-compatibility-demo/README.md
Next.js Compatibility Lab — Three Paths to a Verified Preview screenshot

Next.js Compatibility Lab — Three Paths to a Verified Preview

September 28, 2026 | Patrick Gryczka

## Overview

A live, fixture-only compatibility lab that builds a native Next.js baseline and advances through Vinext, OpenNext for Cloudflare, and a standalone container until the first route-verified target passes. A Worker issues expiring anonymous sessions; a deployment-wide SQLite Durable Object reserves run and publication capacity, Workflows orchestrate Sandbox builds and teardown, and per-run Durable Objects stream evidence to the browser over owner-scoped WebSockets. Passing routes stay available as short-lived, owner-only previews, with observed decision times shown separately from modeled cost scenarios. An independent Emdash / Workers for Platforms lane uploads a platform-owned HTML Worker from bounded manifest metadata; a tenant registry fences updates and dispatch, and an alarm deletes the script after 30 minutes. The public demo accepts only three bundled fixture IDs and this fixed WfP template, not arbitrary uploaded source.

## Highlights

  • -> Three bundled fixtures establish the native baseline and stop at the first route-verified Vinext, OpenNext, or container target
  • -> Workflows orchestrate retries and cancellation; per-run SQLite Durable Objects stream stage evidence over owner-scoped WebSockets
  • -> Sandbox isolates builds and proxies 30-minute previews, returning capacity only after confirmed container destruction
  • -> Expiring HttpOnly sessions, same-origin checks, global quotas, and tenant-derived keys isolate runs and publisher routes
  • -> A separate Workers for Platforms lane publishes a fixed, HTML-escaped Worker from bounded metadata and deletes it on expiry
  • -> Observed compatibility and preview timings are kept distinct from modeled runtime costs and the independent WfP upload

## Architecture

Next.js Compatibility Lab architecture diagram
Browser / Emdash CLI
    │   expiring visitor cookie or Access identity
    ▼
Control Worker ─── authentication, owner-only API and preview proxy
    ├── Fixture lane ── global quota SQLite Durable Object
    │      └── Compatibility Workflow
    │             ├── native Next.js → Vinext → OpenNext → Container
    │             ├── per-run SQLite DO ─── live WebSocket evidence
    │             └── Sandbox / Containers ── owner-only 30m preview
    │
    └── Separate fixed-template WfP lane
           ├── quota coordinator + tenant registry DO
           ├── WfP upload API ───── platform-owned User Worker
           └── owner-only dispatch ─ 30m expiry + script deletion

D1 / R2 / Analytics are disabled prototype scaffolding, not the live fixture path.

## Tech Stack

WorkersContainersDurable ObjectsSQLiteWebSocketsTypeScript
$ _