solid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
by solidjsTypeScript
Commit activity
Last 12 weeks · 27 commits
Community health
5 of 6 standards met
Recent PRs & issues
Summary #4840: changing a keyed `createOptimisticheadingdetailheadingdetailheadingheadinglaneRead_rerunsrerunsh2.childrenlaneSeam → rerunslaneReadlaneDirtylanes.ts#4 Bravoloading #3loading #4#4 Bravoloading #3#3 Crash on savepackages/web/test/for-selection-loop-4840.spec.tsx<>{p.children}nextpackages/signals/tests/for-selection-loop-4840.test.tsmapArraynextdist-nested-manifestsstrict-event-handler-1742frames-trusted-typesdelegated-event-restorenext` today and need a rebuilt compiler and web dist, which this worktree doesn't have. They don't touch lanes, and CI builds fresh. Show-lowered: 1,853 passed. Hydrate: 779 passed. Size: I'm leaving the numbers to CI. Only the lane bundles should move, by a few bytes. Closes #4840 _Generated by Claude Code_
Summary With the attribution engine enabled, a disposed component stays reachable, with its owner and its DOM, until the engine is reset. 3.0.0-next.57 turns performance tracks on under , and the tracks enable the engine, so this reaches any app on the dev server. I found it in vercel-labs/ui, whose leak spec mounts and unmounts each component 50 to 200 times: on rc.21 all 47 of its Solid tests fail on the dev server. #4836 fixes the other leak that spec finds. Three things held the nodes: and kept their rows in s keyed by the node (, , ). The rows are now found through a and listed from a separate collection of plain rows. The rerun history (200 records by default) reached the written signal through and the writing effect through . Both now hold the node in a . A diagnostic that needs the node reads it through or , and skips a node that was collected. kept one row for each scope ever created, so the table grew with every mount. A now folds the row of a collected scope into one row per kind and name. replaces the registry, so a new window releases the rows of the window before it. Size: "app: CSR, observe tier + attribution engine enabled" grows by 113 B minified and 31 B brotli and stays under its cap. Every other scenario is byte-identical. Open questions: The fold changes what returns. Live scopes keep one row each, and collected scopes that share a kind and a name share one row, so the same scenario can list different rows depending on when the collector ran. writes this table into its artifacts. The alternative is to keep one row per scope and let the table grow until reset. I can drop the fold if you prefer that. rows are not folded and still grow by one per source or boundary. They hold no node. Where is missing, the rows are not folded. is used without a guard on the engine's write path, as already does for . I left other holders alone because they did not show up in the leak spec: keeps one pre-landing value across , and an interaction that never settles keeps its transitions until reset. How did you test this change? has five tests. Each one disposes a root, collects garbage through the inspector, and checks that s to the payload and the owner are empty while the row or history record is still there. They cover a row, a flight and fallback, a rerun record written by a relay effect, the fold of three remounts into one row, and the release of a window's rows on the next . in : 513 files, 7,108 tests pass. in : 55 files, 929 tests pass. In , : 266 files, 1,899 tests pass. With : 147 files, 779 tests pass. With : 228 files pass, and does not compile with my local compiler binary, which is older than the fix for #4704. Size from on this branch and on its base, then . The gate's one failure, "page: compiled live server components", is over its cap on the base by the same amount. In vercel-labs/ui I built rc.21 from its tag with this change and #4836 applied, installed the builds over its and , and ran against its dev server with performance tracks on: 47 of 47 pass. That run includes a local one-line fix to ui-sdk's popup, which kept the last closed popup alive when its exit had no animation. That bug made the drawer test fail some runs with or without this change, and with performance tracks off, so it is not in Solid. 🤖 Generated with Claude Code
On at dba2aadbb, the screen goes back to an async memo's value for the previous input after that memo fails and is asked again, while other actions are out. Here a detail memo keyed on fails for issue #3 and is refreshed. When the new answer for #3 lands, the screen shows issue #4's detail (the one selected before), next to from in the same frame. The memo itself has computed #3's answer: in the original app, logging inside the memo showed it returning #3 while the DOM kept #4. We found this in a ReactiveScript eval app (.rx compiles to Solid 2) under our fuzz test. Repro (plain Solid, , jsdom) The frames, from on: The last frame shows #4's detail with #4's rename guess "Alpha", under . Expected: . Holding the error, or , until close:3 ends would also be consistent. Showing #4's detail is never consistent: no moment of the graph has at 3 and the detail at #4, and the screen had already moved past #4 (to loading, then to #3's error). What it needs The heading must read the rename guess. With a plain , the frame stays instead. The close guess () must be there, and so must the unread memo that the actions refresh. Removing either one makes the test pass.
Recent fixes
Describe the bug https://playground.solidjs.com/anonymous/551fc377-eef8-4688-a32e-d136eb295d83 Weather updating onchange is a good idea, or even supported, in my case a bug where by untrack wasn't used at the callsite, it is still strange to see LogComponent which is an unrelated sibling, mount and unmount each time the tickTocktick signal is updated. Your Example Website or App https://playground.solidjs.com/anonymous/551fc377-eef8-4688-a32e-d136eb295d83 Steps to Reproduce the Bug or Issue Run playground see unrelated component mount and unmount on each signal (although its not dependent on that signal) Expected behavior Not sure, but not this Screenshots or Videos _No response_ Platform Latest Additional context _No response_
_Requested by Ryan · project thread_ Refs #1742. Alternative to #4830: the dev-only "strict window" approach. Summary An event handler is bound once, where its element is created. That makes a reactive read in the handler expression a mistake, whether it's , a factory call , or a forwarded whose parent passed a reactive expression. Today such a read silently subscribes the enclosing branch and re-mounts it on every change. Rather than paying for an in production, dev DOM output now reads every handler expression in a strict-read window that keeps tracking: What warns. A reactive read there warns with its own repair: "read in an event handler expression. Event handlers are not reactive: read the value inside the handler function instead." A pending async read throws , as it does in a component body. Dev matches prod. The read still tracks, so dev re-mounts exactly as production does. The window only reports. Where it applies. It covers every template, including a component's root; the root-template skip isn't part of the rule. It covers elements only, because on a component is just a prop and gets caught at the element it's forwarded to. It covers the form and the array (the bound values on delegated events, and the single-element form on non-delegated ones). The non-delegated form is read at dispatch, so it's unchanged. Spread is unchanged, since it binds inside its own effect. What's skipped. Identifiers, inline functions and literals can't read anything, so they compile as before in dev too. Plain with a plain function from the parent reads nothing reactive, so it stays quiet. Changes : (), a strict-read window that leaves tracking alone, plus a handler-specific message for both diagnostics. In prod it is , and nothing imports it. : re-exports it , with an identity on the server entry. : (, compiler output only, like ), and a on the server. / (dom/events.rs): emitted only when . Docs: the section in 08-dev-diagnostics, and the reactivity-diagnostics skill. Rules check Nothing changes reactive semantics. Tracking, verdicts and holds are identical in dev and prod, so no F-/D- rule moves. The window is the existing dev strict-read mechanism (the one effect callbacks and component bodies use), opened with tracking on. The one dev-only behavior change is the pending-read error, which is the same rule the strict windows already apply (#2897 safeguard parity). Size I measured locally with against (f00ce6f). Every scenario is 0 B brotli and 0 B minified, including the hello world (compiled floor) at 9,918 B local. How did you test this change? , under both native and . It covers a forwarded reactive prop warning and still re-mounting, the component root, a store-held handler, a factory call plus delegated bound data, quiet cases (plain function props, inline functions, reads at dispatch), and a pending async read. Dev fixtures (Babel and Oxc agree), plus a Babel test that prod output never imports . Full suites pass. web is 1906 tests on native and the same on babel; web hydrate 779; signals 7,103; solid 929; babel-plugin 432; compiler vitest 6,937, plus and clippy. web passes. _Generated by Claude Code_
Problem Libraries that build components around a native element whose tag is fixed at definition time — , , any design-system primitive factory — have no good way to render that element: is the only isomorphic path from a tag string to an element. It pays a factory memo plus a per-instance memo (and a hydration id) for a value that never changes. In yak-bench's browser hydrate matrix, the lane that renders the styled element through is 1.47× slower (geomean) than the same code with the element compiled from a literal tag; everything else in the two lanes is identical. One memo per element is the entire gap. A runtime factory ( returning a component) removes the memos but can't take spreads natively: a use-site has to be merged into a props object and crossed through a component boundary before sees it, and static attributes are walked instead of compiled. Hand-rolling it means an fork over internals (, , vs ), which is what next-yak/next-yak#644 did. Profiling the composition-heavy SSR cases (tabs) shows Solid's own rendering at ~7% of time and props plumbing (, , proxies, and the GC they generate) at ~55%; the styled-element seam is where most of that plumbing is introduced. Proposal A reserved intrinsic whose tag comes from an in-scope identifier: The compiler lowers it exactly as it would a literal tag, with in place of the template clone: DOM: ; (the sources array from #3419/#3423); ; when hydrating. Two reactive nodes with children, one without, zero memos. Static child subtrees compile to their own templates and are appended; dynamic children go through . SSR: — one walk (#3418), on the element. Hydration ids stay aligned because both sides do exactly what a compiled spread root does today. Universal*: renderer + . The string never reaches the DOM or the SSR output; the compiler consumes it. `tagtagcreateElement(tag)ssrElement(tag, …)valuetagdynamic()asDynamictagelementIntrinsicElements.elementJSXNamespacedNameprops.aselement:tag"element:tag"noUnusedLocalsnoUnusedParameterstaguse:tag={tag}elementIntrinsicElementstagnamenameinputbuttonselecttextareaformiframetagisIntrinsicElements.element: HTMLAttributes & { tag: string }refHTMLElementref--stricttagDynamicelement(tag)hhtmltagIntrinsicElements.elementssrElementgetNextElementspreadprim-elementdynamic()` lane. — Claude via Cursor*
Repository: solidjs/solid. Description: A declarative, efficient, and flexible JavaScript library for building user interfaces. Stars: 36267, Forks: 1145. Primary language: TypeScript. Languages: TypeScript (74.7%), JavaScript (25.1%), CSS (0.2%). License: MIT. Homepage: https://solidjs.com Topics: declarative, fine-grained, javascript, jsx, performance, proxies, reactive, solid. Latest release: v1.9.0 (2y ago). Open PRs: 3, open issues: 12. Last activity: 9m ago. Community health: 87%. Top contributors: ryansolid, thetarnav, otonashixav, Jutanium, dependabot[bot], trusktr, davedbase, bikeshedder, aminya, Gavin-Gong and others.