Skip to content

chat example: drop the local-condition workaround, end renders when the tab closes - #4066

Merged
ryansolid merged 2 commits into
nextfrom
claude/project-thread-271xwi
Oct 14, 2026
Merged

ryansolid merged 2 commits into
nextfrom
claude/project-thread-271xwi

Conversation

@ryansolid

Copy link
Copy Markdown
Member

Before: the chat example read reasoning, error and usage into locals before using them in conditions, and its README told readers to do the same. #4023 made that necessary, because a property condition ({message.usage && …}) froze the live hole. Separately, when a tab closed, chat's server.js kept its render, and the thread watcher, running.

After: messageMarkup reads message.usage, message.reasoning and message.error directly, which works since #4062. The README drops the "test locals, not properties" rule. server.js passes an abort signal to the request and cancels the response body when the client disconnects, as server-dbmon does. Both servers now stay quiet when a closed tab aborts a response, instead of logging the AbortError.

How: verified in Chromium by sending a message and checking that the finished reply shows its usage footer (30 tokens · 2.3s), a property condition that used to stay empty. vite build and the client-bundle check pass. check:server's "thread was yielded many times" assertion fails the same way on next without this change (db timing).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LZkrATgvFJjgFRdDB4Drcq


Generated by Claude Code

…he tab closes

Live holes no longer stop updating when a condition reads a property
(#4023, fixed in #4062), so messageMarkup reads message.usage and friends
directly and the README drops the "test locals" rule. server.js now
aborts the request and cancels the body when the client disconnects, as
server-dbmon does, so a closed tab stops its thread watcher. Both servers
stay quiet about the abort.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZkrATgvFJjgFRdDB4Drcq
@changeset-bot

changeset-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 09f7e43

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Size (brotli, eager entry chunk)

scenario head vs base minified vs base minified vs recorded cap lazy chunks (not counted)
signals: core floor (createSignal/Memo/Effect/Root/flush) 7.47 KB 0 B 0 B +19 B 7.48 KB ✅
signals: + createStore 14.90 KB 0 B 0 B +6 B 14.94 KB ✅
signals: + isPending/latest 9.77 KB 0 B 0 B +18 B 9.77 KB ⚠️ over by 3 B, 2 B minified headroom
app: render + one signal (the simple-app floor) 9.98 KB 0 B 0 B +18 B 9.98 KB ⚠️ over by 2 B, 2 B minified headroom
app: hydrating (no stores) with Show/For/Loading/Errored/lazy 18.09 KB 0 B 0 B −9 B 18.09 KB ✅ lazy-page.js 0.04 KB
app: hydrating + every store primitive family 29.65 KB 0 B 0 B −6 B 29.65 KB ⚠️ over by 4 B, 26 B minified headroom lazy-page.js 0.04 KB
app: CSR with Show/For/Loading/Errored/lazy 13.20 KB 0 B 0 B −69 B 13.20 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier (same app on the observe artifacts) 14.76 KB 0 B 0 B −67 B 14.79 KB ✅ lazy-page.js 0.04 KB
app: CSR, observe tier + attribution engine enabled 29.40 KB 0 B 0 B −66 B 29.38 KB ⚠️ over by 18 B, 86 B minified headroom lazy-page.js 0.04 KB
app: compiled floor (one template, one text hole, one delegated click) 10.19 KB 0 B 0 B +18 B 10.17 KB ⚠️ over by 17 B, 2 B minified headroom
app: compiled CSR (JSX todo app: spread/merge/omit, events, class/style, keyed For, Show, Loading + lazy, store) 25.85 KB 0 B 0 B −67 B 25.92 KB ✅ stats.js 0.18 KB
app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable) 31.78 KB 0 B 0 B −6 B 31.78 KB ⚠️ over by 1 B, 26 B minified headroom stats.js 0.20 KB
frames: eager client consumer (frames client + transport, lazy codec) 11.54 KB 0 B 0 B 0 B 11.54 KB ✅
page: base server components (hydrating + dynamic + frames + sf reference) 34.33 KB 0 B 0 B −932 B 34.33 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 9.02 KB, wire.js 0.93 KB
page: live server components (base + live/GET + action + isPending/latest) 38.15 KB 0 B 0 B −996 B 38.15 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, trace.js 9.00 KB, wire.js 0.93 KB
page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread) 35.18 KB 0 B 0 B −2022 B 35.66 KB ✅ assets.js 0.78 KB, bind.js 1.83 KB, decode.js 6.23 KB, regions.js 0.80 KB, sc-comments.js 0.20 KB, trace.js 8.98 KB, wire.js 0.93 KB
page: compiled live server components (the compiled base page + live/GET + action + isPending/latest) 40.84 KB 0 B 0 B −2010 B 41.21 KB ✅ eager (counted): web.js 21.67 KB; assets.js 0.78 KB, bind.js 1.84 KB, decode.js 6.23 KB, regions.js 0.79 KB, sc-comments.js 0.19 KB, trace.js 8.98 KB, wire.js 0.93 KB
page: base + router (base page + @solidjs/router: createRouter, two routes, preload, useNavigate) 41.73 KB 0 B 0 B −938 B 41.79 KB ✅ assets.js 0.78 KB, bind.js 1.85 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.80 KB, server.js 1.02 KB, serverForms.js 3.58 KB, trace.js 9.02 KB, wire.js 0.94 KB
page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate) 47.50 KB 0 B 0 B −932 B 47.49 KB ⚠️ over by 7 B, 952 B minified headroom eager (counted): client.js 27.90 KB; assets.js 0.78 KB, bind.js 1.84 KB, decode.js 6.23 KB, lazy-page.js 0.04 KB, regions.js 0.81 KB, server.js 1.02 KB, serverForms.js 3.30 KB, trace.js 9.00 KB, wire.js 0.94 KB
server: floor (getRequestEvent + isServer) 1.33 KB 0 B 0 B 0 B 1.34 KB ✅
server: renderToString (the server-render floor) 20.57 KB 0 B 0 B 0 B 20.58 KB ✅

