Patch Changes
-
a40b6cd: The directives pass rejects a
broadcast()render that reads the server function's outer body. The render is shared by every caller with the same arguments, but the body runs per caller, so the first caller's value would show for everyone. The returned component, and any local function it renders, may read the function's parameters, its own locals and module scope. -
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. -
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. -
2ba1c4a: A valueless
prop:attribute (<el prop:active />) now compiles asprop:active={true}, matching bare plain attributes, instead of being dropped silently (#4180).