Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
react-server-docs | b5a6046 | Mar 01 2026, 03:52 PM |
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.
This PR adds a new built-in AWS Lambda deployment adapter to
@lazarv/react-server, enabling users to deploy their React Server applications to AWS with a single configuration change. The adapter leverages AWS SAM (Serverless Application Model) to provision a Lambda function with streaming support and an optional CloudFront CDN distribution.Motivation
AWS Lambda is one of the most widely used serverless platforms. Until now, the
awsoption increate-react-serverwas marked as "coming soon." This PR delivers the full implementation, completing the AWS deployment story alongside the existing Vercel, Netlify, Cloudflare, Azure, Bun, and Deno adapters.What's Included
AWS Lambda Adapter (
packages/react-server/adapters/aws/index.mjs)The core adapter that hooks into the react-server build pipeline:
static-manifest.json) for O(1) lookups at runtime.template.jsonwith:AWS::Serverless::Functionresource configured with Function URL inRESPONSE_STREAMinvoke mode for streaming SSR.AWS::CloudFront::CachePolicythat defers to originCache-Controlheaders (DefaultTTL/MinTTL = 0, MaxTTL = 1 year for immutable assets).AWS::CloudFront::Distributionwith a single Lambda origin — all requests (static and dynamic) flow through one origin, avoiding CloudFront Function size limits, Origin Group failover issues, and hardcoded path patterns.name,stackName,runtime,memorySize,timeout,architecture,authType,environment,functionProperties,cloudfront,resources,outputs,template, anddeployArgs.sam deploy --guidedcommand for first-time guided deployment.Lambda Function Handler (
packages/react-server/adapters/aws/functions/handler.mjs)The runtime handler that executes inside Lambda:
Cache-Controlheaders:/assets/,/client/):public, max-age=31536000, immutablemust-revalidatepublic, max-age=600awslambda.streamifyResponse()when available (Lambda Function URLs withRESPONSE_STREAMmode), falling back to buffered API Gateway v2 responses.Requestobjects, including cookie handling and base64-encoded body support.set-cookieheaders from react-server's HTTP context into the response.Documentation
docs/src/pages/en/(pages)/deploy/aws.mdx) — comprehensive guide covering prerequisites (AWS CLI, SAM CLI), installation, full configuration reference, build & deploy workflow, architecture overview, and advanced customization.docs/src/pages/ja/(pages)/deploy/aws.mdx) — translated version of the English documentation.Scaffolding (
packages/create-react-server/steps/deploy.mjs)disabled: "(coming soon)"flag from the AWS option in the deployment step."AWS Lambda"to the adapter name map and.aws,template.json,samconfig.tomlto the gitignore entries for the adapter.Architecture
Key design decisions:
RESPONSE_STREAMinvoke mode for real-time SSR streaming, with automatic fallback to buffered responses for API Gateway v2.