diff --git a/src/compiler/code_generator.ts b/src/compiler/code_generator.ts index 94cedbb9..f3217687 100644 --- a/src/compiler/code_generator.ts +++ b/src/compiler/code_generator.ts @@ -264,9 +264,7 @@ export class CodeGenerator { tKeyExpr: null, }); // define blocks and utility functions - let mainCode = [ - ` let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;`, - ]; + let mainCode = [` let { text, createBlock, list, multi, html, toggler, comment } = bdom;`]; if (this.helpers.size) { mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`); } @@ -1178,8 +1176,15 @@ export class CodeGenerator { if (ctx.tKeyExpr) { keyArg = `${ctx.tKeyExpr} + ${keyArg}`; } - const blockArgs = `${expr}, ${propString}, ${keyArg}, node, ctx`; - let blockExpr = `component(${blockArgs})`; + let id = generateId("comp"); + this.staticDefs.push({ + id, + expr: `app.createComponent(${ + ast.isDynamic ? null : expr + }, ${!ast.isDynamic}, ${!!ast.slots}, ${!!ast.dynamicProps})`, + }); + + let blockExpr = `${id}(${propString}, ${keyArg}, node, ctx, ${ast.isDynamic ? expr : null})`; if (ast.isDynamic) { blockExpr = `toggler(${expr}, ${blockExpr})`; } @@ -1270,8 +1275,14 @@ export class CodeGenerator { this.helpers.add("capture"); this.define(ctxStr, `capture(ctx)`); } + let id = generateId("comp"); + this.staticDefs.push({ + id, + expr: `app.createComponent(null, false, true, false)`, + }); + const target = compileExpr(ast.target); - const blockString = `component(Portal, {target: ${target},slots: {'default': {__render: ${name}, __ctx: ${ctxStr}}}}, key + \`${key}\`, node, ctx)`; + const blockString = `${id}({target: ${target},slots: {'default': {__render: ${name}, __ctx: ${ctxStr}}}}, key + \`${key}\`, node, ctx, Portal)`; if (block) { this.insertAnchor(block); } diff --git a/src/runtime/app.ts b/src/runtime/app.ts index ce71b395..4d6c8488 100644 --- a/src/runtime/app.ts +++ b/src/runtime/app.ts @@ -1,11 +1,12 @@ -import { Component, ComponentConstructor } from "./component"; +import { Component, ComponentConstructor, Props } from "./component"; import { ComponentNode } from "./component_node"; -import { MountOptions } from "./fibers"; -import { Scheduler } from "./scheduler"; -import { TemplateSet, TemplateSetConfig } from "./template_set"; import { nodeErrorHandlers } from "./error_handling"; -import { validateTarget } from "./utils"; +import { Fiber, MountOptions } from "./fibers"; +import { Scheduler } from "./scheduler"; +import { STATUS } from "./status"; import { validateProps } from "./template_helpers"; +import { TemplateSet, TemplateSetConfig } from "./template_set"; +import { validateTarget } from "./utils"; // reimplement dev mode stuff see last change in 0f7a8289a6fb8387c3c1af41c6664b2a8448758f @@ -112,6 +113,67 @@ export class App< this.root.destroy(); } } + + createComponent

