• Stars
    star
    219
  • Rank 181,133 (Top 4 %)
  • Language
    TypeScript
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Server-rendered React using Vercel Edge Functions.

React on the Edge

sveltekit-on-the-edge but on top of React. It uses esbuild for bundling and Vercel Edge Functions for SSR.

This example is for framework builders and advanced usage of the low-level Vercel Build Output API. If you're looking to develop a React application with dynamic Edge capabilities, we recommend Next.js Middleware and Vercel Edge Functions.

How to use

Run pnpm i then:

  • To build: pnpm build
  • To run a local server: pnpm start

To build this demo with streaming (renderToStream) instead of renderToString run USE_STREAMS=1 pnpm build. After building, .vercel/output will be created which you can deploy via vc --prebuilt.

Architecture

  • util/build.mjs implements the build process on top of esbuild that bundles src/app into an Edge Function.
  • util/start.mjs implements a local server using the edge-runtime package that can locally run the build outputs.

Developing

Due to the absence of a dev server, watchexec can be used as a replacement. Use brew install watchexec to install.

watchexec -c -r --no-meta 'node util/build.mjs; node util/start.mjs'

More Repositories

1

gemini-chatbot

Build your own generative UI chatbot using the Vercel AI SDK and Google Gemini
TypeScript
673
star
2

next-fetch

Intuitive data fetching for Next.js
TypeScript
593
star
3

slacker

A bot that notifies you on Slack whenever your company/product is mentioned on Hacker News. Powered by Vercel Functions & Upstash.
TypeScript
341
star
4

app-router-auth

Auth patterns using Next.js App Router
TypeScript
212
star
5

function-database-latency

Visualize the latency of databases from Vercel Functions.
JavaScript
171
star
6

semantic-image-search

Semantic Image Search with Vercel AI SDK
TypeScript
118
star
7

ai-sdk-preview-rag

TypeScript
110
star
8

ai-sdk-preview-rsc-genui

Generative UI with React Server Components and Vercel AI SDK
TypeScript
101
star
9

rsc-llm-on-the-edge

TypeScript
100
star
10

remix-on-the-edge

Remix running on Vercel Edge Functions
TypeScript
82
star
11

ai-sdk-preview-use-object

TypeScript
35
star
12

ai-sdk-preview-multi-steps

TypeScript
29
star
13

ai-sdk-preview-attachments

TypeScript
27
star
14

next-on-the-edge

TypeScript
21
star
15

remix-platforms

Multi-tenant Remix application (multiple custom domains with a single codebase)
CSS
13
star
16

ai-sdk-flags-edge-config

Example project showing how you can use Edge Config and Feature Flags with the Vercel AI SDK
TypeScript
12
star
17

blue-green

TypeScript
12
star
18

ai-sdk-preview-array-output-mode

TypeScript
10
star
19

react-spa

A React SPA with Express
JavaScript
7
star
20

next-spa-drizzle

https://next-spa-drizzle.vercel.app/
TypeScript
3
star
21

vercel-nav-demo

v0 + Shadcn UI version
TypeScript
3
star
22

ai-sdk-deployment-guide

TypeScript
3
star
23

without-react-tweet-iframes

TypeScript
2
star