[REF] move component function to app, improve some code

This commit is contained in:
Géry Debongnie
2022-06-08 11:09:39 +02:00
committed by Sam Degueldre
parent 51538c2fea
commit 0e6059467f
53 changed files with 2522 additions and 1975 deletions
@@ -3,7 +3,7 @@
exports[`lifecycle hooks basic checks for a component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>test</span>\`);
@@ -16,13 +16,15 @@ exports[`lifecycle hooks basic checks for a component 1`] = `
exports[`lifecycle hooks component semantics 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false);
const comp2 = app.createComponent(\`C\`, true, false, false);
let block1 = createBlock(\`<div>A<block-child-0/><block-child-1/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`B\`, {}, key + \`__1\`, node, ctx);
const b3 = component(\`C\`, {}, key + \`__2\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, ctx, null);
const b3 = comp2({}, key + \`__2\`, node, ctx, null);
return block1([], [b2, b3]);
}
}"
@@ -31,7 +33,7 @@ exports[`lifecycle hooks component semantics 1`] = `
exports[`lifecycle hooks component semantics 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>B</div>\`);
@@ -44,17 +46,20 @@ exports[`lifecycle hooks component semantics 2`] = `
exports[`lifecycle hooks component semantics 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false);
const comp2 = app.createComponent(\`E\`, true, false, false);
const comp3 = app.createComponent(\`F\`, true, false, false);
let block1 = createBlock(\`<div>C<block-child-0/><block-child-1/><block-child-2/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4;
b2 = component(\`D\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
if (ctx['state'].flag) {
b3 = component(\`E\`, {}, key + \`__2\`, node, ctx);
b3 = comp2({}, key + \`__2\`, node, ctx, null);
} else {
b4 = component(\`F\`, {}, key + \`__3\`, node, ctx);
b4 = comp3({}, key + \`__3\`, node, ctx, null);
}
return block1([], [b2, b3, b4]);
}
@@ -64,7 +69,7 @@ exports[`lifecycle hooks component semantics 3`] = `
exports[`lifecycle hooks component semantics 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>D</div>\`);
@@ -77,7 +82,7 @@ exports[`lifecycle hooks component semantics 4`] = `
exports[`lifecycle hooks component semantics 5`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>E</div>\`);
@@ -90,7 +95,7 @@ exports[`lifecycle hooks component semantics 5`] = `
exports[`lifecycle hooks component semantics 6`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>F</div>\`);
@@ -103,14 +108,15 @@ exports[`lifecycle hooks component semantics 6`] = `
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block2 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
const b3 = component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
const b3 = comp1({n: ctx['state'].n}, key + \`__1\`, node, ctx, null);
b2 = block2([], [b3]);
}
return multi([b2]);
@@ -121,7 +127,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -135,12 +141,13 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].ok) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -150,7 +157,7 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -163,13 +170,14 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
exports[`lifecycle hooks destroy new children before being mountged 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4;
b2 = text(\`before\`);
if (ctx['state'].flag) {
b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b3 = comp1({}, key + \`__1\`, node, ctx, null);
}
b4 = text(\`after\`);
return multi([b2, b3, b4]);
@@ -180,7 +188,7 @@ exports[`lifecycle hooks destroy new children before being mountged 1`] = `
exports[`lifecycle hooks destroy new children before being mountged 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -191,12 +199,13 @@ exports[`lifecycle hooks destroy new children before being mountged 2`] = `
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -205,7 +214,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -218,10 +227,11 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Test\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Test\`, {rev: ctx['rev']}, key + \`__1\`, node, ctx);
return comp1({rev: ctx['rev']}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -229,7 +239,7 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].rev);
@@ -240,12 +250,13 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
exports[`lifecycle hooks lifecycle semantics 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {a: ctx['state'].a}, key + \`__1\`, node, ctx);
const b2 = comp1({a: ctx['state'].a}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -254,7 +265,7 @@ exports[`lifecycle hooks lifecycle semantics 1`] = `
exports[`lifecycle hooks lifecycle semantics 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -267,12 +278,13 @@ exports[`lifecycle hooks lifecycle semantics 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -282,10 +294,11 @@ exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -293,7 +306,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -306,12 +319,13 @@ exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -321,12 +335,13 @@ exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -336,10 +351,11 @@ exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -347,7 +363,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -360,12 +376,13 @@ exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -375,7 +392,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -388,10 +405,11 @@ exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx);
return comp1({value: ctx['state'].value}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -399,7 +417,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -412,7 +430,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -425,12 +443,13 @@ exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -440,7 +459,7 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child</div>\`);
@@ -453,12 +472,13 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -467,7 +487,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -480,14 +500,15 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return block1([], [b2]);
}
@@ -497,12 +518,13 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildChild\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`ChildChild\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -511,7 +533,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -524,10 +546,11 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks onWillRender 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {someValue: ctx['state'].value}, key + \`__1\`, node, ctx);
return comp1({someValue: ctx['state'].value}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -535,7 +558,7 @@ exports[`lifecycle hooks onWillRender 1`] = `
exports[`lifecycle hooks onWillRender 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
@@ -550,12 +573,13 @@ exports[`lifecycle hooks onWillRender 2`] = `
exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {a: ctx['state'].a}, key + \`__1\`, node, ctx);
const b2 = comp1({a: ctx['state'].a}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -564,7 +588,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -577,7 +601,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
exports[`lifecycle hooks patched hook is called after updating State 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -591,7 +615,7 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
exports[`lifecycle hooks render in mounted 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -605,7 +629,7 @@ exports[`lifecycle hooks render in mounted 1`] = `
exports[`lifecycle hooks render in patched 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -619,7 +643,7 @@ exports[`lifecycle hooks render in patched 1`] = `
exports[`lifecycle hooks render in willPatch 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -633,12 +657,13 @@ exports[`lifecycle hooks render in willPatch 1`] = `
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
}
return multi([b2]);
}
@@ -648,7 +673,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -661,7 +686,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span/>\`);
@@ -674,12 +699,13 @@ exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
const props1 = {prop: ctx['state'].prop};
helpers.validateProps(\`Child\`, props1, ctx);
return component(\`Child\`, props1, key + \`__1\`, node, ctx);
return comp1(props1, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -687,7 +713,7 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -698,12 +724,13 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
const b2 = comp1({n: ctx['state'].n}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -712,12 +739,13 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildChild\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`ChildChild\`, {n: ctx['props'].n}, key + \`__1\`, node, ctx);
const b2 = comp1({n: ctx['props'].n}, key + \`__1\`, node, ctx, null);
return block1([], [b2]);
}
}"
@@ -726,7 +754,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -740,10 +768,11 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -751,7 +780,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -764,7 +793,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
exports[`lifecycle hooks willStart is called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>simple vnode</span>\`);
@@ -777,7 +806,7 @@ exports[`lifecycle hooks willStart is called 1`] = `
exports[`lifecycle hooks willStart is called with component as this 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>simple vnode</span>\`);
@@ -790,7 +819,8 @@ exports[`lifecycle hooks willStart is called with component as this 1`] = `
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block3 = createBlock(\`<div/>\`);
@@ -798,7 +828,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['state'].ok) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, ctx, null);
} else {
b3 = block3();
}
@@ -810,7 +840,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -823,10 +853,11 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
return comp1({n: ctx['state'].n}, key + \`__1\`, node, ctx, null);
}
}"
`;
@@ -834,7 +865,7 @@ exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
exports[`lifecycle hooks willUpdateProps hook is called 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);