Repository navigation
Commit 3ae9e92
feat(signals,solid,web,diagnostics): OBSERVE.records — one records channel on both platforms; the call record and its origin (#3472)
* feat(signals,solid,web,diagnostics): OBSERVE.records — one records channel on both platforms; the call record and its origin
The runtimes' records move onto one channel, `OBSERVE.records`, owned by
the core: `subscribe(type, listener)`, `observed(type)`, `emit(type,
event, live)`, created once per process and registered on `globalThis`
under `Symbol.for("@solidjs/signals/observe/records")` so a second copy of
the core (a bundled server build instrumented through `--import`) and
wire layers bundled without a framework import reach the same listener
sets. The catalogue is two empty interfaces the runtimes augment, one
augmenter each: `RecordTypes` (solid-js: `"boundary"`) extends
`HostRecordTypes` (@solidjs/web: `"invocation"`, `"frame"`, `"call"`).
`OBSERVE.server` keeps only the `trace` slot.
The `"frame"` record gains its client half: `FrameEvent` is
`FrameProducedEvent | FrameAppliedEvent`, discriminated by `side`, the
same census on both, the client adding `address` and `outcome:
"truncated"`. The server census is corrected — `regions` counts `html`
chunks addressed to a child frame id (the old count read a chunk type
that does not exist) and `shellMs` is the stream's own shell only.
New `"call"` record: one per server-function call made from the browser,
at the caller's settle — `{ id, at, durationMs, method, outcome, status?,
origin?, deferred? }` with `{ args, response?, result? | error? }` beside
it. It replaces `observeServerFunctionCalls`, which is removed from both
server-function entries. `origin` is what the call ran for, read at
dispatch through the new `OBSERVE.attribution.currentOrigin()` (the
`currentOrigin` hook; the installed hooks are also registered on
`globalThis` under `Symbol.for("@solidjs/signals/observe/attribution")`
for the import-free client): the engine's own `ChangeOrigin` — the
interaction whose handler made it, the navigation whose recompute needed
it — so an observer files the call under the interaction record by
identity, not by a time window.
The server-functions and frames client entries gain `observe` and
`development` builds and export conditions; the server-functions client
is now built with its flags replaced in every tier (`_SOLID_DEV_` there
was an unreplaced truthy string).
`@solidjs/diagnostics` format v6: `artifact.server` becomes
`artifact.records: { boundary, invocation, frame, call }`, captured on
both platforms including the browser bridge; JSONL carries one line per
record with `type`, and `recordCounts` in the meta line.
RFC 08/10/11/12 updated; the diagnostics README and the two skills follow
the artifact.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
* test(web): the published-types augmentation tests run in their own program
The web test program holds the package twice — the runtime specs import
`../src`, and everything importing `@solidjs/web` reaches the built
`types/` through the self-link. Both copies now augment `solid-js`'s
record catalogue (src/observe.ts), and TypeScript requires duplicate
property declarations to be of identical type; the copies are, unless a
test augments the published one alone. `request-event-locals.*` does
exactly that (`RequestEventLocals`), so the two `InvocationLive.event`
types differed and the conflict surfaced as TS2717 in whichever file the
program loaded second — hidden before #3470 because the built copy came
second and `skipLibCheck` swallowed it there; the seams change reordered
the imports and put `src/observe.ts` second.
The augmentation acceptance tests move to `tsconfig.test.augment.json`, a
program with one copy of the package (the published one, which is their
point); `test-types` runs both.
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
* fix(web): the client record emitters fold out of prod; observe-tier size caps
The Size check caught the prod frames scenario at +286 B: `records()`
folded to `return undefined`, but the emitters it guarded
(`observeCall`, `observeFrameApply`, `frameCensus`, `isDeferredBody`) and
the wrappers around the dispatch and the apply were retained — rollup
cannot fold a call's undefined return through its call site. Now the
emitters return early behind the observe literal, and the wrappers exist
only where it holds: `fetchServerFunction` IS the dispatch and
`applyFrameResponse` IS the apply loop in prod (`IS_OBSERVE ? observed :
plain` aliases), so prod pays neither the extra frame nor the promise
hop. The frames scenario is back under its cap (11430 B).
The two observe-tier scenarios grew deliberately — the records channel
and the `currentOrigin` query ship there — and their caps move with the
measured artifacts: CSR observe 15.90 -> 16.05 KB (+216), attribution
27.45 -> 27.70 KB (+323).
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Cursor <[email protected]>1 parent d2a36f5 commit 3ae9e92
58 files changed
Lines changed: 3151 additions & 941 deletions
File tree
- .changeset
- documentation
- plans
- solid-2.0
- packages
- diagnostics
- skills/agent-loops
- src
- tests
- signals
- src
- core
- tests
- solid
- skills/reactivity-diagnostics
- src
- server
- test/server
- web
- frames
- src
- server-functions
- src
- src
- test
- server
- scripts/size
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
307 | 309 | | |
308 | 310 | | |
309 | 311 | | |
| |||
346 | 348 | | |
347 | 349 | | |
348 | 350 | | |
349 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
350 | 355 | | |
351 | | - | |
352 | | - | |
| 356 | + | |
| 357 | + | |
353 | 358 | | |
354 | | - | |
| 359 | + | |
355 | 360 | | |
356 | 361 | | |
357 | 362 | | |
358 | 363 | | |
359 | 364 | | |
360 | | - | |
361 | | - | |
| 365 | + | |
| 366 | + | |
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
| |||
0 commit comments