|
@@ -5,86 +5,106 @@ exports[`comile > bindings 1`] = `
|
|
|
import { template, children, insert, setText } from 'vue/vapor';
|
|
import { template, children, insert, setText } from 'vue/vapor';
|
|
|
const t0 = template(\`<div>count is <!>.</div>\`);
|
|
const t0 = template(\`<div>count is <!>.</div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
const {
|
|
const {
|
|
|
- 1: [n2],
|
|
|
|
|
- } = children(n0);
|
|
|
|
|
- const n1 = document.createTextNode(count.value);
|
|
|
|
|
- insert(n1, n0, n2);
|
|
|
|
|
|
|
+ 0: [
|
|
|
|
|
+ n1,
|
|
|
|
|
+ {
|
|
|
|
|
+ 1: [n3],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ } = children(root);
|
|
|
|
|
+ const n2 = document.createTextNode(count.value);
|
|
|
|
|
+ insert(n2, n1, n3);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setText(n1, undefined, count.value);
|
|
|
|
|
|
|
+ setText(n2, undefined, count.value);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-bind > simple expression 1`] = `
|
|
exports[`comile > directives > v-bind > simple expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setAttr } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setAttr } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setAttr(n0, 'id', undefined, id.value);
|
|
|
|
|
|
|
+ setAttr(n1, 'id', undefined, id.value);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-html > no expression 1`] = `
|
|
exports[`comile > directives > v-html > no expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setHtml } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setHtml } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setHtml(n0, undefined, '');
|
|
|
|
|
|
|
+ setHtml(n1, undefined, '');
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-html > simple expression 1`] = `
|
|
exports[`comile > directives > v-html > simple expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setHtml } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setHtml } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setHtml(n0, undefined, code.value);
|
|
|
|
|
|
|
+ setHtml(n1, undefined, code.value);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-on > simple expression 1`] = `
|
|
exports[`comile > directives > v-on > simple expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, on } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, on } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- on(n0, 'click', handleClick);
|
|
|
|
|
|
|
+ on(n1, 'click', handleClick);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-once > as root node 1`] = `
|
|
exports[`comile > directives > v-once > as root node 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setAttr } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setAttr } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setAttr(n0, 'id', undefined, foo);
|
|
|
|
|
|
|
+ setAttr(n1, 'id', undefined, foo);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
@@ -93,53 +113,82 @@ exports[`comile > directives > v-once > basic 1`] = `
|
|
|
"import { template, children, insert, setText, setAttr } from 'vue/vapor';
|
|
"import { template, children, insert, setText, setAttr } from 'vue/vapor';
|
|
|
const t0 = template(\`<div> <span></span></div>\`);
|
|
const t0 = template(\`<div> <span></span></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
const {
|
|
const {
|
|
|
- 1: [n2],
|
|
|
|
|
- } = children(n0);
|
|
|
|
|
- const n1 = document.createTextNode(msg.value);
|
|
|
|
|
- insert(n1, n0, 0 /* InsertPosition.FIRST */);
|
|
|
|
|
- setText(n1, undefined, msg.value);
|
|
|
|
|
- setAttr(n2, 'class', undefined, clz.value);
|
|
|
|
|
- return n0;
|
|
|
|
|
|
|
+ 0: [
|
|
|
|
|
+ n1,
|
|
|
|
|
+ {
|
|
|
|
|
+ 1: [n3],
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
|
|
+ } = children(root);
|
|
|
|
|
+ const n2 = document.createTextNode(msg.value);
|
|
|
|
|
+ insert(n2, n1, 0 /* InsertPosition.FIRST */);
|
|
|
|
|
+ setText(n2, undefined, msg.value);
|
|
|
|
|
+ setAttr(n3, 'class', undefined, clz.value);
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-text > no expression 1`] = `
|
|
exports[`comile > directives > v-text > no expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setText } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setText } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setText(n0, undefined, '');
|
|
|
|
|
|
|
+ setText(n1, undefined, '');
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > directives > v-text > simple expression 1`] = `
|
|
exports[`comile > directives > v-text > simple expression 1`] = `
|
|
|
"import { watchEffect } from 'vue';
|
|
"import { watchEffect } from 'vue';
|
|
|
-import { template, setText } from 'vue/vapor';
|
|
|
|
|
|
|
+import { template, children, setText } from 'vue/vapor';
|
|
|
const t0 = template(\`<div></div>\`);
|
|
const t0 = template(\`<div></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
- setText(n0, undefined, str.value);
|
|
|
|
|
|
|
+ setText(n1, undefined, str.value);
|
|
|
});
|
|
});
|
|
|
- return n0;
|
|
|
|
|
|
|
+ return root;
|
|
|
|
|
+}
|
|
|
|
|
+"
|
|
|
|
|
+`;
|
|
|
|
|
+
|
|
|
|
|
+exports[`comile > fragment 1`] = `
|
|
|
|
|
+"import { template, children } from 'vue/vapor';
|
|
|
|
|
+const t0 = template(\`<p></p><span></span><div></div>\`);
|
|
|
|
|
+export function render() {
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ 1: [n2],
|
|
|
|
|
+ 2: [n3],
|
|
|
|
|
+ } = children(root);
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|
|
|
|
|
|
|
|
exports[`comile > static template 1`] = `
|
|
exports[`comile > static template 1`] = `
|
|
|
-"import { template } from 'vue/vapor';
|
|
|
|
|
|
|
+"import { template, children } from 'vue/vapor';
|
|
|
const t0 = template(\`<div><p>hello</p><input><span></span></div>\`);
|
|
const t0 = template(\`<div><p>hello</p><input><span></span></div>\`);
|
|
|
export function render() {
|
|
export function render() {
|
|
|
- const n0 = t0();
|
|
|
|
|
- return n0;
|
|
|
|
|
|
|
+ const root = t0();
|
|
|
|
|
+ const {
|
|
|
|
|
+ 0: [n1],
|
|
|
|
|
+ } = children(root);
|
|
|
|
|
+ return root;
|
|
|
}
|
|
}
|
|
|
"
|
|
"
|
|
|
`;
|
|
`;
|