Skip to content

Commit 6e5c0c5

Browse files
committed
Merge branch 'minor' into edison/slot-doc
# Conflicts: # packages/compiler-vapor/src/ir/index.ts # packages/runtime-vapor/src/apiCreateFragment.ts # packages/runtime-vapor/src/componentSlots.ts # packages/runtime-vapor/src/fragment.ts
2 parents 1ca6d66 + 1452e5c commit 6e5c0c5

47 files changed

Lines changed: 1348 additions & 1448 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/compiler-vapor/__tests__/__snapshots__/compile.spec.ts.snap

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function render(_ctx) {
3636
const n4 = _createAssetComponent("Comp", null, _extend(() => {
3737
const n0 = _createIf(() => (true), () => {
3838
const n3 = t0()
39-
_setInsertionState(n3, null, 0)
39+
_setInsertionState(n3)
4040
const n2 = _createComponentWithFallback(_component_Bar)
4141
_withVaporDirectives(n2, [[_directive_hello, void 0, void 0, { world: true }]])
4242
return n3
@@ -146,19 +146,20 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
146146
`;
147147
148148
exports[`compile > directives > v-pre > should not affect siblings after it 1`] = `
149-
"import { setProp as _setProp, renderEffect as _renderEffect, setInsertionState as _setInsertionState, createAssetComponent as _createAssetComponent, child as _child, toDisplayString as _toDisplayString, setText as _setText, template as _template } from 'vue';
149+
"import { child as _child, setProp as _setProp, renderEffect as _renderEffect, setInsertionState as _setInsertionState, createAssetComponent as _createAssetComponent, next as _next, toDisplayString as _toDisplayString, setText as _setText, template as _template } from 'vue';
150150
const t0 = _template("<div :id=foo><Comp></Comp>{{ bar }}", 2)
151-
const t1 = _template("<div> ")
151+
const t1 = _template("<div><!> ")
152152
153153
export function render(_ctx, $props, $emit, $attrs, $slots) {
154154
const n0 = t0()
155-
const n3 = t1()
156-
const n2 = _child(n3, 1)
157-
_renderEffect(() => _setProp(n3, "id", _ctx.foo))
158-
_setInsertionState(n3, 0)
155+
const n4 = t1()
156+
const n3 = _child(n4)
157+
const n2 = _next(n3)
158+
_renderEffect(() => _setProp(n4, "id", _ctx.foo))
159+
_setInsertionState(n4, n3)
159160
const n1 = _createAssetComponent("Comp")
160161
_renderEffect(() => _setText(n2, _toDisplayString(_ctx.bar)))
161-
return [n0, n3]
162+
return [n0, n4]
162163
}"
163164
`;
164165
@@ -215,10 +216,10 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
215216
const n0 = _createFor(() => (_ctx.rows), (_for_item0) => {
216217
const n6 = t0()
217218
const n2 = _child(n6)
218-
const n5 = _next(n2, 1)
219-
const n4 = _next(n5, 2)
219+
const n5 = _next(n2)
220+
const n4 = _next(n5)
220221
const x2 = _txt(n2)
221-
_setInsertionState(n6, n5, 1)
222+
_setInsertionState(n6, n5)
222223
const n3 = _createComponentWithFallback(_component_Child)
223224
const x4 = _txt(n4)
224225
_renderEffect(() => _setText(x4, _toDisplayString(_ctx.useId())))
@@ -239,7 +240,7 @@ const t0 = _template("<div>", 1)
239240
export function render(_ctx, $props, $emit, $attrs, $slots) {
240241
const n1 = t0()
241242
_renderEffect(() => _setProp(n1, "id", _ctx.useId()))
242-
_setInsertionState(n1, null, 0)
243+
_setInsertionState(n1)
243244
const n0 = _createAssetComponent("Child")
244245
return n1
245246
}"
@@ -265,12 +266,12 @@ const t1 = _template("<div><div></div><!><div></div><!><div><button>", 1)
265266
266267
export function render(_ctx) {
267268
const n6 = t1()
268-
const n5 = _next(_child(n6), 1)
269+
const n5 = _next(_child(n6))
269270
const n7 = _nthChild(n6, 3)
270-
const n4 = _child(_next(n7, 4))
271-
_setInsertionState(n6, n5, 1)
271+
const n4 = _child(_next(n7))
272+
_setInsertionState(n6, n5)
272273
const n0 = _createAssetComponent("Comp")
273-
_setInsertionState(n6, n7, 3)
274+
_setInsertionState(n6, n7)
274275
const n1 = _createIf(() => (true), () => {
275276
const n3 = t0()
276277
return n3
@@ -287,9 +288,9 @@ const t0 = _template("<div><div>", 1)
287288
export function render(_ctx) {
288289
const n3 = t0()
289290
const n1 = _child(n3)
290-
_setInsertionState(n1, null, 0)
291+
_setInsertionState(n1)
291292
const n0 = _createSlot()
292-
_setInsertionState(n3, null, 1)
293+
_setInsertionState(n3, 1)
293294
const n2 = _createAssetComponent("Comp")
294295
return n3
295296
}"
@@ -302,7 +303,7 @@ const t0 = _template("<div><span> </span> <br> ", 1)
302303
export function render(_ctx) {
303304
const n3 = t0()
304305
const n0 = _child(n3)
305-
const n1 = _next(n0, 1)
306+
const n1 = _next(n0)
306307
const n2 = _nthChild(n3, 3)
307308
const x0 = _txt(n0)
308309
_setText(x0, _toDisplayString(_ctx.foo))
@@ -460,9 +461,9 @@ const t0 = _template("<div><div>x</div><div><span> </div><div><span> ", 1)
460461
461462
export function render(_ctx, $props, $emit, $attrs, $slots) {
462463
const n2 = t0()
463-
let p1 = _next(_child(n2), 1)
464+
let p1 = _next(_child(n2))
464465
const n0 = _child(p1)
465-
const n1 = _child((p1 = _next(p1, 2)))
466+
const n1 = _child((p1 = _next(p1)))
466467
const x0 = _txt(n0)
467468
const x1 = _txt(n1)
468469
_renderEffect(() => {

packages/compiler-vapor/__tests__/__snapshots__/staticTemplate.spec.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,17 @@ export function render(_ctx) {
148148
`;
149149
150150
exports[`static template marker > keeps materialized createElement text path non-static 1`] = `
151-
"import { createPlainElement as _createPlainElement, setText as _setText, insert as _insert, template as _template } from 'vue';
151+
"import { createPlainElement as _createPlainElement, insert as _insert, setText as _setText, template as _template } from 'vue';
152152
const t0 = _template("<span></span>", 2)
153153
const t1 = _template("")
154154
155155
export function render(_ctx) {
156156
const n2 = _createPlainElement("template", null, null, true)
157157
const n0 = t0()
158+
_insert(n0, n2)
158159
const n1 = t1()
160+
_insert(n1, n2)
159161
_setText(n1, "<b>foo</b>")
160-
_insert([n0, n1], n2)
161-
_insert([n0, n1], n2)
162162
return n2
163163
}"
164164
`;
@@ -176,14 +176,14 @@ export function render(_ctx) {
176176
`;
177177
178178
exports[`static template marker > keeps template empty-string semantics unchanged 1`] = `
179-
"import { createPlainElement as _createPlainElement, setText as _setText, insert as _insert, template as _template } from 'vue';
179+
"import { createPlainElement as _createPlainElement, insert as _insert, setText as _setText, template as _template } from 'vue';
180180
const t0 = _template("")
181181
182182
export function render(_ctx) {
183183
const n1 = _createPlainElement("template", null, null, true)
184184
const n0 = t0()
185-
_setText(n0, "<b>foo</b>")
186185
_insert(n0, n1)
186+
_setText(n0, "<b>foo</b>")
187187
return n1
188188
}"
189189
`;

packages/compiler-vapor/__tests__/compile.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ describe('compile', () => {
317317
})
318318
expect(code).contains(
319319
`_renderEffect(() => _setProp(n1, "id", _ctx.useId()))
320-
_setInsertionState(n1, null, 0)
320+
_setInsertionState(n1)
321321
const n0 = _createAssetComponent("Child")`,
322322
)
323323
expect(code).matchSnapshot()
@@ -473,9 +473,9 @@ describe('compile', () => {
473473
expect(code).matchSnapshot()
474474
expect(code).not.contains('let p0 = ')
475475
expect(code).not.contains('let p2 = ')
476-
expect(code).contains('let p1 = _next(_child(n2), 1)')
476+
expect(code).contains('let p1 = _next(_child(n2))')
477477
expect(code).contains('const n0 = _child(p1)')
478-
expect(code).contains('const n1 = _child((p1 = _next(p1, 2)))')
478+
expect(code).contains('const n1 = _child((p1 = _next(p1)))')
479479
})
480480
})
481481
})

packages/compiler-vapor/__tests__/transforms/__snapshots__/TransformTransition.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function render(_ctx) {
4545
return n5
4646
}, () => {
4747
const n15 = t3()
48-
_setInsertionState(n15, null, 0)
48+
_setInsertionState(n15)
4949
const n9 = _createIf(() => (_ctx.c), () => {
5050
const n11 = t1()
5151
return n11

0 commit comments

Comments
 (0)