Repository navigation
CS1: the blog on Workers - #2
Merged
Merged
Conversation
apps/web is Vercel's Blog with Sanity CMS with the Workers build around it: typegen at prebuild (offline, against the schema), next build (standalone, traced from the monorepo root, placeholders for the project id, dataset and token when unset), opennextjs-cloudflare build, populateCache into the static-assets bundle. tests/web exercises the image URL builder, the date component and the draft-mode enable route end to end with a mocked client. Departures from upstream, all recorded in the epic: the blog routes are force-dynamic with fetchCache force-no-store (ISR cannot run on the read-only static-assets cache; Sanity's API CDN is the 60 s cache) and generateStaticParams goes with it, the Studio loads client-side only so the sanity package ships as static assets and not inside the Worker (7.6 MB instead of 31 MB uploaded), VisualEditing comes from next-sanity/visual-editing, Speed Insights becomes the Cloudflare Web Analytics beacon (opt-in by token), next-sanity 13 and sanity 6 are the lines that declare Next 16, and Tailwind 4 replaces 3 because Studio v6's stylesheet uses cascade layers Tailwind 3 rejects. Orun-Task: CS-2 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CS1 — the blog on Workers.
apps/webis Vercel's Blog with Sanity CMS with the Workers build around it:sanity schema extract --force && sanity typegen generateatprebuild(offline),next build(standalone output, traced from the monorepo root;placeholderproject id and dataset and abuild-placeholdertoken when unset, so the credential-free build runs — verified with a fetch guard that it contacts no Sanity API),opennextjs-cloudflare build,populateCache localinto the static-assets bundle.tests/webexercisesurlForImage/resolveOpenGraphImage/resolveHref, theDateComponent, andGET /api/draft-mode/enableend to end throughnext-sanity/draft-modeand@sanity/preview-url-secretwith a mocked client (8 tests).Verified locally: typecheck, lint (0 errors, 1 upstream warning), test and build green;
wrangler deploy --dry-runuploads 7.6 MB / 1.58 MB gzip with no Studio code in the Worker (the Studio is 10 MB of_next/staticchunks);wrangler devover the built Worker answers/studio(200, the shell withnoindex),/studio/structure(200), its chunks and/favicon.ico(200),/nope(404),/api/draft-mode/enablewithout a secret (401Invalid secret, no network), and/+/posts/[slug]reach Sanity's API CDN (with the placeholder project: 500, Sanity's "Dataset not found"). Departures from upstream, recorded inIMPLEMENTATION-STATUS.md:force-dynamic+fetchCache = "force-no-store"on the blog layout andgenerateStaticParamsremoved (ISR cannot run on the read-only static-assets cache; the API CDN's 60 s TTL is the interval upstream matched), the Studio loaded client-side only and its layout's metadata written out (both re-exports putsanityinto the Worker's SSR chunks),VisualEditingfromnext-sanity/visual-editing, Cloudflare Web Analytics in place of Speed Insights (opt-in byNEXT_PUBLIC_CF_BEACON_TOKEN), next-sanity 13 / sanity 6 /@sanity/clientas an explicit peer, Tailwind 4 CSS-first (Studio v6's stylesheet uses cascade layers Tailwind 3's PostCSS plugin rejects), the eslint 9 flat config with@typescript-eslint/no-explicit-anyoff by name,.env.example+.dev.vars.examplein place of.env.local.example.🤖 Generated with Claude Code