Repository navigation
docs: fix the from() migration snippet, add createDeferred to the cheatsheet, note SETTLED_CLEANUP_UNOWNED throws - #4183
Conversation
…atsheet, note SETTLED_CLEANUP_UNOWNED throws
|
…mo and still closes the source
… its delayed cleanup
Merging this PR will improve performance by 14.52%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | memo + sync render effect only (reference) |
33.6 ms | 29.4 ms | +14.52% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing devagrawal09:docs/deferred-from-settled-cleanup (80bb890) with next (b0ad1df)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
…ter mutation of the objects passed in
The drain costs about 35 B minified in every signals scenario, including the simple-app floor, for a leak that only follows a cleanup that throws. Held for a size decision. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1
* fix(signals): release lazy nodes collected before a throwing cleanup #4176 restores the release collector when a cleanup throws while an unfinished pass's frame is dismantled, but the throw also skips the drain at the end of the pass, so lazy nodes the frame's children released before the throw were never released. Drain them before rethrowing. Also adds the solid-js changeset for #4183's docs, which ship in the package. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1 * revert the lazy-release drain; keep only the #4183 changeset The drain costs about 35 B minified in every signals scenario, including the simple-app floor, for a leak that only follows a cleanup that throws. Held for a size decision. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1 * chore(size): re-record the compiled CSR cap after #4188, #4207 and #4176 Each passed alone; together they put next 1 B past the 20 B minified allowance (81,159 B against 81,138 recorded). Accepted by the maintainer. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1 --------- Co-authored-by: Claude <noreply@anthropic.com>
Three small docs fixes found while writing the "From React" additions in solidjs/solid-docs#1664.
MIGRATION.md: document that thefromreplacement doesn't clean up immediately (related to #4182)async function*+for await. A note after it explains that when the owner is disposed, or a re-run replaces the stream, Solid calls the generator'sreturn(), but a generator waiting at anawaitcan't finish until thatawaitsettles. So the source stays subscribed until it produces another value or ends.next@ b0ad1df: after dispose, the upstreamreturn()is called 0 times, then 1 time once the upstream produces its next value.createMemo(() => observable$)closes the source right away (return()called once, immediately on dispose).from()keeps the upstream subscription after dispose; add a subscription helper #4182. I tried the user-side options (onCleanupinside the compute or the generator, and wrapping the generator'sreturn()), and none is clean enough for the migration guide.CHEATSHEET.md:createDeferredadded to the imports list and the Async section. It's exported fromsolid-jsand is the closest counterpart to React'suseDeferredValue, but the cheatsheet didn't mention it.skills/reactivity-diagnostics/SKILL.md:SETTLED_CLEANUP_UNOWNEDnow says it throws in dev (signals.ts,throw new Error(message)after the diagnostic) and that the cleanup is dropped in production, matching08-dev-diagnostics.md. Before, it sat under "leaks" with no mention of the throw.Prettier passes on the lines this PR adds. Docs only, no code changes.
07-dom.md+CHEATSHEET.md: a ref runs before the element is attached. Inside a ref callback,el.isConnectedisfalseandel.ownerDocumentis the template's inert document, sodefaultViewisnull. Code that reacheswindowthrough the element (listeners,getComputedStyle) silently breaks. The docs now say to use the globalwindow/document, oronSettledfor layout-dependent work. Tested onnext(jsdom, native and Babel compilers):defaultViewownerDocument === documentisConnectednullonSettledwindow04-stores.md: don't keep mutating an object after handing it to a store. Tested: after an in-place change to the object, the store still read the old value. Assigning the same object again, or reconciling it, changed nothing. A fresh copy updated it. This mostly affects test fixtures and caches that reuse one response object.Both came from OpenClaw's Solid 2 migration notes (
lessons.mdL41 and L31 in openclaw/openclaw.agents/skills/solid/references/).07-dom.mdand04-stores.mdalready failprettier --checkonnext(an existing table and thesetStore((s) =>formatting); I left those lines alone.