( + name: string | null, + isStatic: boolean, + hasSlotsProp: boolean, + hasDynamicPropList: boolean + ) { + const isDynamic = !isStatic; + function _arePropsDifferent(props1: Props, props2: Props): boolean { + for (let k in props1) { + if (props1[k] !== props2[k]) { + return true; + } + } + return hasDynamicPropList && Object.keys(props1).length !== Object.keys(props2).length; + } + const arePropsDifferent = hasSlotsProp ? () => true : _arePropsDifferent; + + return (props: P, key: string, ctx: ComponentNode, parent: any, C: any) => { + let children = ctx.children; + let node: any = children[key]; + + if (node && node.status === STATUS.DESTROYED) { + node = undefined; + } + if (isDynamic && node && node.component.constructor !== C) { + node = undefined; + } + + const parentFiber = ctx.fiber!; + if (node) { + let shouldRender = node.forceNextRender; + if (shouldRender) { + node.forceNextRender = false; + } else { + const currentProps = node.props; + shouldRender = parentFiber.deep || arePropsDifferent(currentProps, props); + } + if (shouldRender) { + node.updateAndRender(props, parentFiber); + } + } else { + // new component + if (isStatic) { + C = parent.constructor.components[name as any]; + if (!C) { + throw new Error(`Cannot find the definition of component "${name}"`); + } else if (!(C.prototype instanceof Component)) { + throw new Error( + `"${name}" is not a Component. It must inherit from the Component class` + ); + } + } + node = new ComponentNode(C, props, this, ctx, key); + children[key] = node; + node.initiateRender(new Fiber(node, parentFiber)); + } + parentFiber.childrenMap[key] = node; + return node; + }; + } } export async function mount< diff --git a/src/runtime/component.ts b/src/runtime/component.ts index 6889de37..61a025ac 100644 --- a/src/runtime/component.ts +++ b/src/runtime/component.ts @@ -5,7 +5,7 @@ import type { ComponentNode } from "./component_node"; // Component Class // ----------------------------------------------------------------------------- -type Props = { [key: string]: any }; +export type Props = { [key: string]: any }; interface StaticComponentProperties { template: string; diff --git a/src/runtime/component_node.ts b/src/runtime/component_node.ts index 0238eade..bc43fa37 100644 --- a/src/runtime/component_node.ts +++ b/src/runtime/component_node.ts @@ -1,19 +1,18 @@ import type { App, Env } from "./app"; import { BDom, VNode } from "./blockdom"; +import { Component, ComponentConstructor, Props } from "./component"; +import { fibersInError, handleError } from "./error_handling"; +import { Fiber, makeChildFiber, makeRootFiber, MountFiber, MountOptions } from "./fibers"; import { clearReactivesForCallback, getSubscriptions, NonReactive, Reactive, reactive, - toRaw, TARGET, } from "./reactivity"; -import { batched, Callback } from "./utils"; -import { Component, ComponentConstructor } from "./component"; -import { fibersInError, handleError } from "./error_handling"; -import { Fiber, makeChildFiber, makeRootFiber, MountFiber, MountOptions } from "./fibers"; import { STATUS } from "./status"; +import { batched, Callback } from "./utils"; let currentNode: ComponentNode | null = null; @@ -31,14 +30,12 @@ export function useComponent(): Component { /** * Apply default props (only top level). */ -function applyDefaultProps

(props: P, defaultProps: Partial

): P { - const result = Object.assign({} as any, props); +function applyDefaultProps

(props: P, defaultProps: Partial

) { for (let propName in defaultProps) { if (props[propName] === undefined) { - result[propName] = defaultProps[propName]; + (props as any)[propName] = defaultProps[propName]; } } - return result; } // ----------------------------------------------------------------------------- // Integration with reactivity system (useState) @@ -67,72 +64,6 @@ export function useState(state: T): Reactive | NonReactive< return reactive(state, render); } -// ----------------------------------------------------------------------------- -// component function (used in compiled template code) -// ----------------------------------------------------------------------------- -type Props = { [key: string]: any }; - -function arePropsDifferent(props1: Props, props2: Props): boolean { - for (let k in props1) { - const prop1 = props1[k] && typeof props1[k] === "object" ? toRaw(props1[k]) : props1[k]; - const prop2 = props2[k] && typeof props2[k] === "object" ? toRaw(props2[k]) : props2[k]; - if (prop1 !== prop2) { - return true; - } - } - return Object.keys(props1).length !== Object.keys(props2).length; -} - -export function component

( - name: string | ComponentConstructor

, - props: P, - key: string, - ctx: ComponentNode, - parent: any -): ComponentNode

{ - let node: any = ctx.children[key]; - let isDynamic = typeof name !== "string"; - - if (node && node.status === STATUS.DESTROYED) { - node = undefined; - } - if (isDynamic && node && node.component.constructor !== name) { - node = undefined; - } - - const parentFiber = ctx.fiber!; - if (node) { - let shouldRender = node.forceNextRender; - if (shouldRender) { - node.forceNextRender = false; - } else { - const currentProps = node.props; - shouldRender = parentFiber.deep || arePropsDifferent(currentProps, props); - } - if (shouldRender) { - node.updateAndRender(props, parentFiber); - } - } else { - // new component - let C; - if (isDynamic) { - C = name; - } else { - C = parent.constructor.components[name as any]; - if (!C) { - throw new Error(`Cannot find the definition of component "${name}"`); - } else if (!(C.prototype instanceof Component)) { - throw new Error(`"${name}" is not a Component. It must inherit from the Component class`); - } - } - node = new ComponentNode(C, props, ctx.app, ctx, key); - ctx.children[key] = node; - node.initiateRender(new Fiber(node, parentFiber)); - } - parentFiber.childrenMap[key] = node; - return node; -} - // ----------------------------------------------------------------------------- // Component VNode class // ----------------------------------------------------------------------------- @@ -179,8 +110,9 @@ export class ComponentNode

implements VNode implements VNode\`); return function template(ctx, node, key = \\"\\") { let b2; if (ctx['state'].flag) { - b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); + b2 = comp1({}, key + \`__1\`, node, ctx, null); } return block1([], [b2]); } @@ -66,7 +67,7 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti exports[`Reactivity: useState destroyed component before being mounted is inactive 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -80,14 +81,15 @@ exports[`Reactivity: useState destroyed component before being mounted is inacti exports[`Reactivity: useState destroyed component is inactive 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); let block1 = createBlock(\`

\`); return function template(ctx, node, key = \\"\\") { let b2; if (ctx['state'].flag) { - b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); + b2 = comp1({}, key + \`__1\`, node, ctx, null); } return block1([], [b2]); } @@ -97,7 +99,7 @@ exports[`Reactivity: useState destroyed component is inactive 1`] = ` exports[`Reactivity: useState destroyed component is inactive 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -111,7 +113,7 @@ exports[`Reactivity: useState destroyed component is inactive 2`] = ` exports[`Reactivity: useState one components can subscribe twice to same context 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -126,12 +128,13 @@ exports[`Reactivity: useState one components can subscribe twice to same context exports[`Reactivity: useState parent and children subscribed to same context 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); + const b2 = comp1({}, key + \`__1\`, node, ctx, null); let txt1 = ctx['contextObj'].b; return block1([txt1], [b2]); } @@ -141,7 +144,7 @@ exports[`Reactivity: useState parent and children subscribed to same context 1`] exports[`Reactivity: useState parent and children subscribed to same context 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -218,13 +221,15 @@ exports[`Reactivity: useState several nodes on different level use same context exports[`Reactivity: useState two components are updated in parallel 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); + const comp2 = app.createComponent(\`Child\`, true, false, false); let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); - const b3 = component(\`Child\`, {}, key + \`__2\`, node, ctx); + const b2 = comp1({}, key + \`__1\`, node, ctx, null); + const b3 = comp2({}, key + \`__2\`, node, ctx, null); return block1([], [b2, b3]); } }" @@ -233,7 +238,7 @@ exports[`Reactivity: useState two components are updated in parallel 1`] = ` exports[`Reactivity: useState two components are updated in parallel 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -247,13 +252,15 @@ exports[`Reactivity: useState two components are updated in parallel 2`] = ` exports[`Reactivity: useState two components can subscribe to same context 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); + const comp2 = app.createComponent(\`Child\`, true, false, false); let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); - const b3 = component(\`Child\`, {}, key + \`__2\`, node, ctx); + const b2 = comp1({}, key + \`__1\`, node, ctx, null); + const b3 = comp2({}, key + \`__2\`, node, ctx, null); return block1([], [b2, b3]); } }" @@ -262,7 +269,7 @@ exports[`Reactivity: useState two components can subscribe to same context 1`] = exports[`Reactivity: useState two components can subscribe to same context 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -276,13 +283,15 @@ exports[`Reactivity: useState two components can subscribe to same context 2`] = exports[`Reactivity: useState two independent components on different levels are updated in parallel 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); + const comp2 = app.createComponent(\`Parent\`, true, false, false); let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); - const b3 = component(\`Parent\`, {}, key + \`__2\`, node, ctx); + const b2 = comp1({}, key + \`__1\`, node, ctx, null); + const b3 = comp2({}, key + \`__2\`, node, ctx, null); return block1([], [b2, b3]); } }" @@ -291,7 +300,7 @@ exports[`Reactivity: useState two independent components on different levels are exports[`Reactivity: useState two independent components on different levels are updated in parallel 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -305,12 +314,13 @@ exports[`Reactivity: useState two independent components on different levels are exports[`Reactivity: useState two independent components on different levels are updated in parallel 3`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; + const comp1 = app.createComponent(\`Child\`, true, false, false); let block1 = createBlock(\`
\`); return function template(ctx, node, key = \\"\\") { - const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx); + const b2 = comp1({}, key + \`__1\`, node, ctx, null); return block1([], [b2]); } }" @@ -319,7 +329,7 @@ exports[`Reactivity: useState two independent components on different levels are exports[`Reactivity: useState useContext=useState hook is reactive, for one component 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -333,8 +343,9 @@ exports[`Reactivity: useState useContext=useState hook is reactive, for one comp exports[`Reactivity: useState useless atoms should be deleted 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let { prepareList, withKey } = helpers; + const comp1 = app.createComponent(\`Quantity\`, true, false, false); let block1 = createBlock(\`
Total: Count:
\`); @@ -344,7 +355,7 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = ` for (let i1 = 0; i1 < l_block2; i1++) { ctx[\`id\`] = v_block2[i1]; const key1 = ctx['id']; - c_block2[i1] = withKey(component(\`Quantity\`, {id: ctx['id']}, key + \`__1__\${key1}\`, node, ctx), key1); + c_block2[i1] = withKey(comp1({id: ctx['id']}, key + \`__1__\${key1}\`, node, ctx, null), key1); } ctx = ctx.__proto__; const b2 = list(c_block2); @@ -358,7 +369,7 @@ exports[`Reactivity: useState useless atoms should be deleted 1`] = ` exports[`Reactivity: useState useless atoms should be deleted 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -372,7 +383,7 @@ exports[`Reactivity: useState useless atoms should be deleted 2`] = ` exports[`Reactivity: useState very simple use, with initial value 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); diff --git a/tests/app/__snapshots__/app.test.ts.snap b/tests/app/__snapshots__/app.test.ts.snap index 55aa6434..010c4172 100644 --- a/tests/app/__snapshots__/app.test.ts.snap +++ b/tests/app/__snapshots__/app.test.ts.snap @@ -3,7 +3,7 @@ exports[`app App supports env with getters/setters 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -18,7 +18,7 @@ exports[`app App supports env with getters/setters 1`] = ` exports[`app can configure an app with props 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -32,7 +32,7 @@ exports[`app can configure an app with props 1`] = ` exports[`app destroy remove the widget from the DOM 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -45,7 +45,7 @@ exports[`app destroy remove the widget from the DOM 1`] = ` exports[`app warnIfNoStaticProps works as expected 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); diff --git a/tests/compiler/__snapshots__/attributes.test.ts.snap b/tests/compiler/__snapshots__/attributes.test.ts.snap index 941acce0..b5afa9b8 100644 --- a/tests/compiler/__snapshots__/attributes.test.ts.snap +++ b/tests/compiler/__snapshots__/attributes.test.ts.snap @@ -3,7 +3,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -17,7 +17,7 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = ` exports[`attributes changing a class with t-att-class 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -31,7 +31,7 @@ exports[`attributes changing a class with t-att-class 1`] = ` exports[`attributes changing an attribute with t-att- 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -45,7 +45,7 @@ exports[`attributes changing an attribute with t-att- 1`] = ` exports[`attributes class and t-att-class should combine together 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -59,7 +59,7 @@ exports[`attributes class and t-att-class should combine together 1`] = ` exports[`attributes class and t-attf-class with ternary operation 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -73,7 +73,7 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = ` exports[`attributes dynamic attribute evaluating to 0 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -87,7 +87,7 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = ` exports[`attributes dynamic attribute falsy variable 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -101,7 +101,7 @@ exports[`attributes dynamic attribute falsy variable 1`] = ` exports[`attributes dynamic attribute with a dash 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -115,7 +115,7 @@ exports[`attributes dynamic attribute with a dash 1`] = ` exports[`attributes dynamic attributes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -129,7 +129,7 @@ exports[`attributes dynamic attributes 1`] = ` exports[`attributes dynamic class attribute 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -143,7 +143,7 @@ exports[`attributes dynamic class attribute 1`] = ` exports[`attributes dynamic class attribute evaluating to 0 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -157,7 +157,7 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = ` exports[`attributes dynamic empty class attribute 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -171,7 +171,7 @@ exports[`attributes dynamic empty class attribute 1`] = ` exports[`attributes dynamic formatted attributes with a dash 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -185,7 +185,7 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = ` exports[`attributes dynamic undefined class attribute 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -199,7 +199,7 @@ exports[`attributes dynamic undefined class attribute 1`] = ` exports[`attributes dynamic undefined generic attribute 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -213,7 +213,7 @@ exports[`attributes dynamic undefined generic attribute 1`] = ` exports[`attributes fixed variable 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -227,7 +227,7 @@ exports[`attributes fixed variable 1`] = ` exports[`attributes format expression 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -241,7 +241,7 @@ exports[`attributes format expression 1`] = ` exports[`attributes format literal 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -255,7 +255,7 @@ exports[`attributes format literal 1`] = ` exports[`attributes format multiple 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -269,7 +269,7 @@ exports[`attributes format multiple 1`] = ` exports[`attributes format value 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -283,7 +283,7 @@ exports[`attributes format value 1`] = ` exports[`attributes from object variables set previously 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -301,7 +301,7 @@ exports[`attributes from object variables set previously 1`] = ` exports[`attributes from variables set previously (no external node) 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`\`); @@ -319,7 +319,7 @@ exports[`attributes from variables set previously (no external node) 1`] = ` exports[`attributes from variables set previously 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let { isBoundary, withDefault, setContextValue } = helpers; let block1 = createBlock(\`
\`); @@ -337,7 +337,7 @@ exports[`attributes from variables set previously 1`] = ` exports[`attributes object 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -351,7 +351,7 @@ exports[`attributes object 1`] = ` exports[`attributes static attributes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -364,7 +364,7 @@ exports[`attributes static attributes 1`] = ` exports[`attributes static attributes on void elements 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\\"Test\\"/\`); @@ -377,7 +377,7 @@ exports[`attributes static attributes on void elements 1`] = ` exports[`attributes static attributes with dashes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -390,7 +390,7 @@ exports[`attributes static attributes with dashes 1`] = ` exports[`attributes string interpolation, alternate syntax 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -404,7 +404,7 @@ exports[`attributes string interpolation, alternate syntax 1`] = ` exports[`attributes t-att-class and class should combine together 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -418,7 +418,7 @@ exports[`attributes t-att-class and class should combine together 1`] = ` exports[`attributes t-att-class with multiple classes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -432,7 +432,7 @@ exports[`attributes t-att-class with multiple classes 1`] = ` exports[`attributes t-att-class with multiple classes 2`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -446,7 +446,7 @@ exports[`attributes t-att-class with multiple classes 2`] = ` exports[`attributes t-att-class with multiple classes, some of which are duplicate 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -460,7 +460,7 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica exports[`attributes t-att-class with object 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -474,7 +474,7 @@ exports[`attributes t-att-class with object 1`] = ` exports[`attributes t-attf-class 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -488,7 +488,7 @@ exports[`attributes t-attf-class 1`] = ` exports[`attributes t-attf-class should combine with class 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -502,7 +502,7 @@ exports[`attributes t-attf-class should combine with class 1`] = ` exports[`attributes t-attf-class with multiple classes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -516,7 +516,7 @@ exports[`attributes t-attf-class with multiple classes 1`] = ` exports[`attributes t-attf-class with multiple classes separated by multiple spaces 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -530,7 +530,7 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa exports[`attributes tuple literal 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -544,7 +544,7 @@ exports[`attributes tuple literal 1`] = ` exports[`attributes tuple variable 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -558,7 +558,7 @@ exports[`attributes tuple variable 1`] = ` exports[`attributes two classes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -571,7 +571,7 @@ exports[`attributes two classes 1`] = ` exports[`attributes two dynamic attributes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -586,7 +586,7 @@ exports[`attributes two dynamic attributes 1`] = ` exports[`attributes updating classes (with obj notation) 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -600,7 +600,7 @@ exports[`attributes updating classes (with obj notation) 1`] = ` exports[`attributes various escapes 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
\`); @@ -616,7 +616,7 @@ exports[`attributes various escapes 1`] = ` exports[`attributes various escapes 2 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`
<
\`); @@ -629,7 +629,7 @@ exports[`attributes various escapes 2 1`] = ` exports[`special cases for some specific html attributes/properties input of type checkbox with t-att-indeterminate 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -643,7 +643,7 @@ exports[`special cases for some specific html attributes/properties input of typ exports[`special cases for some specific html attributes/properties input type= checkbox, with t-att-checked 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -657,7 +657,7 @@ exports[`special cases for some specific html attributes/properties input type= exports[`special cases for some specific html attributes/properties input with t-att-value 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -671,7 +671,7 @@ exports[`special cases for some specific html attributes/properties input with t exports[`special cases for some specific html attributes/properties select with t-att-value 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`\`); @@ -685,7 +685,7 @@ exports[`special cases for some specific html attributes/properties select with exports[`special cases for some specific html attributes/properties textarea with t-att-value 1`] = ` "function anonymous(app, bdom, helpers ) { - let { text, createBlock, list, multi, html, toggler, component, comment } = bdom; + let { text, createBlock, list, multi, html, toggler, comment } = bdom; let block1 = createBlock(\`