github solidjs/solid @solidjs/compiler@2.0.0-rc.14

Patch Changes

  • ba8c593: Restore Clippy and rustfmt checks for the native compiler and apply the resulting lint and formatting cleanups
  • 3c1f809: Preserve /* istanbul ignore … */ and /* c8 ignore … */ block comments written as JSX children on the generated component children getter. Line comments are not carried.
  • 5dbe29a: Count all JavaScript line terminators in scoped style and refresh locations and DOM and server-function diagnostics. Report diagnostic columns in UTF-16 units.
  • a8c98bd: Preserve the source location of captured references in SSR props constructors so source maps point to the authored expression instead of the start of the JSX element, matching @solidjs/babel-plugin.
  • 59fb244: SSR hoistProps no longer captures names in TypeScript type positions (type parameters, annotations, as/satisfies targets, type arguments, typeof x queries, local type/interface declarations, implements/extends heritage) as constructor arguments, which threw ReferenceError once the types were stripped (#3828). A type or interface that shares a value's name no longer makes that value count as redeclared, so its site still hoists.
  • ab57910: Report correct TSRX diagnostic positions after Unicode line separators and carriage returns, preserving UTF-16 columns and treating CRLF as one line break.
  • 41be120: The @solidjs/compiler-wasm32-wasi fallback loads on Android (Termux), where the filesystem root cannot be opened: its generated loader no longer preopens / there (it failed with UVWASI_EACCES, uvwasi_init). The loader is regenerated by @napi-rs/cli 3.10.6, which maps the WASI root to the working directory on Android.
  • c8aac88: Fix native TSRX compilation of parenthesized keys, iterables, and conditions, including annotated @for loops used directly in a component body. Map comments back to the authored source to prevent invalid JavaScript and Unicode panics when source maps are enabled.
  • 98b916d: Fix compiled SSR output that renders style="" or class="" for null and undefined. Babel and the native compiler now omit these attributes on elements without a spread.
  • 98d35b9: Fix computed keys in compiled SSR style objects (builds without serverComponents). A computed key's name got no ;, so style={{ color: "red", [k]: v }} rendered color:redtop:1px and 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 new ssrStyleProperties(name, value, …) helper, which writes the separator only between the entries it writes; a single entry keeps ssrStyleProperty.
  • ea5f1da: Fix native TSRX compilation when a setup statement has no semicolon before markup.
  • 4f67697: Breaking: only on followed by an uppercase letter (onClick, onPointerDown) is an event handler. Lowercase on* names (onclick, onmouseover) are plain attributes everywhere:
    • Both compilers compile onclick={expr} like any other attribute (setAttribute, reactive when expr is dynamic) instead of binding a delegated or native event, and SSR renders it as an escaped attribute instead of dropping it. A leftover 1.x on:click={fn} is likewise a plain namespaced attribute (it previously compiled to addEventListener(":click", fn)).
    • @solidjs/web spread/assign set lowercase on* keys as attributes, the server spread walk renders them, and useHead applies lowercase on* attributes (camelCase handler names stay skipped). ssrAttribute escapes a function value instead of interpolating its source raw.
    • @solidjs/html and @solidjs/h elements wrap a function passed to a lowercase on* in a getter like any other attribute; only onXxx and ref are exempt.
    • @solidjs/html components follow @solidjs/h's rule: every zero-argument function prop, onXxx handlers and ref included, is a getter, so a component handler must declare its event argument (onClick=${e => …}).
    • New dev-only check LOWERCASE_EVENT_ATTRIBUTE (added to the DiagnosticCode union): warns once per attribute name when a function is set on a lowercase on* (or on:) attribute, naming the camelCase handler to use.

Don't miss a new solid release

NewReleases is sending notifications on new releases.