Releases: orenelbaum/babel-plugin-solid-undestructure
v1.1.0
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
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
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
- 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
- Adds features: rest element destructuring and prop renaming.
- Adds automated testing.
v0.0.10
- Fixes a bug with default props.
v0.0.9
- Adds the ability to specify default props.
v0.0.8
- Fixes bug: In vanilla JavaScript mode, the
component
function could be used only once per file.
v0.0.7
- Adds vanilla Javascript mode
- Removes unsafe Javascript mode
v0.0.6
- Fixes a mistake in the readme.