Repository navigation
@solidjs/babel-plugin@2.0.0-rc.14
Pre-releasePatch Changes
-
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). -
3c1f809: Preserve
/* istanbul ignore … */and/* c8 ignore … */block comments written as JSX children on the generated componentchildrengetter. Line comments are not carried. -
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. -
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
-
7513131: Preserve the source location of captured references in SSR props constructors so source maps point to the authored expression, including dynamic TSRX tags.