vite-plugin-solid@3.0.0-next.14
Pre-release
Pre-release
·
13 commits
to main
since this release
Patch Changes
-
b2b9979: update to solid 2.0.0-beta.21 and @dom-expressions/compiler 0.50.0-next.24
-
5828a6e: Turnkey SSR: the object form of the
ssroption (even empty:ssr: {})
adds a serving layer on top of the SSR transforms so a plain Vite app gets
streaming server-side rendering with zero wiring — no entry files, no
index.html, no dev server script (requires Vite 6+;ssr: truekeeps the
transform-only behavior unchanged).- Dev: a middleware on the Vite dev server streams the rendered app for
HTML-accepting GET requests through the SSR environment, scoping each
request withprovideRequestEventand injecting the Vite client and the
dev style patch into<head>; SSR errors flow (stack-fixed) to Vite's
error page with the overlay.viteis the whole dev story. - Build: a plain
vite buildproduces both bundles via the
environments/builder API — client assets and manifest todist/client,
the server bundle todist/server/server.js(vite build --appand the
classic two-stepvite build+vite build --ssralso work). - Prod: the server bundle's entry is the new
virtual:solid-ssr-handler,
whosehandleRequest(request)export maps a web-standardRequestto a
streamedResponse— adapter-agnostic, one line to mount on any server.
Hashed client assets are resolved throughvirtual:solid-manifest. - Entries are conventional with escape hatches, resolved in order: explicit
ssr.entryServer/ssr.entryClient; conventionalsrc/entry-server.*/
src/entry-client.*(the server entry exports
render(request?, context?); authored/src/entry-client.tsxscript
references are rewritten to the hashed asset in prod); else both entries
are generated from a root component (ssr.app, defaultsrc/App.*)
wrapped in a document shell (ssr.document, defaultsrc/Document.*,
else a built-in one). - With
serverFunctionsenabled the two compose: the dev server-function
middleware runs ahead of SSR, and the productionhandleRequestserves
the endpoint before rendering. - Server-function registration robustness: the SSR build now merges the
client build's persisted manifest at manifest load time as well, so
builder-mode (single-invocation) builds keep registrations for functions
only client code references.
- Dev: a middleware on the Vite dev server streams the rendered app for