Minor Changes
- 89a0531: Absorb the 0.50 expressions snapshot into this repo: lift compilers as
@solidjs/babel-pluginand@solidjs/compiler, dump runtimes into@solidjs/web/h/html/universal. Origin: ryansolid/dom-expressions@e97e4290 (0.50.0-next.44). - 89a0531: Collapse the expressions dump: drop the rxcore seam, flatten runtimes into package
src/, deletebabel-preset-solid, and publish compiler natives as@solidjs/compiler-*.
Patch Changes
-
ead7b1a: Keep hydration IDs aligned when an intrinsic element has a ref and one reactive spread.
-
8cff139: Evaluated negative and non-finite numbers (
c={-1},d={NaN}) are static again. Since Babel 8 support,evaluateAndInlinebuilt them witht.valueToNode, which gives-1/0 / 0expressions rather than numeric literals, so they stopped being inlined into templates (SSR emittedssrAttribute("c", -1)instead ofc="-1") and diverged from@solidjs/compiler(the parity probes' "exotic literal holes"). They are now NumericLiteral nodes again, built directly where @babel/types 8's builder would reject the value; both Babel majors print them as before. -
55c7329: Support
@babel/core8 alongside 7: the peer range is now^7.20.12 || ^8.0.0. SSR no longer readsScope#uids(removed in Babel 8), evaluated negative or non-finite numbers are built withvalueToNode,import()parsed asImportExpressionstays dynamic, and TSRX emits the AST shape of the running Babel major (type arguments, type parameter names,import(), enums, heritage). TSRX also keepsimport()options and class method type parameters, which it dropped before. -
59fb244: SSR
hoistPropsskips TypeScript type positions when collecting captures, so on authored TSX (types parsed, stripped later) atypeof xquery or a type named like a value no longer captures that value, or forces the literal fallback when it is reassigned (#3828). -
4a99c84:
sourceNamesgains alocationskind (and the plugin arootoption): component and binding labels carry afile:line:colfor diagnostics.createComponent(Home, props, "Home", "src/App.tsx:12:5")points at the<Homeopening element (DOM and SSR output); a binding's options gainlocaftername— the attribute's start for an attribute effect (a merged effect points at the first attribute it lists), the hole's{for an insert — and a spread passes it after the tag (spread(el, props, false, undefined, "div", "src/App.tsx:20:12")). The path is relative toroot(default: the working directory) with/separators; line and column are 1-based, so a dev server links the location straight to the source. Like the other kinds,locationsfollowsdevwhen unset,trueturns every kind on, and the object form picks; a location is only emitted beside its label, and never when Babel has nofilenamefor the module. -
d815fd4: Keep a returned element's setup inside a braceless
if,elseor loop body.if (c) return <span>{x.join()}</span>;emitted the template clone andinsertbefore theif, so they ran (andx.join()threw) whencwas false, a loop body's setup read its loop variable out of scope, and a hydratinggetNextElementclaimed a node for a branch not taken. The setup is now inserted before thereturn, and Babel wraps the body in a block. -
617d195: Emit element claims after the element's initial attributes are applied (#3923), at parity across both compilers.
A fully static
a[href]/form[action]is claimed at the end of its creation statements (after static writes and refs). An element with dynamic bindings captures its owner at creation (var _o$ = _$getOwner()) and is claimed as the last statement of its binding effect's callback —_$claimElement(_el$, _o$)— in both the single-binding and the multi-binding shapes, so the claim observes the applied values on the first run whether that run is synchronous or lands from a held flush. An element carrying a spread emits no compiled claim: thespreadruntime claims it after the first application. -
01ac18c: Compiler
componentNamesoption: component owner labels that survive minification. With the flag on, DOM output carries the tag as written in source as a thirdcreateComponentargument —<Home />compiles tocreateComponent(Home, props, "Home"),<Ui.Button />to"Ui.Button",<this.Row />to"this.Row"— and the dev and observe runtimes label the component's owner with it (<Home>in diagnosticownerPaths, attribution chains, and the devtools_component.name), falling back toComp.nameas before. Until now an observe-tier production bundle reported hot scopes and holds under whatever the minifier left of the function name (<Xt> › <Kn>), and alazy()or HMR wrapper hid the tag name even in dev. Off by default and byte-identical output when off; SSR (which inlines the call) and universal output never emit it; the productioncreateComponentignores the argument. Both compilers implement it in parity (shared fixtures, cross-mode ratchet).@solidjs/vite-pluginenables it for the dev andobservepostures. -
3c1f809: Preserve
/* istanbul ignore … */and/* c8 ignore … */block comments written as JSX children on the generated componentchildrengetter. Line comments are not carried. -
ca15970: Non-hydratable client builds now remove the
valueattribute when a checkbox or radio input binds a nullishvalueordefaultValue, matching the runtime fix from #4009, so a checked box submits"on"instead of"". Both compilers route these bindings throughsetPropertywhen the input's statictypeischeckboxorradio, or when itstypecannot be known at compile time (an expression,prop:type,attr:type). Text inputs, inputs without atype, and textareas still clear to""inline (#2957). -
ad1ecc5:
serverComponents(SSR): keep attribute-slot positions bindable on intrinsic elements. A dynamicclassorstylenow compiles to a whole-attribute_$ssrElementAttributehole instead of a value inside the template's quotes, so a server component'sclass={{ selected: filters.all }}can mark the class name a client attribute slot owns;ref/on*positions compile, as before, to one guarded_$ssrClaimhole per element, which now emits_s:on:*/_s:refmarkers for slot reads (the_bndbehavior-claim marker is gone). A spread element compiles its namedref/on*(<button {...rest} onClick={row.go} ref={row.el} />, wherever they sit relative to the spreads) to the same claim map —{ click: expr, ref: [a, b] }, duplicate refs merged, a duplicate handler last-wins as on the template path — keyed by the index of the source each attribute sits before (<b {...a} onClick={go} {...b}>→{ 1: { click: go } }) and handed to_$ssrElementas a seventh argument, a thunk the runtime reads only inside a server component's render, so plain SSR never evaluates the expressions (they used to drop with no marker and no finding); the runtime settles each handler position in source order, as the client'sspread/merge()do (the last source that has the key owns it,undefinedincluded). Arefbeside a lone spread goes through the sources loop under the option (a dynamic spread call is thunked there, as it is beside any other attribute). The event name is always the lowercasedon*remainder (onClick→click);on:/oncapture:are not 2.0 syntaxes and are no longer special-cased. Both compilers share theattributeSlotsserver-components fixture; plain SSR output is unchanged. -
fd36d37:
sourceNames.bindings: compiled binding effects are named by what they write. An attribute effect gets<tag>.<attribute>as written (span.textContent,div.class:active,div.style:color; a template's merged effect lists all of its bindings), a hole's insert is named for the parent it fills (div.children), and a spread passes its tag so the runtime labels its attribute effectdiv.spreadand its children insertdiv.children. The names travel as a trailing options argument oneffect/insert({ name }) and a trailing string onspread;@solidjs/web'seffect,insert, andspreadaccept them and put them on the render effect nodes, where the dev and observe tiers show them in owner paths, attribution chains, and the Propagation track — a binding effect readsspan.textContent ← countinstead ofeffect ← count. Production ignores the names; output with the option off is unchanged. DOM output only;sourceNames: trueturns it on withcomponents. -
fd36d37: Rename the compilers'
componentNamesoption tosourceNames, nowboolean | { components?: boolean }.sourceNames: true(or{ components: true }) is whatcomponentNames: truewas — the tag as written in source ascreateComponent's third argument, on DOM and SSR output. The option is now the home for every kind of source name the compilers can carry into output for the dev and observe runtimes to label the reactive graph with (binding effects and primitives follow); the object form picks kinds.@solidjs/compilerrejectscomponentNamesas an unknown option, so a stale@solidjs/vite-pluginfails loudly rather than compiling without labels. -
8d6de07: Native elements with several spread sources compile to the runtimes' array form instead of a
mergeProps()call, in DOM and SSR output:<div id="x" {...a} {...b}>becomesspread(el, [{ id: "x" }, a, b], …)on the client andssrElement("div", [{ id: "x" }, a, b], …)on the server. The runtimes read the sources directly — later sources win per key, only the winning source is read — with no merge proxy to build and walk, and a reactive spread is a plain thunk called inside the tracking scope, so it mints no memo and consumes no hydration id on either side (the hydratable SSR() => mergeProps(…)wrapper is gone for the same reason). A lone spread still passes straight through (#3105). Requires@solidjs/webwith thespread/ssrElementarray forms (#3418, #3419). -
d70dda5: Carry authored
istanbul/c8ignore pragmas through the remaining #2138 cases: a pragma immediately before a component (including through a fragment) leads that component'schildrengetter, pragmas inside fragments are preserved, and SSR prop-hoist copies them onto the shared descriptor'sget(). -
6d2bdeb: Move delegated event handlers off the
$$<type>element key Solid 1 uses.Solid 1 delegates from
documentand fires any$$click/$$input/… it finds while walking up from the target, so a 1.x runtime on the same page — an older embedded widget, a devtools panel built on 1.x — ran every delegated handler in a 2.x app a second time. Compiled output and the runtime now stamp_$$<type>/_$$<type>Datainstead; neither version can see the other's handlers, in either nesting direction.The key, the
_$SOLID_EVENT_OWNERmark, and the walk rules are documented inclient.tsas the delegated-event wire contract shared by every Solid copy on a page. Anything readingel.$$clickdirectly must switch toel._$$click. -
1e7fa73: Reject authored TSRX lazy destructuring in Solid while retaining deferred patterns generated for keyed loops and catch clauses.
-
47a797e: Drop leftover DOM Expressions loader fallbacks and reframe the compiler and Babel plugin as Solid 2.0 packages. Node
transform()now defaultsmoduleNameto@solidjs/webandbuiltInsto the Solid control-flow set, matching@solidjs/babel-plugin. SSR leaves a sole component child unescaped (it is a value; the callee's insert sites escape) and only HTML-escapes mixed/fragment children and element holes. Local native builds remain usable when an in-repo platform-package stub has not been populated yet. -
bf71c28: DOM output no longer declares positional walks to nodes nothing reads. A text node ahead of an appended expression, like
User :in<h1>User : {name()}</h1>, used to getvar _el$3 = _el$2.firstChildeven though the insert appends with anullmarker. A minifier keeps that property read, since it could be a getter, so it shipped as_el$2.firstChild;. Both compilers now drop afirstChild/nextSiblingwalk when no later statement reads its node, including a walk that only fed another dropped walk. -
0d2810a: Fix Babel and native compiler lowering divergences around nested content, custom-element ownership, static attributes, namespaces, and conditional evaluation order.
-
43570f8: Reapply a select's bound value when its options arrive after the value was written.
-
7d985b6: Fix SSR XSS: strings yielded by flow-control memos rendered unescaped
<Show when={s}>{s}</Show>,<For>{v => v}</For>,<Dynamic component={() => s} />,
<Switch>/<Match>, boundary fallbacks and any component that returns a string through a
memo rendered that string raw on the server. The server flow controls return memos for
hydration-id alignment;escape()passed functions through by identity, and the resolver
appended whatever they later produced without escaping.One rule now:
escape(x)at a hole covers everything reachable fromx— strings, array
items, and what a function yields when the resolver calls it (a deferred-escape wrapper).
Finished{ t }nodes pass through.Loadingescapes its content the way it already
escaped its fallback. The compilers stop wrapping fragment / mixed component children in
_$escape(they are values; escaping them too double-escaped through
<Comp>{props.children}</Comp>), and a single-expression fragment at a hole keeps the
hole's wrap. Live-hole tags ride the wrapper and$slotsurvives the array copy, so
frames behave as before. -
98b916d: Fix compiled SSR output that renders
style=""orclass=""fornullandundefined. Babel and the native compiler now omit these attributes on elements without a spread. -
98d35b9: Fix computed keys in compiled SSR
styleobjects (builds withoutserverComponents). A computed key's name got no;, sostyle={{ color: "red", [k]: v }}renderedcolor:redtop:1pxand the browser dropped both declarations. Hydration keeps the server's inline style, so they stayed dropped. A nullish first value also no longer leaves a leading;. Both compilers now pass a multi-entry object to a newssrStyleProperties(name, value, …)helper, which writes the separator only between the entries it writes; a single entry keepsssrStyleProperty. -
bbff5e0: Direct
value/checked(and other stateful DOM property) bindings no longer overwrite pre-hydration user input during the hydration claim pass (#3182). Hydratable compiled output now routes locked DOM properties throughsetProperty, which skips writes on hydrating nodes and carries the<select value>microtask and input/textarea nullish special cases. -
cdbd584: Assign static
<select value>values through the live DOM property so the matching option is selected consistently with reactive values. -
077c787: A
<textarea>with a dynamicvalue/defaultValueno longer desyncs hydration ids for the siblings after it (#3691). The server folds the value into the textarea's text content, and that fold was taking the_$scopehydration-id reservation a dynamic child hole gets — but the client writes the value as a plain property effect that never allocates an id, so every component after the textarea hydrated one id off and its updates targeted detached DOM. The fold is now treated like theinnerHTML/textContentredirects (#3015): opaque content, no id reservation, in both the Babel plugin and the native compiler. -
5a1abb3: Compile TSRX loops with an index but no explicit key using Solid's non-keyed callback shape.
-
320f1f5: Universal text is text (#3127). The DOM and SSR generators splice static
text into an HTML template that a parser later unescapes, so they escape
static values and keep JSX entities as written. The universal generator
hands strings straight to the host —createTextNode,setProp— with no
parser downstream, so the escaping rendered literally ({"<b>"}showed as
<b>) and entities never decoded (<showed as<), leaving no
spelling that produced a literal<in static text under a custom
renderer. Universal-rendered element children now pass static values
through unescaped and decode JSX entities in text and string attributes,
matching what component children and fragment text always did. The flag
rides on the element, not the config, sogenerate: "dynamic"decides per
renderer. Applied to both compilers; the attribute half closed ten pinned
cross-mode parity divergences between them. Reported with the fix mapped
out by @antoinevanwel. -
b3586e8: Validate document-shell templates in the document context (#3259). The
validatepass round-trips templates through a body-context fragment parse, which strips<html>/<head>/<body>wrappers no matter how well-formed the markup — so once #3099 made validate failures compile errors, a root component owning the document shell failed to compile in plain client mode, and merely importing it (the jsdom component-test configuration) was fatal. Shell-rooted templates now parse as a document and the shell element is compared back — the analogue of the synthetic<table>wrap for table partials, in both the Babel plugin and the native compiler. Genuine restructuring (an implied<head>, flow content in<head>, a<p>split in<body>) still errors. Since<template>parsing flattens shells, actually client-creating one now throws a descriptive dev-mode error fromtemplate()pointing athydrate()— the failure moved from every import to the one broken act. -
246eeeb: Emit non-identifier getter keys in compiled props literals as string literals (
get "aria-label"() {}) instead of computed keys (get ["aria-label"]() {}). Same property, but a computed key drops the whole object literal off V8's boilerplate path into per-property runtime definition; on a seven-getter props literal the computed form costs ~45% more to build. Applies to every getter site in both compilers: component props, dynamic element attributes (DOM, SSR, universal). -
4ba1731: A controlled input no longer loses typed text when its signal write is held (an async derivation of it is pending) and another binding in the same template re-runs, such as a sibling
isPendingclass flipping: a stateful DOM prop (value,checked, …) in a grouped effect or a spread skips an unchanged write while the effect is a stale reader of an open hold, and the hold's landing writes the bound value (#4872). Outside a hold every run still writes (#2016, #4186). -
82868c6: Support recursive lazy destructuring, lazy arrow parameters, per-read defaults, computed keys, rest views, standalone assignments, accessor-backed keyed-loop and catch patterns, and JavaScript-correct writes and updates across the Babel and native TSRX frontends.
-
9e1edbc: A lone dynamic spread on an SSR element (
<label {...props()} />) now defers behind a thunk like a spread beside other attributes, so it runs after the element's hydration key. A spread that created a memo shifted the element's key on the server only, and hydration missed the element (#4240). -
5230666: Fix hydration ids drifting after a reactive lone spread (#3105). A lone spread now passes its accessor straight to
spread()on the client — nomergeProps, no memo, no hydration id — matching the server's existing pass-through fast path. The runtime resolves a function props source inside its own tracking scopes. -
96ffcf7: Production builds compile a
<Show>that needs no component to the ternary it renders: nokeyed, no spread, onlywhenandfallback, with JSX children or a one-parameter callback whosewhenis a plain read (eachu()readswhenagain). Dev builds keep the component and its stale-read error. ThelowerShowoption overrides the default (!dev). The native compiler's SSR pass also no longer returns a TSRX module's static templates unescaped when one element in the module is marked as safe. -
4f67697: Breaking: only
onfollowed by an uppercase letter (onClick,onPointerDown) is an event handler. Lowercaseon*names (onclick,onmouseover) are plain attributes everywhere:- Both compilers compile
onclick={expr}like any other attribute (setAttribute, reactive whenexpris dynamic) instead of binding a delegated or native event, and SSR renders it as an escaped attribute instead of dropping it. A leftover 1.xon:click={fn}is likewise a plain namespaced attribute (it previously compiled toaddEventListener(":click", fn)). @solidjs/webspread/assignset lowercaseon*keys as attributes, the server spread walk renders them, anduseHeadapplies lowercaseon*attributes (camelCase handler names stay skipped).ssrAttributeescapes a function value instead of interpolating its source raw.@solidjs/htmland@solidjs/helements wrap a function passed to a lowercaseon*in a getter like any other attribute; onlyonXxxandrefare exempt.@solidjs/htmlcomponents follow@solidjs/h's rule: every zero-argument function prop,onXxxhandlers andrefincluded, is a getter, so a component handler must declare its event argument (onClick=${e => …}).- New dev-only check
LOWERCASE_EVENT_ATTRIBUTE(added to theDiagnosticCodeunion): warns once per attribute name when a function is set on a lowercaseon*(oron:) attribute, naming the camelCase handler to use.
- Both compilers compile
-
ea8e37c: A production
<Show>whose callback reads its value ({u => <p>{u()}</p>}) is lowered to a ternary only whenwhenreads signals, memos, stores, names, literals and operators. Awhenthat reads another object's member, such as a prop, keeps the component (#4936): the ternary wroteu()as a second read ofwhen, and a prop's getter runs again on each read, sowhen={props.children}created the child twice and broke its hydration. JSX children without a callback still lower for anywhen. -
8d249c7: Patch-channel contract hardening from the stage-2 re-audit: ordinary
patchDriverregistrations unbind with their owner (entries no longer leak past unmount); merged transitions move their held-patch stash so no patch strands; the optimistic drain shares the normal drain's per-entry error isolation and boundary routing; accessor-bearing records are excluded at admission (scan-before-trust) and records that acquire accessors demote their patches to tracked effect fallbacks; writable projection arrays emit setter row ops at their fold-commit visibility moment; row-ops/slot registrations resolve chained backings to the ultimate owner; duplicate keys match occurrence-aware instead of first-wins; the production dev-token typo (_DX_DEV_) is fixed;patchDriver: truenormalizes identically in Babel and the native loader, the option is typed inTransformOptions, and adom-patchparity tier ratchets patch-mode output across both compilers (currently byte-identical on all fixtures). -
c71486d: DOM output: an element's
refnow runs after its attributes and spread are applied, and still before its children. A ref's own attribute writes now survive client creation the way they already survived hydration (#3685). -
3f36f77: Server components: binding slots are removed. Client components in slots replace them: place a client component through a
Slot(<props.x />) where the server's markup needs client behavior, or a formactionfor a mutation. Removed with them: theBindingSlot,SlotOutputandSlotErrortypes, the lazy@solidjs/web/frames/bindentry and its"bind"tier, the_s:*position markers and the compiledssrClaimhole, the effect of theserverComponentscompiler option (@solidjs/compilerand@solidjs/babel-pluginstill accept it, so existing build configs keep working, and ignore it), and theBINDING_SLOT_POSITIONdiagnostic code (@solidjs/signals'DiagnosticCode,solid-js'sdiagnostics.json). Ordinary slots, theirslot:<id>ranges and records, and$keyare unchanged. -
d601119: Remove the experimental patch channel and patch-mode list driver (always opt-in, never default). Graph-native regions own value delivery and the unified-For design owns list structure, so the channel's parallel delivery machinery is retired:
patch.ts/patch-driver.tsdeleted, the compiler-contract exports (registerPatch/registerRowOps/registerSlotPatch/patchableRaw,patchDriver/rowProof/driveList) removed, thepatchDrivercompiler option dropped from both compilers, the insert$llseam stripped, and the write-side channel struct dieted to the single written-keys bound (t.wk) the core fold/notify paths actually use. Store-family app bundles reclaim up to ~900 B brotli; every measured tier shrinks. -
3e72783: The removed Solid 1.x attribute forms are now compile errors on native elements in the
domandssrgenerates (#4187).on:,oncapture:,attr:,bool:,use:andclassListused to compile silently into literal attributes (<div use:tip="() => {}">,classlist="[object Object]"). Both compilers now reject them with the same message, which names the 2.0 replacement: a camelCase handler or arefcallback foron:, a plain attribute forattr:, a boolean value forbool:, arefdirective factory foruse:, and an object or arrayclassforclassList. Components, the universal generate,prop:and the XML namespaces (xlink:,xml:,xmlns:) are unaffected. The check runs only at compile time and adds no runtime code. -
b534733: Scope-wrap bare function children in hydratable mode. A function child (
<main>{() => <App/>}</main>, including via thechildrenattribute) is a deferred hole at runtime, but it never classified asdynamic, so neither generate reserved an id scope for it — its owner ids drifted across async retry passes on the server and desynced from the client (the #2900 hydration-id-parity class). Both compilers now treat syntactic function expressions as scope-eligible alongside dynamic values, emitting_$scope(...)in the ssr generate and around the matching insert accessor in the dom generate. The native compiler also unwraps TS casts in the allocate-ids predicate, matching Babel (fixes a scope-emission desync for{call() as any}children). -
45407d1: JSX passed through a prop other than
children(a layout'sheader, an object of slots, a context value) now hydrates when another id-allocating hole follows it (#3567). Both compilers' hole-scope predicate treated onlyprops.childrenas able to build hydratable content, so a{props.header}hole compiled to a transparent insert: the server reserved the scoped sibling's slot at registration and gave the header's elements the next id, while the client allocated in source order, and every key after the slot shifted. The predicate is now a denylist: a dynamic hole takes a scope unless its value is provably a primitive (literals, template literals, unary, binary and update expressions), so property reads, optional calls, the left operand of||/??, sequence and assignment expressions, and array literals with hydratable entries are all scoped. Ids of elements after such a hole shift by one slot on both sides. -
6717d35:
sourceNamesfollowsdevin both JSX compilers. Unset, every kind (components,bindings) is on whendev: trueand off otherwise;true/falsesets every kind (sourceNames: falseopts a dev build out); the object form picks, and each kind it leaves unspecified followsdev(previouslyfalse). Production output (dev: false) is byte-identical with the option set or unset.@solidjs/babel-plugin'sPluginConfig.sourceNamesis now optional. Dev builds label components (createComponent(Home, props, "Home")) and binding effects (span.children) out of the box, so diagnostics and the Performance panel read as source without build-tool configuration.Primitive naming (
createSignal(0, { name: "count" })) stays with@solidjs/compiler's standalonetransformSourceNamespass, which the build tool runs on every module independently of the JSX compiler; it is not a JSX-transform kind, and the READMEs and RFC now say so. -
d0ba31c: SSR evaluates a
refexpression beside a spread, as it already does without one, so a ref factory's owned setup (ref={tooltip()}) runs on the server too and the hydration ids after it line up. The ref itself is still never called on the server (#4081). UnderserverComponentsthe same holds outside a server component's render, where a ref expression was never evaluated on either path; inside one the claim evaluates it, once. -
56683ea: SSR templates write characters above U+00FF in static text and quoted attribute values as numeric character references (
→becomes→), as do the static attributes baked into a spread element's attribute string. One character above U+00FF in a template made V8 store the whole rendered page as a two-byte string, which roughly doubled the cost of flattening and UTF-8 encoding the response (#4328). Latin-1 characters stay literal. Tag internals, comments, raw-text bodies such as<script>and<style>, and the children of a spread<script>or<style>keep their characters, since browsers do not decode references there. Client output is unchanged. -
7513131: Preserve the source location of captured references in SSR props constructors so source maps point to the authored expression, including dynamic TSRX tags.
-
63560a1:
componentNamesnow applies to SSR output. Under the option both compilers keep thecreateComponentcall they otherwise inline toComp(props)and pass the source tag name —createComponent(Comp, props, "Comp")— so the server runtime's observe/devcreateComponentlabels the owner and a server finding'sownerPathreads<App> › <Page>like the client's. Without the option (prod builds) SSR output is unchanged.@solidjs/vite-pluginalready passes the option for its dev and observe postures, so app server builds pick this up with no config change.Fixes
ssrScopeunder transparent owners: the virtual hole scope swapped the current owner's id counter, but content inside a hole resolves ids by walking past transparent owners, so with one in between (the server-component scope owner; now the labelled component owner) the hole's content took ids from the enclosing counter and disagreed with the client. The scope now swaps the nearest id-bearing owner. -
b2cb0c7: The server build escapes string literals in a ternary branch, after
&&, and in everyreturnof a function child, including areturninsideif,switch,tryor a loop. The server now renders them as text, as the client does, in children and in attribute values (#4710). A function value in an attribute keeps its literals as written at every depth, because the server stringifies its source. -
701cbb3: SSR escapes the children of
<style>and<script>under<svg>and<math>. There they are ordinary elements whose text parses as markup, so only HTML-namespace<style>/<script>render raw text (#4704). -
22f942d: SSR: a router can mark links in server HTML (#3878). Element claims never fire during SSR, so plain anchors arrived without
aria-current="page"/data-active— late on hydrated pages, never on pages that do not hydrate. Both compilers now give every candidate<a href>in SSR output one hole after its attributes,ssrLinkClaim(attrs), where a render's link handler writes the anchor's link state and""otherwise. A static anchor's hole is one eager call over a hoisted attributes object (no allocation per render); a dynamic anchor's joins the element's attribute group and reuses the raw value itshrefhole evaluated. Anchors the compiler can rule out — a static non-emptytarget, adownload, arelnamingexternal, an author-writtenaria-current, an empty href or a non-HTTP scheme — get no hole at all. The hole creates no owner and takes no hydration id. A spread anchor's link attributes are collected byssrElementfrom its winning sources (an anchor's trailing link attributes stay a source instead of baked tail markup).New server API (
@experimental):setLinkClaim(handler)sets the handler of the render the caller belongs to — found through the owner chain likegetHydrationWriter(), so concurrent renders never share one — and returnsfalseoutside a render;undefinedclears it. The handler,(attrs) => string, receives the anchor's link-relevant attributes (href,target,rel,download,link,aria-current, raw values as written) and returns its attribute markup. An author-writtenaria-currentalways wins. Server components inline in the document render under the page's handler; a server component's own frame stream has none unless its render sets one.Trust marker: the first
setLinkClaimof a render writes thelinkshydration record once (_$HY.r.links = 1, with the shell's hydration script on the document face, a data record on a frame stream).hasServerLinkState()(client;falseon the server) reads it non-destructively, so a link consumer can tell "this page's anchors carry the server's link state" from "no handler ran" and trust the HTML at hydration instead of resolving every anchor's URL at claim. Without a handler the HTML and the hydration ids are byte-for-byte what they were. -
1735074: SSR: a component's props literal with getters compiles to a module-level constructor with shared getters (
hoistProps, default on) instead of an object literal, which V8 builds in dictionary mode with a closure per getter per instance. Same own keys, order, descriptors and prototype; a props getter is now defined only for a read through its own object — copying its descriptor elsewhere throws (dev names the rule). Sites closing over a reassigned or later-declared binding,this, orargumentskeep the literal. Babel and the native compiler emit the same output. -
eabc4c5: A bound
<select value>marks its matching<option selected>while the server renders, not in a pass over the finished html (#4891). The old pass was switched on for the whole process by a module-scopessrSelectValues()call in any module that had a bound select, so every render after it scanned its full html and every streamed fragment, even with no select in it. Both compilers now read the select's value once ahead of its children (ssrSelect) and keep it on a transparent owner the select's children render under (ssrIn). Each compiled server<option>asksssrOptionwhether it is selected. Options a<For>, a component or a later async pass renders inside the select are matched too, and a select whose options stream in after a<Loading>inside it is no longer left unmarked.ssrSelectValuesandresolveSSRSelectValuesare removed. A multiple select's bound value is matched as the client assigns it, entry by entry from an array, with no comma split. An option whose text content is markup (novalueattribute) is not matched. -
e10a4ba: SSR: attributes written after an element's last spread are markup, not a source.
<li {...rest} class="row" data-id={id}>compiles tossrElement("li", rest, …, _sk$, () => ' class="row"' + ssrElementAttribute("data-id", id))— statics written as the template path writes them, dynamics throughssrElementAttribute(the spread walk's rules for one key), the whole string a literal when every part is static — with a hoisted skip predicate (var _sk$ = k => k === "class" || k === "data-id", one per key set) so the spread's own copies of those keys are never read or emitted. No later source can override a trailing attribute, so the output is unchanged; the thunk runs where the trailing source's getters used to be read, so hydration ids keep their order. What goes away per element is the trailing object literal (with getters, a dictionary-mode object and a closure per getter), its key list, and the precedence check on every key of the spread — an element whose only other source is the spread now serializes from one plain object. Attributes before a spread stay a source, and a source literal with getters (<li data-id={id} class="row" {...rest}>) now compiles to the same hoisted constructor as a component's props (hoistProps). Spread-static-tail server bench, 500 rows: statics after the spread 1.31×; a dynamic and a static after the spread 1.42× (1.22× from the hoisted source form, 1.17× from the thunk on top); the same attributes before the spread 1.21×. Child properties (innerHTML,textContent,children), a textarea'svalue, reserved namespaces and JSX-valued attributes stay sources. -
9adf007: Escape static text on SSR spread elements (#3557)
- Static text children of a spread element (
<div {...props}>a <b></div>) are now HTML-escaped at compile time in both compilers, matching the template path;scriptandstylechildren stay raw. - A static textarea
valuefolded into the template (<textarea value="a <b>" />) is escaped in both compilers. - The Babel plugin no longer folds a textarea
valueinto children on an element that carries a spread, so the value stays a prop and precedence follows JSX source order, matching the native compiler. - Static string props on the Babel spread paths are rebuilt from their decoded value, so
<div {...props} title="a & b" />no longer double-encodes entities.
- Static text children of a spread element (
-
8a6de0f: Dev builds now warn with
STRICT_READ_UNTRACKED(#1742) when an element's event handler expression reads reactive state, e.g.onClick={selected() ? a : b}or aprops.onClickthe parent passed a reactive expression. A handler is bound once, where its element is created, so such a read is not meant to be reactive; the warning says to read the value inside the handler function instead. A pending async read there throwsPENDING_ASYNC_UNTRACKED_READ, as in a component body. The read still tracks, so dev re-mounts on a change exactly as production does.Production output is unchanged byte for byte. In dev DOM output both compilers wrap each handler expression that can read reactive state (anything but an identifier, an inline function or a literal), including the
[handler, data]form's bound values on delegated events, in a newstrictHandler(() => expr)helper from@solidjs/web. It readsexprthroughstrictReadTracked, a dev-only strict-read window that keeps tracking (internal, from@solidjs/signalsviasolid-js). No production-compiled module imports either, so they tree-shake away. -
774aad5: Add compile-time scoped styles, CSS sidecar output, style class maps, and style refs to both TSRX frontends.
-
ab4c40c: Object-valued
style/classbindings are read in the TRACKED half of their effect.style()andclassName()enumerate their object in the effect's untracked commit phase, so a proxy value — a store sub-object (style={state.style},class={row.classes}), merged props, anything arriving through a spread — was identity-reactive only: in-place key mutations never re-applied, and every leaf read trippedSTRICT_READ_UNTRACKEDin dev. Both compilers now wrap the compute value of a non-inlinestyle={expr}/class={expr}in a new compiler primitive,readShallow(), andspread()applies it to those two keys as it copies.readShallowis an identity passthrough for strings, plain objects and proxy-free arrays (a fresh literal is already the compute's own — the common case pays atypeof); a proxy is copied with oneownKeystrap (its own trap keeps the key set tracked) plus one tracked read per key; arrays are re-mapped only when an element is a proxy. Inline literals are untouched — they already compile per property. Provably-string expressions (string/template literals, concatenation) and literal objects/arrays skip the wrap at compile time. New Tier-1 benchstyle-class-object: plain-object rows at parity; store-backed rows go from identity-only (and, in dev, ~97 ms per 500 elements of diagnostics) to per-key reactive at ~3.5 ms. Octane svg-dashboard (prod build, store-backed style/attrs through spread): mount at parity, style_spread_pulse −6%, select_toggle −7%.spread()shares the same enumeration: its compute half copied the source withfor…in+hasOwn, which on a proxy source (merge()/omit(),{...props}in a component, store records — nearly every spread) is anownKeystrap plus twogetOwnPropertyDescriptortraps per key, each allocating a descriptor and a getter closure. It now takes the key set from oneReflect.ownKeystrap (the trap keeps the key set tracked) and reads each string key once; plain sources useObject.keys, the exact own-enumerable set the old loop yielded. New Tier-1 benchspread-enumerate(500 elements, 8 keys):merge(static, reactive)376 → 537 ops/s (+43%), store record 253 → 415 ops/s (+64%), plain object at parity. -
350f65f: TSRX:
@for … index/keyitems and@catcherrors pass through toFor/Erroredas the accessors Solid hands out; the compilers no longer rewrite reads of those bindings into calls (#3474). Authoritem(),i()(under a custom key), anderr()exactly as in JSX. A destructuring pattern in one of those positions is rejected with a diagnostic, since there is nothing to destructure — the default keyed@foritem is still a raw value and still destructures.projectTsrxForTypecheckemits the same(item, i) =>/(err, reset) =>arrows@tsrx/soliddoes, so the two typecheck projections now agree. -
c9c16cb: Add an experimental TSRX syntax frontend to both compilers.
.tsrxsources (routed by filename with the newsyntax: "auto" | "jsx" | "tsrx"option) desugar@if/@else,@for … @empty,@switch/@case,@try/@catch/@pending,@{}statement containers, and lazy destructuring (&{}/&[]) into the shared Solid JSX lowering, producing byte-identical output from both compilers. The Babel plugin loads the optional@tsrx/corepeer dependency lazily; the native compiler ships the frontend behind the default-ontsrxcargo feature (statement containers in expression position are rejected with a structured diagnostic pending upstream oxc-tsrx support). -
6cca8b5: Dev builds now warn with
UNCOMMITTED_INPUT_OVERWRITTEN(#4186) when a stateful DOM property binding (value/checkedon an input,valueon a textarea,value/selectedon an option,mutedon media) is about to re-write the value it wrote last time over an edit the user never committed to the bound signal — e.g.value={props.name} onChange={commit}with no draft signal, when another dynamic attribute in the same template changes. Runtime behavior is unchanged: the write still happens, once per element and property the warning names the fix (write the signal fromonInput, usedefaultValue/defaultCheckedfor an uncontrolled element, or write a rejected edit back withe.currentTarget.value = next).Production output is unchanged byte for byte. In dev DOM output both compilers write stateful properties through a new
setStatefulProperty(el, name, value)helper instead of the inlineel.name = value; hydratable output keepssetProperty, andspread/assigncheck in the runtime. The check lives only in@solidjs/web's dev build; the production entry carries a plainnode[name] = valuestub that no production-compiled module imports, so it tree-shakes away.The "Form inputs" section of the DOM RFC, the cheatsheet and the solid-2.0 skill now say that a change to any other dynamic attribute in the same template re-runs a stateful binding, link the new code, and drop
equals: falseas a way to reject input (it is what the warning reports); write the accepted value back withe.currentTarget.value = nextinstead. -
1643d2a: The universal renderer's
spread()follows the@solidjs/webcontract (#3388):reffolds into the props effect and is re-applied only when its identity changes (refs run with no owner, so nothing they create is disposed by the fold); children keep their own ownedinsert— that effect owns the child subtree — but a plain object whosechildrenis a data property inserts the value with no effect at all. Three reactive nodes become two when children flow through the spread, one when they don't.spreadalso resolves a lone function source inside its own tracking scopes and accepts an array of sources —spread(node, [a, b], skipChildren)— the union of their keys with later sources winning, only the winning source read, function sources called inline with no merge and no memo. Both compilers' universal output uses it: a lone spread passes straight through (reactive included, no moremergeProps(() => …)), and several sources compile to the array instead of amergeProps()call. -
e27dc29:
validatenow fails the compile instead of warning when a template's markup would be restructured by the browser's HTML parser (#3099). Once the validator fires the emitted positional walk is guaranteed not to match the browser-built DOM (crashed or silently misplaced bindings; desynced hydration under SSR), so warn-and-emit shipped certain breakage with the diagnostic buried in server logs. Errors now point at the offending JSX (code frame in Babel, line:col in the native compiler).validate: falseremains the opt-out. -
2ba1c4a: A valueless
prop:attribute (<el prop:active />) now compiles asprop:active={true}, matching bare plain attributes, instead of being dropped silently (#4180).