Repository navigation
Conversation
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
74 other measured values are unchanged. Public-import reachability bundles (bytes)
112 other measured values are unchanged. |
trueadm
left a comment
There was a problem hiding this comment.
Thanks. The change is small and CI is green. One concern before merging into next, which is a size-focused branch: the benchmark report (run 38741491717) shows bytes going up with no measured speed-up.
- Size: shell_ full +110 B gzip (106,365 → 106,475), shell_client +72, full_fw +70, hydrate-frame +87, split-shell +72, split-shell-signals +80.
- Speed: every js-framework operation is within noise, and no work counter moved.
The win here is one fewer Map per signal-reading render, but nothing we benchmark exercises that. Could you add a measurement that shows it? For example, the scoped-signals bench or a focused allocation counter (hook-memo style) for a component reading one scope, with the Map allocation gone and no regression in multi-scope reads. If the gain is real there, the bytes are easier to justify.
Two smaller notes:
getCandidatenow does aninstanceof Mapcheck on every read. That's probably fine, but the per-read cost on the multi-scope path is worth confirming in that same bench.- Moving
assertAliveintoerrors.tsto keep serialization off the graph bridge is a nice separate win. If the Map change doesn't hold up, it could land on its own.
Reviewed with Claude Code
trueadm
left a comment
There was a problem hiding this comment.
Thanks for narrowing this to the owner-validation move. It's size-neutral, and serialization no longer reaches the graph bridge only to check that an owner is alive. All 30 checks are green on c50a7ed. Approving.
Reviewed with Claude Code
Summary
Serializing a retained signal owner currently goes through the graph bridge just to check whether the owner is retired. Call the same
assertAliveguard directly fromscopeSeedEntry. Keep it available fromgraph.tsfor existing consumers;serializeScopeReadstill uses the bridge where it needs graph traversal for SSR. The error, seed format, suspension and disposal behavior are unchanged.This is the smaller alternative requested in review. Controlled production Oxc runs showed the removed inline-Candidate optimization saved one Map per single-scope render and helped a sampled-style fixture (−3.4%), but a real second-scope read regressed by +4.6% with 16 signals and +14.1% with 128. Baseline-vs-baseline controls were near zero. Those gains did not justify the multi-scope regression, so this PR now has no
native-read-client.tsdiff. Independently extracted from #2036, againstnext.Validation
pnpm syncandgit diff --check.Risk / follow-ups
No runtime hot-path change remains. This removes a dependency edge for seed ownership validation only; consumers that still need graph serialization may retain the graph bridge. PR-only hosted comparison: next 4ae77f2 → PR merge f94d19b of c50a7ed, before #2090 landed. Full JavaScript gzip: TSRX 31,551 → 31,551 B and JSX 55,431 → 55,431 B. Threadline Oxc 53,221 → 53,221 B / esbuild 60,319 → 60,319 B; Pagecraft Oxc 171,565 → 171,565 B / esbuild 186,925 → 186,925 B. Wayfinder −34 B. JSX full signal shell 107,135 → 107,147 B (+12 B); client shell −4 B; hydrate-frame +13 B; combined split-shell −6 B. This is effectively bundle-neutral in the full apps; the older +110 B shell/Map change is gone. No new size target is claimed. #2090 does not conflict with this PR, but the hosted benchmark's merge parent predates that split.
Provenance
agent-authored)Implementation: Codex task · host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Refactor only: same retired-owner check, with a narrower import path during seed serialization; SSR graph serialization still uses the bridge.
Overview
Moves
assertAlivefromgraph.tsintoerrors.tsand re-exports it from the graph module so existing imports keep working.When copying retained owners during
scopeSeedEntryserialization, validation now callsassertAlivedirectly instead ofgraphBridge.assertAlive, so that path no longer depends on the transition graph bridge (and its optional transition ops) just to throwScopeDisposedErroron retired scopes.serializeScopeReadstill uses the bridge for graph-node walks and SSR checks.Patch changeset notes the same ownership-validation behavior with a lighter dependency edge.
Reviewed by Cursor Bugbot for commit c50a7ed. Bugbot is set up for automated code reviews on this repo. Configure here.