Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/solid-rc16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@solidjs/vite-plugin': patch
---

Require solid-js / @solidjs/web 2.0.0-rc.16 (peer floor) and compile with @solidjs/compiler / @solidjs/babel-plugin rc.16. rc.16 adds `reportRequestFailure` to @solidjs/web, and start mode's production handler now reports a contained failure (a middleware throw, a `setup` failure) through it, so the `configureServerErrors` hook hears it as `{ kind: 'request', handling: 'failed', event }` — and not at all when the runtime already reported that error (an uncaught in-process server-function call stays `server-function`/`thrown`), where rc.16's per-kind ledger would otherwise have heard it twice. JSX source locations (`sourceNames.locations`, which rc.16's compilers emit) now point at the authored source on both compiler backends: the JSX transform runs after the primitive-names, `lazy()` and refresh passes have reprinted the module, so its positions are mapped back through those passes' sourcemap.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,10 @@ Whatever escapes the chain is settled at the handler edge. A thrown
counts as a failure. In a production build any other failure (a middleware
throw, a `setup` failure, or an invalid `event.renderMode` / `event.nonce`) is contained by the
handler instead of rejecting to the host. It is reported once to the hook
registered with `configureServerErrors` from `@solidjs/web`, with the site
a failed render reports (`{ kind: 'render', handling: 'failed' }` and the
request `event`), or logged with `console.error` when no hook is
registered with `configureServerErrors` from `@solidjs/web` (through its
`reportRequestFailure`: `{ kind: 'request', handling: 'failed' }` and the
request `event`; an error the runtime already reported is not heard
again), or logged with `console.error` when no hook is
registered, and the client gets a bodyless 500. That 500 carries the
headers and cookies written to the request event only while the response
head is still open: once `next()` has returned a rendered page, the head
Expand Down
15 changes: 7 additions & 8 deletions examples/start-ssr/test/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3798,23 +3798,23 @@ async function runContainmentChecks(
const failures = heardFor(secret);
return (
failures.length === 1 &&
failures[0].kind === 'render' &&
failures[0].kind === 'request' &&
failures[0].handling === 'failed' &&
failures[0].event === true
);
};
record(
mode,
'contain',
'configureServerErrors hook hears the failure once (render/failed, with the event)',
'configureServerErrors hook hears the failure once (request/failed, with the event)',
failedOnce('mw-throw-secret') && failedOnce('late-throw-secret'),
JSON.stringify(heard),
);
if (setup) {
record(
mode,
'contain',
'a start.setup failure reaches the hook once (render/failed, with the event)',
'a start.setup failure reaches the hook once (request/failed, with the event)',
failedOnce('setup-throw-secret'),
JSON.stringify(heard),
);
Expand Down Expand Up @@ -3954,16 +3954,15 @@ async function runMiddlewareMode() {
);
// Dev containment is the thrown-Response half only: the catch answers
// a thrown Response or envelope and rethrows everything else to
// Vite's error middleware. Reporting (reportServerError from
// solid-js/internal) and the bodyless 500 are build-only.
// Vite's error middleware. Reporting (reportRequestFailure) and the
// bodyless 500 are build-only.
record(
'mw-codegen',
'gen',
'dev handler catch rethrows failures (no reportServerError, no synthesized 500)',
'dev handler catch rethrows failures (no reportRequestFailure, no synthesized 500)',
code.includes('function containFailure') &&
code.includes('throw error') &&
!code.includes('reportServerError') &&
!code.includes('solid-js/internal'),
!code.includes('reportRequestFailure'),
);
// The generated entry-server threads start.setup: awaited with the
// request event before renderToStream, its result (or App) rendered.
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
"dependencies": {
"@ampproject/remapping": "^2.3.0",
"@babel/core": "^7.23.3",
"@solidjs/babel-plugin": "^2.0.0-rc.14",
"@solidjs/compiler": "^2.0.0-rc.14",
"@solidjs/babel-plugin": "^2.0.0-rc.16",
"@solidjs/compiler": "^2.0.0-rc.16",
"@types/babel__core": "^7.20.4",
"merge-anything": "^5.1.7",
"vitefu": "^1.0.4"
Expand All @@ -77,9 +77,9 @@
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@skypack/package-check": "^0.2.2",
"@solidjs/diagnostics": "2.0.0-rc.14",
"@solidjs/diagnostics": "2.0.0-rc.16",
"@solidjs/start-devtools": "^1.0.0-next.3",
"@solidjs/web": "^2.0.0-rc.14",
"@solidjs/web": "^2.0.0-rc.16",
"@types/node": "^24.0.0",
"cypress": "^14.0.0",
"cypress-visual-regression": "^5.2.2",
Expand All @@ -88,16 +88,16 @@
"prettier": "^3.1.0",
"rollup": "^4.5.0",
"rollup-plugin-cleaner": "^1.0.0",
"solid-js": "^2.0.0-rc.14",
"solid-js": "^2.0.0-rc.16",
"typescript": "^5.2.2",
"vite": "^8.2.1",
"vitest": "^4.1.11"
},
"peerDependencies": {
"@solidjs/start-devtools": "^1.0.0-next.2",
"@solidjs/web": "^2.0.0-rc.14",
"@solidjs/web": "^2.0.0-rc.16",
"@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.0.0 || ^7.0.0",
"solid-js": "^2.0.0-rc.14",
"solid-js": "^2.0.0-rc.16",
"vite": "^8.0.0 || ^9.0.0"
},
"peerDependenciesMeta": {
Expand Down
Loading
Loading