~repos/edge-city
edge-city is a next level meta-framework for react that runs only on edge runtimes
update app
refactor dir
Fix more warnings
edge-city
edge-city is a next level meta-framework for react that runs only on edge runtimes.
It uses file system routing with streaming SSR + CSR to render pages.
It is very opionated and has set of idiomatic ways of doing things.
It has an inbuilt rpc mechanism to access server resources instead of a typical REST API.
It aims to have almost the same router api as nextjs router for ease of use.
During development each request for a page is executed in a separate edge-runtime (miniflare/vercel) vm.
During production each page is packaged to an esm function adapted to the platform of your choice.
Why?
- Its really hard to have a streaming SSR + CSR with automatic data rehydration setup in nextjs 13.
- There is no meta-framework which runs your code in an edge simulated environment during development.
Requirements
node >= v20
wrangler
for deploying to cloudflare page functionsvercel
for deploying to vercel edge runtime
DB access
Since it runs only on edge runtimes which run in a constrained browser environment, you have to use database drivers which can run in the browser, basically utilize Ajax/Fetch/Websocket. Here is a list of some of them,
- NeonDB serverless driver - postgres
- Platnetscale serverless driver - mysql
- Mongo Http - mongodb
Supported platforms
Developing
node >= v20.2.0
pnpm >= v8.5.1
Todo[General]
- Build a docs website
- Add tests for bot
- Add tests for runtime
- Add E2E tests for example
- Maybe move to vite for HMR goodness
Todo[Cloudflare]
- Fix 404 pages not routing on server