Skip to content

Commit d2d1bed

Browse files
committed
chore: release v2.1.1
1 parent 187bf8c commit d2d1bed

File tree

10 files changed

+95
-13
lines changed

10 files changed

+95
-13
lines changed

Diff for: CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## [2.1.1](https://github.com/vuejs/vue-jsx-vapor/compare/v2.1.0...v2.1.1) (2025-03-17)
2+
3+
4+
### Bug Fixes
5+
6+
* **compiler:** missing modifiers ([32849a7](https://github.com/vuejs/vue-jsx-vapor/commit/32849a73c28f7da97dfc868f11d7a4aa0f45e4fe))
7+
* **compiler:** remove empty modifiers ([dce2e83](https://github.com/vuejs/vue-jsx-vapor/commit/dce2e83d6892a47ef5a3a6132305bfed6e619269))
8+
* **compiler:** use setInsertionState instead of insert ([2fae757](https://github.com/vuejs/vue-jsx-vapor/commit/2fae757c4323b93466cf233187b64968659c043c))
9+
10+
11+
### Features
12+
13+
* **compiler:** support empty expression for event with modifiers ([187bf8c](https://github.com/vuejs/vue-jsx-vapor/commit/187bf8c1f0dbad4f726d48a10a9d487e46277f33))
14+
15+
16+
117
# [2.1.0](https://github.com/vuejs/vue-jsx-vapor/compare/v2.0.1...v2.1.0) (2025-03-16)
218

319

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.1.0",
2+
"version": "2.1.1",
33
"packageManager": "[email protected]",
44
"description": "Vue JSX Vapor",
55
"type": "module",

Diff for: packages/babel/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-jsx-vapor/babel",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"packageManager": "[email protected]",
55
"description": "Vue JSX Vapor Babel Plugin",
66
"type": "module",

Diff for: packages/compiler/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-jsx-vapor/compiler",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"packageManager": "[email protected]",
55
"description": "Vue JSX Vapor Compiler",
66
"type": "module",

Diff for: packages/compiler/src/transforms/transformChildren.ts

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function processDynamicChildren(context: TransformContext<Node>) {
7575
const anchor = (prevDynamics[0].anchor = context.increaseId())
7676
registerInsertion(prevDynamics, context, anchor)
7777
} else {
78+
prevDynamics[0].flags -= DynamicFlag.NON_TEMPLATE
7879
registerInsertion(prevDynamics, context, -1 /* prepend */)
7980
}
8081
prevDynamics = []
@@ -94,6 +95,7 @@ function registerInsertion(
9495
anchor?: number,
9596
) {
9697
for (const child of dynamics) {
98+
console.log(child)
9799
if (child.template != null) {
98100
// template node due to invalid nesting - generate actual insertion
99101
context.registerOperation({

Diff for: packages/compiler/test/transforms/transformChildren.spec.ts

+63
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,67 @@ describe('compiler: children transform', () => {
159159
expect(code).contains(`const n0 = _nthChild(n1, 2)`)
160160
expect(code).toMatchSnapshot()
161161
})
162+
163+
test('nested elements error', () => {
164+
const { code, ir } = compileWithElementTransform(
165+
`
166+
<div>
167+
<div />
168+
<Comp />
169+
<button disabled={foo} />
170+
</div>
171+
`,
172+
{ inline: false },
173+
)
174+
expect(code).toMatchInlineSnapshot(`
175+
"import { child as _child, next as _next, setInsertionState as _setInsertionState, createComponent as _createComponent, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
176+
const t0 = _template("<div><div></div><!><button></button></div>", true)
177+
178+
export function render(_ctx) {
179+
const n3 = t0()
180+
const n2 = _next(_child(n3))
181+
_setInsertionState(n3, n2)
182+
const n0 = _createComponent(_ctx.Comp)
183+
const n1 = _next(n2)
184+
_renderEffect(() => _setProp(n1, "disabled", _ctx.foo))
185+
return n3
186+
}"
187+
`)
188+
// expect(ir.block.dynamic).toMatchObject({
189+
// children: [
190+
// {
191+
// children: [
192+
// {
193+
// children: [],
194+
// flags: 3,
195+
// },
196+
// {
197+
// children: [],
198+
// flags: 1,
199+
// },
200+
// {
201+
// children: [],
202+
// flags: 3,
203+
// },
204+
// {
205+
// children: [],
206+
// flags: 1,
207+
// id: 0,
208+
// },
209+
// {
210+
// children: [],
211+
// flags: 3,
212+
// },
213+
// ],
214+
// flags: 1,
215+
// hasDynamicChild: true,
216+
// id: 1,
217+
// template: 0,
218+
// },
219+
// ],
220+
// flags: 1,
221+
// hasDynamicChild: true,
222+
// })
223+
console.log(ir.block.dynamic)
224+
})
162225
})

Diff for: packages/macros/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-jsx-vapor/macros",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"packageManager": "[email protected]",
55
"description": "Macros for Vue JSX Vapor",
66
"type": "module",

Diff for: packages/vue-jsx-vapor/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-jsx-vapor",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"packageManager": "[email protected]",
55
"description": "Convert Vue JSX to Vapor",
66
"type": "module",

Diff for: playground/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "playground",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

Diff for: playground/src/model.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import { ref } from 'vue'
2-
32
const Comp = () => {
43
const model = defineModel<string>()
5-
return <input v-model={model.value} />
4+
return <div>comp</div>
65
}
76

87
export default () => {
98
const model = ref('model')
109

1110
return (
12-
<>
13-
<input v-model={model.value}></input>
14-
<Comp v-model={model.value} />
15-
{model.value}
16-
</>
11+
<div>
12+
123
13+
<Comp />1
14+
<div>
15+
<button disabled={!!model.value}>123</button>
16+
</div>
17+
</div>
1718
)
1819
}

0 commit comments

Comments
 (0)