Repository navigation
CC1: the blog on Workers - #2
Merged
Merged
Conversation
vercel/next.js examples/cms-contentful in apps/web: Next.js 16.3.8 (upstream's `latest` is 16.4, which OpenNext does not support) with React 19, built by next build, then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. / and /posts/[slug] render on request (force-dynamic, no generateStaticParams, reads no-store against Contentful's API CDN). The space id and Content Delivery API token are read at build and inlined into the server bundle (server-only); the preview token and the preview and revalidate secrets are Worker secrets read at request time. /api/draft checks CONTENTFUL_PREVIEW_SECRET, looks the post up through the Content Preview API, enables draft mode and redirects, in place of @contentful/vercel-nextjs-toolkit (Vercel's protection-bypass token); the template's preview URL is unchanged. With no space the blog is unconnected: three bundled sample posts under a "connect your Contentful space" notice, and draft mode answers 401 with the reason. An unknown post is a 404; the slug is quoted as a GraphQL string literal; an embedded rich-text image goes through the template's Contentful loader. The blog's name is one seam (SITE_NAME in app/site.ts: the heading, the title, the link home). The content-model import stays `pnpm --filter @app/web run setup`, a person's step with a management token. tests/web: identity, the sample mode, the GraphQL reads, the rich-text body and the draft route. typecheck, lint, test and build are green; wrangler dev serves the home page, every sample post, a 404, draft mode's 401, leaving draft mode and the webhook's 401. The Worker is 1.1 MiB gzipped. Co-Authored-By: Claude <noreply@anthropic.com> Orun-Task: CC-2
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.
vercel/next.js examples/cms-contentful in apps/web: Next.js 16.3.8 (upstream's
latestis 16.4, which OpenNext does not support) with React 19, built by next build, then @opennextjs/cloudflare (standalone output, the static-assets incremental cache) into one Worker with Static Assets. / and /posts/[slug] render on request (force-dynamic, no generateStaticParams, reads no-store against Contentful's API CDN). The space id and Content Delivery API token are read at build and inlined into the server bundle (server-only); the preview token and the preview and revalidate secrets are Worker secrets read at request time. /api/draft checks CONTENTFUL_PREVIEW_SECRET, looks the post up through the Content Preview API, enables draft mode and redirects, in place of @contentful/vercel-nextjs-toolkit (Vercel's protection-bypass token); the template's preview URL is unchanged. With no space the blog is unconnected: three bundled sample posts under a "connect your Contentful space" notice, and draft mode answers 401 with the reason. An unknown post is a 404; the slug is quoted as a GraphQL string literal; an embedded rich-text image goes through the template's Contentful loader. The blog's name is one seam (SITE_NAME in app/site.ts: the heading, the title, the link home). The content-model import stayspnpm --filter @app/web run setup, a person's step with a management token. tests/web: identity, the sample mode, the GraphQL reads, the rich-text body and the draft route. typecheck, lint, test and build are green; wrangler dev serves the home page, every sample post, a 404, draft mode's 401, leaving draft mode and the webhook's 401. The Worker is 1.1 MiB gzipped.🤖 Generated with Claude Code