Skip to content

v0.10.0

Compare
Choose a tag to compare
@lxsmnsyc lxsmnsyc released this 07 Jan 04:53
· 114 commits to main since this release
  • Adds $component CTF. This CTF is used for defining Solid components, and allows the component's props to be implicitly destructured, much like $destructure.
$component(({ [x]: { y, ...z } = { y: 10 }, ...a }) => (
  <>
    {y}
    {z}
    {a}
  </>
))
import { mergeProps as _mergeProps } from "solid-js";
import { splitProps as _splitProps } from "solid-js";
import { createMemo as _createMemo } from "solid-js";

_props => {
  const _def = _createMemo(() => ({
    y: 10
  })),
        _prop = () => {
    const _value = _props[x];
    return _value == null ? _def() : _value;
  },
        _prop2 = () => _prop().y,
        _other = _splitProps(_props, [x])[1],
        _other2 = _splitProps(_mergeProps(_prop(), _def), ["y"])[1];

  return <>
    {_prop2()}
    {_other2}
    {_other}
  </>;
};
  • Adds support for default values in $destructure.
  • Adds disabled option to the plugin.
{
  disabled: {
    labels: {
      signal: true,
    },
    pragma: {
      '@signal': true,
    },
    ctf: {
      $signal: true,
    },
  }
}