Repository navigation
Commit bae6b06
feat(solid,web,signals): server diagnostics on OBSERVE.diagnostics; OBSERVE.server owned by solid-js's server entry
The server runtime reports on the same structured channel as the client
(server-dev-build-plan P1 + P2, one PR). Two helper modules hold the gates
— packages/solid/src/server/diagnostics.ts and packages/web/src/diagnostics.ts
— with three verbs: emitFinding (observe + dev: emit, and in dev report
through DEV.report), recordFinding (emit only, for a site that throws its
message), devCheck (emitFinding behind the dev gate). Call sites are wrapped
in literal "_SOLID_OBSERVE_" / "_SOLID_DEV_" tests so Rollup drops the
message strings from the tiers below; the prod server artifacts carry none
of it.
Findings (observe + dev): SSR_RENDER_ERROR_CONTAINED (data.handling:
fallback from createErrorBoundary, client/failed from the Loading boundary's
routing, failed from the root — the structured face of renderToStream's
onError, on the process-wide channel), SSR_SUBTREE_ABANDONED,
SSR_STREAM_ABANDONED (consumer | sink), LATE_HEADER_WRITE (recorded beside
the dev throw / prod log), SERVER_FN_ERROR_SANITIZED (the original the wire
replaced), FRAME_MARKER_CORRUPTED (frames client).
Checks (dev): every server console.warn becomes a code — SERVER_WRITE,
REVEAL_IN_RENDER_TO_STRING, LAZY_ASSET_UNMAPPED, PRELOAD_DESCRIPTOR_INVALID,
HEAD_TAG_INVALID, BEHAVIOR_CLAIM_DROPPED, UNRECOGNIZED_INSERT_VALUE (one code
and a new `render` kind on both platforms; the client's console.warn is
converted too). ASYNC_OUTSIDE_LOADING_BOUNDARY on the server records with
data.side: "server" before it throws. DiagnosticKind gains ssr, head, render.
ownerPath: the server createComponent runs the body under a transparent
owner labelled <Name> in observe/dev (createComponentOwner — no hydration id
consumed, no ownerCreations tick); the core's ownerPath walk reads
SSROwner._parent/_name unchanged. The repair-guide console footer moves to
src/console-footer.ts and both entries install it, so a server render's
[SERVER_WRITE] points at the same skill section. The server entry also
exports the Dev/Observe/Diagnostic* types the client entry does.
OBSERVE.server (C0/C1 follow-ups J.23/J.24): the invocation listener set and
trace-provider slot are created by solid-js's server entry
(src/server/observe.ts), once per process under
Symbol.for("solid-js/observe/server") on globalThis — not by web's module
init (an observer's init() importing only solid-js found the slot empty) and
not by the signals core (one artifact per tier for both platforms; a draft
there cost the client observe tier 138 B). The core keeps `server: {}`; web
reads the containers by the registered names.
Docs: RFC 08 "Server rendering" reference + quick-reference rows, the
corrected OBSERVE.server ownership paragraph; reactivity-diagnostics skill
gains a section per server code; plan doc records P1/P2 landed and the
compiler gap (SSR output inlines Comp(props); labels need createComponent
emitted under componentNames — separate PR).
Specs: solid/test/server/{server-diagnostics,observe-server,console-footer}.spec.ts,
web/test/server/server-diagnostics.spec.tsx, web/test/frames-marker-corruption.spec.tsx,
a client UNRECOGNIZED_INSERT_VALUE case in web/test/dev-warning.spec.tsx.
Size: observe CSR 15493 B (cap 15550), attribution 27093 B (cap 27160).
Co-authored-by: Cursor <[email protected]>1 parent a031271 commit bae6b06
32 files changed
Lines changed: 2212 additions & 225 deletions
File tree
- .changeset
- documentation
- plans
- solid-2.0
- packages
- signals/src/core
- solid
- skills/reactivity-diagnostics
- src
- server
- test/server
- web
- frames/src
- server-functions/src
- src
- test
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
173 | 207 | | |
174 | 208 | | |
175 | 209 | | |
| |||
243 | 277 | | |
244 | 278 | | |
245 | 279 | | |
246 | | - | |
| 280 | + | |
247 | 281 | | |
248 | | - | |
| 282 | + | |
249 | 283 | | |
250 | 284 | | |
251 | 285 | | |
| |||
0 commit comments