\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let attr1 = ctx['id'];
return block1([attr1]);
}
@@ -126,9 +135,10 @@ exports[`t-call dynamic t-call: key is propagated 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
@@ -138,12 +148,13 @@ exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const call = app.callTemplate.bind(app);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
- const template1 = ('__template__999');
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
+ const template1 = ('xml_template_999');
const b2 = call(this, template1, ctx, node, key + \`__1\`);
let txt1 = ctx['counter'];
return block1([txt1], [b2]);
@@ -155,10 +166,11 @@ exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
lucas
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
const v1 = ctx['this'];
let hdlr1 = [()=>v1.update(), ctx];
return block1([hdlr1]);
@@ -170,11 +182,12 @@ exports[`t-call handlers are properly bound through a t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
- const callTemplate_1 = app.getTemplate(\`__template__999\`);
+ // Template name: \\"xml_template_1000\\"
+ const callTemplate_1 = app.getTemplate(\`xml_template_999\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
let txt1 = ctx['counter'];
return block1([txt1], [b2]);
@@ -186,10 +199,11 @@ exports[`t-call handlers are properly bound through a t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
lucas
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['update'], ctx];
return block1([hdlr1]);
}
@@ -200,11 +214,12 @@ exports[`t-call handlers with arguments are properly bound through a t-call 1`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
- const callTemplate_1 = app.getTemplate(\`__template__999\`);
+ // Template name: \\"xml_template_1000\\"
+ const callTemplate_1 = app.getTemplate(\`xml_template_999\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return block1([], [b2]);
}
@@ -215,10 +230,11 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
lucas
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
const v1 = ctx['this'];
const v2 = ctx['a'];
let hdlr1 = [()=>v1.update(v2), ctx];
@@ -231,11 +247,12 @@ exports[`t-call parent is set within t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
- const callTemplate_1 = app.getTemplate(\`__template__999\`);
+ // Template name: \\"xml_template_1001\\"
+ const callTemplate_1 = app.getTemplate(\`xml_template_999\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return block1([], [b2]);
}
@@ -246,9 +263,10 @@ exports[`t-call parent is set within t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
@@ -258,10 +276,11 @@ exports[`t-call parent is set within t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
lucas \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -271,9 +290,10 @@ exports[`t-call parent is set within t-call with no parentNode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
- const callTemplate_1 = app.getTemplate(\`__template__999\`);
+ // Template name: \\"xml_template_1001\\"
+ const callTemplate_1 = app.getTemplate(\`xml_template_999\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
return callTemplate_1.call(this, ctx, node, key + \`__1\`);
}
}"
@@ -283,9 +303,10 @@ exports[`t-call parent is set within t-call with no parentNode 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
}"
@@ -295,10 +316,11 @@ exports[`t-call parent is set within t-call with no parentNode 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
lucas \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -309,11 +331,12 @@ exports[`t-call recursive t-call binding this -- static t-call 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
const callTemplate_1 = app.getTemplate(\`recursive\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx = Object.create(ctx);
@@ -330,11 +353,12 @@ exports[`t-call recursive t-call binding this -- static t-call 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"recursive\\"
const callTemplate_1 = app.getTemplate(\`recursive\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function recursive(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let b2;
@@ -358,12 +382,13 @@ exports[`t-call sub components in two t-calls 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`sub\`);
const callTemplate_2 = app.getTemplate(\`sub\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['state'].val===1) {
b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
@@ -380,9 +405,10 @@ exports[`t-call sub components in two t-calls 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"sub\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function sub(ctx, node, key = \\"\\") {
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
}"
@@ -392,10 +418,11 @@ exports[`t-call sub components in two t-calls 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
@@ -407,11 +434,12 @@ exports[`t-call t-call in t-foreach and children component 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
- const callTemplate_1 = app.getTemplate(\`__template__999\`);
+ // Template name: \\"xml_template_1001\\"
+ const callTemplate_1 = app.getTemplate(\`xml_template_999\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(['a','b','c']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -433,9 +461,10 @@ exports[`t-call t-call in t-foreach and children component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999(ctx, node, key = \\"\\") {
return comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
}
}"
@@ -445,10 +474,11 @@ exports[`t-call t-call in t-foreach and children component 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
@@ -459,9 +489,10 @@ exports[`t-call t-call with t-call-context and subcomponent 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Root(ctx, node, key = \\"\\") {
let ctx1 = ctx['subctx'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -472,10 +503,11 @@ exports[`t-call t-call with t-call-context and subcomponent 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"someTemplate\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"name\\"]);
const comp2 = app.createComponent(\`Child\`, true, false, false, [\\"name\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function someTemplate(ctx, node, key = \\"\\") {
const b2 = comp1({name: ctx['aab']}, key + \`__1\`, node, this, null);
const b3 = comp2({name: ctx['lpe']}, key + \`__2\`, node, this, null);
return multi([b2, b3]);
@@ -487,8 +519,9 @@ exports[`t-call t-call with t-call-context and subcomponent 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = text(\`child\`);
const b3 = text(ctx['props'].name);
return multi([b2, b3]);
@@ -500,9 +533,10 @@ exports[`t-call t-call with t-call-context and subcomponent, in dev mode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Root(ctx, node, key = \\"\\") {
let ctx1 = ctx['subctx'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -513,10 +547,11 @@ exports[`t-call t-call with t-call-context and subcomponent, in dev mode 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"someTemplate\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"name\\"]);
const comp2 = app.createComponent(\`Child\`, true, false, false, [\\"name\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function someTemplate(ctx, node, key = \\"\\") {
const props1 = {name: ctx['aab']};
helpers.validateProps(\`Child\`, props1, this);
const b2 = comp1(props1, key + \`__1\`, node, this, null);
@@ -532,8 +567,9 @@ exports[`t-call t-call with t-call-context and subcomponent, in dev mode 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = text(\`child\`);
const b3 = text(ctx['props'].name);
return multi([b2, b3]);
@@ -545,9 +581,10 @@ exports[`t-call t-call with t-call-context, simple use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Root(ctx, node, key = \\"\\") {
let ctx1 = ctx['subctx'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -558,8 +595,9 @@ exports[`t-call t-call with t-call-context, simple use 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"someTemplate\\"
- return function template(ctx, node, key = \\"\\") {
+ return function someTemplate(ctx, node, key = \\"\\") {
const b2 = text(ctx['aab']);
const b3 = text(ctx['lpe']);
return multi([b2, b3]);
@@ -571,9 +609,10 @@ exports[`t-call t-call-context: ComponentNode is not looked up in the context 1`
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Root(ctx, node, key = \\"\\") {
let ctx1 = {method:function(){}};
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -585,6 +624,7 @@ exports[`t-call t-call-context: ComponentNode is not looked up in the context 2`
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, setContextValue, markRaw } = helpers;
+ // Template name: \\"someTemplate\\"
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
let block2 = createBlock(\`
outside slot
\`);
@@ -602,7 +642,7 @@ exports[`t-call t-call-context: ComponentNode is not looked up in the context 2`
return multi([b4, b5]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function someTemplate(ctx, node, key = \\"\\") {
let ref1 = (el) => this.__owl__.setRef((\`myRef\`), el);
const b2 = block2([ref1]);
const ctx1 = capture(ctx);
@@ -617,8 +657,9 @@ exports[`t-call t-call-context: ComponentNode is not looked up in the context 3`
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
@@ -628,9 +669,10 @@ exports[`t-call t-call-context: slots don't make component available again when
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`template\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Root(ctx, node, key = \\"\\") {
let ctx1 = {};
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -642,6 +684,7 @@ exports[`t-call t-call-context: slots don't make component available again when
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
+ // Template name: \\"template\\"
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
function slot1(ctx, node, key = \\"\\") {
@@ -665,8 +708,9 @@ exports[`t-call t-call-context: slots don't make component available again when
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
}"
@@ -676,9 +720,10 @@ exports[`t-call t-call-context: this is not available inside t-call-context 1`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Root(ctx, node, key = \\"\\") {
let ctx1 = {};
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
@@ -689,8 +734,9 @@ exports[`t-call t-call-context: this is not available inside t-call-context 2`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"someTemplate\\"
- return function template(ctx, node, key = \\"\\") {
+ return function someTemplate(ctx, node, key = \\"\\") {
return text(ctx['this']);
}
}"
diff --git a/tests/components/__snapshots__/t_call_block.test.ts.snap b/tests/components/__snapshots__/t_call_block.test.ts.snap
index 4d8fc03d..bf3a9c82 100644
--- a/tests/components/__snapshots__/t_call_block.test.ts.snap
+++ b/tests/components/__snapshots__/t_call_block.test.ts.snap
@@ -4,10 +4,11 @@ exports[`t-call-block simple t-call-block with static text 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const b2 = ctx['myBlock']();
return block1([], [b2]);
}
diff --git a/tests/components/__snapshots__/t_component.test.ts.snap b/tests/components/__snapshots__/t_component.test.ts.snap
index 6a9ef104..b7874568 100644
--- a/tests/components/__snapshots__/t_component.test.ts.snap
+++ b/tests/components/__snapshots__/t_component.test.ts.snap
@@ -4,11 +4,12 @@ exports[`t-component can switch between dynamic components without the need for
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(null, false, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_App(ctx, node, key = \\"\\") {
const Comp1 = ctx['constructor'].components[ctx['state'].child];
const b2 = toggler(Comp1, comp1({}, (Comp1).name + key + \`__1\`, node, this, Comp1));
return block1([], [b2]);
@@ -20,10 +21,11 @@ exports[`t-component can switch between dynamic components without the need for
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child a \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_A(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -33,10 +35,11 @@ exports[`t-component can switch between dynamic components without the need for
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
child b \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_B(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -46,9 +49,10 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(null, false, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
const tKey_1 = ctx['state'].child;
const Comp1 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp1, comp1({}, (Comp1).name + tKey_1 + key + \`__1\`, node, this, Comp1)));
@@ -60,10 +64,11 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child a \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_A(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -73,10 +78,11 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
child b
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_B(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -86,9 +92,10 @@ exports[`t-component can use dynamic components (the class) if given 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(null, false, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
const tKey_1 = ctx['state'].child;
const Comp1 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp1, comp1({}, (Comp1).name + tKey_1 + key + \`__1\`, node, this, Comp1)));
@@ -100,10 +107,11 @@ exports[`t-component can use dynamic components (the class) if given 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child a \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_A(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -113,10 +121,11 @@ exports[`t-component can use dynamic components (the class) if given 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
let block1 = createBlock(\`
child b \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_B(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -126,11 +135,12 @@ exports[`t-component modifying a sub widget 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(null, false, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_ParentWidget(ctx, node, key = \\"\\") {
const Comp1 = ctx['Counter'];
const b2 = toggler(Comp1, comp1({}, (Comp1).name + key + \`__1\`, node, this, Comp1));
return block1([], [b2]);
@@ -142,10 +152,11 @@ exports[`t-component modifying a sub widget 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
Inc
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Counter(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].counter;
const v1 = ctx['state'];
let hdlr1 = [()=>v1.counter++, ctx];
@@ -158,9 +169,10 @@ exports[`t-component switching dynamic component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(null, false, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
const Comp1 = ctx['Child'];
return toggler(Comp1, comp1({}, (Comp1).name + key + \`__1\`, node, this, Comp1));
}
@@ -171,10 +183,11 @@ exports[`t-component switching dynamic component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child a
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_ChildA(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -184,8 +197,9 @@ exports[`t-component switching dynamic component 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_ChildB(ctx, node, key = \\"\\") {
return text(\`child b\`);
}
}"
@@ -195,9 +209,10 @@ exports[`t-component t-component works in simple case 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(null, false, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const Comp1 = ctx['Child'];
return toggler(Comp1, comp1({}, (Comp1).name + key + \`__1\`, node, this, Comp1));
}
@@ -208,10 +223,11 @@ exports[`t-component t-component works in simple case 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
diff --git a/tests/components/__snapshots__/t_foreach.test.ts.snap b/tests/components/__snapshots__/t_foreach.test.ts.snap
index 819b7040..9a706f9e 100644
--- a/tests/components/__snapshots__/t_foreach.test.ts.snap
+++ b/tests/components/__snapshots__/t_foreach.test.ts.snap
@@ -5,12 +5,13 @@ exports[`list of components components in a node in a t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"item\\"]);
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -29,10 +30,11 @@ exports[`list of components components in a node in a t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].item;
return block1([txt1]);
}
@@ -44,9 +46,10 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, OwlError, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList([1,2]);;
const keys1 = new Set();
@@ -68,8 +71,9 @@ exports[`list of components crash on duplicate key in dev mode 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return text(\`\`);
}
}"
@@ -80,9 +84,10 @@ exports[`list of components crash when using object as keys that serialize to th
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, OwlError, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList([{},{}]);;
const keys1 = new Set();
@@ -104,8 +109,9 @@ exports[`list of components crash when using object as keys that serialize to th
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return text(\`\`);
}
}"
@@ -116,12 +122,13 @@ exports[`list of components list of sub components inside other nodes 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`SubComponent\`, true, false, false, []);
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].blips);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -140,10 +147,11 @@ exports[`list of components list of sub components inside other nodes 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
asdf \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SubComponent(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -154,6 +162,7 @@ exports[`list of components order is correct when slots are not of same type 1`]
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
let block2 = createBlock(\`
A
\`);
@@ -174,7 +183,7 @@ exports[`list of components order is correct when slots are not of same type 1`]
return text(\`C\`);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp1({slots: markRaw({'a': {__render: slot1.bind(this), __ctx: ctx1, active: !ctx['state'].active}, 'b': {__render: slot2.bind(this), __ctx: ctx1, active: true}, 'c': {__render: slot3.bind(this), __ctx: ctx1, active: ctx['state'].active}})}, key + \`__1\`, node, this, null);
}
@@ -186,8 +195,9 @@ exports[`list of components order is correct when slots are not of same type 2`]
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, callSlot, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['slotNames']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -206,11 +216,12 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"blip\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].s);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -238,10 +249,11 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].blip;
return block1([txt1]);
}
@@ -253,13 +265,14 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"row\\",\\"col\\"]);
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
let block5 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].rows);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -287,10 +300,11 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].row+'_'+ctx['props'].col;
return block1([txt1]);
}
@@ -302,9 +316,10 @@ exports[`list of components simple list 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['state'].elems);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -321,10 +336,11 @@ exports[`list of components simple list 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -336,11 +352,12 @@ exports[`list of components sub components rendered in a loop 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"n\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].numbers);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -358,10 +375,11 @@ exports[`list of components sub components rendered in a loop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].n;
return block1([txt1]);
}
@@ -373,11 +391,12 @@ exports[`list of components sub components with some state rendered in a loop 1`
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].numbers);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -395,10 +414,11 @@ exports[`list of components sub components with some state rendered in a loop 2`
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].n;
return block1([txt1]);
}
@@ -410,11 +430,12 @@ exports[`list of components switch component position 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['clist']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -432,10 +453,11 @@ exports[`list of components switch component position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -447,11 +469,12 @@ exports[`list of components t-foreach with t-component, and update 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(2));;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -470,10 +493,11 @@ exports[`list of components t-foreach with t-component, and update 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].val;
let txt2 = ctx['props'].val;
return block1([txt1, txt2]);
diff --git a/tests/components/__snapshots__/t_key.test.ts.snap b/tests/components/__snapshots__/t_key.test.ts.snap
index bde84761..09702532 100644
--- a/tests/components/__snapshots__/t_key.test.ts.snap
+++ b/tests/components/__snapshots__/t_key.test.ts.snap
@@ -5,11 +5,12 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['clist']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -28,10 +29,11 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -42,9 +44,10 @@ exports[`t-key t-key on Component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
}
@@ -55,10 +58,11 @@ exports[`t-key t-key on Component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -69,11 +73,12 @@ exports[`t-key t-key on Component as a function 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
const b2 = toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
return block1([], [b2]);
@@ -85,10 +90,11 @@ exports[`t-key t-key on Component as a function 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -99,12 +105,13 @@ exports[`t-key t-key on multiple Components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
const comp2 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key1'];
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
const tKey_2 = ctx['key2'];
@@ -118,10 +125,11 @@ exports[`t-key t-key on multiple Components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -133,12 +141,13 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
const callTemplate_2 = app.getTemplate(\`calledTemplate\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx = Object.create(ctx);
@@ -159,9 +168,10 @@ exports[`t-key t-key on multiple Components with t-call 1 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"calledTemplate\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function calledTemplate(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
}
@@ -172,10 +182,11 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
@@ -186,11 +197,12 @@ exports[`t-key t-key on multiple Components with t-call 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
return block1([], [b2]);
}
@@ -201,10 +213,11 @@ exports[`t-key t-key on multiple Components with t-call 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"calledTemplate\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
const comp2 = app.createComponent(\`Child\`, true, false, false, [\\"key\\"]);
- return function template(ctx, node, key = \\"\\") {
+ return function calledTemplate(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key1'];
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
const tKey_2 = ctx['key2'];
@@ -218,10 +231,11 @@ exports[`t-key t-key on multiple Components with t-call 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].key;
return block1([txt1]);
}
diff --git a/tests/components/__snapshots__/t_model.test.ts.snap b/tests/components/__snapshots__/t_model.test.ts.snap
index 7b30a6cb..b56baf80 100644
--- a/tests/components/__snapshots__/t_model.test.ts.snap
+++ b/tests/components/__snapshots__/t_model.test.ts.snap
@@ -5,10 +5,11 @@ exports[`t-model directive .lazy modifier 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -24,10 +25,11 @@ exports[`t-model directive .number modifier 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'number';
let prop1 = bExpr1[expr1];
@@ -43,10 +45,11 @@ exports[`t-model directive .trim modifier 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -62,10 +65,11 @@ exports[`t-model directive basic use, on an input 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -81,10 +85,11 @@ exports[`t-model directive basic use, on an input with bracket expression 1`] =
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -100,10 +105,11 @@ exports[`t-model directive basic use, on another key in component 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['some'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -119,10 +125,11 @@ exports[`t-model directive can also define t-on directive on same event, part 1
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -138,10 +145,11 @@ exports[`t-model directive can also define t-on directive on same event, part 2
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'choice';
let prop1 = bExpr1[expr1] === 'One';
@@ -167,10 +175,11 @@ exports[`t-model directive following a scope protecting directive (e.g. t-set) 1
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"admiral\\", 'Bruno');
@@ -188,11 +197,12 @@ exports[`t-model directive in a t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -215,11 +225,12 @@ exports[`t-model directive in a t-foreach, part 2 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -243,11 +254,12 @@ exports[`t-model directive in a t-foreach, part 3 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['names']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -271,10 +283,11 @@ exports[`t-model directive on a select 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
Please select one Red Blue Choice:
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'color';
let prop1 = bExpr1[expr1];
@@ -290,10 +303,11 @@ exports[`t-model directive on a select, initial state 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
Please select one Red Blue
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'color';
let prop1 = bExpr1[expr1];
@@ -308,10 +322,11 @@ exports[`t-model directive on a sub state key 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'].something;
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -327,10 +342,11 @@ exports[`t-model directive on an input type=radio 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
Choice:
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'choice';
let prop1 = bExpr1[expr1] === 'One';
@@ -350,10 +366,11 @@ exports[`t-model directive on an input type=radio, with initial value 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'choice';
let prop1 = bExpr1[expr1] === 'One';
@@ -372,10 +389,11 @@ exports[`t-model directive on an input, type=checkbox 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
let b2,b3;
const bExpr1 = ctx['state'];
const expr1 = 'flag';
@@ -396,10 +414,11 @@ exports[`t-model directive on an textarea 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -415,10 +434,11 @@ exports[`t-model directive t-model is applied before t-on-input 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -434,10 +454,11 @@ exports[`t-model directive t-model on an input with an undefined value 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'text';
let prop1 = bExpr1[expr1];
@@ -452,10 +473,11 @@ exports[`t-model directive t-model on select with static options 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'model';
let prop1 = bExpr1[expr1];
@@ -473,11 +495,12 @@ exports[`t-model directive t-model with dynamic number values on select options
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber, prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'value';
const bValue1 = bExpr1[expr1];
@@ -503,10 +526,11 @@ exports[`t-model directive t-model with dynamic values on select options -- 2 1`
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'model';
const bValue1 = bExpr1[expr1];
@@ -527,10 +551,11 @@ exports[`t-model directive t-model with dynamic values on select options -- 3 1`
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'model';
const bValue1 = bExpr1[expr1];
@@ -550,10 +575,11 @@ exports[`t-model directive t-model with dynamic values on select options 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'model';
const bValue1 = bExpr1[expr1];
@@ -574,11 +600,12 @@ exports[`t-model directive t-model with dynamic values on select options in fore
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber, prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Test(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'];
const expr1 = 'model';
const bValue1 = bExpr1[expr1];
@@ -604,11 +631,12 @@ exports[`t-model directive t-model with radio button group in t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['getData'], ctx];
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['options']);;
@@ -634,12 +662,13 @@ exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block2 = createBlock(\`
\`);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['state'].flag) {
const bExpr1 = ctx['state'];
@@ -665,10 +694,11 @@ exports[`t-model directive with expression having a changing key 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
const bExpr1 = ctx['state'].something;
const expr1 = ctx['text'].key;
let prop1 = bExpr1[expr1];
diff --git a/tests/components/__snapshots__/t_on.test.ts.snap b/tests/components/__snapshots__/t_on.test.ts.snap
index 7b81880f..3233b4d9 100644
--- a/tests/components/__snapshots__/t_on.test.ts.snap
+++ b/tests/components/__snapshots__/t_on.test.ts.snap
@@ -5,11 +5,12 @@ exports[`t-on t-on expression captured in t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
expr
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 0);
@@ -35,11 +36,12 @@ exports[`t-on t-on expression in t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
: Expr
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].values);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -64,11 +66,12 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
: Expr
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"bossa\\", 'nova');
@@ -98,11 +101,12 @@ exports[`t-on t-on method call in t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block3 = createBlock(\`
: meth call
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].values);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -127,12 +131,13 @@ exports[`t-on t-on on component next to t-on on div 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click\\":0});
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
let hdlr2 = [ctx['decrement'], ctx];
@@ -145,10 +150,11 @@ exports[`t-on t-on on component next to t-on on div 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -160,10 +166,11 @@ exports[`t-on t-on on components 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
return catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
}
@@ -174,10 +181,11 @@ exports[`t-on t-on on components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -189,10 +197,11 @@ exports[`t-on t-on on components and t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, createCatcher, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(['John','Raoul','Gérald']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -212,10 +221,11 @@ exports[`t-on t-on on components and t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -227,12 +237,13 @@ exports[`t-on t-on on components, variation 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click\\":0});
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
return block1([], [b2]);
@@ -244,10 +255,11 @@ exports[`t-on t-on on components, variation 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -259,10 +271,11 @@ exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click.prevent\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const hdlr1 = [\\"prevent\\", ctx['increment'], ctx];
return catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
}
@@ -273,10 +286,11 @@ exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -288,10 +302,11 @@ exports[`t-on t-on on components, with a handler update 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"value\\"]);
const catcher1 = createCatcher({\\"click\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"name\\", ctx['state'].name);
@@ -307,10 +322,11 @@ exports[`t-on t-on on components, with a handler update 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].value;
return block1([txt1]);
}
@@ -321,11 +337,12 @@ exports[`t-on t-on on destroyed components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = comp1({}, key + \`__1\`, node, this, null);
@@ -339,10 +356,11 @@ exports[`t-on t-on on destroyed components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['onClick'], ctx];
return block1([hdlr1]);
}
@@ -354,6 +372,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
let block1 = createBlock(\`
button \`);
@@ -362,7 +381,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
return block1();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
@@ -373,9 +392,10 @@ exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, createCatcher } = helpers;
+ // Template name: \\"xml_template_999\\"
const catcher1 = createCatcher({\\"click.prevent\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const hdlr1 = [\\"prevent\\", ctx['doSomething'], ctx];
return catcher1(callSlot(ctx, node, key, 'default', false, {}), [hdlr1]);
}
@@ -387,6 +407,7 @@ exports[`t-on t-on on t-set-slots 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, createCatcher, markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const catcher1 = createCatcher({\\"click\\":0});
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
@@ -401,7 +422,7 @@ exports[`t-on t-on on t-set-slots 1`] = `
return catcher1(multi([b6, b7]), [hdlr1]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = text(\` [\`);
const b3 = text(ctx['state'].count);
const b4 = text(\`] \`);
@@ -417,8 +438,9 @@ exports[`t-on t-on on t-set-slots 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'myslot', false, {});
}
}"
@@ -429,6 +451,7 @@ exports[`t-on t-on on t-slots 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, true, false, []);
let block1 = createBlock(\`
something
\`);
@@ -437,7 +460,7 @@ exports[`t-on t-on on t-slots 1`] = `
return block1();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
return comp1({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
@@ -448,9 +471,10 @@ exports[`t-on t-on on t-slots 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, createCatcher } = helpers;
+ // Template name: \\"xml_template_999\\"
const catcher1 = createCatcher({\\"click\\":0});
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = text(\` [\`);
const b3 = text(ctx['state'].count);
const b4 = text(\`] \`);
@@ -467,12 +491,13 @@ exports[`t-on t-on when first component child is an empty component 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"list\\"]);
const catcher1 = createCatcher({\\"click\\":0});
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['push'], ctx];
const hdlr2 = [()=>{}, ctx];
const b2 = catcher1(comp1({list: ctx['list']}, key + \`__1\`, node, this, null), [hdlr2]);
@@ -486,10 +511,11 @@ exports[`t-on t-on when first component child is an empty component 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
let block2 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['props'].list);;
for (let i1 = 0; i1 < l_block1; i1++) {
diff --git a/tests/components/__snapshots__/t_out.test.ts.snap b/tests/components/__snapshots__/t_out.test.ts.snap
index 3e2af694..dcd3c39f 100644
--- a/tests/components/__snapshots__/t_out.test.ts.snap
+++ b/tests/components/__snapshots__/t_out.test.ts.snap
@@ -5,13 +5,14 @@ exports[`components in t-out simple list 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, LazyValue, safeOutput, withKey } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
function value1(ctx, node, key = \\"\\") {
return comp1({}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx = Object.create(ctx);
@@ -31,8 +32,9 @@ exports[`components in t-out simple list 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return text(\`child\`);
}
}"
diff --git a/tests/components/__snapshots__/t_props.test.ts.snap b/tests/components/__snapshots__/t_props.test.ts.snap
index 7cc8efda..4da60431 100644
--- a/tests/components/__snapshots__/t_props.test.ts.snap
+++ b/tests/components/__snapshots__/t_props.test.ts.snap
@@ -4,11 +4,12 @@ exports[`t-props basic use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, true, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['some'].obj), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
@@ -19,10 +20,11 @@ exports[`t-props basic use 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a+ctx['props'].b;
return block1([txt1]);
}
@@ -33,9 +35,10 @@ exports[`t-props child receives a copy of the t-props object, not the original 1
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, true, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
return comp1(Object.assign({}, ctx['childProps']), key + \`__1\`, node, this, null);
}
}"
@@ -45,10 +48,11 @@ exports[`t-props child receives a copy of the t-props object, not the original 2
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -58,11 +62,12 @@ exports[`t-props t-props and other props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Comp\`, true, false, true, [\\"a\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['state1'], {a: ctx['a']}), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
@@ -73,10 +78,11 @@ exports[`t-props t-props and other props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a;
let txt2 = ctx['props'].b;
return block1([txt1, txt2]);
@@ -88,11 +94,12 @@ exports[`t-props t-props only 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Comp\`, true, false, true, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
@@ -103,10 +110,11 @@ exports[`t-props t-props only 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a;
return block1([txt1]);
}
@@ -117,11 +125,12 @@ exports[`t-props t-props with props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, true, [\\"a\\",\\"b\\"]);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
@@ -132,10 +141,11 @@ exports[`t-props t-props with props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
diff --git a/tests/components/__snapshots__/t_set.test.ts.snap b/tests/components/__snapshots__/t_set.test.ts.snap
index 7f023e06..174e2c9a 100644
--- a/tests/components/__snapshots__/t_set.test.ts.snap
+++ b/tests/components/__snapshots__/t_set.test.ts.snap
@@ -5,6 +5,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Childcomp\`, true, true, false, []);
let block1 = createBlock(\`
\`);
@@ -16,7 +17,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
return text('');
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 'source');
@@ -34,10 +35,11 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Childcomp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let txt1 = ctx['iter'];
@@ -53,6 +55,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(\`C\`, true, false, false, []);
const comp2 = app.createComponent(\`Child\`, true, true, false, []);
@@ -69,7 +72,7 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
return comp1({}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Comp(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
@@ -81,8 +84,9 @@ exports[`t-set slots with a t-set with a component in body 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_1000\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Child(ctx, node, key = \\"\\") {
const b2 = text(\`Child \`);
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
@@ -94,8 +98,9 @@ exports[`t-set slots with a t-set with a component in body 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_C(ctx, node, key = \\"\\") {
return text(\`C\`);
}
}"
@@ -106,6 +111,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
const comp2 = app.createComponent(\`Blorg\`, true, true, false, []);
@@ -126,7 +132,7 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
return multi([b3, b4]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Comp(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
@@ -138,8 +144,9 @@ exports[`t-set slots with an t-set with a component in body 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_1000\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Blorg(ctx, node, key = \\"\\") {
const b2 = text(\`Blorg \`);
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
@@ -151,8 +158,9 @@ exports[`t-set slots with an t-set with a component in body 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return text(\`Child\`);
}
}"
@@ -163,6 +171,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, markRaw } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
const comp2 = app.createComponent(\`Child\`, true, true, false, []);
@@ -177,7 +186,7 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
return comp1({}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Comp(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
@@ -189,8 +198,9 @@ exports[`t-set slots with an unused t-set with a component in body 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = text(\`Child \`);
const b3 = callSlot(ctx, node, key, 'default', false, {});
return multi([b2, b3]);
@@ -203,10 +213,11 @@ exports[`t-set t-set can't alter component even if key in component 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let txt1 = ctx['iter'];
@@ -222,10 +233,11 @@ exports[`t-set t-set can't alter component if key not in component 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let txt1 = ctx['iter'];
@@ -241,10 +253,11 @@ exports[`t-set t-set in t-if 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"flag\\", ctx['state'].flag);
@@ -266,11 +279,12 @@ exports[`t-set t-set not altered by child comp 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Childcomp\`, true, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 'source');
@@ -287,10 +301,11 @@ exports[`t-set t-set not altered by child comp 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Childcomp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let txt1 = ctx['iter'];
@@ -306,10 +321,11 @@ exports[`t-set t-set outside modified in t-if 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 0);
@@ -332,6 +348,7 @@ exports[`t-set t-set with a component in body 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block1 = createBlock(\`
\`);
@@ -340,7 +357,7 @@ exports[`t-set t-set with a component in body 1`] = `
return comp1({}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
@@ -354,8 +371,9 @@ exports[`t-set t-set with a component in body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return text(\`Child\`);
}
}"
@@ -366,6 +384,7 @@ exports[`t-set t-set with something in body 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
let block2 = createBlock(\`
coucou
\`);
@@ -374,7 +393,7 @@ exports[`t-set t-set with something in body 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Comp(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, this, node, key);
diff --git a/tests/components/error_handling.test.ts b/tests/components/error_handling.test.ts
index a444125c..088c4de7 100644
--- a/tests/components/error_handling.test.ts
+++ b/tests/components/error_handling.test.ts
@@ -156,15 +156,16 @@ describe("basics", () => {
} catch (e) {
error = e as Error;
}
- const expectedErrorMessage = `Failed to compile anonymous template: Unexpected identifier
+ const expectedErrorMessage = `Failed to compile template "xml_template_999": Unexpected identifier
generated code:
function(app, bdom, helpers) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: "xml_template_999"
let block1 = createBlock(\`
test
\`);
- return function template(ctx, node, key = "") {
+ return function xml_template_999_Comp(ctx, node, key = "") {
let attr1 = ctx['a']ctx['b'];
return block1([attr1]);
}
@@ -181,15 +182,16 @@ function(app, bdom, helpers) {
static components = { Child };
static template = xml`
`;
}
- const expectedErrorMessage = `Failed to compile anonymous template: Unexpected identifier
+ const expectedErrorMessage = `Failed to compile template "xml_template_999": Unexpected identifier
generated code:
function(app, bdom, helpers) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: "xml_template_999"
let block1 = createBlock(\`
test
\`);
- return function template(ctx, node, key = "") {
+ return function xml_template_999_Child(ctx, node, key = "") {
let attr1 = ctx['a']ctx['b'];
return block1([attr1]);
}
diff --git a/tests/misc/__snapshots__/portal.test.ts.snap b/tests/misc/__snapshots__/portal.test.ts.snap
index 5840ced6..1339bfc9 100644
--- a/tests/misc/__snapshots__/portal.test.ts.snap
+++ b/tests/misc/__snapshots__/portal.test.ts.snap
@@ -5,6 +5,7 @@ exports[`Portal Add and remove portals 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -14,7 +15,7 @@ exports[`Portal Add and remove portals 1`] = `
return multi([b3, b4]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['portalIds']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -33,6 +34,7 @@ exports[`Portal Add and remove portals on div 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -43,7 +45,7 @@ exports[`Portal Add and remove portals on div 1`] = `
return block2([txt1]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['portalIds']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -62,6 +64,7 @@ exports[`Portal Add and remove portals with t-foreach 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -73,7 +76,7 @@ exports[`Portal Add and remove portals with t-foreach 1`] = `
return multi([b4, b5]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['portalIds']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -94,6 +97,7 @@ exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -105,7 +109,7 @@ exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
return multi([b4, b5]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block1, v_block1, l_block1, c_block1] = prepareList(ctx['portalIds']);;
for (let i1 = 0; i1 < l_block1; i1++) {
@@ -126,6 +130,7 @@ exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -138,7 +143,7 @@ exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
return multi([b5, b6]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['portalIds']);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -159,11 +164,12 @@ exports[`Portal Child and Portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block3 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = comp1({}, key + \`__1\`, node, this, null);
const b3 = block3();
return multi([b2, b3]);
@@ -175,6 +181,7 @@ exports[`Portal Child and Portal 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -185,7 +192,7 @@ exports[`Portal Child and Portal 2`] = `
return block3();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = block2();
const b4 = comp1({target: '.portal',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return multi([b2, b4]);
@@ -198,6 +205,7 @@ exports[`Portal Portal composed with t-slot 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
+ // Template name: \\"xml_template_1001\\"
const comp1 = app.createComponent(\`Child2\`, true, false, false, [\\"customHandler\\"]);
const comp2 = app.createComponent(\`Child\`, true, true, false, []);
@@ -207,7 +215,7 @@ exports[`Portal Portal composed with t-slot 1`] = `
return comp1({customHandler: ctx['_handled']}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1001_Parent(ctx, node, key = \\"\\") {
const b3 = comp2({slots: markRaw({'default': {__render: slot1.bind(this), __ctx: ctx}})}, key + \`__2\`, node, this, null);
return block1([], [b3]);
}
@@ -219,6 +227,7 @@ exports[`Portal Portal composed with t-slot 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -226,7 +235,7 @@ exports[`Portal Portal composed with t-slot 2`] = `
return callSlot(ctx, node, key, 'default', false, {});
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Child(ctx, node, key = \\"\\") {
return comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
}
}"
@@ -236,10 +245,11 @@ exports[`Portal Portal composed with t-slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child2
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child2(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['onCustom'], ctx];
return block1([hdlr1]);
}
@@ -250,6 +260,7 @@ exports[`Portal basic use of portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -260,7 +271,7 @@ exports[`Portal basic use of portal 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -271,6 +282,7 @@ exports[`Portal basic use of portal in dev mode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -281,7 +293,7 @@ exports[`Portal basic use of portal in dev mode 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -292,6 +304,7 @@ exports[`Portal basic use of portal on div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -302,7 +315,7 @@ exports[`Portal basic use of portal on div 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -313,6 +326,7 @@ exports[`Portal basic use of portal, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -323,7 +337,7 @@ exports[`Portal basic use of portal, variation 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: ctx['target'],slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -334,6 +348,7 @@ exports[`Portal conditional use of Portal (with sub Component) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -344,7 +359,7 @@ exports[`Portal conditional use of Portal (with sub Component) 1`] = `
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2,b4;
b2 = block2();
if (ctx['state'].hasPortal) {
@@ -359,10 +374,11 @@ exports[`Portal conditional use of Portal (with sub Component) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
@@ -373,6 +389,7 @@ exports[`Portal conditional use of Portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -383,7 +400,7 @@ exports[`Portal conditional use of Portal 1`] = `
return block3();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
let b2,b4;
b2 = block2();
if (ctx['state'].hasPortal) {
@@ -398,9 +415,10 @@ exports[`Portal conditional use of Portal with child and div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
b2 = comp1({}, key + \`__1\`, node, this, null);
@@ -415,6 +433,7 @@ exports[`Portal conditional use of Portal with child and div 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -425,7 +444,7 @@ exports[`Portal conditional use of Portal with child and div 2`] = `
return block3();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
const [k_block2, v_block2, l_block2, c_block2] = prepareList([1]);;
for (let i1 = 0; i1 < l_block2; i1++) {
@@ -444,11 +463,12 @@ exports[`Portal conditional use of Portal with child and div, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block2 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
const b3 = comp1({}, key + \`__1\`, node, this, null);
@@ -464,6 +484,7 @@ exports[`Portal conditional use of Portal with child and div, variation 2`] = `
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -474,7 +495,7 @@ exports[`Portal conditional use of Portal with child and div, variation 2`] = `
return block4();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = block2();
ctx = Object.create(ctx);
const [k_block3, v_block3, l_block3, c_block3] = prepareList([1]);;
@@ -494,6 +515,7 @@ exports[`Portal conditional use of Portal with div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -504,7 +526,7 @@ exports[`Portal conditional use of Portal with div 1`] = `
return block3();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
@@ -519,6 +541,7 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 1`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -529,7 +552,7 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 1`]
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b3;
if (ctx['state'].hasChild) {
b3 = comp2({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
@@ -543,10 +566,11 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 2`]
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
@@ -557,11 +581,12 @@ exports[`Portal portal and Child 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
let block2 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b2 = block2();
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
@@ -573,6 +598,7 @@ exports[`Portal portal and Child 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -583,7 +609,7 @@ exports[`Portal portal and Child 2`] = `
return block3();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
const b2 = block2();
const b4 = comp1({target: '.portal',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return multi([b2, b4]);
@@ -595,6 +621,7 @@ exports[`Portal portal could have dynamically no content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -610,7 +637,7 @@ exports[`Portal portal could have dynamically no content 1`] = `
return multi([b3]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b4]);
}
@@ -621,6 +648,7 @@ exports[`Portal portal destroys on crash 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"error\\"]);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -631,7 +659,7 @@ exports[`Portal portal destroys on crash 1`] = `
return comp1({error: ctx['state'].error}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -642,10 +670,11 @@ exports[`Portal portal destroys on crash 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].error&&ctx['this'].will.crash;
return block1([txt1]);
}
@@ -656,6 +685,7 @@ exports[`Portal portal with child and props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -666,7 +696,7 @@ exports[`Portal portal with child and props 1`] = `
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -677,10 +707,11 @@ exports[`Portal portal with child and props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].val;
return block1([txt1]);
}
@@ -691,6 +722,7 @@ exports[`Portal portal with dynamic body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -709,7 +741,7 @@ exports[`Portal portal with dynamic body 1`] = `
return multi([b3, b4]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b5 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b5]);
}
@@ -720,6 +752,7 @@ exports[`Portal portal with many children 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -733,7 +766,7 @@ exports[`Portal portal with many children 1`] = `
return multi([b3, b4]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b5 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b5]);
}
@@ -744,6 +777,7 @@ exports[`Portal portal with no content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -757,7 +791,7 @@ exports[`Portal portal with no content 1`] = `
return multi([b3]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b4]);
}
@@ -768,6 +802,7 @@ exports[`Portal portal with only text as content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -777,7 +812,7 @@ exports[`Portal portal with only text as content 1`] = `
return text('only text');
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -788,6 +823,7 @@ exports[`Portal portal with target not in dom 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -798,7 +834,7 @@ exports[`Portal portal with target not in dom 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#does-not-exist',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -809,6 +845,7 @@ exports[`Portal portal's parent's env is not polluted 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, []);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -819,7 +856,7 @@ exports[`Portal portal's parent's env is not polluted 1`] = `
return comp1({}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -830,10 +867,11 @@ exports[`Portal portal's parent's env is not polluted 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
child \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -843,11 +881,12 @@ exports[`Portal simple catchError with portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const comp1 = app.createComponent(\`Boom\`, true, false, false, []);
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['error']) {
b2 = text(\`Error\`);
@@ -863,6 +902,7 @@ exports[`Portal simple catchError with portal 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -874,7 +914,7 @@ exports[`Portal simple catchError with portal 2`] = `
return block2([txt1]);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Boom(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -885,6 +925,7 @@ exports[`Portal with target in template (after portal) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -895,7 +936,7 @@ exports[`Portal with target in template (after portal) 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#local-target',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -906,6 +947,7 @@ exports[`Portal with target in template (before portal) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -916,7 +958,7 @@ exports[`Portal with target in template (before portal) 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: '#local-target',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -927,6 +969,7 @@ exports[`Portal: Props validation target must be a valid selector 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -937,7 +980,7 @@ exports[`Portal: Props validation target must be a valid selector 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: ' ',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -948,6 +991,7 @@ exports[`Portal: Props validation target must be a valid selector 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
@@ -958,7 +1002,7 @@ exports[`Portal: Props validation target must be a valid selector 2 1`] = `
return block2();
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Parent(ctx, node, key = \\"\\") {
const b3 = comp1({target: 'aa',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -969,6 +1013,7 @@ exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_1000\\"
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, [\\"val\\"]);
const comp2 = app.createComponent(null, false, true, false, false);
@@ -979,7 +1024,7 @@ exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_1000_Parent(ctx, node, key = \\"\\") {
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1.bind(this), __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
@@ -990,10 +1035,11 @@ exports[`Portal: UI/UX focus is kept across re-renders 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_Child(ctx, node, key = \\"\\") {
let attr1 = ctx['props'].val;
return block1([attr1]);
}
diff --git a/tests/shadow_dom/__snapshots__/shadow_dom.test.ts.snap b/tests/shadow_dom/__snapshots__/shadow_dom.test.ts.snap
index 60644d42..b3d07d0b 100644
--- a/tests/shadow_dom/__snapshots__/shadow_dom.test.ts.snap
+++ b/tests/shadow_dom/__snapshots__/shadow_dom.test.ts.snap
@@ -4,10 +4,11 @@ exports[`shadow_dom can bind event handler 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
Click \`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['add'], ctx];
return block1([hdlr1]);
}
@@ -18,10 +19,11 @@ exports[`shadow_dom can mount app 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
return block1();
}
}"
@@ -31,10 +33,11 @@ exports[`shadow_dom useRef hook 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
+ // Template name: \\"xml_template_999\\"
let block1 = createBlock(\`
\`);
- return function template(ctx, node, key = \\"\\") {
+ return function xml_template_999_SomeComponent(ctx, node, key = \\"\\") {
let ref1 = (el) => this.__owl__.setRef((\`refName\`), el);
return block1([ref1]);
}