Repository navigation
@solidjs/compiler@2.0.0-rc.14
Pre-release
Pre-release
·
39 commits
to main
since this release
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 componentchildrengetter. 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
hoistPropsno longer captures names in TypeScript type positions (type parameters, annotations,as/satisfiestargets, type arguments,typeof xqueries, localtype/interfacedeclarations,implements/extendsheritage) as constructor arguments, which threwReferenceErroronce the types were stripped (#3828). Atypeorinterfacethat 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-wasifallback loads on Android (Termux), where the filesystem root cannot be opened: its generated loader no longer preopens/there (it failed withUVWASI_EACCES, uvwasi_init). The loader is regenerated by@napi-rs/cli3.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
@forloops 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=""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. - ea5f1da: Fix native TSRX compilation when a setup statement has no semicolon before markup.
- 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