Patch Changes
-
ecb68a1: Binding slots: the fill runs once per occurrence, untracked, under the occurrence's owner — as a component body and a template-slot fill do. State created in the fill lives as long as the occurrence; a top-level read is a one-time read (dev:
STRICT_READ_UNTRACKED, naming the fill); getters are the reactive form. Handlers and refs are read once when an element binds and go throughassign, so events delegate, tuples bind and interactions wrap as in client JSX. On the server an array at a handler position is a dev finding (reasontuple) instead of being flattened; onlyrefmerges arrays. Template-slot fills are untracked on every render path and carry the same labelled warning.Breaking:
AttributeSlotis renamedBindingSlot, with no alias, and its return is constrained (SlotOutput<J>/SlotError<M>, both exported) so an array, DOM node, function, async value or$-prefixed key is a type error on both sides. The diagnostic codeATTRIBUTE_SLOT_POSITIONis renamedBINDING_SLOT_POSITION. The fill-shape finding also names async values. -
9e85a09:
h()no longer writes to the caller's props object, so an element can be materialized again (aShowre-showing children whose own children areh()elements threw "Cannot set property children … which has only a getter"). Anh()element returned from an accessor child is now created in the insert's tracking pass rather than re-created whenever its output changes (an accessor returningh(Loading, …)over async children never settled). A functionclasson a tag with static classes (h("span.a", { class: () => … })) keeps the static classes.h(...)with element/component arguments is typed asHyperElement, sorender(h(App), el)— the documented root form, now corrected in the README — type-checks. -
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
-
Updated dependencies [ecb68a1]
-
Updated dependencies [d4b10b5]
-
Updated dependencies [2eb6e00]
-
Updated dependencies [721eb06]
-
Updated dependencies [365f37d]
-
Updated dependencies [98d35b9]
-
Updated dependencies [b57eb2e]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [9d89df7]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [3c1d512]
-
Updated dependencies [9d89df7]
-
Updated dependencies [7233451]
-
Updated dependencies [9d89df7]
-
Updated dependencies [9d89df7]
-
Updated dependencies [7233451]
-
Updated dependencies [3c1d512]
-
Updated dependencies [1b9ceb6]
-
Updated dependencies [203ab1a]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [3c7631a]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [7233451]
-
Updated dependencies [e44b2e4]
-
Updated dependencies [01e80a6]
-
Updated dependencies [be82cf3]
-
Updated dependencies [4f67697]
-
Updated dependencies [41fdf96]
-
Updated dependencies [53ef0e6]
-
Updated dependencies [2656284]
-
Updated dependencies [9338c00]
-
Updated dependencies [7addcc6]
-
Updated dependencies [6f77b1b]
-
Updated dependencies [537e945]
-
Updated dependencies [7233451]
-
Updated dependencies [8d66ae5]
- @solidjs/web@2.0.0-rc.14