Skip to content

Commit f74f536

Browse files
Version Packages (next)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent ee8d09f commit f74f536

3 files changed

Lines changed: 63 additions & 1 deletion

File tree

.changeset/pre.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
"lazy-entry-rolldown-reclassify",
1515
"lazy-load-native-compiler",
1616
"lazy-manifest-robustness",
17+
"native-babel-free-refresh",
1718
"native-compiler-option",
19+
"native-server-function-transform",
20+
"scoped-server-function-dce",
1821
"server-functions-compiler",
1922
"server-functions-default-runtime",
23+
"server-functions-turnkey",
2024
"six-lions-joke",
2125
"true-boxes-arrive"
2226
]

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# Changelog
22

3+
## 3.0.0-next.13
4+
5+
### Patch Changes
6+
7+
- e372cc0: The native `@dom-expressions/compiler` is now the default JSX compiler (`compiler: 'native'`). `compiler: 'babel'` remains available as an escape hatch that switches ONLY the JSX transform back to `babel-preset-solid` — if native output differs from your expectations, set it and file an issue (the behavioral diff between the modes is the bug report). Platforms without a prebuilt native binary (e.g. StackBlitz WebContainers) automatically use the compiler's wasm32-wasi fallback; the compiler package is required in every mode.
8+
9+
The `lazy()` module-URL pass and the solid-refresh HMR pass now run through native compiler passes (`transformLazy` / `transformRefresh`) in every mode, ahead of whichever JSX backend is selected, with sourcemaps chained across all passes. The plugin's own `lazy-module-url` Babel plugin is deleted (the placeholder format and its bundler-side resolution are unchanged), and supplying custom `babel` options in native mode reintroduces a Babel support pass hosting just those options.
10+
11+
HMR wrappers in all modes now import the refresh runtime from the dev-only `solid-js/refresh` core entry, and the `solid-refresh` package dependency is removed entirely — this also fixes solid-refresh#85 (stale registrations resurrected after full-tree disposal on Solid 2.0) for what was previously the Babel path. Requires the solid-js release that ships the `solid-js/refresh` entry (landing with this release train).
12+
13+
- 4b9c1ea: The server-function `"use server"` directive transform now uses the native `transformDirectives` pass from `@dom-expressions/compiler` (Rust/Oxc) instead of the in-tree Babel implementation. Output is byte-compatible — same runtime ABI, `xxhash32(relative path)-<count>` function IDs, and manifest behavior — but the transform is faster and now reports invalid closure captures as compile-time errors: a server function referencing a binding from an intermediate enclosing scope (an enclosing function's local or parameter, a loop variable) fails the build naming the variable and its location instead of silently breaking at runtime. JSX compilation is unchanged (Babel by default, native opt-in); only the directive transform is native-always.
14+
15+
Note: this requires `@dom-expressions/compiler` 0.50.0-next.23 or later — earlier releases do not include `transformDirectives`. The dependency is pinned accordingly.
16+
17+
- bde3e2b: More precise dead-code elimination after the `"use server"` client rewrite:
18+
19+
- The shake is now scoped to bindings orphaned by the rewrite (names
20+
referenced from the replaced function bodies, cascading through removed
21+
declarations). Code that was already unreferenced before the transform —
22+
e.g. `const t = startTimer()` written for its side effect — is no longer
23+
deleted from client output.
24+
- Destructuring patterns are now shaken: `const { db } = createClient()`
25+
used only inside a server function is removed from the client build along
26+
with its now-unused imports, closing a server-code-leak hole. Array
27+
pattern elements become holes (or truncate the tail), rest elements and
28+
nested patterns cascade, and a declarator whose pattern empties is dropped
29+
entirely.
30+
- Modules containing a direct `eval(...)` call skip the shake (reference
31+
counts are unreliable there); the directive rewrite itself still applies,
32+
and a warning is logged in development mode.
33+
34+
- 25f0506: Turnkey server functions: `serverFunctions: true` now gives a fully working
35+
setup with no manual wiring.
36+
37+
- Dev: a middleware on the Vite dev server handles the endpoint (default
38+
`/_server`, joined with `base`) end to end — it maps the incoming function
39+
ID back to its module through the compiler manifest, loads it in the SSR
40+
environment so the registration exists (even for functions only client
41+
code references, before any SSR render has run), scopes the request with
42+
`provideRequestEvent`, and dispatches to `handleServerFunctionRequest`,
43+
streaming bodies in both directions.
44+
- Prod: import `virtual:solid-server-function-handler` in the server entry
45+
and mount its `handleServerFunctionRequest(request)` export on the endpoint
46+
— one line, router-agnostic. The module eagerly imports every module
47+
containing server functions (via the persisted manifest, so tree-shaking
48+
can't drop registrations), configures the endpoint, and scopes requests
49+
with `provideRequestEvent`. Vite preview has no SSR runtime, so prod always
50+
goes through this mount.
51+
- New `endpoint` option on `ServerFunctionsOptions`, threaded to the dev
52+
middleware, the virtual handler, and — whenever the resolved path differs
53+
from the runtime default — `configureServerFunctions{Client,Server}` calls
54+
appended to compiled modules, so the client transport and rendered
55+
reference `.url`s agree without any manual configure call.
56+
- Bring-your-own wiring keeps working: the standalone `serverFunctions()`
57+
export (used by meta-frameworks like SolidStart) never installs the dev
58+
middleware, compiled output is byte-identical when the endpoint resolves to
59+
the default, and the virtual handler only activates if imported.
60+
361
## 3.0.0-next.12
462

563
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vite-plugin-solid",
3-
"version": "3.0.0-next.12",
3+
"version": "3.0.0-next.13",
44
"description": "solid-js integration plugin for vite 3/4/5/6/7",
55
"type": "module",
66
"files": [

0 commit comments

Comments
 (0)