⚠️ Over the brotli cap within the minified allowance (passes)

  • signals: + isPending/latest: over brotli cap by 3 B; minified 27,465 B vs 27,447 B recorded with the cap (+18 B) — 2 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: render + one signal (the simple-app floor): over brotli cap by 2 B; minified 27,963 B vs 27,945 B recorded with the cap (+18 B) — 2 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: hydrating + every store primitive family: over brotli cap by 4 B; minified 93,708 B vs 93,714 B recorded with the cap (−6 B) — 26 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: CSR, observe tier + attribution engine enabled: over brotli cap by 18 B; minified 88,264 B vs 88,330 B recorded with the cap (−66 B) — 86 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: compiled floor (one template, one text hole, one delegated click): over brotli cap by 17 B; minified 28,493 B vs 28,475 B recorded with the cap (+18 B) — 2 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • app: compiled hydrating (the same JSX todo app through hydrate(), compiled hydratable): over brotli cap by 1 B; minified 101,332 B vs 101,338 B recorded with the cap (−6 B) — 26 B of the 20 B minified allowance left; +0 B minified over this PR's base
  • page: live + router (live page + @solidjs/router: createRouter, two routes, preload, useNavigate): over brotli cap by 7 B; minified 143,192 B vs 144,124 B recorded with the cap (−932 B) — 952 B of the 20 B minified allowance left; +0 B minified over this PR's base

Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in scripts/size/scenarios.js; the floor and page caps in floor-caps.json are frozen (lower only, or Size-Exception: in the PR body). npm run ratchet lowers caps per RC; it never raises one (scripts/size/README.md).

Copy link
Copy Markdown
Member Author

The check job's size gate is red on three hydrating scenarios, but this PR doesn't cause it. The gate reports +0 B minified over this PR's base for each one, because this PR only touches examples/.

The growth comes from #4059 (2da0f8e3), which merged into next just before #4062. It added +61 B minified to the hydrating client bundles without raising their caps:

  • app: hydrating (no stores): 34 B over the brotli cap.
  • app: hydrating + every store primitive family: 14 B over.
  • app: compiled hydrating: 101 B over.

So next itself is over these caps. This PR can't fix that without widening into #4059's size decision, so I'm leaving it as is. It will go green once next either raises those caps with #4059's reason or trims the growth. Re-running wouldn't help, because the result is deterministic.


Generated by Claude Code

@coveralls

coveralls commented Oct 14, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 38632511713

Coverage remained the same at 77.515%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1326
Covered Lines: 1084
Line Coverage: 81.75%
Relevant Branches: 1040
Covered Branches: 750
Branch Coverage: 72.12%
Branches in Coverage %: Yes
Coverage Strength: 27.42 hits per line

💛 - Coveralls

@codspeed

codspeed Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 193 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ dbmon shallow full tick 50.4 ms 53.3 ms -5.49%
⚡ createStore setter: delete + set one root key (#3044 overlay) 2.1 ms 1.7 ms +17.17%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/project-thread-271xwi (09f7e43) with next (0109a56)

Open in CodSpeed

Copy link
Copy Markdown
Member Author

All other checks are green on 09f7e43, including the size gate now that #4065 is on next. CodSpeed is the only red check, and this PR doesn't cause it either. The PR changes only examples/chat and examples/server-dbmon/server.js, and no benchmark loads those. CodSpeed flags dbmon shallow full tick (a packages/signals store benchmark) at −5.5% and in the same run reports createStore setter: delete + set one root key at +17%. It also warns that the two sides were compared across different runtime environments. That matches the runner noise this repo has seen on PRs that don't touch signals. No code fix applies; the regression needs acknowledging on CodSpeed or a re-run.


Generated by Claude Code

@ryansolid
ryansolid merged commit fb8558c into next Oct 14, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants