Skip to content

Commit d06de34

Browse files
committed
v-0.0.14
1 parent 2ec3e84 commit d06de34

32 files changed

Lines changed: 2091 additions & 647 deletions

dev-notes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Dev Notes
2+
3+
4+
## Default Props VS Fallback Props
5+
6+
This plugin supports 2 different ways of declaring default props:
7+
- `({ x = defaultX, y = defaultY }) => ...`
8+
- `({ x, y } = { x = defaultX, y = defaultY }) => ...`
9+
10+
In the source code I will refer to the first way as default props and the second way as fallback props.

example.png

-342 KB
Binary file not shown.

exp.cjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { transformAsync } = require("@babel/core");
2+
3+
(async () => {
4+
const src=/*javascript*/`
5+
import { component } from 'babel-plugin-solid-undestructure'
6+
const Child = component(({ count: c = 100, ...other }) => {
7+
// return (
8+
// <button onclick={other.increment}>{c}</button>
9+
// );
10+
});
11+
`
12+
13+
const res = await transformAsync(
14+
src,
15+
{ plugins: ["./src/index.cjs"] }
16+
)
17+
18+
console.log(res.code);
19+
})()

index.cjs

Lines changed: 0 additions & 232 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

jsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es6"
5+
},
6+
"exclude": ["node_modules"]
7+
}

0 commit comments

Comments
 (0)