All Projects → sw-yx → Amplify React Serverless Components

sw-yx / Amplify React Serverless Components

a trial app to deploy React Server Components inside of a serverless AWS Lambda function, scaffolded using the AWS Amplify CLI

Labels

amplify-react-serverless-components

a trial app to deploy React Server Components inside of a serverless AWS Lambda function, scaffolded using the AWS Amplify CLI

image

Context - What are React Server Components?

The main React code and serverless code can be found in /amplify/backend/function/rsc/src.

You can watch the live stream here! https://www.youtube.com/watch?v=VA3TFymZlW4

Live demo: https://m5x7he153l.execute-api.us-east-1.amazonaws.com/dev/rsc/

The main steps are:

  • take https://github.com/pomber/server-components-demo React team demo minus Postgres
  • create a new serverless function from scratch
  • copy over the dependencies
  • copy over the minimal client code
  • copy over the minimal server code and adapt it to a serverless context
  • fix the build script
  • make sure to set nodejs flags and env variables exactly according to the original React team demo
  • Warning: client components dont work in production if you are compiling them on your machine because they use absolute paths (LINK TO DAN ABRAMOV TWEET)0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].