Files
owl/tests/components/__snapshots__/concurrency.test.ts.snap
T

1972 lines
60 KiB
Plaintext
Raw Normal View History

2020-11-26 16:45:25 +01:00
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Cascading renders after microtaskTick 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
const b3 = text(\` _ \`);
ctx = Object.create(ctx);
const [k_block4, v_block4, l_block4, c_block4] = prepareList(ctx['state']);;
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`elem\`] = v_block4[i1];
const key1 = ctx['elem'].id;
c_block4[i1] = withKey(text(ctx['elem'].id), key1);
}
const b4 = list(c_block4);
return multi([b2, b3, b4]);
}
}"
`;
exports[`Cascading renders after microtaskTick 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Element\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['state']);;
for (let i1 = 0; i1 < l_block1; i1++) {
ctx[\`elem\`] = v_block1[i1];
const key1 = ctx['elem'].id;
c_block1[i1] = withKey(comp1({id: ctx['elem'].id}, key + \`__1__\${key1}\`, node, this, null), key1);
}
return list(c_block1);
}
}"
`;
exports[`Cascading renders after microtaskTick 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].id);
}
}"
`;
exports[`another scenario with delayed rendering 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`A\`);
if (ctx['state'].value<15) {
b3 = comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`another scenario with delayed rendering 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].value);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`another scenario with delayed rendering 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
return block1([hdlr1, txt1]);
}
}"
`;
2020-11-26 16:45:25 +01:00
exports[`async rendering destroying a widget before start is over 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div/>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
2021-10-15 10:58:29 +02:00
exports[`calling render in destroy 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-15 10:58:29 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
2021-10-15 10:58:29 +02:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
const tKey_1 = ctx['key'];
return toggler(tKey_1, comp1({fromA: ctx['state']}, tKey_1 + key + \`__1\`, node, this, null));
2021-10-15 10:58:29 +02:00
}
}"
`;
exports[`calling render in destroy 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-15 10:58:29 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
2021-10-15 10:58:29 +02:00
return function template(ctx, node, key = \\"\\") {
return comp1({fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2021-10-15 10:58:29 +02:00
}
}"
`;
exports[`calling render in destroy 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-15 10:58:29 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-10-15 10:58:29 +02:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/></div>\`);
2021-10-15 10:58:29 +02:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
return block1([txt1]);
2021-10-15 10:58:29 +02:00
}
}"
`;
2020-11-26 16:45:25 +01:00
exports[`change state and call manually render: no unnecessary rendering 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`changing state before first render does not trigger a render (with parent) 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`TestW\`, true, false, false, true);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
let b2;
if (ctx['state'].flag) {
b2 = comp1({}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
}
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`changing state before first render does not trigger a render (with parent) 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`changing state before first render does not trigger a render 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 1 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 1 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromB: ctx['state'].fromB}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 1 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['someValue']();
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 2 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].fromA;
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
return block1([txt1], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 2 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromB: ctx['state'].fromB}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 2 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['props'].fromB;
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 2bis 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 2bis 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromB: ctx['state'].fromB}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 2bis 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['props'].fromB;
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 3 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 3 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 3 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-child-0/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromC: ctx['state'].fromC}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 3 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['someValue']();
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 4 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 4 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 4 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-child-0/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromC: ctx['state'].fromC}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 4 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<i><block-text-0/><block-text-1/></i>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['someValue']();
return block1([txt1, txt2]);
2021-12-20 11:19:59 +01:00
}
}"
`;
exports[`concurrent renderings scenario 5 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-20 11:19:59 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2021-12-20 11:19:59 +01:00
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 5 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-text-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['someValue']();
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 6 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 6 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-text-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['someValue']();
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 7 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 7 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['someValue']();
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 8 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 8 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['state'].fromB;
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 9 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
const comp2 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/><block-child-0/><block-child-1/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].fromA;
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
const b3 = comp2({fromA: ctx['state'].fromA}, key + \`__2\`, node, this, null);
return block1([txt1], [b2, b3]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 9 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<b><block-text-0/></b>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 9 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentD\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['props'].fromA,fromC: ctx['state'].fromC}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 9 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['props'].fromC;
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 10 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 10 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = comp1({value: ctx['props'].value}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 10 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`concurrent renderings scenario 11 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({val: ctx['state'].valA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 11 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/>|<block-text-1/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
let txt2 = ctx['val'];
return block1([txt1, txt2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 12 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 12 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 13 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = comp1({}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
if (ctx['state'].bool) {
b3 = comp2({}, key + \`__2\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
return block1([], [b2, b3]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 13 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 14 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 14 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromB: ctx['state'].fromB,fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 14 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['props'].fromB;
let txt3 = ctx['state'].fromC;
return block1([txt1, txt2, txt3]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 15 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-20 11:19:59 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
}
}"
`;
2020-11-26 16:45:25 +01:00
exports[`concurrent renderings scenario 15 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({fromB: ctx['state'].fromB,fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
exports[`concurrent renderings scenario 15 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<p><span><block-text-0/></span><span><block-text-1/></span><span><block-text-2/></span></p>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].fromA;
let txt2 = ctx['props'].fromB;
let txt3 = ctx['state'].fromC;
return block1([txt1, txt2, txt3]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-01 13:12:01 +01:00
exports[`concurrent renderings scenario 16 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-01 13:12:01 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
2021-12-01 13:12:01 +01:00
return function template(ctx, node, key = \\"\\") {
return comp1({fromA: ctx['state'].fromA}, key + \`__1\`, node, this, null);
2021-12-01 13:12:01 +01:00
}
}"
`;
exports[`concurrent renderings scenario 16 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-01 13:12:01 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
2021-12-01 13:12:01 +01:00
2021-12-20 11:19:59 +01:00
return function template(ctx, node, key = \\"\\") {
return comp1({fromB: ctx['state'].fromB,fromA: ctx['props'].fromA}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
}
}"
`;
exports[`concurrent renderings scenario 16 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-20 11:19:59 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false, true);
2021-12-20 11:19:59 +01:00
2021-12-01 13:12:01 +01:00
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4,b5,b6,b7,b8;
b2 = text(ctx['props'].fromA);
b3 = text(\`:\`);
b4 = text(ctx['props'].fromB);
b5 = text(\`:\`);
b6 = text(ctx['state'].fromC);
b7 = text(\`: \`);
if (ctx['state'].fromC===13) {
b8 = comp1({}, key + \`__1\`, node, this, null);
2021-12-01 13:12:01 +01:00
}
return multi([b2, b3, b4, b5, b6, b7, b8]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`concurrent renderings scenario 16 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-01 13:12:01 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-12-01 13:12:01 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return text(\`D\`);
2021-12-01 13:12:01 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 1 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-01 13:12:01 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, true);
const comp2 = app.createComponent(\`ChildB\`, true, false, false, true);
2021-12-01 13:12:01 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
let b2,b3;
if (ctx['state'].flagA) {
b2 = comp1({}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
}
if (ctx['state'].flagB) {
b3 = comp2({}, key + \`__2\`, node, this, null);
2021-12-20 11:19:59 +01:00
}
return multi([b2, b3]);
2021-12-01 13:12:01 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 1 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['getValue']();
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 1 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span>b</span>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 2 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = comp1({val: ctx['state'].valA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
if (ctx['state'].flagB) {
b3 = comp2({val: ctx['state'].valB}, key + \`__2\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
2021-12-20 11:19:59 +01:00
return block1([], [b2, b3]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 2 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 2 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 3 (patching in the same frame) 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = comp1({val: ctx['state'].valA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
if (ctx['state'].flagB) {
b3 = comp2({val: ctx['state'].valB}, key + \`__2\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
return block1([], [b2, b3]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 3 (patching in the same frame) 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span>a<block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`creating two async components, scenario 3 (patching in the same frame) 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span>b<block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`delay willUpdateProps 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`delay willUpdateProps 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].value);
const b3 = text(\`_\`);
const b4 = text(ctx['state'].int);
return multi([b2, b3, b4]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`delay willUpdateProps with rendering grandchild 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Parent\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({state: ctx['state']}, key + \`__1\`, node, this, null);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`delay willUpdateProps with rendering grandchild 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`DelayedChild\`, true, false, false, false);
const comp2 = app.createComponent(\`ReactiveChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({value: ctx['props'].state.value}, key + \`__1\`, node, this, null);
const b3 = comp2({}, key + \`__2\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`delay willUpdateProps with rendering grandchild 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].value);
const b3 = text(\`_\`);
const b4 = text(ctx['state'].int);
2021-12-20 11:19:59 +01:00
return multi([b2, b3, b4]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`delay willUpdateProps with rendering grandchild 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div/>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return block1();
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`delayed fiber does not get rendered if it was cancelled 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`A\`);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed fiber does not get rendered if it was cancelled 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`B\`);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed fiber does not get rendered if it was cancelled 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`C\`);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed fiber does not get rendered if it was cancelled 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`D\`);
}
}"
`;
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].someValue+ctx['props'].value}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false, true);
let block3 = createBlock(\`<p><block-text-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
let txt1 = ctx['props'].value;
const b3 = block3([txt1]);
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, but then initial rendering is cancelled by yet another render 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
return block1([hdlr1, txt1]);
}
}"
`;
exports[`delayed rendering, destruction, stuff happens 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`A\`);
const b3 = comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, destruction, stuff happens 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`B\`);
if (ctx['state'].hasChild) {
b3 = comp1({value: ctx['state'].someValue+ctx['props'].value}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, destruction, stuff happens 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false, true);
let block4 = createBlock(\`<p><block-text-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`C\`);
const b3 = comp1({}, key + \`__1\`, node, this, null);
let txt1 = ctx['props'].value;
const b4 = block4([txt1]);
return multi([b2, b3, b4]);
}
}"
`;
exports[`delayed rendering, destruction, stuff happens 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`D\`);
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
const b3 = block3([hdlr1, txt1]);
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, reusing fiber and stuff 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`delayed rendering, reusing fiber and stuff 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].value);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, reusing fiber and stuff 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
return block1([hdlr1, txt1]);
}
}"
`;
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`A\`);
if (ctx['state'].value<15) {
b3 = comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].value);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, reusing fiber then component is destroyed and stuff 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
return block1([hdlr1, txt1]);
}
}"
`;
exports[`delayed rendering, then component is destroyed and stuff 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`delayed rendering, then component is destroyed and stuff 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(ctx['props'].value);
if (ctx['props'].value<10) {
b3 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`delayed rendering, then component is destroyed and stuff 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
return block1([hdlr1, txt1]);
}
}"
`;
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
const comp2 = app.createComponent(\`C\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\` A \`);
if (ctx['state'].flag) {
const b4 = comp1({value: ctx['state'].valueB}, key + \`__1\`, node, this, null);
const b5 = comp2({value: ctx['state'].valueC}, key + \`__2\`, node, this, null);
b3 = multi([b4, b5]);
}
return multi([b2, b3]);
}
}"
`;
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].value);
}
}"
`;
exports[`destroyed component causes other soon to be destroyed component to rerender, weird stuff happens 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['state'].val+ctx['props'].value);
}
}"
`;
exports[`destroying/recreating a subcomponent, other scenario 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`parent\`);
if (ctx['state'].hasChild) {
b3 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`destroying/recreating a subcomponent, other scenario 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`destroying/recreating a subwidget with different props (if start is not over) 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].val>1) {
b2 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`destroying/recreating a subwidget with different props (if start is not over) 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-25 10:47:50 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-11-25 10:47:50 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span>child:<block-text-0/></span>\`);
2021-11-25 10:47:50 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2021-11-25 10:47:50 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`parent and child rendered at exact same time 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-25 10:47:50 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
2021-11-25 10:47:50 +01:00
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
2021-11-25 10:47:50 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`parent and child rendered at exact same time 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return text(ctx['props'].value);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`properly behave when destroyed/unmounted while rendering 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
let b2;
if (ctx['state'].flag) {
b2 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
}
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`properly behave when destroyed/unmounted while rendering 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`SubChild\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({val: ctx['props'].val}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`properly behave when destroyed/unmounted while rendering 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div/>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`rendering component again in next microtick 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\">Click</button><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
let hdlr1 = [ctx['onClick'], ctx];
if (ctx['env'].config.flag) {
b2 = comp1({}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
}
return block1([hdlr1], [b2]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`rendering component again in next microtick 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div>Child</div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return block1();
2020-11-26 16:45:25 +01:00
}
}"
`;
exports[`rendering parent twice, with different props on child and stuff 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
exports[`rendering parent twice, with different props on child and stuff 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].value);
}
}"
`;
exports[`renderings, destruction, patch, stuff, ... yet another variation 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
const comp2 = app.createComponent(\`D\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`A\`);
const b3 = comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
const b4 = comp2({}, key + \`__2\`, node, this, null);
return multi([b2, b3, b4]);
}
}"
`;
exports[`renderings, destruction, patch, stuff, ... yet another variation 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`B\`);
if (ctx['props'].value===33) {
b3 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2, b3]);
}
}"
`;
exports[`renderings, destruction, patch, stuff, ... yet another variation 3`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<p block-handler-0=\\"click\\"><block-text-1/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`D\`);
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
const b3 = block3([hdlr1, txt1]);
return multi([b2, b3]);
}
}"
`;
exports[`renderings, destruction, patch, stuff, ... yet another variation 4`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<span block-handler-0=\\"click\\"><block-text-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`C\`);
let hdlr1 = [ctx['increment'], ctx];
let txt1 = ctx['state'].val;
const b3 = block3([hdlr1, txt1]);
return multi([b2, b3]);
}
}"
`;
exports[`t-foreach with dynamic async component 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(null, false, false, false, false);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['list']);;
for (let i1 = 0; i1 < l_block1; i1++) {
ctx[\`arr\`] = v_block1[i1];
ctx[\`arr_index\`] = i1;
const key1 = ctx['arr_index'];
let b3;
if (ctx['arr']) {
const Comp1 = ctx['myComp'];
b3 = toggler(Comp1, comp1({key: ctx['arr'][0]}, key + \`__1__\${key1}\`, node, this, Comp1));
}
c_block1[i1] = withKey(multi([b3]), key1);
}
return list(c_block1);
}
}"
`;
exports[`t-foreach with dynamic async component 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
}"
`;
exports[`t-key on dom node having a component 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
const Comp1 = ctx['myComp'];
const b2 = toggler(tKey_1, toggler(Comp1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, Comp1)));
return toggler(tKey_1, block1([], [b2]));
}
}"
`;
exports[`t-key on dom node having a component 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].key);
}
}"
`;
exports[`t-key on dynamic async component (toggler is never patched) 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, false);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
const Comp1 = ctx['myComp'];
return toggler(tKey_1, toggler(Comp1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, Comp1)));
}
}"
`;
exports[`t-key on dynamic async component (toggler is never patched) 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`two renderings initiated between willPatch and patched 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Panel\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/><block-child-0/></div>\`);
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
const tKey_1 = 'panel_'+ctx['state'].panel;
b2 = toggler(tKey_1, comp1({val: ctx['state'].panel}, tKey_1 + key + \`__1\`, node, this, null));
2020-11-26 16:45:25 +01:00
}
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`two renderings initiated between willPatch and patched 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<abc><block-text-0/><block-text-1/></abc>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
let txt2 = ctx['mounted'];
return block1([txt1, txt2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`two sequential renderings before an animation frame 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`two sequential renderings before an animation frame 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return text(ctx['props'].value);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`update a sub-component twice in the same frame 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({val: ctx['state'].valA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`update a sub-component twice in the same frame 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
2020-11-26 16:45:25 +01:00
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`update a sub-component twice in the same frame, 2 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2020-11-26 16:45:25 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
2020-11-26 16:45:25 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({val: ctx['state'].valA}, key + \`__1\`, node, this, null);
2020-11-26 16:45:25 +01:00
return block1([], [b2]);
}
}"
`;
2021-12-20 11:19:59 +01:00
exports[`update a sub-component twice in the same frame, 2 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-12-20 11:19:59 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['val']();
return block1([txt1]);
2021-12-20 11:19:59 +01:00
}
}"
`;