Skip to content

Commit 53dcb39

Browse files
committed
Merge branch 'next' into top-level-capabilities
2 parents 48ef8ab + fc8e0c8 commit 53dcb39

12 files changed

Lines changed: 202 additions & 136 deletions

‎.changeset/frontends-option.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
'@solidjs/vite-plugin': minor
2+
'@solidjs/vite-plugin': patch
33
---
44

55
Add a `frontends` option: other languages that lower to Solid can claim a file extension and compile its modules themselves (`frontends: { ".x": x() }`). A front end's `compile(source, { id, moduleId, ssr, root, solid, addWatchFile })` returns `{ code, map, css }`, given the compiler options this plugin would use for a JSX module in that environment; the result then takes the lowered `.tsrx` route (lazy and refresh passes, server functions keyed by the module's real path, `css` as a CSS module, dep scanning). Server functions in a front end's modules need `@solidjs/compiler` with secondary passes that accept any extension. `.rx` (ReactiveScript) is built in: with `@reactivescript/compiler` installed in the project, `.rx` modules compile with no option.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solidjs/vite-plugin': patch
3+
---
4+
5+
Rename `start.errorBoundary` to `start.productionErrorBoundary`, since the boundary is only added in production builds. The old key fails at config time with a message naming the replacement.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solidjs/vite-plugin': patch
3+
---
4+
5+
The generated server entry passes the request's `signal` to `renderToStream`, so a render still pending when the client disconnects is disposed (#467).

‎.changeset/solid-rc19.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solidjs/vite-plugin': patch
3+
---
4+
5+
Solid packages move to `^2.0.0-rc.19` (`solid-js`, `@solidjs/web`, `@solidjs/compiler`, `@solidjs/babel-plugin`).

‎README.md‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ The object form carries the options (`start: true` is pure sugar for
235235
`start: {}` — both mean the identical start mode with defaults, and
236236
`false`/absent means off): `app`, `document`, `entryServer`, `entryClient`,
237237
`middleware`, `setup`, `instrument`, `clientSetup`, `renderMode`,
238-
`devtools`, `errorBoundary`,
238+
`devtools`, `productionErrorBoundary`,
239239
`css`, `external`, `node`, all documented below.
240240

