Migration checklist
Migration checklist in the Next.js to ShadowJS guide.
- Create the Vite app with
dusk(), setjsxImportSourceto@shadow-js/webandtypesto["vite/client", "node"]. - Move
app/**/page.tsxandlayout.tsxtoroutes/**:index.tsx,name.tsx,[param].tsx,_layout.tsx. - Port each page with React to ShadowJS: state, effects, forms, lists.
- Move data access into server functions (
serverFn), and call them fromloaders and event handlers. - Replace
next/linkwithA,next/navigationwith the router hooks;metadata,generateMetadataandviewportkeep their names. - Move
app/api/**/route.tstoroutes/api/**, and Server Actions to server functions with an input schema. - Move
middleware.tsto themiddlewarearray insrc/entry-server.ts; replace eachmatcherwith a path check. - Rename
NEXT_PUBLIC_*toDUSK_PUBLIC_*, or move a value the browser may read to.env.publicwithout a prefix. Read the public values withimport.meta.env, and describe server variables withdefineEnv. ANEXT_PUBLIC_*name that must keep its name can be listed inenv.public.prefixesindusk.config.ts. - Replace
next/imagewith Dusk’sImageand optimizer, or a plainimg; replacenext/fontwithdefineFontsor@font-face. - Replace
@clerk/nextjswith@shadow-js/clerk, andconvex/reactwith@shadow-js/convex. - Set
security.allowedHosts,cookieSecretsand a CSP; read the production checklist. - Port the tests with
@shadow-js/dusk/testingand@shadow-js/testing; run the new app next to the old one before moving traffic.