Skip to content

Commit 9722574

Browse files
committed
wip(vapor): adjust children and block generation order for hydration
1 parent e3a33e6 commit 9722574

26 files changed

+943
-1006
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,17 @@ export function render(_ctx, $props, $emit, $attrs, $slots) {
149149
`;
150150
151151
exports[`compile > directives > v-pre > should not affect siblings after it 1`] = `
152-
"import { resolveComponent as _resolveComponent, child as _child, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
152+
"import { resolveComponent as _resolveComponent, setInsertionState as _setInsertionState, createComponentWithFallback as _createComponentWithFallback, child as _child, toDisplayString as _toDisplayString, setText as _setText, setProp as _setProp, renderEffect as _renderEffect, template as _template } from 'vue';
153153
const t0 = _template("<div :id=\\"foo\\"><Comp></Comp>{{ bar }}</div>")
154154
const t1 = _template("<div> </div>")
155155
156156
export function render(_ctx, $props, $emit, $attrs, $slots) {
157157
const _component_Comp = _resolveComponent("Comp")
158158
const n0 = t0()
159159
const n3 = t1()
160-
const n2 = _child(n3)
161160
_setInsertionState(n3, 0)
162161
const n1 = _createComponentWithFallback(_component_Comp)
162+
const n2 = _child(n3)
163163
_renderEffect(() => {
164164
_setText(n2, _toDisplayString(_ctx.bar))
165165
_setProp(n3, "id", _ctx.foo)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ const t0 = _template("<div><div>x</div><div><span> </span></div><div><span> </sp
4040
export function render(_ctx) {
4141
const n3 = t0()
4242
const p0 = _next(_child(n3))
43-
const n0 = _child(p0)
4443
const p1 = _next(p0)
45-
const n1 = _child(p1)
4644
const p2 = _next(p1)
45+
const n0 = _child(p0)
46+
const n1 = _child(p1)
4747
const n2 = _child(p2)
4848
const x0 = _child(n0)
4949
const x1 = _child(n1)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ exports[`compiler: element transform > component > generate multi root component
2929
const t0 = _template("123")
3030
3131
export function render(_ctx, $props, $emit, $attrs, $slots) {
32-
const n1 = t0()
3332
const n0 = _createComponent(_ctx.Comp)
33+
const n1 = t0()
3434
return [n0, n1]
3535
}"
3636
`;
@@ -321,8 +321,8 @@ const t2 = _template("<form></form>")
321321
322322
export function render(_ctx) {
323323
const n1 = t1()
324-
const n0 = t0()
325324
const n3 = t2()
325+
const n0 = t0()
326326
const n2 = t2()
327327
_insert(n0, n1)
328328
_insert(n2, n3)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const t4 = _template("fine")
2525
const t5 = _template("<div> </div>")
2626
2727
export function render(_ctx) {
28-
const n13 = t5()
2928
const n0 = _createIf(() => (_ctx.ok), () => {
3029
const n2 = t0()
3130
return n2
@@ -38,6 +37,7 @@ export function render(_ctx) {
3837
const n11 = t4()
3938
return [n10, n11]
4039
}))
40+
const n13 = t5()
4141
const x13 = _child(n13)
4242
_renderEffect(() => _setText(x13, _toDisplayString(_ctx.text)))
4343
return [n0, n13]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,14 @@ export function render(_ctx) {
167167
const _component_Comp = _resolveComponent("Comp")
168168
const n5 = _createComponentWithFallback(_component_Comp, null, {
169169
"default": (_slotProps0) => {
170-
const n3 = t0()
171170
const n1 = _createComponentWithFallback(_component_Inner, null, {
172171
"default": (_slotProps1) => {
173172
const n0 = t0()
174173
_renderEffect(() => _setText(n0, _toDisplayString(_slotProps0["foo"] + _slotProps1["bar"] + _ctx.baz)))
175174
return n0
176175
}
177176
})
177+
const n3 = t0()
178178
_renderEffect(() => _setText(n3, " " + _toDisplayString(_slotProps0["foo"] + _ctx.bar + _ctx.baz)))
179179
return [n1, n3]
180180
}

0 commit comments

Comments
 (0)