You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cloudflare-workers-migration.md
+24-17Lines changed: 24 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,14 @@ TanStack.com is configured as a Cloudflare Workers deployment for this branch. N
4
4
5
5
## Files Changed
6
6
7
-
-`package.json`, `pnpm-lock.yaml`: Cloudflare build/preview/deploy scripts, `@cloudflare/vite-plugin`, `wrangler`, and removal of Netlify hosting packages.
8
-
-`vite.config.ts`: Cloudflare Vite plugin, Worker build constants, opt-in image transformation flag, and server builder-generation disabled for Worker size.
7
+
-`package.json`, `pnpm-lock.yaml`: Cloudflare build/preview/deploy scripts, `@cloudflare/vite-plugin`, `wrangler`, `@tanstack/create@0.68.4`, and removal of Netlify hosting packages.
8
+
-`vite.config.ts`: Cloudflare Vite plugin, Worker build constants, opt-in image transformation flag, and server builder-generation enabled with the Worker-safe create API.
9
9
-`wrangler.jsonc`: Worker name/account, assets binding, `nodejs_compat`, CPU limit, cron triggers, and production `SITE_URL`.
10
10
-`src/server.ts`, `src/server/scheduled.server.ts`: Worker `fetch` and `scheduled` entrypoints, replacing former Netlify scheduled functions.
11
11
-`src/server/runtime/host.server.ts`, `src/utils/hosting-cache.server.ts`: host cache purge adapter using Cloudflare cache-tag purge.
12
12
-`src/components/OptimizedImage.tsx`, `src/utils/optimizedImage.ts`: host-neutral optimized image helper with Cloudflare image transformations behind an explicit build flag.
13
-
-`src/routes/api/builder/*`, `src/components/builder/*`: builder deploy/download path uses browser-generated files; direct server-generation endpoints return explicit 501 on Workers.
13
+
-`src/builder/api/create-worker.ts`: host-neutral adapter around `@tanstack/create/worker` with local Worker manifest loaders for supported frameworks and add-ons.
14
+
-`src/builder/api/*`, `src/routes/api/builder/*`: builder feature catalog, compile, download, validate, suggest, and GitHub deploy paths use the Worker-safe create adapter.
14
15
-`src/routes/*`, `src/utils/*`, `src/server/*`: CDN cache headers moved from Netlify-specific headers to portable `CDN-Cache-Control` / `Cache-Tag`.
15
16
-`src/utils/markdown/processor.ts`: site-side compatibility guard for escaped angle brackets in generated TypeDoc markdown until `@tanstack/markdown` handles `\<...\>` as escaped text.
16
17
-`package.json`, `pnpm-lock.yaml`: `@tanstack/markdown@0.0.5` for compact table delimiters, footnotes, and legacy single-tilde strike headings without the temporary pnpm patch.
@@ -20,9 +21,12 @@ TanStack.com is configured as a Cloudflare Workers deployment for this branch. N
20
21
21
22
```bash
22
23
pnpm install --lockfile-only
24
+
pnpm add @tanstack/create@^0.68.4
23
25
pnpm run test:tsc
26
+
pnpm exec tsc --noEmit
24
27
pnpm run build:cloudflare
25
28
pnpm test
29
+
pnpm run dev:cloudflare
26
30
pnpm run deploy:cloudflare
27
31
pnpm run preview:cloudflare -- --host 127.0.0.1 --port 3001
28
32
pnpm install
@@ -35,9 +39,9 @@ Additional checks used `curl`, Node fetch scripts, Wrangler tail, and Playwright
- Note: the secret-bearing `tanstack-com-staging` Worker was renamed to `tanstack-com`, and the older empty `tanstack-com` Worker was removed.
42
46
43
47
## Passed
@@ -59,6 +63,13 @@ Additional checks used `curl`, Node fetch scripts, Wrangler tail, and Playwright
59
63
-`/.well-known/oauth-authorization-server` returned OAuth metadata.
60
64
-`/api/mcp/` returned the expected unauthenticated JSON-RPC auth error instead of a runtime failure.
61
65
-`POST /api/application-starter/resolve` returned a Start recipe.
66
+
-`/api/builder/features?framework=react` returned the Worker-safe catalog, including `tanstack-query`, `cloudflare`, and `biome`.
67
+
-`/api/builder/compile` generated representative React and Solid projects server-side on the Worker.
68
+
-`/api/builder/download` returned a valid zip for a representative React builder project.
69
+
-`https://tanstack.com/api/builder/features?framework=react` returned the same Worker-safe builder catalog.
70
+
-`https://tanstack.com/builder` returned 200 HTML with COOP/COEP headers.
71
+
- Worker output does not include `generated/create-manifest.js` or a `create-manifest` chunk.
72
+
- Cloudflare dry-run/upload size stayed below the paid Worker 10 MiB gzip limit after excluding the heavy React `events` example implementation chunk.
62
73
-`Link` response headers for static assets are emitted on SSR responses for Cloudflare Early Hints fallback.
63
74
- Broad docs/blog audit generated 2,767 latest-doc/blog URLs from GitHub doc trees plus local blog posts and compared production vs Worker.
64
75
- Escaped generic headings in TypeDoc markdown now render correctly, e.g. `Interface: AudioAdapter<TModel, TProviderOptions>` with the production-compatible `interface-audioadaptertmodel-tprovideroptions` anchor.
@@ -72,23 +83,19 @@ Additional checks used `curl`, Node fetch scripts, Wrangler tail, and Playwright
72
83
73
84
## Failed Or Not Proven
74
85
75
-
- Direct server-side builder generation endpoints return 501 on Workers:
76
-
-`/api/builder/features`
77
-
-`/api/builder/compile`
78
-
-`/api/builder/compile-attributed`
79
-
-`/api/builder/download`
80
-
-`/api/builder/validate`
81
-
-`/api/builder/feature-artifacts`
82
86
- Full GitHub OAuth callback/account login was not completed.
83
87
- End-to-end GitHub repository deploy was not completed with a logged-in account.
84
88
- Cron trigger behavior was deployed but not manually invoked.
89
+
- The React `events` example is not exposed in the Worker builder catalog because its implementation chunk pushes the Worker over Cloudflare's paid 10 MiB gzip upload limit.
85
90
- High-concurrency audit runs can still produce transient Worker 500s with `{"status":500,"unhandled":true,"message":"HTTPError"}` on changing docs paths, but targeted full-body rechecks did not reproduce stable page failures. Treat this as a load/audit-cache risk, not a confirmed content regression.
86
91
87
92
## Builder Generation Note
88
93
89
-
The released `@tanstack/create@0.68.3``edge` import is Worker-runtime compatible, but it still statically imports the generated create manifest. That manifest made the Worker upload `11222.23 KiB` gzip, over the paid 10 MiB Worker script limit.
94
+
`@tanstack/create@0.68.4` adds the lazy `@tanstack/create/worker` API. The site now imports that API through `src/builder/api/create-worker.ts` instead of importing `@tanstack/create/edge` from route logic.
90
95
91
-
The deployable compromise in this branch keeps dynamic generation in the browser for the builder UI, downloads, and GitHub deploy handoff, and excludes server-side create generation from the Worker bundle. After that change, the Worker upload is `4804.51 KiB` gzip.
96
+
`/api/builder/features` remains catalog-only by using `create.getFrameworkById` and `create.getAllAddOns`. ZIP/project generation loads only the requested framework/add-on chunks, then calls `create.finalizeAddOns`, `create.populateAddOnOptionsDefaults`, `createMemoryEnvironment`, and `create.createApp`.
97
+
98
+
The Worker build was checked for `generated/create-manifest.js` and `create-manifest` output, and no generated manifest bundle was present. Including the React `events` example implementation still pushed upload size to `11179.57 KiB` gzip, so the Worker loader intentionally omits that chunk. The deployed Worker is `6413.10 KiB` gzip.
92
99
93
100
## Image Transformation Note
94
101
@@ -112,6 +119,6 @@ Remaining markdown differences observed during audit:
112
119
113
120
## Readiness
114
121
115
-
Core marketing SSR, docs/start navigation, security headers, static assets, analytics proxying, GitHub auth start, MCP auth rejection, application-starter API, scheduled Worker registration, Cloudflare preview, deploy, and dynamic OG image generation are working on Cloudflare Workers.
122
+
Core marketing SSR, docs/start navigation, security headers, static assets, analytics proxying, GitHub auth start, MCP auth rejection, application-starter API, scheduled Worker registration, Cloudflare preview, deploy, dynamic OG image generation, and representative Worker-side builder generation are working on Cloudflare Workers.
116
123
117
-
Production migration is close, but not fully safe until logged-in OAuth/account flows, cron jobs, and an authenticated builder GitHub deploy are verified. The biggest remaining product parity decision is whether direct server-side builder generation APIs must be supported on the Worker; supporting them requires a smaller create manifest/runtime from `@tanstack/create` or a separate generation service.
124
+
Production migration is close, but not fully safe until logged-in OAuth/account flows pass, cron jobs are verified, and an authenticated builder GitHub deploy is completed. The main remaining builder gap is the omitted React `events` example chunk.
0 commit comments