This repository shows how Hydrogen "2" (2023-01+) can be deployed on Vercel Edge Functions.
Try it here: https://hydrogen-2-vercel-demo.vercel.app/
- server.ts
- server-dev.ts (new)
- remix.config.ts
- remix.env.d.ts
- app/lib/session.server.ts
-
Why are there two server.ts/server-dev.ts files?
For local development the server-dev.ts is used to work with MiniOxygen.
-
Why is "cache" removed?
Vercel doesn't support the Cache API present in Cloudflare Workers/Oxygen, so for now its removed.
-
Why is session.server.ts changed? The Demo Store uses
createCookieSessionStorage()
from@shopify/remix-oxygen
which wouldn't work on Vercel for me. It's replaced with a generic Cookie Session implementation.