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

pre-release5 hours ago

Patch Changes

  • a5d0e76: Zero-argument functions passed to component props named on, only, once, etc. are now wrapped in getters like any other dynamic prop (#3728). The on* exemption on components now covers only onXxx handler names (an uppercase letter after on), so <${Loading} on=${() => key()}> re-keys the boundary when key() changes. Native elements are unchanged: every on* prop is still passed through as an event handler. A lowercase onclick passed to a component is now wrapped in a getter; name it onClick or give the handler a parameter.

  • 6be8486: Fix the tokenizer staying in raw text mode after a self-closing raw text element such as <textarea />, which swallowed the rest of the template as text.

  • 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.
  • 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

Don't miss a new solid release

NewReleases is sending notifications on new releases.