From e4a0277f683847b34f41b2bec26117f5505a71cc Mon Sep 17 00:00:00 2001 From: Mathieu Duckerts-Antoine Date: Tue, 19 Oct 2021 11:00:26 +0200 Subject: [PATCH] [FIX] qweb: t-set directive This commit reintroduces some tests for the t-set directive and make them pass. For that, it was necessary to adapt the qweb compiler in order to get the following behaviors: A t-set can affect parent contexts (up to the first parent tagged as boundary) when the key changed is found in one of the parent contexts. Some context are marked as boundaries in such a way that - rendering contexts (e.g. components) cannot be modified via a t-set. - a t-set in a t-call body or in a called template can never change a context above the t-call context. Code prettification has been done. Snapshots have been modified. --- src/qweb/compiler.ts | 7 +- src/qweb/inline_expressions.ts | 7 +- src/qweb/template_helpers.ts | 18 + .../components/__snapshots__/app.test.ts.snap | 2 +- .../__snapshots__/basics.test.ts.snap | 136 ++++---- .../__snapshots__/concurrency.test.ts.snap | 154 ++++----- .../__snapshots__/error_handling.test.ts.snap | 4 +- .../__snapshots__/event_handling.test.ts.snap | 10 +- .../higher_order_component.test.ts.snap | 26 +- .../__snapshots__/lifecycle.test.ts.snap | 92 +++--- .../__snapshots__/props.test.ts.snap | 27 +- .../__snapshots__/refs.test.ts.snap | 4 +- .../__snapshots__/slots.test.ts.snap | 255 ++++++++------- .../__snapshots__/style_class.test.ts.snap | 64 ++-- .../__snapshots__/t_call.test.ts.snap | 39 +-- .../__snapshots__/t_call_block.test.ts.snap | 2 +- .../__snapshots__/t_component.test.ts.snap | 34 +- .../__snapshots__/t_foreach.test.ts.snap | 32 +- .../__snapshots__/t_on.test.ts.snap | 22 +- .../__snapshots__/t_set.test.ts.snap | 174 ++++++++++ tests/components/error_handling.test.ts | 15 +- tests/components/style_class.test.ts | 3 +- tests/components/t_set.test.ts | 155 +++++++++ tests/misc/__snapshots__/memo.test.ts.snap | 10 +- tests/misc/__snapshots__/portal.test.ts.snap | 44 +-- .../__snapshots__/attributes.test.ts.snap | 99 +++--- .../qweb/__snapshots__/comments.test.ts.snap | 6 +- .../__snapshots__/event_handling.test.ts.snap | 44 +-- tests/qweb/__snapshots__/misc.test.ts.snap | 19 +- .../simple_templates.test.ts.snap | 48 +-- tests/qweb/__snapshots__/t_call.test.ts.snap | 199 ++++++----- .../__snapshots__/t_debug_log.test.ts.snap | 7 +- tests/qweb/__snapshots__/t_esc.test.ts.snap | 26 +- .../qweb/__snapshots__/t_foreach.test.ts.snap | 43 +-- tests/qweb/__snapshots__/t_if.test.ts.snap | 63 ++-- tests/qweb/__snapshots__/t_raw.test.ts.snap | 25 +- tests/qweb/__snapshots__/t_ref.test.ts.snap | 14 +- tests/qweb/__snapshots__/t_set.test.ts.snap | 308 +++++++++++++++--- .../__snapshots__/translation.test.ts.snap | 36 +- .../__snapshots__/white_space.test.ts.snap | 12 +- tests/qweb/t_set.test.ts | 97 +++++- 41 files changed, 1557 insertions(+), 825 deletions(-) create mode 100644 tests/components/__snapshots__/t_set.test.ts.snap create mode 100644 tests/components/t_set.test.ts diff --git a/src/qweb/compiler.ts b/src/qweb/compiler.ts index 8860b653..411d0742 100644 --- a/src/qweb/compiler.ts +++ b/src/qweb/compiler.ts @@ -274,7 +274,7 @@ export class QWebCompiler { // define blocks and utility functions this.addLine(`let { text, createBlock, list, multi, html, toggler, component } = bdom;`); this.addLine( - `let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers;` + `let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;` ); if (this.shouldDefineAssign) { this.addLine(`let assign = Object.assign;`); @@ -308,6 +308,7 @@ export class QWebCompiler { } if (this.shouldProtectScope) { this.addLine(` ctx = Object.create(ctx);`); + this.addLine(` ctx[isBoundary] = 1`); } if (this.target.hasCache) { this.addLine(` let cache = ctx.cache || {};`); @@ -815,9 +816,9 @@ export class QWebCompiler { compileTCall(ast: ASTTCall, ctx: Context) { let { block, forceNewBlock } = ctx; - // this.hasTCall = true; if (ast.body) { this.addLine(`ctx = Object.create(ctx);`); + this.addLine(`ctx[isBoundary] = 1;`); const nextId = BlockDescription.nextBlockId; const subCtx: Context = createContext(ctx, { preventRoot: true }); this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx); @@ -883,7 +884,7 @@ export class QWebCompiler { } else { value = expr; } - this.addLine(`ctx[\`${ast.name}\`] = ${value};`); + this.addLine(`setContextValue(ctx, "${ast.name}", ${value});`); } } diff --git a/src/qweb/inline_expressions.ts b/src/qweb/inline_expressions.ts index 2474c414..24a533d8 100644 --- a/src/qweb/inline_expressions.ts +++ b/src/qweb/inline_expressions.ts @@ -25,9 +25,10 @@ // Misc types, constants and helpers //------------------------------------------------------------------------------ -const RESERVED_WORDS = "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,eval,void,Math,RegExp,Array,Object,Date".split( - "," -); +const RESERVED_WORDS = + "true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,eval,void,Math,RegExp,Array,Object,Date".split( + "," + ); const WORD_REPLACEMENT: { [key: string]: string } = Object.assign(Object.create(null), { and: "&&", diff --git a/src/qweb/template_helpers.ts b/src/qweb/template_helpers.ts index 8c178974..2978969b 100644 --- a/src/qweb/template_helpers.ts +++ b/src/qweb/template_helpers.ts @@ -65,16 +65,34 @@ function prepareList(collection: any): [any[], any[], number, any[]] { const n = values.length; return [keys, values, n, new Array(n)]; } + +const isBoundary = Symbol("isBoundary"); + +function setContextValue(ctx: { [key: string]: any }, key: string, value: any): void { + const ctx0 = ctx; + while (!ctx.hasOwnProperty(key) && !ctx.hasOwnProperty(isBoundary)) { + const newCtx = ctx.__proto__; + if (!newCtx) { + ctx = ctx0; + break; + } + ctx = newCtx; + } + ctx[key] = value; +} + export const UTILS = { // elem, // setText, withDefault, zero: Symbol("zero"), + isBoundary, callSlot, capture, // toClassObj, withKey, prepareList, + setContextValue, shallowEqual, }; diff --git a/tests/components/__snapshots__/app.test.ts.snap b/tests/components/__snapshots__/app.test.ts.snap index 03f8245d..e837bd88 100644 --- a/tests/components/__snapshots__/app.test.ts.snap +++ b/tests/components/__snapshots__/app.test.ts.snap @@ -4,7 +4,7 @@ exports[`app destroy remove the widget from the DOM 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/basics.test.ts.snap b/tests/components/__snapshots__/basics.test.ts.snap index 327a35e6..4744b613 100644 --- a/tests/components/__snapshots__/basics.test.ts.snap +++ b/tests/components/__snapshots__/basics.test.ts.snap @@ -4,7 +4,7 @@ exports[`basics Multi root component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block2 = createBlock(\`1\`); let block4 = createBlock(\`2\`); @@ -22,7 +22,7 @@ exports[`basics a class component inside a class component, no external dom 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -36,7 +36,7 @@ exports[`basics a class component inside a class component, no external dom 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -48,7 +48,7 @@ exports[`basics a component cannot be mounted in a detached node 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -62,7 +62,7 @@ exports[`basics a component inside a component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -76,7 +76,7 @@ exports[`basics a component inside a component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -91,7 +91,7 @@ exports[`basics can be clicked on and updated 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -108,7 +108,7 @@ exports[`basics can handle empty props 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -123,7 +123,7 @@ exports[`basics can handle empty props 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -138,7 +138,7 @@ exports[`basics can mount a component with just some text 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`just text\`); @@ -150,7 +150,7 @@ exports[`basics can mount a component with no text 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`\`); @@ -162,7 +162,7 @@ exports[`basics can mount a simple component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -176,7 +176,7 @@ exports[`basics can mount a simple component with multiple roots 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block2 = createBlock(\`\`); let block3 = createBlock(\`
\`); @@ -193,7 +193,7 @@ exports[`basics can mount a simple component with props 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -208,7 +208,7 @@ exports[`basics cannot mount on a documentFragment 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
content
\`); @@ -222,7 +222,7 @@ exports[`basics child can be updated 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(ctx['props'].value); @@ -234,7 +234,7 @@ exports[`basics child can be updated 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {value: ctx['state'].counter}, key + \`__1\`, node, ctx); @@ -246,7 +246,7 @@ exports[`basics class component with dynamic text 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`My value: \`); @@ -261,7 +261,7 @@ exports[`basics class parent, class child component with props 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -276,7 +276,7 @@ exports[`basics class parent, class child component with props 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {value: 42}, key + \`__1\`, node, ctx); @@ -288,7 +288,7 @@ exports[`basics component with dynamic content can be updated 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -303,7 +303,7 @@ exports[`basics do not remove previously rendered dom if not necessary 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -317,7 +317,7 @@ exports[`basics do not remove previously rendered dom if not necessary, variatio "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

h1

\`); @@ -370,7 +370,7 @@ exports[`basics has no el after creation 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple\`); @@ -384,7 +384,7 @@ exports[`basics higher order components parent and child 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
a
\`); @@ -398,7 +398,7 @@ exports[`basics higher order components parent and child 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`b\`); @@ -412,7 +412,7 @@ exports[`basics higher order components parent and child 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2,b3; @@ -430,7 +430,7 @@ exports[`basics higher order components parent and child 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {child: ctx['state'].child}, key + \`__1\`, node, ctx); @@ -442,7 +442,7 @@ exports[`basics list of two sub components inside other nodes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`asdf\`); @@ -456,7 +456,7 @@ exports[`basics list of two sub components inside other nodes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block3 = createBlock(\`
\`); @@ -481,7 +481,7 @@ exports[`basics parent, child and grandchild 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
hey
\`); @@ -495,7 +495,7 @@ exports[`basics parent, child and grandchild 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -507,7 +507,7 @@ exports[`basics parent, child and grandchild 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -519,7 +519,7 @@ exports[`basics props is set on root component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -533,7 +533,7 @@ exports[`basics reconciliation alg is not confused in some specific situation 1` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child\`); @@ -547,7 +547,7 @@ exports[`basics reconciliation alg is not confused in some specific situation 2` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -563,7 +563,7 @@ exports[`basics rerendering a widget with a sub widget 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -580,7 +580,7 @@ exports[`basics rerendering a widget with a sub widget 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Counter\`, {}, key + \`__1\`, node, ctx); @@ -592,7 +592,7 @@ exports[`basics same t-keys in two different places 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -607,7 +607,7 @@ exports[`basics same t-keys in two different places 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -623,7 +623,7 @@ exports[`basics simple component with a dynamic text 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -638,7 +638,7 @@ exports[`basics simple component, useState 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -653,7 +653,7 @@ exports[`basics some simple sanity checks (el/status) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -667,7 +667,7 @@ exports[`basics sub components between t-ifs 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child\`); @@ -681,7 +681,7 @@ exports[`basics sub components between t-ifs 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block2 = createBlock(\`

hey

\`); @@ -708,7 +708,7 @@ exports[`basics t-elif works with t-component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`hey\`); @@ -722,7 +722,7 @@ exports[`basics t-elif works with t-component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block2 = createBlock(\`
somediv
\`); @@ -743,7 +743,7 @@ exports[`basics t-else with empty string works with t-component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`hey\`); @@ -757,7 +757,7 @@ exports[`basics t-else with empty string works with t-component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block2 = createBlock(\`
somediv
\`); @@ -778,7 +778,7 @@ exports[`basics t-else works with t-component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`hey\`); @@ -792,7 +792,7 @@ exports[`basics t-else works with t-component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block2 = createBlock(\`
somediv
\`); @@ -813,7 +813,7 @@ exports[`basics t-if works with t-component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`hey\`); @@ -827,7 +827,7 @@ exports[`basics t-if works with t-component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -845,7 +845,7 @@ exports[`basics t-key on a component with t-if, and a sibling component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child\`); @@ -859,7 +859,7 @@ exports[`basics t-key on a component with t-if, and a sibling component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -878,7 +878,7 @@ exports[`basics text after a conditional component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

simple vnode

\`); @@ -892,7 +892,7 @@ exports[`basics text after a conditional component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -911,7 +911,7 @@ exports[`basics three level of components with collapsing root nodes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
2
\`); @@ -925,7 +925,7 @@ exports[`basics three level of components with collapsing root nodes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -937,7 +937,7 @@ exports[`basics three level of components with collapsing root nodes 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -949,7 +949,7 @@ exports[`basics throws if mounting on target=null 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -963,7 +963,7 @@ exports[`basics two child components 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -977,7 +977,7 @@ exports[`basics two child components 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -991,7 +991,7 @@ exports[`basics updating a component with t-foreach as root 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); @@ -1010,7 +1010,7 @@ exports[`basics widget after a t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1024,7 +1024,7 @@ exports[`basics widget after a t-foreach 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1049,7 +1049,7 @@ exports[`basics zero or one child components 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -1063,7 +1063,7 @@ exports[`basics zero or one child components 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; diff --git a/tests/components/__snapshots__/concurrency.test.ts.snap b/tests/components/__snapshots__/concurrency.test.ts.snap index f2fabfde..dc991183 100644 --- a/tests/components/__snapshots__/concurrency.test.ts.snap +++ b/tests/components/__snapshots__/concurrency.test.ts.snap @@ -4,7 +4,7 @@ exports[`async rendering destroying a widget before start is over 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -18,7 +18,7 @@ exports[`calling render in destroy 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, inTCall, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -57,7 +57,7 @@ exports[`change state and call manually render: no unnecessary rendering 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -72,7 +72,7 @@ exports[`changing state before first render does not trigger a render (with pare "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -87,7 +87,7 @@ exports[`changing state before first render does not trigger a render (with pare "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -105,7 +105,7 @@ exports[`changing state before first render does not trigger a render 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -120,7 +120,7 @@ exports[`concurrent renderings scenario 1 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -136,7 +136,7 @@ exports[`concurrent renderings scenario 1 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -151,7 +151,7 @@ exports[`concurrent renderings scenario 1 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -166,7 +166,7 @@ exports[`concurrent renderings scenario 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -182,7 +182,7 @@ exports[`concurrent renderings scenario 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -197,7 +197,7 @@ exports[`concurrent renderings scenario 2 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -213,7 +213,7 @@ exports[`concurrent renderings scenario 2bis 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -229,7 +229,7 @@ exports[`concurrent renderings scenario 2bis 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -244,7 +244,7 @@ exports[`concurrent renderings scenario 2bis 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -259,7 +259,7 @@ exports[`concurrent renderings scenario 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -275,7 +275,7 @@ exports[`concurrent renderings scenario 3 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -290,7 +290,7 @@ exports[`concurrent renderings scenario 3 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -305,7 +305,7 @@ exports[`concurrent renderings scenario 3 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -320,7 +320,7 @@ exports[`concurrent renderings scenario 4 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -336,7 +336,7 @@ exports[`concurrent renderings scenario 4 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -351,7 +351,7 @@ exports[`concurrent renderings scenario 4 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -366,7 +366,7 @@ exports[`concurrent renderings scenario 4 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -381,7 +381,7 @@ exports[`concurrent renderings scenario 5 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -396,7 +396,7 @@ exports[`concurrent renderings scenario 5 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -411,7 +411,7 @@ exports[`concurrent renderings scenario 6 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -426,7 +426,7 @@ exports[`concurrent renderings scenario 6 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -441,7 +441,7 @@ exports[`concurrent renderings scenario 7 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -457,7 +457,7 @@ exports[`concurrent renderings scenario 7 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -472,7 +472,7 @@ exports[`concurrent renderings scenario 8 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -488,7 +488,7 @@ exports[`concurrent renderings scenario 8 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -503,7 +503,7 @@ exports[`concurrent renderings scenario 9 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -519,7 +519,7 @@ exports[`concurrent renderings scenario 9 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -534,7 +534,7 @@ exports[`concurrent renderings scenario 9 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -549,7 +549,7 @@ exports[`concurrent renderings scenario 9 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -566,7 +566,7 @@ exports[`concurrent renderings scenario 10 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -581,7 +581,7 @@ exports[`concurrent renderings scenario 10 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -599,7 +599,7 @@ exports[`concurrent renderings scenario 10 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -614,7 +614,7 @@ exports[`concurrent renderings scenario 11 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`|\`); @@ -630,7 +630,7 @@ exports[`concurrent renderings scenario 11 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -645,7 +645,7 @@ exports[`concurrent renderings scenario 12 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -660,7 +660,7 @@ exports[`concurrent renderings scenario 12 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -675,7 +675,7 @@ exports[`concurrent renderings scenario 13 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -690,7 +690,7 @@ exports[`concurrent renderings scenario 13 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -709,7 +709,7 @@ exports[`concurrent renderings scenario 14 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -726,7 +726,7 @@ exports[`concurrent renderings scenario 14 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -741,7 +741,7 @@ exports[`concurrent renderings scenario 14 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -756,7 +756,7 @@ exports[`concurrent renderings scenario 15 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -773,7 +773,7 @@ exports[`concurrent renderings scenario 15 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -788,7 +788,7 @@ exports[`concurrent renderings scenario 15 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -803,7 +803,7 @@ exports[`concurrent renderings scenario 16 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    DDD
\`); @@ -817,7 +817,7 @@ exports[`concurrent renderings scenario 16 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -838,7 +838,7 @@ exports[`concurrent renderings scenario 16 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -853,7 +853,7 @@ exports[`concurrent renderings scenario 16 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -868,7 +868,7 @@ exports[`creating two async components, scenario 1 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -883,7 +883,7 @@ exports[`creating two async components, scenario 1 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`b\`); @@ -897,7 +897,7 @@ exports[`creating two async components, scenario 1 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2,b3; @@ -916,7 +916,7 @@ exports[`creating two async components, scenario 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`a\`); @@ -931,7 +931,7 @@ exports[`creating two async components, scenario 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`b\`); @@ -946,7 +946,7 @@ exports[`creating two async components, scenario 2 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -965,7 +965,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`a\`); @@ -980,7 +980,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`b\`); @@ -995,7 +995,7 @@ exports[`creating two async components, scenario 3 (patching in the same frame) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1014,7 +1014,7 @@ exports[`destroying/recreating a subwidget with different props (if start is not "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child:\`); @@ -1029,7 +1029,7 @@ exports[`destroying/recreating a subwidget with different props (if start is not "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1047,7 +1047,7 @@ exports[`properly behave when destroyed/unmounted while rendering 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1061,7 +1061,7 @@ exports[`properly behave when destroyed/unmounted while rendering 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1076,7 +1076,7 @@ exports[`properly behave when destroyed/unmounted while rendering 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1094,7 +1094,7 @@ exports[`render method wait until rendering is done 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1109,7 +1109,7 @@ exports[`rendering component again in next microtick 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
Child
\`); @@ -1123,7 +1123,7 @@ exports[`rendering component again in next microtick 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1142,7 +1142,7 @@ exports[`two renderings initiated between willPatch and patched 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1157,7 +1157,7 @@ exports[`two renderings initiated between willPatch and patched 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1175,7 +1175,7 @@ exports[`update a sub-component twice in the same frame 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1190,7 +1190,7 @@ exports[`update a sub-component twice in the same frame 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1205,7 +1205,7 @@ exports[`update a sub-component twice in the same frame, 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1220,7 +1220,7 @@ exports[`update a sub-component twice in the same frame, 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/error_handling.test.ts.snap b/tests/components/__snapshots__/error_handling.test.ts.snap index f39ed6f7..d27afa38 100644 --- a/tests/components/__snapshots__/error_handling.test.ts.snap +++ b/tests/components/__snapshots__/error_handling.test.ts.snap @@ -4,7 +4,7 @@ exports[`basics no component catching error lead to full app destruction 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
hey
\`); @@ -19,7 +19,7 @@ exports[`basics no component catching error lead to full app destruction 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/event_handling.test.ts.snap b/tests/components/__snapshots__/event_handling.test.ts.snap index f4fdcc0d..c23d9860 100644 --- a/tests/components/__snapshots__/event_handling.test.ts.snap +++ b/tests/components/__snapshots__/event_handling.test.ts.snap @@ -4,7 +4,7 @@ exports[`event handling can set handler on sub component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -18,7 +18,7 @@ exports[`event handling can set handler on sub component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; return function template(ctx, node, key = \\"\\") { @@ -34,7 +34,7 @@ exports[`event handling handler receive the event as argument 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
simple vnode
\`); @@ -48,7 +48,7 @@ exports[`event handling handler receive the event as argument 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; return function template(ctx, node, key = \\"\\") { @@ -64,7 +64,7 @@ exports[`event handling support for callable expression in event handler 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/higher_order_component.test.ts.snap b/tests/components/__snapshots__/higher_order_component.test.ts.snap index 64ad0d18..ee4c3a7f 100644 --- a/tests/components/__snapshots__/higher_order_component.test.ts.snap +++ b/tests/components/__snapshots__/higher_order_component.test.ts.snap @@ -4,7 +4,7 @@ exports[`basics basic use 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child\`); @@ -19,7 +19,7 @@ exports[`basics basic use 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {p: 1}, key + \`__1\`, node, ctx); @@ -31,7 +31,7 @@ exports[`basics can select a sub widget 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`CHILD 1\`); @@ -45,7 +45,7 @@ exports[`basics can select a sub widget 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
CHILD 2
\`); @@ -59,7 +59,7 @@ exports[`basics can select a sub widget 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2,b3; @@ -78,7 +78,7 @@ exports[`basics can select a sub widget, part 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`CHILD 1\`); @@ -92,7 +92,7 @@ exports[`basics can select a sub widget, part 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
CHILD 2
\`); @@ -106,7 +106,7 @@ exports[`basics can select a sub widget, part 2 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2,b3; @@ -125,7 +125,7 @@ exports[`basics sub widget is interactive 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child\`); @@ -141,7 +141,7 @@ exports[`basics sub widget is interactive 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {p: 1}, key + \`__1\`, node, ctx); @@ -153,7 +153,7 @@ exports[`basics top level sub widget with a parent 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`Hello\`); @@ -167,7 +167,7 @@ exports[`basics top level sub widget with a parent 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`ComponentC\`, {}, key + \`__1\`, node, ctx); @@ -179,7 +179,7 @@ exports[`basics top level sub widget with a parent 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/lifecycle.test.ts.snap b/tests/components/__snapshots__/lifecycle.test.ts.snap index 18adf0c3..ec6b0f90 100644 --- a/tests/components/__snapshots__/lifecycle.test.ts.snap +++ b/tests/components/__snapshots__/lifecycle.test.ts.snap @@ -4,7 +4,7 @@ exports[`lifecycle hooks basic checks for a component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`test\`); @@ -18,7 +18,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -32,7 +32,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -48,7 +48,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -63,7 +63,7 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block2 = createBlock(\`
\`); @@ -82,7 +82,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -96,7 +96,7 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -111,7 +111,7 @@ exports[`lifecycle hooks lifecycle semantics 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -125,7 +125,7 @@ exports[`lifecycle hooks lifecycle semantics 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -140,7 +140,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -154,7 +154,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -166,7 +166,7 @@ exports[`lifecycle hooks lifecycle semantics, part 2 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -182,7 +182,7 @@ exports[`lifecycle hooks lifecycle semantics, part 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -196,7 +196,7 @@ exports[`lifecycle hooks lifecycle semantics, part 3 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -208,7 +208,7 @@ exports[`lifecycle hooks lifecycle semantics, part 3 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -224,7 +224,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -238,7 +238,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -250,7 +250,7 @@ exports[`lifecycle hooks lifecycle semantics, part 4 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -266,7 +266,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -280,7 +280,7 @@ exports[`lifecycle hooks lifecycle semantics, part 5 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -296,7 +296,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -310,7 +310,7 @@ exports[`lifecycle hooks lifecycle semantics, part 6 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx); @@ -322,7 +322,7 @@ exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -336,7 +336,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -350,7 +350,7 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -365,7 +365,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -379,7 +379,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -394,7 +394,7 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -412,7 +412,7 @@ exports[`lifecycle hooks onRender 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -428,7 +428,7 @@ exports[`lifecycle hooks onRender 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -440,7 +440,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -454,7 +454,7 @@ exports[`lifecycle hooks patched hook is called after updateProps 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -469,7 +469,7 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -483,7 +483,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -497,7 +497,7 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2; @@ -513,7 +513,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -528,7 +528,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -543,7 +543,7 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -558,7 +558,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -572,7 +572,7 @@ exports[`lifecycle hooks willStart hook is called on sub component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -584,7 +584,7 @@ exports[`lifecycle hooks willStart is called 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -598,7 +598,7 @@ exports[`lifecycle hooks willStart is called with component as this 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`simple vnode\`); @@ -612,7 +612,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -626,7 +626,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block3 = createBlock(\`
\`); @@ -647,7 +647,7 @@ exports[`lifecycle hooks willUpdateProps hook is called 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -662,7 +662,7 @@ exports[`lifecycle hooks willUpdateProps hook is called 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx); diff --git a/tests/components/__snapshots__/props.test.ts.snap b/tests/components/__snapshots__/props.test.ts.snap index ea2de893..380cf7ee 100644 --- a/tests/components/__snapshots__/props.test.ts.snap +++ b/tests/components/__snapshots__/props.test.ts.snap @@ -4,7 +4,7 @@ exports[`basics accept ES6-like syntax for props (with getters) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -19,7 +19,7 @@ exports[`basics accept ES6-like syntax for props (with getters) 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -34,7 +34,7 @@ exports[`basics explicit object prop 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -49,7 +49,7 @@ exports[`basics explicit object prop 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -64,7 +64,7 @@ exports[`basics t-set with a body expression can be passed in props, and then t- "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -80,13 +80,14 @@ exports[`basics t-set with a body expression can be passed in props, and then t- "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block2 = createBlock(\`

43

\`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 let b2 = block2(); ctx[\`abc\`] = b2; let b3 = component(\`Child\`, {val: ctx['abc']}, key + \`__1\`, node, ctx); @@ -99,7 +100,7 @@ exports[`basics t-set with a body expression can be used as textual prop 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -114,13 +115,14 @@ exports[`basics t-set with a body expression can be used as textual prop 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`abc\`] = \`42\`; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"abc\\", \`42\`); let b2 = component(\`Child\`, {val: ctx['abc']}, key + \`__1\`, node, ctx); return block1([], [b2]); } @@ -131,7 +133,7 @@ exports[`basics t-set works 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -146,13 +148,14 @@ exports[`basics t-set works 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`val\`] = 42; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"val\\", 42); let b2 = component(\`Child\`, {val: ctx['val']}, key + \`__1\`, node, ctx); return block1([], [b2]); } diff --git a/tests/components/__snapshots__/refs.test.ts.snap b/tests/components/__snapshots__/refs.test.ts.snap index fd0d90e4..8b1e0e7d 100644 --- a/tests/components/__snapshots__/refs.test.ts.snap +++ b/tests/components/__snapshots__/refs.test.ts.snap @@ -4,7 +4,7 @@ exports[`refs refs are properly bound in slots 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -19,7 +19,7 @@ exports[`refs refs are properly bound in slots 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/slots.test.ts.snap b/tests/components/__snapshots__/slots.test.ts.snap index 6992085b..1268f9fa 100644 --- a/tests/components/__snapshots__/slots.test.ts.snap +++ b/tests/components/__snapshots__/slots.test.ts.snap @@ -4,7 +4,7 @@ exports[`slots can define and call slots 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -20,7 +20,7 @@ exports[`slots can define and call slots 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -47,7 +47,7 @@ exports[`slots content is the default slot (variation) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -59,7 +59,7 @@ exports[`slots content is the default slot (variation) 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`sts rocks\`); @@ -78,7 +78,7 @@ exports[`slots content is the default slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -93,7 +93,7 @@ exports[`slots content is the default slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -114,7 +114,7 @@ exports[`slots dafault slots can define a default content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -133,7 +133,7 @@ exports[`slots dafault slots can define a default content 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -148,7 +148,7 @@ exports[`slots default content is not rendered if named slot is provided 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -167,7 +167,7 @@ exports[`slots default content is not rendered if named slot is provided 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -188,7 +188,7 @@ exports[`slots default content is not rendered if slot is provided 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -207,7 +207,7 @@ exports[`slots default content is not rendered if slot is provided 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -227,7 +227,7 @@ exports[`slots default slot next to named slot, with default content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -251,7 +251,7 @@ exports[`slots default slot next to named slot, with default content 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -272,7 +272,7 @@ exports[`slots default slot work with text nodes (variation) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -284,7 +284,7 @@ exports[`slots default slot work with text nodes (variation) 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -301,7 +301,7 @@ exports[`slots default slot work with text nodes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -316,7 +316,7 @@ exports[`slots default slot work with text nodes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -336,7 +336,7 @@ exports[`slots dynamic t-slot call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -353,7 +353,7 @@ exports[`slots dynamic t-slot call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -383,7 +383,7 @@ exports[`slots dynamic t-slot call with default 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -403,7 +403,7 @@ exports[`slots dynamic t-slot call with default 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -433,7 +433,7 @@ exports[`slots fun: two calls to the same slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2 = callSlot(ctx, node, key, 'default'); @@ -447,7 +447,7 @@ exports[`slots fun: two calls to the same slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -464,7 +464,7 @@ exports[`slots missing slots are ignored 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`some content\`); @@ -480,7 +480,7 @@ exports[`slots missing slots are ignored 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -495,7 +495,7 @@ exports[`slots multiple roots are allowed in a default slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -510,7 +510,7 @@ exports[`slots multiple roots are allowed in a default slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -534,7 +534,7 @@ exports[`slots multiple roots are allowed in a named slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -549,7 +549,7 @@ exports[`slots multiple roots are allowed in a named slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -574,7 +574,7 @@ exports[`slots multiple slots containing components 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -589,7 +589,7 @@ exports[`slots multiple slots containing components 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -605,7 +605,7 @@ exports[`slots multiple slots containing components 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot3 = ctx => (node, key) => { @@ -627,7 +627,7 @@ exports[`slots named slot inside slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -643,7 +643,7 @@ exports[`slots named slot inside slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -677,7 +677,7 @@ exports[`slots named slot inside slot, part 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -693,7 +693,7 @@ exports[`slots named slot inside slot, part 3 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -727,7 +727,7 @@ exports[`slots named slots can define a default content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -746,7 +746,7 @@ exports[`slots named slots can define a default content 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -761,7 +761,7 @@ exports[`slots named slots inside slot, again 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -786,7 +786,7 @@ exports[`slots named slots inside slot, again 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -820,7 +820,7 @@ exports[`slots nested slots in same template 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -835,7 +835,7 @@ exports[`slots nested slots in same template 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -850,7 +850,7 @@ exports[`slots nested slots in same template 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`Child 3\`); @@ -864,7 +864,7 @@ exports[`slots nested slots in same template 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`\`); @@ -888,7 +888,7 @@ exports[`slots nested slots: evaluation context and parented relationship 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -903,7 +903,7 @@ exports[`slots nested slots: evaluation context and parented relationship 2`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -918,7 +918,7 @@ exports[`slots nested slots: evaluation context and parented relationship 3`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -935,7 +935,7 @@ exports[`slots nested slots: evaluation context and parented relationship 4`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -952,7 +952,7 @@ exports[`slots no named slot content => just no children 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -967,7 +967,7 @@ exports[`slots no named slot content => just no children 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Dialog\`, {}, key + \`__1\`, node, ctx); @@ -979,7 +979,7 @@ exports[`slots simple default slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -994,7 +994,7 @@ exports[`slots simple default slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -1011,7 +1011,7 @@ exports[`slots simple default slot, variation 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -1023,7 +1023,7 @@ exports[`slots simple default slot, variation 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -1040,7 +1040,7 @@ exports[`slots slot and (inline) t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

sokka

\`); @@ -1054,7 +1054,7 @@ exports[`slots slot and (inline) t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1069,7 +1069,7 @@ exports[`slots slot and (inline) t-call 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const callTemplate_5 = getTemplate(\`__template__9\`); @@ -1091,7 +1091,7 @@ exports[`slots slot and (inline) t-esc 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1106,7 +1106,7 @@ exports[`slots slot and (inline) t-esc 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1126,7 +1126,7 @@ exports[`slots slot and t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

sokka

\`); @@ -1140,7 +1140,7 @@ exports[`slots slot and t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1155,7 +1155,7 @@ exports[`slots slot and t-call 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const callTemplate_5 = getTemplate(\`__template__9\`); @@ -1177,7 +1177,7 @@ exports[`slots slot and t-esc 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1192,7 +1192,7 @@ exports[`slots slot and t-esc 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1212,7 +1212,7 @@ exports[`slots slot are properly rendered if inner props are changed 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
SC:
\`); @@ -1227,7 +1227,7 @@ exports[`slots slot are properly rendered if inner props are changed 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1242,7 +1242,7 @@ exports[`slots slot are properly rendered if inner props are changed 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1264,7 +1264,7 @@ exports[`slots slot content is bound to caller 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1279,7 +1279,7 @@ exports[`slots slot content is bound to caller 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`\`); @@ -1299,7 +1299,7 @@ exports[`slots slot preserves properly parented relationship 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -1311,7 +1311,7 @@ exports[`slots slot preserves properly parented relationship 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`Grand Child\`); @@ -1323,7 +1323,7 @@ exports[`slots slot preserves properly parented relationship 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1343,7 +1343,7 @@ exports[`slots slot preserves properly parented relationship, even through t-cal "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -1355,7 +1355,7 @@ exports[`slots slot preserves properly parented relationship, even through t-cal "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`Grand Child\`); @@ -1367,7 +1367,7 @@ exports[`slots slot preserves properly parented relationship, even through t-cal "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx); @@ -1379,7 +1379,7 @@ exports[`slots slot preserves properly parented relationship, even through t-cal "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const callTemplate_5 = getTemplate(\`sub\`); @@ -1401,7 +1401,7 @@ exports[`slots slots and wrapper components 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1416,7 +1416,7 @@ exports[`slots slots and wrapper components 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -1433,7 +1433,7 @@ exports[`slots slots are rendered with proper context 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1448,7 +1448,7 @@ exports[`slots slots are rendered with proper context 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1472,7 +1472,7 @@ exports[`slots slots are rendered with proper context, part 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1488,7 +1488,7 @@ exports[`slots slots are rendered with proper context, part 2 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1520,7 +1520,7 @@ exports[`slots slots are rendered with proper context, part 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1536,7 +1536,7 @@ exports[`slots slots are rendered with proper context, part 3 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1548,12 +1548,13 @@ exports[`slots slots are rendered with proper context, part 3 2`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 ctx = Object.create(ctx); const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['state'].users); for (let i1 = 0; i1 < l_block2; i1++) { ctx[\`user\`] = v_block2[i1]; let key1 = ctx['user'].id; - ctx[\`userdescr\`] = 'User '+ctx['user'].name; + setContextValue(ctx, \\"userdescr\\", 'User '+ctx['user'].name); const ctx2 = capture(ctx); let b5 = assign(component(\`Link\`, {to: '/user/'+ctx['user'].id}, key + \`__1__\${key1}\`, node, ctx), {slots: {'default': slot3(ctx2)}}); c_block2[i1] = withKey(block3([], [b5]), key1); @@ -1568,7 +1569,7 @@ exports[`slots slots are rendered with proper context, part 4 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1584,7 +1585,7 @@ exports[`slots slots are rendered with proper context, part 4 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1595,7 +1596,8 @@ exports[`slots slots are rendered with proper context, part 4 2`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`userdescr\`] = 'User '+ctx['state'].user.name; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"userdescr\\", 'User '+ctx['state'].user.name); const ctx2 = capture(ctx); let b3 = assign(component(\`Link\`, {to: '/user/'+ctx['state'].user.id}, key + \`__1\`, node, ctx), {slots: {'default': slot3(ctx2)}}); return block1([], [b3]); @@ -1607,7 +1609,7 @@ exports[`slots slots in slots, with vars 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1622,7 +1624,7 @@ exports[`slots slots in slots, with vars 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1642,7 +1644,7 @@ exports[`slots slots in slots, with vars 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1655,7 +1657,8 @@ exports[`slots slots in slots, with vars 3`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`test\`] = ctx['state'].name; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"test\\", ctx['state'].name); const ctx2 = capture(ctx); let b3 = assign(component(\`A\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot3(ctx2)}}); return block1([], [b3]); @@ -1667,7 +1670,7 @@ exports[`slots slots in t-foreach and re-rendering 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1683,7 +1686,7 @@ exports[`slots slots in t-foreach and re-rendering 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1712,7 +1715,7 @@ exports[`slots slots in t-foreach in t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -1727,7 +1730,7 @@ exports[`slots slots in t-foreach in t-foreach 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1771,7 +1774,7 @@ exports[`slots slots in t-foreach with t-set and re-rendering 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1787,7 +1790,7 @@ exports[`slots slots in t-foreach with t-set and re-rendering 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1798,13 +1801,14 @@ exports[`slots slots in t-foreach with t-set and re-rendering 2`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 ctx = Object.create(ctx); const [k_block2, v_block2, l_block2, c_block2] = prepareList(Array(2)); for (let i1 = 0; i1 < l_block2; i1++) { ctx[\`n\`] = v_block2[i1]; ctx[\`n_index\`] = i1; let key1 = ctx['n_index']; - ctx[\`dummy\`] = ctx['n_index']; + setContextValue(ctx, \\"dummy\\", ctx['n_index']); const ctx2 = capture(ctx); c_block2[i1] = withKey(assign(component(\`Child\`, {}, key + \`__1__\${key1}\`, node, ctx), {slots: {'default': slot3(ctx2)}}), key1); } @@ -1818,7 +1822,7 @@ exports[`slots t-debug on a t-set-slot (defining a slot) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1833,7 +1837,7 @@ exports[`slots t-debug on a t-set-slot (defining a slot) 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -1855,7 +1859,7 @@ exports[`slots t-set t-value in a slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1870,18 +1874,19 @@ exports[`slots t-set t-value in a slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); const slot3 = ctx => (node, key) => { - ctx[\`rainbow\`] = 'dash'; + setContextValue(ctx, \\"rainbow\\", 'dash'); return text(ctx['rainbow']); } return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 const ctx2 = capture(ctx); let b3 = assign(component(\`Dialog\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot3(ctx2)}}); return block1([], [b3]); @@ -1893,7 +1898,7 @@ exports[`slots t-slot in recursive templates 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1908,7 +1913,7 @@ exports[`slots t-slot in recursive templates 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const callTemplate_5 = getTemplate(\`_test_recursive_template\`); @@ -1928,8 +1933,9 @@ exports[`slots t-slot in recursive templates 2`] = ` b5 = text(ctx['item'].name); } else { ctx = Object.create(ctx); - ctx[\`name\`] = ctx['item'].name; - ctx[\`items\`] = ctx['item'].children; + ctx[isBoundary] = 1; + setContextValue(ctx, \\"name\\", ctx['item'].name); + setContextValue(ctx, \\"items\\", ctx['item'].children); b6 = callTemplate_5(ctx, node, key + \`__4__\${key1}\`); ctx = ctx.__proto__; } @@ -1942,6 +1948,7 @@ exports[`slots t-slot in recursive templates 2`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 const ctx2 = capture(ctx); return assign(component(\`Wrapper\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot3(ctx2)}}); } @@ -1952,7 +1959,7 @@ exports[`slots t-slot nested within another slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`Child 3\`); @@ -1966,7 +1973,7 @@ exports[`slots t-slot nested within another slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1981,7 +1988,7 @@ exports[`slots t-slot nested within another slot 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -1996,7 +2003,7 @@ exports[`slots t-slot nested within another slot 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`\`); @@ -2020,7 +2027,7 @@ exports[`slots t-slot nested within another slot 5`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`\`); @@ -2040,7 +2047,7 @@ exports[`slots t-slot scope context 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -2052,7 +2059,7 @@ exports[`slots t-slot scope context 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -2073,7 +2080,7 @@ exports[`slots t-slot scope context 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`\`); @@ -2092,7 +2099,7 @@ exports[`slots t-slot within dynamic t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -2106,7 +2113,7 @@ exports[`slots t-slot within dynamic t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -2121,7 +2128,7 @@ exports[`slots t-slot within dynamic t-call 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -2136,7 +2143,7 @@ exports[`slots t-slot within dynamic t-call 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); @@ -2158,7 +2165,7 @@ exports[`slots template can just return a slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -2173,7 +2180,7 @@ exports[`slots template can just return a slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return callSlot(ctx, node, key, 'default'); @@ -2185,7 +2192,7 @@ exports[`slots template can just return a slot 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/style_class.test.ts.snap b/tests/components/__snapshots__/style_class.test.ts.snap index 878bb5c6..3d0e8b00 100644 --- a/tests/components/__snapshots__/style_class.test.ts.snap +++ b/tests/components/__snapshots__/style_class.test.ts.snap @@ -4,7 +4,7 @@ exports[`style and class handling can set class on multi root component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block2 = createBlock(\`
a
\`); let block3 = createBlock(\`b\`); @@ -22,7 +22,7 @@ exports[`style and class handling can set class on multi root component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'fromparent'}, key + \`__1\`, node, ctx); @@ -34,7 +34,7 @@ exports[`style and class handling can set class on sub component, as prop 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -49,7 +49,7 @@ exports[`style and class handling can set class on sub component, as prop 2`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'some-class'}, key + \`__1\`, node, ctx); @@ -61,7 +61,7 @@ exports[`style and class handling can set class on sub sub component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
childchild
\`); @@ -76,7 +76,7 @@ exports[`style and class handling can set class on sub sub component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`ChildChild\`, {class: (ctx['props'].class||'')+' fromchild'}, key + \`__1\`, node, ctx); @@ -88,7 +88,7 @@ exports[`style and class handling can set class on sub sub component 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'fromparent'}, key + \`__1\`, node, ctx); @@ -100,7 +100,7 @@ exports[`style and class handling can set more than one class on sub component 1 "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -115,7 +115,7 @@ exports[`style and class handling can set more than one class on sub component 2 "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'a b'}, key + \`__1\`, node, ctx); @@ -127,7 +127,7 @@ exports[`style and class handling can set style and class inside component 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
world
\`); @@ -156,7 +156,7 @@ exports[`style and class handling class on sub component, which is switched to a "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
a
\`); @@ -171,7 +171,7 @@ exports[`style and class handling class on sub component, which is switched to a "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`b\`); @@ -186,7 +186,7 @@ exports[`style and class handling class on sub component, which is switched to a "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let b2,b3; @@ -204,7 +204,7 @@ exports[`style and class handling class on sub component, which is switched to a "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'someclass',child: ctx['state'].child}, key + \`__1\`, node, ctx); @@ -216,7 +216,7 @@ exports[`style and class handling class with extra whitespaces (variation) 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -231,7 +231,7 @@ exports[`style and class handling class with extra whitespaces (variation) 2`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

\`); @@ -246,7 +246,7 @@ exports[`style and class handling class with extra whitespaces 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -261,7 +261,7 @@ exports[`style and class handling class with extra whitespaces 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'a b c d'}, key + \`__1\`, node, ctx); @@ -273,7 +273,7 @@ exports[`style and class handling component class and parent class combine toget "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -288,7 +288,7 @@ exports[`style and class handling component class and parent class combine toget "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'from parent'}, key + \`__1\`, node, ctx); @@ -327,7 +327,7 @@ exports[`style and class handling empty class attribute is not added on widget r "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -342,7 +342,7 @@ exports[`style and class handling empty class attribute is not added on widget r "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -357,7 +357,7 @@ exports[`style and class handling error in subcomponent with class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -373,7 +373,7 @@ exports[`style and class handling error in subcomponent with class 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'a'}, key + \`__1\`, node, ctx); @@ -385,7 +385,7 @@ exports[`style and class handling no class is set is child ignores it 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -399,7 +399,7 @@ exports[`style and class handling no class is set is child ignores it 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {class: 'hey'}, key + \`__1\`, node, ctx); @@ -411,7 +411,7 @@ exports[`style and class handling no class is set is parent does not give it as "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -426,7 +426,7 @@ exports[`style and class handling no class is set is parent does not give it as "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -438,7 +438,7 @@ exports[`style and class handling style is properly added on widget root el 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -453,7 +453,7 @@ exports[`style and class handling style is properly added on widget root el 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {style: 'font-weight: bold;'}, key + \`__1\`, node, ctx); @@ -465,7 +465,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -480,7 +480,7 @@ exports[`style and class handling t-att-class is properly added/removed on widge "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/t_call.test.ts.snap b/tests/components/__snapshots__/t_call.test.ts.snap index 9c256d31..24377cc7 100644 --- a/tests/components/__snapshots__/t_call.test.ts.snap +++ b/tests/components/__snapshots__/t_call.test.ts.snap @@ -4,10 +4,11 @@ exports[`t-call dynamic t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1; let b1 = text(\` owl \`); ctx[zero] = b1; const template2 = (ctx['current'].template); @@ -20,7 +21,7 @@ exports[`t-call dynamic t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
foo
\`); @@ -34,7 +35,7 @@ exports[`t-call dynamic t-call 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`bar\`); @@ -46,7 +47,7 @@ exports[`t-call handlers are properly bound through a t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

lucas

\`); @@ -61,7 +62,7 @@ exports[`t-call handlers are properly bound through a t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`__template__9\`); let block1 = createBlock(\`
\`); @@ -78,7 +79,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

lucas

\`); @@ -94,7 +95,7 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`__template__9\`); let block1 = createBlock(\`
\`); @@ -110,7 +111,7 @@ exports[`t-call parent is set within t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -122,7 +123,7 @@ exports[`t-call parent is set within t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`lucas\`); @@ -136,7 +137,7 @@ exports[`t-call parent is set within t-call 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`__template__9\`); let block1 = createBlock(\`
\`); @@ -152,7 +153,7 @@ exports[`t-call parent is set within t-call with no parentNode 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {}, key + \`__1\`, node, ctx); @@ -164,7 +165,7 @@ exports[`t-call parent is set within t-call with no parentNode 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`lucas\`); @@ -178,7 +179,7 @@ exports[`t-call parent is set within t-call with no parentNode 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`__template__9\`); return function template(ctx, node, key = \\"\\") { @@ -191,7 +192,7 @@ exports[`t-call sub components in two t-calls 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -206,7 +207,7 @@ exports[`t-call sub components in two t-calls 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`sub\`); const callTemplate_4 = getTemplate(\`sub\`); @@ -229,7 +230,7 @@ exports[`t-call sub components in two t-calls 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx); @@ -241,7 +242,7 @@ exports[`t-call t-call in t-foreach and children component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return component(\`Child\`, {val: ctx['val']}, key + \`__1\`, node, ctx); @@ -253,7 +254,7 @@ exports[`t-call t-call in t-foreach and children component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -268,7 +269,7 @@ exports[`t-call t-call in t-foreach and children component 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`__template__9\`); let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/t_call_block.test.ts.snap b/tests/components/__snapshots__/t_call_block.test.ts.snap index e5d91448..cda7abd5 100644 --- a/tests/components/__snapshots__/t_call_block.test.ts.snap +++ b/tests/components/__snapshots__/t_call_block.test.ts.snap @@ -4,7 +4,7 @@ exports[`t-call-block simple t-call-block with static text 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/components/__snapshots__/t_component.test.ts.snap b/tests/components/__snapshots__/t_component.test.ts.snap index bd999847..ec4b3078 100644 --- a/tests/components/__snapshots__/t_component.test.ts.snap +++ b/tests/components/__snapshots__/t_component.test.ts.snap @@ -4,7 +4,7 @@ exports[`t-component can switch between dynamic components without the need for "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child a\`); @@ -18,7 +18,7 @@ exports[`t-component can switch between dynamic components without the need for "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child b\`); @@ -32,7 +32,7 @@ exports[`t-component can switch between dynamic components without the need for "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -48,7 +48,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child a\`); @@ -62,7 +62,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child b
\`); @@ -76,7 +76,7 @@ exports[`t-component can use dynamic components (the class) if given (with diffe "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let Comp2 = ctx['myComponent']; @@ -89,7 +89,7 @@ exports[`t-component can use dynamic components (the class) if given 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child a\`); @@ -103,7 +103,7 @@ exports[`t-component can use dynamic components (the class) if given 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`child b\`); @@ -117,7 +117,7 @@ exports[`t-component can use dynamic components (the class) if given 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let Comp2 = ctx['myComponent']; @@ -130,7 +130,7 @@ exports[`t-component modifying a sub widget 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -147,7 +147,7 @@ exports[`t-component modifying a sub widget 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -163,7 +163,7 @@ exports[`t-component switching dynamic component 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child a
\`); @@ -177,7 +177,7 @@ exports[`t-component switching dynamic component 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(\`child b\`); @@ -189,7 +189,7 @@ exports[`t-component switching dynamic component 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let Comp2 = ctx['Child']; @@ -202,7 +202,7 @@ exports[`t-component t-component not on a node 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`1\`); @@ -216,7 +216,7 @@ exports[`t-component t-component works in simple case 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
child
\`); @@ -230,7 +230,7 @@ exports[`t-component t-component works in simple case 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { let Comp2 = ctx['Child']; diff --git a/tests/components/__snapshots__/t_foreach.test.ts.snap b/tests/components/__snapshots__/t_foreach.test.ts.snap index af6c42cb..68e2f3ae 100644 --- a/tests/components/__snapshots__/t_foreach.test.ts.snap +++ b/tests/components/__snapshots__/t_foreach.test.ts.snap @@ -4,7 +4,7 @@ exports[`list of components components in a node in a t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -19,7 +19,7 @@ exports[`list of components components in a node in a t-foreach 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
\`); let block3 = createBlock(\`
  • \`); @@ -43,7 +43,7 @@ exports[`list of components list of sub components inside other nodes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`asdf\`); @@ -57,7 +57,7 @@ exports[`list of components list of sub components inside other nodes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
    \`); @@ -81,7 +81,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -96,7 +96,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -128,7 +128,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach, "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -143,7 +143,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach, "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`

    \`); @@ -177,7 +177,7 @@ exports[`list of components simple list 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -192,7 +192,7 @@ exports[`list of components simple list 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); @@ -211,7 +211,7 @@ exports[`list of components sub components rendered in a loop 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

    \`); @@ -226,7 +226,7 @@ exports[`list of components sub components rendered in a loop 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -248,7 +248,7 @@ exports[`list of components sub components with some state rendered in a loop 1` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

    \`); @@ -263,7 +263,7 @@ exports[`list of components sub components with some state rendered in a loop 2` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -285,7 +285,7 @@ exports[`list of components t-foreach with t-component, and update 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -301,7 +301,7 @@ exports[`list of components t-foreach with t-component, and update 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); diff --git a/tests/components/__snapshots__/t_on.test.ts.snap b/tests/components/__snapshots__/t_on.test.ts.snap index 1b50a452..03977e39 100644 --- a/tests/components/__snapshots__/t_on.test.ts.snap +++ b/tests/components/__snapshots__/t_on.test.ts.snap @@ -4,14 +4,15 @@ exports[`t-on t-on expression captured in t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
    \`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`iter\`] = 0; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"iter\\", 0); ctx = Object.create(ctx); const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['arr']); for (let i1 = 0; i1 < l_block2; i1++) { @@ -20,7 +21,7 @@ exports[`t-on t-on expression captured in t-foreach 1`] = ` const v1 = ctx['otherState']; const v2 = ctx['iter']; let d1 = (e) => {const res = (() => { return v1.vals.push(v2+'_'+v2) })(); if (typeof res === 'function') { res(e) }}; - ctx[\`iter\`] = ctx['iter']+1; + setContextValue(ctx, \\"iter\\", ctx['iter']+1); c_block2[i1] = withKey(block3([d1]), key1); } let b2 = list(c_block2); @@ -33,7 +34,7 @@ exports[`t-on t-on expression in t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
    :
    \`); @@ -62,21 +63,22 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
    :
    \`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`bossa\`] = 'nova'; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"bossa\\", 'nova'); 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++) { ctx[\`val\`] = v_block2[i1]; ctx[\`val_index\`] = i1; let key1 = ctx['val']; - ctx[\`bossa\`] = ctx['bossa']+'_'+ctx['val_index']; + setContextValue(ctx, \\"bossa\\", ctx['bossa']+'_'+ctx['val_index']); let d1 = ctx['val_index']; let d2 = ctx['val']+''; const v1 = ctx['otherState']; @@ -95,7 +97,7 @@ exports[`t-on t-on method call in t-foreach 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
    :
    \`); @@ -123,7 +125,7 @@ exports[`t-on t-on on destroyed components 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -138,7 +140,7 @@ exports[`t-on t-on on destroyed components 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); diff --git a/tests/components/__snapshots__/t_set.test.ts.snap b/tests/components/__snapshots__/t_set.test.ts.snap new file mode 100644 index 00000000..b4ca3c16 --- /dev/null +++ b/tests/components/__snapshots__/t_set.test.ts.snap @@ -0,0 +1,174 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`
    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + let d1 = ctx['iter']; + setContextValue(ctx, \\"iter\\", 'called'); + let d2 = ctx['iter']; + return block1([d1, d2]); + } +}" +`; + +exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + let assign = Object.assign; + + let block1 = createBlock(\`

    \`); + + const slot3 = ctx => (node, key) => { + setContextValue(ctx, \\"iter\\", 'inCall'); + } + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + setContextValue(ctx, \\"iter\\", 'source'); + let d1 = ctx['iter']; + const ctx2 = capture(ctx); + let b2 = assign(component(\`Childcomp\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot3(ctx2)}}); + let d2 = ctx['iter']; + return block1([d1, d2], [b2]); + } +}" +`; + +exports[`t-set t-set can't alter component even if key in component 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`

    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + let d1 = ctx['iter']; + setContextValue(ctx, \\"iter\\", 5); + let d2 = ctx['iter']; + return block1([d1, d2]); + } +}" +`; + +exports[`t-set t-set can't alter component if key not in component 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`

    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + let d1 = ctx['iter']; + setContextValue(ctx, \\"iter\\", 5); + let d2 = ctx['iter']; + return block1([d1, d2]); + } +}" +`; + +exports[`t-set t-set in t-if 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`

    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + setContextValue(ctx, \\"flag\\", ctx['state'].flag); + if (ctx['flag']==='if') { + setContextValue(ctx, \\"iter\\", 2); + } else if (ctx['flag']==='elif') { + setContextValue(ctx, \\"iter\\", 3); + } else { + setContextValue(ctx, \\"iter\\", 4); + } + let d1 = ctx['iter']; + return block1([d1]); + } +}" +`; + +exports[`t-set t-set not altered by child comp 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`
    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + let d1 = ctx['iter']; + setContextValue(ctx, \\"iter\\", 'called'); + let d2 = ctx['iter']; + return block1([d1, d2]); + } +}" +`; + +exports[`t-set t-set not altered by child comp 2`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`

    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + setContextValue(ctx, \\"iter\\", 'source'); + let d1 = ctx['iter']; + let b2 = component(\`Childcomp\`, {}, key + \`__1\`, node, ctx); + let d2 = ctx['iter']; + return block1([d1, d2], [b2]); + } +}" +`; + +exports[`t-set t-set outside modified in t-if 1`] = ` +"function anonymous(bdom, helpers +) { + let { text, createBlock, list, multi, html, toggler, component } = bdom; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; + + let block1 = createBlock(\`

    \`); + + return function template(ctx, node, key = \\"\\") { + ctx = Object.create(ctx); + ctx[isBoundary] = 1 + setContextValue(ctx, \\"iter\\", 0); + setContextValue(ctx, \\"flag\\", ctx['state'].flag); + if (ctx['flag']==='if') { + setContextValue(ctx, \\"iter\\", 2); + } else if (ctx['flag']==='elif') { + setContextValue(ctx, \\"iter\\", 3); + } else { + setContextValue(ctx, \\"iter\\", 4); + } + let d1 = ctx['iter']; + return block1([d1]); + } +}" +`; diff --git a/tests/components/error_handling.test.ts b/tests/components/error_handling.test.ts index 67ef11ef..963f5676 100644 --- a/tests/components/error_handling.test.ts +++ b/tests/components/error_handling.test.ts @@ -43,7 +43,8 @@ describe("basics", () => { expect(fixture.innerHTML).toBe(""); expect(status(parent)).toBe("destroyed"); expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'this'\)|Cannot read property 'this' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'this'\)|Cannot read property 'this' of undefined/g; expect(error.message).toMatch(regexp); }); @@ -112,7 +113,8 @@ describe.skip("errors and promises", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -225,7 +227,8 @@ describe.skip("errors and promises", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -251,7 +254,8 @@ describe.skip("errors and promises", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(console.error).toBeCalledTimes(0); @@ -274,7 +278,8 @@ describe.skip("errors and promises", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'y'\)|Cannot read property 'y' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'y'\)|Cannot read property 'y' of undefined/g; expect(error.message).toMatch(regexp); }); diff --git a/tests/components/style_class.test.ts b/tests/components/style_class.test.ts index e44a1262..2f75798f 100644 --- a/tests/components/style_class.test.ts +++ b/tests/components/style_class.test.ts @@ -341,7 +341,8 @@ describe("style and class handling", () => { error = e; } expect(error).toBeDefined(); - const regexp = /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; + const regexp = + /Cannot read properties of undefined \(reading 'crash'\)|Cannot read property 'crash' of undefined/g; expect(error.message).toMatch(regexp); expect(fixture.innerHTML).toBe(""); }); diff --git a/tests/components/t_set.test.ts b/tests/components/t_set.test.ts new file mode 100644 index 00000000..000866a2 --- /dev/null +++ b/tests/components/t_set.test.ts @@ -0,0 +1,155 @@ +import { Component, mount, xml } from "../../src"; +import { makeTestFixture, snapshotEverything } from "../helpers"; + +snapshotEverything(); + +let fixture: HTMLElement; + +beforeEach(() => { + fixture = makeTestFixture(); +}); + +// ----------------------------------------------------------------------------- +// t-set +// ----------------------------------------------------------------------------- + +describe("t-set", () => { + test("t-set outside modified in t-if", async () => { + class Comp extends Component { + static template = xml` +
    + + + + + + + + + + + +

    +
    `; + state = { flag: "if" }; + } + const comp = await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    2

    "); + comp.state.flag = "elif"; + await comp.render(); + expect(fixture.innerHTML).toBe("

    3

    "); + comp.state.flag = "false"; + await comp.render(); + expect(fixture.innerHTML).toBe("

    4

    "); + }); + + test("t-set in t-if", async () => { + // Weird that code block within 'if' leaks outside of it + // Python does the same + class Comp extends Component { + static template = xml` +
    + + + + + + + + + + +

    +
    `; + state = { flag: "if" }; + } + const comp = await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    2

    "); + comp.state.flag = "elif"; + await comp.render(); + expect(fixture.innerHTML).toBe("

    3

    "); + comp.state.flag = "false"; + await comp.render(); + expect(fixture.innerHTML).toBe("

    4

    "); + }); + + test("t-set can't alter component even if key in component", async () => { + class Comp extends Component { + static template = xml` +
    +

    + +

    +
    `; + iter = 1; + } + const comp = await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    1

    5

    "); + expect(comp.iter).toBe(1); + }); + + test("t-set can't alter component if key not in component", async () => { + class Comp extends Component { + static template = xml` +
    +

    + +

    +
    `; + } + const comp = await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    5

    "); + expect((comp as any).iter).toBeUndefined(); + }); + + test("slot setted value (with t-set) not accessible with t-esc", async () => { + class Childcomp extends Component { + static template = xml`
    `; + } + class Comp extends Component { + static components = { Childcomp }; + static template = xml` +
    + +

    + + + +

    +
    `; + } + await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    source

    called

    source

    "); + }); + + test("t-set not altered by child comp", async () => { + let child; + class Childcomp extends Component { + static template = xml`
    `; + iter = "child"; + setup() { + super.setup(); + child = this; + } + } + class Comp extends Component { + static components = { Childcomp }; + static template = xml` +
    + +

    + +

    +
    `; + } + await mount(Comp, fixture); + + expect(fixture.innerHTML).toBe("

    source

    childcalled

    source

    "); + expect((child as any).iter).toBe("child"); + }); +}); diff --git a/tests/misc/__snapshots__/memo.test.ts.snap b/tests/misc/__snapshots__/memo.test.ts.snap index f21e3032..2ec3190f 100644 --- a/tests/misc/__snapshots__/memo.test.ts.snap +++ b/tests/misc/__snapshots__/memo.test.ts.snap @@ -4,7 +4,7 @@ exports[`Memo if no prop change, prevent renderings from above 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(ctx['props'].value); @@ -16,7 +16,7 @@ exports[`Memo if no prop change, prevent renderings from above 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -40,7 +40,7 @@ exports[`Memo if no props, prevent renderings from above 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; return function template(ctx, node, key = \\"\\") { return text(ctx['props'].value); @@ -52,7 +52,7 @@ exports[`Memo if no props, prevent renderings from above 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot3 = ctx => (node, key) => { @@ -71,7 +71,7 @@ exports[`Memo if no props, prevent renderings from above (work with simple html) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { diff --git a/tests/misc/__snapshots__/portal.test.ts.snap b/tests/misc/__snapshots__/portal.test.ts.snap index b45539fe..5a4c9a16 100644 --- a/tests/misc/__snapshots__/portal.test.ts.snap +++ b/tests/misc/__snapshots__/portal.test.ts.snap @@ -4,7 +4,7 @@ exports[`Portal Portal composed with t-slot 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    child2
    \`); @@ -18,7 +18,7 @@ exports[`Portal Portal composed with t-slot 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; const slot2 = ctx => (node, key) => { @@ -35,7 +35,7 @@ exports[`Portal Portal composed with t-slot 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -56,7 +56,7 @@ exports[`Portal basic use of portal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    1
    \`); @@ -77,7 +77,7 @@ exports[`Portal conditional use of Portal (with sub Component) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

    \`); @@ -92,7 +92,7 @@ exports[`Portal conditional use of Portal (with sub Component) 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block2 = createBlock(\`1\`); @@ -116,7 +116,7 @@ exports[`Portal conditional use of Portal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block2 = createBlock(\`1\`); @@ -141,7 +141,7 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -156,7 +156,7 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -179,7 +179,7 @@ exports[`Portal portal could have dynamically no content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -205,7 +205,7 @@ exports[`Portal portal with child and props 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -220,7 +220,7 @@ exports[`Portal portal with child and props 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -240,7 +240,7 @@ exports[`Portal portal with dynamic body 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -269,7 +269,7 @@ exports[`Portal portal with many children 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -293,7 +293,7 @@ exports[`Portal portal with no content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -317,7 +317,7 @@ exports[`Portal portal with only text as content 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -358,7 +358,7 @@ exports[`Portal portal's parent's env is not polluted 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -372,7 +372,7 @@ exports[`Portal portal's parent's env is not polluted 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); @@ -392,7 +392,7 @@ exports[`Portal with target in template (after portal) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    1
    \`); @@ -413,7 +413,7 @@ exports[`Portal with target in template (before portal) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    1
    \`); @@ -434,7 +434,7 @@ exports[`Portal: UI/UX focus is kept across re-renders 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -449,7 +449,7 @@ exports[`Portal: UI/UX focus is kept across re-renders 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let assign = Object.assign; let block1 = createBlock(\`
    \`); diff --git a/tests/qweb/__snapshots__/attributes.test.ts.snap b/tests/qweb/__snapshots__/attributes.test.ts.snap index 3fbf6bdb..7886548e 100644 --- a/tests/qweb/__snapshots__/attributes.test.ts.snap +++ b/tests/qweb/__snapshots__/attributes.test.ts.snap @@ -4,7 +4,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -19,7 +19,7 @@ exports[`attributes changing a class with t-att-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -34,7 +34,7 @@ exports[`attributes changing an attribute with t-att- 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -49,7 +49,7 @@ exports[`attributes class and t-att-class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -64,7 +64,7 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -79,7 +79,7 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -94,7 +94,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -109,7 +109,7 @@ exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -124,7 +124,7 @@ exports[`attributes dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -139,7 +139,7 @@ exports[`attributes dynamic class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -154,7 +154,7 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -169,7 +169,7 @@ exports[`attributes dynamic empty class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -184,7 +184,7 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -199,7 +199,7 @@ exports[`attributes fixed variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -214,7 +214,7 @@ exports[`attributes format expression 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -229,7 +229,7 @@ exports[`attributes format literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -244,7 +244,7 @@ exports[`attributes format multiple 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -259,7 +259,7 @@ exports[`attributes format value 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -274,13 +274,14 @@ exports[`attributes from object variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`o\`] = {a:'b'}; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"o\\", {a:'b'}); let d1 = ctx['o'].a; return block1([d1]); } @@ -291,13 +292,14 @@ exports[`attributes from variables set previously (no external node) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`abc\`] = 'def'; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"abc\\", 'def'); let d1 = ctx['abc']; return block1([d1]); } @@ -308,13 +310,14 @@ exports[`attributes from variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); - ctx[\`abc\`] = 'def'; + ctx[isBoundary] = 1 + setContextValue(ctx, \\"abc\\", 'def'); let d1 = ctx['abc']; return block1([d1]); } @@ -325,7 +328,7 @@ exports[`attributes object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -340,7 +343,7 @@ exports[`attributes static attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -354,7 +357,7 @@ exports[`attributes static attributes on void elements 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\\"Test\\"/\`); @@ -368,7 +371,7 @@ exports[`attributes static attributes with dashes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -382,7 +385,7 @@ exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -397,7 +400,7 @@ exports[`attributes t-att-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -412,7 +415,7 @@ exports[`attributes t-att-class with multiple classes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -427,7 +430,7 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -442,7 +445,7 @@ exports[`attributes t-att-class with object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -457,7 +460,7 @@ exports[`attributes t-attf-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -472,7 +475,7 @@ exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -487,7 +490,7 @@ exports[`attributes t-attf-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -502,7 +505,7 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -517,7 +520,7 @@ exports[`attributes tuple literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -532,7 +535,7 @@ exports[`attributes tuple variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -547,7 +550,7 @@ exports[`attributes two classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -561,7 +564,7 @@ exports[`attributes two dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -577,7 +580,7 @@ exports[`attributes updating classes (with obj notation) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -592,7 +595,7 @@ exports[`attributes various escapes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -609,7 +612,7 @@ exports[`attributes various escapes 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    <
    \`); @@ -623,7 +626,7 @@ exports[`special cases for some specific html attributes/properties input of typ "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -638,7 +641,7 @@ exports[`special cases for some specific html attributes/properties input type= "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -653,7 +656,7 @@ exports[`special cases for some specific html attributes/properties input with t "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -668,7 +671,7 @@ exports[`special cases for some specific html attributes/properties various bool "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); diff --git a/tests/qweb/__snapshots__/comments.test.ts.snap b/tests/qweb/__snapshots__/comments.test.ts.snap index 3e42785c..5c7f2e05 100644 --- a/tests/qweb/__snapshots__/comments.test.ts.snap +++ b/tests/qweb/__snapshots__/comments.test.ts.snap @@ -4,7 +4,7 @@ exports[`comments only a comment 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -18,7 +18,7 @@ exports[`comments properly handle comments 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    hello owl
    \`); @@ -32,7 +32,7 @@ exports[`comments properly handle comments between t-if/t-else 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block2 = createBlock(\`true\`); diff --git a/tests/qweb/__snapshots__/event_handling.test.ts.snap b/tests/qweb/__snapshots__/event_handling.test.ts.snap index 23ff0ff1..e5e5307f 100644 --- a/tests/qweb/__snapshots__/event_handling.test.ts.snap +++ b/tests/qweb/__snapshots__/event_handling.test.ts.snap @@ -4,7 +4,7 @@ exports[`t-on can bind event handler 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -19,7 +19,7 @@ exports[`t-on can bind handlers with arguments 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -35,7 +35,7 @@ exports[`t-on can bind handlers with empty object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -51,7 +51,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -67,7 +67,7 @@ exports[`t-on can bind handlers with empty object (with non empty inner string) "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block3 = createBlock(\`
  • link
  • \`); @@ -93,7 +93,7 @@ exports[`t-on can bind handlers with object arguments 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -109,7 +109,7 @@ exports[`t-on can bind two event handlers 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -125,7 +125,7 @@ exports[`t-on handler is bound to proper owner 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -140,7 +140,7 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block2 = createBlock(\`\`); @@ -162,7 +162,7 @@ exports[`t-on handler is bound to proper owner, part 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -177,7 +177,7 @@ exports[`t-on handler is bound to proper owner, part 3 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`sub\`); return function template(ctx, node, key = \\"\\") { @@ -190,7 +190,7 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -205,7 +205,7 @@ exports[`t-on handler is bound to proper owner, part 4 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`sub\`); return function template(ctx, node, key = \\"\\") { @@ -229,7 +229,7 @@ exports[`t-on receive event in first argument 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -244,7 +244,7 @@ exports[`t-on t-on with inline statement (function call) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -260,7 +260,7 @@ exports[`t-on t-on with inline statement 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -276,7 +276,7 @@ exports[`t-on t-on with inline statement, part 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -292,7 +292,7 @@ exports[`t-on t-on with inline statement, part 3 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -309,7 +309,7 @@ exports[`t-on t-on with t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

    lucas

    \`); @@ -324,7 +324,7 @@ exports[`t-on t-on with t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`sub\`); let block1 = createBlock(\`
    \`); @@ -340,7 +340,7 @@ exports[`t-on t-on, with arguments and t-call 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`

    lucas

    \`); @@ -356,7 +356,7 @@ exports[`t-on t-on, with arguments and t-call 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`sub\`); let block1 = createBlock(\`
    \`); diff --git a/tests/qweb/__snapshots__/misc.test.ts.snap b/tests/qweb/__snapshots__/misc.test.ts.snap index a011278c..d2a88b0f 100644 --- a/tests/qweb/__snapshots__/misc.test.ts.snap +++ b/tests/qweb/__snapshots__/misc.test.ts.snap @@ -4,7 +4,7 @@ exports[`misc complex template 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); let block2 = createBlock(\`\`); @@ -82,7 +82,7 @@ exports[`misc global 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -98,7 +98,7 @@ exports[`misc global 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -113,7 +113,7 @@ exports[`misc global 3`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; let block1 = createBlock(\`
    \`); @@ -129,7 +129,7 @@ exports[`misc global 4`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_2 = getTemplate(\`_callee-uses-foo\`); const callTemplate_4 = getTemplate(\`_callee-uses-foo\`); const callTemplate_6 = getTemplate(\`_callee-uses-foo\`); @@ -141,6 +141,7 @@ exports[`misc global 4`] = ` return function template(ctx, node, key = \\"\\") { ctx = Object.create(ctx); + ctx[isBoundary] = 1 ctx = Object.create(ctx); const [k_block2, v_block2, l_block2, c_block2] = prepareList([4,5,6]); for (let i1 = 0; i1 < l_block2; i1++) { @@ -153,12 +154,14 @@ exports[`misc global 4`] = ` let d1 = ctx['value']; let b4 = block4([d1]); ctx = Object.create(ctx); + ctx[isBoundary] = 1; ctx = Object.create(ctx); - ctx[\`foo\`] = 'aaa'; + ctx[isBoundary] = 1; + setContextValue(ctx, \\"foo\\", 'aaa'); let b6 = callTemplate_2(ctx, node, key + \`__1__\${key1}\`); ctx = ctx.__proto__; let b7 = callTemplate_4(ctx, node, key + \`__3__\${key1}\`); - ctx[\`foo\`] = 'bbb'; + setContextValue(ctx, \\"foo\\", 'bbb'); let b8 = callTemplate_6(ctx, node, key + \`__5__\${key1}\`); let b5 = multi([b6, b7, b8]); ctx[zero] = b5; @@ -178,7 +181,7 @@ exports[`misc other complex template 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers; + let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers; const callTemplate_3 = getTemplate(\`LOAD_INFOS_TEMPLATE\`); let block1 = createBlock(\`