241241
Install `@solidjs/start-devtools` as a development dependency to add the
@@ -495,7 +495,7 @@ registered, and the client gets a bodyless 500. That 500 carries the
495495
headers and cookies written to the request event only while the response
496496
head is still open: once `next()` has returned a rendered page, the head
497497
was committed with that page, and a later throw drops them. An error
498-
middleware still sees a throw first, and with `errorBoundary` on, render
498+
middleware still sees a throw first, and with `productionErrorBoundary` on, render
499499
errors are handled by the boundary before they get this far. In dev those
500500
failures still reject, so the dev server sees the original error (with the
501501
built-in dev middleware, Vite's error middleware and its overlay).
@@ -656,14 +656,14 @@ settle, so the option is a documented no-op there. A nonce set during the
656656
client-mode shell prerender is ignored (and the build warns): baking one
657657
into `dist/client/index.html` would replay it on every load.
658658

659-
**`errorBoundary`** — in a production build, generated entries wrap the app
659+
**`productionErrorBoundary`** — in a production build, generated entries wrap the app
660660
in a default error boundary (and the document in an outer one): a render
661661
error streams a generic `500 | Internal Server Error` fallback — no stack
662662
or error details reach the HTML; the error itself goes to `console.error`
663663
— and an error caught before the shell flushes commits a real 500 status
664664
through the response-head lifecycle. Development is unaffected (Vite's
665665
error overlay owns dev errors), as are authored entries — the boundary is
666-
generated-entry codegen. Disable it with `start: { errorBoundary: false }`
666+
generated-entry codegen. Disable it with `start: { productionErrorBoundary: false }`
667667
when application middleware owns error handling (an error middleware only
668668
sees the throw when no boundary catches it first). Default: `true`.
669669

@@ -961,6 +961,30 @@ configureServerFunctionsServer({
961961

962962
Set `csrf: false` only when another trusted layer protects the endpoint.
963963

964+
Custom serialization (extra seroval plugins for class instances such as a
965+
`Money` or an `ObjectId`) is configured the same way, once per side. Set the
966+
server codec in the `configure` module and the client codec in
967+
[`start.clientSetup`](#optionsstart), both from one shared options module:
968+
969+
```ts
970+
// src/serialization.ts
971+
import type { JSONCodecOptions } from '@solidjs/web/serialization';
972+
export default { plugins: [MoneyPlugin] } satisfies JSONCodecOptions;
973+
974+
// src/server-config.ts (serverFunctions.configure)
975+
import { configureServerFunctionsServer } from '@solidjs/web/server-functions/server';
976+
import codec from './serialization';
977+
configureServerFunctionsServer({ codec });
978+
979+
// src/client-setup.ts (start.clientSetup)
980+
import { configureServerFunctionsClient } from '@solidjs/web/server-functions/client';
981+
import codec from './serialization';
982+
configureServerFunctionsClient({ codec });
983+
```
984+
985+
Both sides must use the same plugins. This covers server-function arguments
986+
and results; the SSR hydration payload takes its own `plugins` option.
987+
964988
Meta-frameworks that need to control plugin ordering and dispatch requests
965989
through their own server should use the standalone `serverFunctions()`
966990
export instead, which never installs the dev middleware. See

‎examples/start-ssr/test/run.mjs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3988,6 +3988,15 @@ async function runMiddlewareMode() {
39883988
entryCode.includes('const prepared = ') &&
39893989
entryCode.includes('__solidSetupStream'),
39903990
);
3991+
// A client that disconnects before the shell flushes aborts
3992+
// request.signal; the entry forwards it so the pending render is
3993+
// disposed (#467).
3994+
record(
3995+
'mw-codegen',
3996+
'gen',
3997+
'generated entry forwards request.signal to renderToStream',
3998+
entryCode.includes('.request.signal'),
3999+
);
39914000
// The `options.event` seam on an external handleRequest call: a
39924001
// host-shaped direct dispatch (no dev middleware involved) passes a
39934002
// synthetic nativeEvent, and the event the app sees (the /api/native

‎examples/start-ssr/vite.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default defineConfig({
223223
// chain fronting every dispatch path — page SSR, /_server,
224224
// preview — with getRequestEvent() live inside it.
225225
...(process.env.SSR_MIDDLEWARE
226-
? { middleware: './src/middleware.ts', errorBoundary: false }
226+
? { middleware: './src/middleware.ts', productionErrorBoundary: false }
227227
: process.env.SSR_RENDER_MODE === 'middleware' || process.env.SSR_NONCE
228228
? { middleware: './src/middleware.ts' }
229229
: {}),

‎package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
"dependencies": {
6464
"@ampproject/remapping": "^2.3.0",
6565
"@babel/core": "^7.23.3",
66-
"@solidjs/babel-plugin": "^2.0.0-rc.16",
67-
"@solidjs/compiler": "^2.0.0-rc.16",
66+
"@solidjs/babel-plugin": "^2.0.0-rc.19",
67+
"@solidjs/compiler": "^2.0.0-rc.19",
6868
"@types/babel__core": "^7.20.4",
6969
"merge-anything": "^5.1.7",
7070
"vitefu": "^1.0.4"
@@ -77,9 +77,9 @@
7777
"@rollup/plugin-commonjs": "^25.0.7",
7878
"@rollup/plugin-node-resolve": "^15.2.3",
7979
"@skypack/package-check": "^0.2.2",
80-
"@solidjs/diagnostics": "2.0.0-rc.16",
80+
"@solidjs/diagnostics": "2.0.0-rc.19",
8181
"@solidjs/start-devtools": "^1.0.0-next.3",
82-
"@solidjs/web": "^2.0.0-rc.16",
82+
"@solidjs/web": "^2.0.0-rc.19",
8383
"@types/node": "^24.0.0",
8484
"cypress": "^14.0.0",
8585
"cypress-visual-regression": "^5.2.2",
@@ -88,16 +88,16 @@
8888
"prettier": "^3.1.0",
8989
"rollup": "^4.5.0",
9090
"rollup-plugin-cleaner": "^1.0.0",
91-
"solid-js": "^2.0.0-rc.16",
91+
"solid-js": "^2.0.0-rc.19",
9292
"typescript": "^5.2.2",
9393
"vite": "^8.2.1",
9494
"vitest": "^4.1.11"
9595
},
9696
"peerDependencies": {
9797
"@solidjs/start-devtools": "^1.0.0-next.2",
98-
"@solidjs/web": "^2.0.0-rc.16",
98+
"@solidjs/web": "^2.0.0-rc.19",
9999
"@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.0.0 || ^7.0.0",
100-
"solid-js": "^2.0.0-rc.16",
100+
"solid-js": "^2.0.0-rc.19",
101101
"vite": "^8.0.0 || ^9.0.0"
102102
},
103103
"peerDependenciesMeta": {

0 commit comments

Comments
 (0)