Skip to content

Releases: orenelbaum/babel-plugin-solid-undestructure

v1.1.0

09 Dec 13:53
Compare
Choose a tag to compare

Added support for ParentComponent type annotation.

import type { ParentComponent } from 'solid-js'
const MyComp: ParentComponent<...> = ({ a, b, c }) => {a; b; c;};

//  ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
import type { ParentComponent } from 'solid-js'
const MyComp: ParentComponent<...> = props => {props.a; props.b; props.c;}

v1.0

06 Dec 14:42
Compare
Choose a tag to compare

Changes:

  • import { component } from 'babel-plugin-solid-undestructure' => import { component } from 'undestructure-macros'

This plugin should be production ready now.
Until now the component CTF was imported from babel-plugin-solid-undestructure.
This made me paranoid that people would bundle the actual Babel plugin into their frontend for whatever reason.
That's why I added a macro placeholder package undestructure-macros. Now the component macro is imported from there.
The only code the package actually contains is code that that throws an error in case the package was bundled into the app for whatever reason.
However this is an extra safety measure, since even if you import from undestructure-macros and don't run the plugin so that the import remains in your code, vite should fail to bundle at build time and throw an error.

v0.1.0

06 Dec 00:28
Compare
Choose a tag to compare

I don't know why I haven't bumped minor version until now.
Anyway, nested components! Have fun with them.

import { Component } from 'solid-js'
const Parent: Component<...> = ({ a, b }) => {
  const Child: Component<...> = ({ c, d }) => {
    a; b; c; d;
  }
}

//  ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
import { Component } from 'solid-js'
const Parent: Component<...> = props1 => {
  const Child: Component<...> = props2 => {
    props1.a; props1.b; props2.c; props2.d;
  }
}

v-0.0.15

04 Feb 14:25
Compare
Choose a tag to compare
  • Bug fixes.
  • Add the following check as a safe-fail mechanism: if any CTFs weren't removed and any of them are used, throws an error, otherwise removes unused imports.

v-0.0.14

03 Jan 13:49
Compare
Choose a tag to compare
  • Adds features: rest element destructuring and prop renaming.
  • Adds automated testing.

v0.0.10

27 Nov 09:28
Compare
Choose a tag to compare
  • Fixes a bug with default props.

v0.0.9

27 Nov 08:38
Compare
Choose a tag to compare
  • Adds the ability to specify default props.

v0.0.8

26 Nov 11:22
Compare
Choose a tag to compare
  • Fixes bug: In vanilla JavaScript mode, the component function could be used only once per file.

v0.0.7

20 Nov 01:42
Compare
Choose a tag to compare
  • Adds vanilla Javascript mode
  • Removes unsafe Javascript mode

v0.0.6

22 Sep 21:25
Compare
Choose a tag to compare
  • Fixes a mistake in the readme.