feat: add SSR deployment adapters for Cloudflare Workers, Vercel, and Deno#597
Draft
advl wants to merge 1 commit intofeat/ssr-adapter-typesfrom
Draft
feat: add SSR deployment adapters for Cloudflare Workers, Vercel, and Deno#597advl wants to merge 1 commit intofeat/ssr-adapter-typesfrom
advl wants to merge 1 commit intofeat/ssr-adapter-typesfrom
Conversation
… Deno Three new packages that bridge @canonical/react-ssr renderers to platform-specific deployment targets: - @canonical/ssr-adapter-deno: Deno.serve() handler with filesystem static asset serving. Simplest adapter (~60 lines). - @canonical/ssr-adapter-cloudflare: Workers fetch handler with R2 static assets, Cloudflare Cache API for SSR caching, ctx.waitUntil for background cache writes. - @canonical/ssr-adapter-vercel: Node.js serverless handler (renderToPipeableStream via IncomingMessage→Request conversion) and Edge handler (renderToReadableStream). Both with Cache-Control header support. All adapters share the RendererFactory type from @canonical/react-ssr/adapter and use the same route matching, MIME detection, and cache control utilities. 43 tests across all three packages, 100% coverage each.
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.
Done
Three new adapter packages that bridge
@canonical/react-ssrrenderers to platform-specific deployment targets. Depends on #596.@canonical/ssr-adapter-deno—createHandler(config)forDeno.serve(), filesystem static assets, ~60 lines, 12 tests, 100% coverage@canonical/ssr-adapter-cloudflare—createFetchHandler(config)for Workersfetch(request, env, ctx), R2 static assets, Cache API withctx.waitUntil, ~90 lines, 15 tests, 100% coverage@canonical/ssr-adapter-vercel—createNodeHandler(config)for serverless (Node.js,IncomingMessage→Requestconversion) andcreateEdgeHandler(config)for Edge (Web Standard), Cache-Control headers, ~120 lines, 16 tests, 100% coverageAll adapters share types from
@canonical/react-ssr/adapter(#596).QA
For each adapter package (
ssr-adapter-deno,ssr-adapter-cloudflare,ssr-adapter-vercel):cd packages/react/<adapter> && bun run check:ts— passescd packages/react/<adapter> && bun run check:biome— exit 0cd packages/react/<adapter> && bun run test:coverage— 100% coveragecd packages/react/<adapter> && bun run build— clean tsc buildPR readiness check
Feature 🎁package.json:check,check:fix, andtest.buildto build the package for development or distribution,build:allto build all artifacts.npm publish --access publicfrom each adapter package directory).