From 60b8817ac0caeb3a313c4be0409428510ac2d98f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Wed, 1 Dec 2021 17:03:53 +0100 Subject: [PATCH] [REF] compiler: simplify all compiled templates --- src/compiler/code_generator.ts | 21 +- tests/__snapshots__/reactivity.test.ts.snap | 19 +- .../__snapshots__/attributes.test.ts.snap | 50 +--- .../__snapshots__/comments.test.ts.snap | 3 - .../__snapshots__/error_handling.test.ts.snap | 1 - .../__snapshots__/event_handling.test.ts.snap | 41 +--- .../compiler/__snapshots__/misc.test.ts.snap | 12 +- .../__snapshots__/qweb_memory.test.ts.snap | 2 +- .../simple_templates.test.ts.snap | 28 +-- tests/compiler/__snapshots__/svg.test.ts.snap | 4 - .../__snapshots__/t_call.test.ts.snap | 94 +++----- .../__snapshots__/t_debug_log.test.ts.snap | 6 +- .../compiler/__snapshots__/t_esc.test.ts.snap | 17 +- .../__snapshots__/t_foreach.test.ts.snap | 35 ++- .../compiler/__snapshots__/t_if.test.ts.snap | 29 +-- .../compiler/__snapshots__/t_key.test.ts.snap | 5 +- .../compiler/__snapshots__/t_out.test.ts.snap | 54 ++--- .../compiler/__snapshots__/t_ref.test.ts.snap | 9 +- .../compiler/__snapshots__/t_set.test.ts.snap | 56 ++--- .../compiler/__snapshots__/t_tag.test.ts.snap | 8 - .../__snapshots__/template_set.test.ts.snap | 6 - .../__snapshots__/translation.test.ts.snap | 5 - .../__snapshots__/white_space.test.ts.snap | 6 - .../components/__snapshots__/app.test.ts.snap | 1 - .../__snapshots__/basics.test.ts.snap | 88 +------ .../__snapshots__/concurrency.test.ts.snap | 80 ------- .../__snapshots__/error_handling.test.ts.snap | 67 +----- .../__snapshots__/event_handling.test.ts.snap | 7 +- .../higher_order_component.test.ts.snap | 13 - .../__snapshots__/hooks.test.ts.snap | 17 -- .../__snapshots__/lifecycle.test.ts.snap | 54 ----- .../__snapshots__/props.test.ts.snap | 23 +- .../props_validation.test.ts.snap | 31 --- .../__snapshots__/reactivity.test.ts.snap | 5 - .../__snapshots__/refs.test.ts.snap | 5 +- .../__snapshots__/slots.test.ts.snap | 225 +++++++----------- .../__snapshots__/style_class.test.ts.snap | 35 --- .../__snapshots__/t_call.test.ts.snap | 29 +-- .../__snapshots__/t_call_block.test.ts.snap | 1 - .../__snapshots__/t_component.test.ts.snap | 17 -- .../__snapshots__/t_foreach.test.ts.snap | 32 +-- .../__snapshots__/t_key.test.ts.snap | 17 +- .../__snapshots__/t_model.test.ts.snap | 38 +-- .../__snapshots__/t_on.test.ts.snap | 10 +- .../__snapshots__/t_props.test.ts.snap | 8 - .../__snapshots__/t_set.test.ts.snap | 16 +- tests/misc/__snapshots__/memo.test.ts.snap | 5 - tests/misc/__snapshots__/portal.test.ts.snap | 28 +-- 48 files changed, 332 insertions(+), 1031 deletions(-) diff --git a/src/compiler/code_generator.ts b/src/compiler/code_generator.ts index ac2c4db0..1034d339 100644 --- a/src/compiler/code_generator.ts +++ b/src/compiler/code_generator.ts @@ -201,6 +201,7 @@ export class CodeGenerator { translatableAttributes: string[]; ast: AST; staticCalls: { id: string; template: string }[] = []; + helpers: Set = new Set(); constructor(ast: AST, options: CodeGenOptions) { this.translateFn = options.translateFn || ((s: string) => s); @@ -224,12 +225,13 @@ export class CodeGenerator { translate: true, tKeyExpr: null, }); - // define blocks and utility functions let mainCode = [ ` let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;`, - `let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;`, ]; + if (this.helpers.size) { + mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`); + } if (this.templateName) { mainCode.push(`// Template name: "${this.templateName}"`); } @@ -321,6 +323,7 @@ export class CodeGenerator { if (tKeyExpr) { keyArg = `${tKeyExpr} + ${keyArg}`; } + this.helpers.add("withKey"); this.addLine(`${block.parentVar}[${ctx.index}] = withKey(${blockExpr}, ${keyArg});`); return; } @@ -579,6 +582,7 @@ export class CodeGenerator { idx = block!.insertData(`${baseExpression}[${expression}]`); attrs[`block-attribute-${idx}`] = targetAttr; } + this.helpers.add("toNumber"); let valueCode = `ev.target.${targetAttr}`; valueCode = shouldTrim ? `${valueCode}.trim()` : valueCode; valueCode = shouldNumberize ? `toNumber(${valueCode})` : valueCode; @@ -635,10 +639,12 @@ export class CodeGenerator { let { block, forceNewBlock } = ctx; let expr: string; if (ast.expr === "0") { + this.helpers.add("zero"); expr = `ctx[zero]`; } else { expr = compileExpr(ast.expr); if (ast.defaultValue) { + this.helpers.add("withDefault"); expr = `withDefault(${expr}, \`${ast.defaultValue}\`)`; } } @@ -658,11 +664,13 @@ export class CodeGenerator { this.insertAnchor(block); } block = this.createBlock(block, "html", ctx); + this.helpers.add(ast.expr === "0" ? "zero" : "safeOutput"); let expr = ast.expr === "0" ? "ctx[zero]" : `safeOutput(${compileExpr(ast.expr)})`; if (ast.body) { const nextId = BlockDescription.nextBlockId; const subCtx: Context = createContext(ctx); this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx); + this.helpers.add("withDefault"); expr = `withDefault(${expr}, b${nextId})`; } this.insertBlock(`${expr}`, block, ctx); @@ -739,6 +747,7 @@ export class CodeGenerator { const keys = `k_block${block.id}`; const l = `l_block${block.id}`; const c = `c_block${block.id}`; + this.helpers.add("prepareList"); this.addLine( `const [${keys}, ${vals}, ${l}, ${c}] = prepareList(${compileExpr(ast.collection)});` ); @@ -874,10 +883,12 @@ export class CodeGenerator { if (ast.body) { this.addLine(`ctx = Object.create(ctx);`); this.addLine(`ctx[isBoundary] = 1;`); + this.helpers.add("isBoundary"); const nextId = BlockDescription.nextBlockId; const subCtx: Context = createContext(ctx, { preventRoot: true }); this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx); if (nextId !== BlockDescription.nextBlockId) { + this.helpers.add("zero"); this.addLine(`ctx[zero] = b${nextId};`); } } @@ -893,12 +904,14 @@ export class CodeGenerator { const templateVar = this.generateId("template"); this.addLine(`const ${templateVar} = ${subTemplate};`); block = this.createBlock(block, "multi", ctx); + this.helpers.add("call"); this.insertBlock(`call(this, ${templateVar}, ctx, node, ${key})`, block!, { ...ctx, forceNewBlock: !block, }); } else { const id = this.generateId(`callTemplate_`); + this.helpers.add("getTemplate"); this.staticCalls.push({ id, template: subTemplate }); block = this.createBlock(block, "multi", ctx); this.insertBlock(`${id}.call(this, ctx, node, ${key})`, block!, { @@ -924,6 +937,7 @@ export class CodeGenerator { compileTSet(ast: ASTTSet, ctx: Context) { this.target.shouldProtectScope = true; + this.helpers.add("isBoundary").add("withDefault"); const expr = ast.value ? compileExpr(ast.value || "") : "null"; if (ast.body) { const subCtx: Context = createContext(ctx); @@ -942,6 +956,7 @@ export class CodeGenerator { } else { value = expr; } + this.helpers.add("setContextValue"); this.addLine(`setContextValue(ctx, "${ast.name}", ${value});`); } } @@ -975,6 +990,7 @@ export class CodeGenerator { let ctxStr = "ctx"; if (this.target.loopLevel || !this.hasSafeContext) { ctxStr = this.generateId("ctx"); + this.helpers.add("capture"); this.addLine(`const ${ctxStr} = capture(ctx);`); } let slotStr: string[] = []; @@ -1062,6 +1078,7 @@ export class CodeGenerator { } compileTSlot(ast: ASTSlot, ctx: Context) { + this.helpers.add("callSlot"); let { block } = ctx; let blockString: string; let slotName; diff --git a/tests/__snapshots__/reactivity.test.ts.snap b/tests/__snapshots__/reactivity.test.ts.snap index 1695cfbb..69bb5cf4 100644 --- a/tests/__snapshots__/reactivity.test.ts.snap +++ b/tests/__snapshots__/reactivity.test.ts.snap @@ -50,7 +50,6 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -65,7 +64,6 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -83,7 +81,6 @@ exports[`Reactivity: useState destroyed component is inactive 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -98,7 +95,6 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -116,7 +112,6 @@ exports[`Reactivity: useState one components can subscribe twice to same context "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -132,7 +127,6 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -147,7 +141,6 @@ exports[`Reactivity: useState parent and children subscribed to same context 2`] "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -226,7 +219,6 @@ exports[`Reactivity: useState two components are updated in parallel 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -241,7 +233,6 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -257,7 +248,6 @@ exports[`Reactivity: useState two components can subscribe to same context 1`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -272,7 +262,6 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] = "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -288,7 +277,6 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -303,7 +291,6 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -318,7 +305,6 @@ exports[`Reactivity: useState two independent components on different levels are "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -334,7 +320,6 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -349,7 +334,6 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -364,7 +348,7 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; + let { prepareList, withKey } = helpers; let block1 = createBlock(\`
Total: Count:
\`); @@ -389,7 +373,6 @@ exports[`Reactivity: useState very simple use, with initial value 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); diff --git a/tests/compiler/__snapshots__/attributes.test.ts.snap b/tests/compiler/__snapshots__/attributes.test.ts.snap index 152f159f..f509a8fc 100644 --- a/tests/compiler/__snapshots__/attributes.test.ts.snap +++ b/tests/compiler/__snapshots__/attributes.test.ts.snap @@ -4,7 +4,6 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -19,7 +18,6 @@ exports[`attributes changing a class with t-att-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -34,7 +32,6 @@ exports[`attributes changing an attribute with t-att- 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -49,7 +46,6 @@ exports[`attributes class and t-att-class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -64,7 +60,6 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -79,7 +74,6 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -94,7 +88,6 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -109,7 +102,6 @@ exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -124,7 +116,6 @@ exports[`attributes dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -139,7 +130,6 @@ exports[`attributes dynamic class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -154,7 +144,6 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -169,7 +158,6 @@ exports[`attributes dynamic empty class attribute 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -184,7 +172,6 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -199,7 +186,6 @@ exports[`attributes fixed variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -214,7 +200,6 @@ exports[`attributes format expression 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -229,7 +214,6 @@ exports[`attributes format literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -244,7 +228,6 @@ exports[`attributes format multiple 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -259,7 +242,6 @@ exports[`attributes format value 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -274,7 +256,7 @@ exports[`attributes from object variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; + let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -292,7 +274,7 @@ exports[`attributes from variables set previously (no external node) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; + let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -310,7 +292,7 @@ exports[`attributes from variables set previously 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; + let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -328,7 +310,6 @@ exports[`attributes object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -343,7 +324,6 @@ exports[`attributes static attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -357,7 +337,6 @@ exports[`attributes static attributes on void elements 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\\"Test\\"/\`); @@ -371,7 +350,6 @@ exports[`attributes static attributes with dashes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -385,7 +363,6 @@ exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -400,7 +377,6 @@ exports[`attributes t-att-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -415,7 +391,6 @@ exports[`attributes t-att-class with multiple classes 2`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -430,7 +405,6 @@ 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, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -445,7 +419,6 @@ exports[`attributes t-att-class with object 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -460,7 +433,6 @@ exports[`attributes t-attf-class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -475,7 +447,6 @@ exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -490,7 +461,6 @@ exports[`attributes t-attf-class with multiple classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -505,7 +475,6 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -520,7 +489,6 @@ exports[`attributes tuple literal 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -535,7 +503,6 @@ exports[`attributes tuple variable 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -550,7 +517,6 @@ exports[`attributes two classes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -564,7 +530,6 @@ exports[`attributes two dynamic attributes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -580,7 +545,6 @@ exports[`attributes updating classes (with obj notation) 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -595,7 +559,6 @@ exports[`attributes various escapes 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
\`); @@ -612,7 +575,6 @@ exports[`attributes various escapes 2 1`] = ` "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`
<
\`); @@ -626,7 +588,6 @@ exports[`special cases for some specific html attributes/properties input of typ "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -641,7 +602,6 @@ exports[`special cases for some specific html attributes/properties input type= "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -656,7 +616,6 @@ exports[`special cases for some specific html attributes/properties input with t "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -671,7 +630,6 @@ exports[`special cases for some specific html attributes/properties select with "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`\`); @@ -686,7 +644,6 @@ exports[`special cases for some specific html attributes/properties textarea wit "function anonymous(bdom, helpers ) { let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; - let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers; let block1 = createBlock(\`