What has no equivalent yet
These are stated as they are in the source today, not as plans.
These are stated as they are in the source today, not as plans.
| Next.js feature | Status in Dusk | What to do |
|---|---|---|
React Server Components, "use client" |
Not available. Components render on the server and in the browser | Loaders and server functions for data; *.server.ts and server functions for server-only code |
Caching layers: the fetch cache, unstable_cache |
None as such. Dusk has ISR (revalidate), dataCache() for fetched data and tags (cacheTags, revalidateTag). Any other response is cache-control: private, no-store unless the route, a route rule or security.defaultCacheControl sets one; the browser keeps a loader cache (staleTime) |
Caching pages (ISR), event.responseHeaders.set("cache-control", ...), a CDN, prerender for static pages |
generateStaticParams, dynamicParams |
Partly. export const prerender is a list of paths or a function that returns the params, and export const dynamicParams = false makes the server answer 404 for a param the list omits. Two differences: the refusal is the server's, so a client-side navigation to an unlisted URL is not refused in the browser, and a prerender function also runs on the server (once per process) to read the list |
Params the page does not list |
Parallel routes (@slot), intercepting routes ((.)photo) |
Not supported by design (1.0.0) | Nested layouts and URL-state dialogs |
Route segment config (dynamic, runtime, revalidate) |
None as such; ISR with revalidate is the closest, see the link |
Caching pages (ISR) |
rewrites, redirects, headers in next.config.js |
Declarative rewrites, redirects and headers in dusk.config.ts, plus per-path routeRules |
See Dusk configuration for shapes, defaults and precedence. |
Middleware matcher, edge runtime |
None. A middleware runs for every request the handler answers, on every adapter | Check event.url.pathname |
useActionState, useFormStatus, useOptimistic, <form action={fn}> |
Dusk’s Form, useSubmission and server functions with form: true; core useOptimistic for optimistic state |
Form submits in place with JavaScript and posts to fn.url without it. Configure cookie secrets to carry the result after the redirect. |
next/font |
defineFonts in @shadow-js/dusk/vite, using local files or explicit build-time Google Fonts input |
Vendor local files into public/fonts/, or use { google: [...] } to download at build time. |
File metadata conventions (opengraph-image, sitemap.ts, robots.ts, manifest.ts) |
Dusk reads these files at the top of src/ (sitemap, robots, manifest, opengraph-image, twitter-image, icon, apple-icon, favicon.ico) and serves them as routes; the helpers sitemapRoute, robotsRoute, manifestRoute and ImageResponse build them. A file inside routes/ is a page, not a convention |
Put the file at the top of src/, named as the convention; see Icons and social images. Static opengraph-image and twitter-image image files are also found in every route folder, with the nearest folder winning, and their tags are written for you; see Static social images. A dynamic opengraph-image.tsx in a route folder (app/blog/[slug]/opengraph-image.tsx in Next) is served at /blog/:slug/opengraph-image with its params; its alt, size and contentType exports (literals) write the tags, and generateImageMetadata is not supported (write one module per folder); see Dynamic social images |
Built-in i18n routing, next-intl integration |
i18n in dusk.config.ts declares locales and the default locale; its routing options enable locale routing |
Use @shadow-js/i18n for messages, formatting, catalogs and hydration state. |
export const ssr = false as a request-time switch |
The server sends an empty document shell without running route loaders or components. "data-only" runs guards and loaders and sends their data without page markup |
The most restrictive matching layout or page wins: false, then "data-only", then full SSR. Protect private server operations independently of browser rendering. |
| Turbopack | Not applicable. Vite 8 |
Anything on the React side that Next.js apps lean on (React Query, React Hook Form, Radix) needs a replacement, as the
React guide explains. React Hook Form becomes @shadow-js/forms, and shadcn/ui,
the usual component layer of a Next.js app, becomes @shadow-js/ui.