@solidjs/vite-plugin@3.0.0-next.29
Pre-release
Pre-release
·
13 commits
to main
since this release
Minor Changes
- 24747b7:
options.event: the public wrapper→event extension seam on the generated handlers. Fields passed ashandleRequest(request, { event })(andhandleServerFunctionRequest(request, { event })on the standalone server-function handler, threaded through itscreateEventoption) spread into the request event at creation, so hosts and custom server entries can extend whatgetRequestEvent()answers with — no new convention beyondcreateRequestEvent's own init parameter. The conventional field isnativeEvent, the platform's raw request object: the plugin's own dev, preview, and server-function dev middlewares now passevent: { nativeEvent: req }(the NodeIncomingMessage), sogetRequestEvent().nativeEventreads the same undervite dev/vite previewas behind a production Node entry that passes it. The event shape itself is unchanged ({ request, locals, response }plus whatever the wrapper spreads in); nothing is attached to theRequest, and no client-address helper is added — on bare Node readevent.nativeEvent.socket.remoteAddress, behind a trusted proxy read the forwarding headers offevent.request.
Patch Changes
- 40c6865: Housekeeping: add the MIT LICENSE file the
licensefield has always declared but the repo never carried (#219), and documentvirtual:solid-manifestin the README — what it exports in dev (the live asset resolver) versus SSR builds (the baked client manifest with_base), and its role as the seam for frameworks doing their own asset gating (e.g. the TanStack Start integration). - ca4d221:
start.env: the generatedvirtual:env/servermodule no longer contains
top-level await, removing the esnext-target deploy requirement. Boot
validation used to conditionallyawaiteach validator result (Standard
Schema allowsvalidate()to return a Promise), which put a TLA in the
server env chunk whenever the schema hadserverkeys — and any
downstream bundler with a non-esnext target refuses a TLA chunk outright
(Nitro's node-server preset is the one that bites in practice), forcing
deployments to override the build target toesnext. Boot validation is
now fully synchronous with identical semantics: sameprocess.envread at
module init, same per-key report, same fail-loud-at-boot before any
importer's body runs, same frozenenvexport — and synchronous init is
the only shape that can keep the "validated before first use" guarantee,
since user server modules readenv.KEYat their own top level (deferring
the await to request entry cannot cover module-init consumers). The
tradeoff is explicit: async validators (e.g.z.string().refine(async ...)) are no longer supported forserverkeys — they are rejected at
config/build time with the fix in the message (they could only ever have
failed at deploy boot otherwise), and boot backstops with the same report
for schemas whose async-ness only surfaces on real values.clientkeys
keep async support: their values are baked at build time, where the plugin
awaits. The start-env suite now asserts every built server chunk
transforms under esbuild target es2020 (which rejects TLA at parse time —
exactly the check a downstream bundler applies) so this cannot regress. - 3257a97: Vite 8's dependency scan no longer breaks on
.tsxfiles (issue #262).
The plugin previously setoptimizeDeps.rolldownOptions.transform.jsx: 'preserve'to stop Rolldown from injectingreact/jsx-dev-runtime
imports during the scan — but the scanner re-parses the transformed
output as plain JS (import.meta.globhandling force-tags modules as
js, and even without glob the oxc-preserved JSX is re-parsed without
JSX enabled), so any.tsxwith JSX was a hardPARSE_ERROR: Unexpected JSX expressionthat aborted the whole scan. Every dependency was then
missed by pre-bundling and discovered at runtime instead ("new
dependencies optimized" mid-session re-optimize/reload — the classic
symptom for deps only reachable throughimport.meta.glob). The scan
transform now uses the classic JSX runtime, which lowers JSX to bare
React.createElementcalls without injecting any import: the scan
output is never executed, it only exists so rolldown can walk the import
graph, so the undefined identifier is harmless. With this, the scan
completes and glob-only dependencies are pre-bundled up front.