Compare commits

..

12 Commits

Author SHA1 Message Date
Géry Debongnie 2068196377 [IMP] compiler: generate templates in strict mode
Before this commit, generated template functions were not using strict
mode. This may be a bad idea, since strict mode could be more performant
in some cases.
2022-06-24 15:54:09 +02:00
Géry Debongnie 7f580a4e1d [IMP] compiler: add support for binary operators 2022-06-24 15:39:55 +02:00
Géry Debongnie c7459ef87b [IMP] add support for t-call-context directive 2022-06-22 16:15:54 +02:00
Géry Debongnie 5772b4e9e4 [FIX] properly get component reference instead of context
Before this commit, the generated code for the component directive was
using the current context as the place to look for static informations
(such as the sub components). However, it is not entirely correct, since
the current context may be different than the current component (which
is easily accessed by using the this variable).

Also, while doing this, we fix some issues in the t-set directive, which
as calling lazy values with the wrong this.
2022-06-22 16:15:54 +02:00
Samuel Degueldre e57e2ee378 [FIX] blockdom: fix crash when class object key has leading spaces
Previously, having a leading or trailing space caused
HTMLElement.classList.add to be called with an empty string (because we
are splitting on whitespace), which is not allowed and caused a crash.
This commit fixes that by trimming the keys of the class object in the
same way that we already do it for class strings.
2022-06-22 15:48:45 +02:00
Géry Debongnie 2e03332acd [REL] v2.0.0-beta-10
# v2.0.0-beta-10

- ref: compiler: remove useless ; in compiled output
- ref: move some code around
- imp: app: small scale perf improvement
- imp: app: add fast path for when component has no prop
- imp: validation: add support for value types
- fix: compiler: escape backticks in attributes
2022-06-22 10:33:12 +02:00
Aaron Bohy c16d7d52b1 [FIX] compiler: escape backticks in attributes
Before this commit, the generated code crashed if an attribute in
the template contained backticks. The compiler output something
like

```js
   let block1 = createBlock(`<div foo="`bar`"/>`);
```

The backticks are now properly escaped.
2022-06-22 10:22:31 +02:00
Géry Debongnie 9c4c3e3b83 [IMP] validation: add support for value types
This commit add supports for value types in prop validation. To describe
a value V type, one has to simply write {value: V}.

Note that this commit also improves the validation typing.

closes #1198
closes #910
2022-06-15 08:56:44 +02:00
Géry Debongnie 55ac43c1db [IMP] app: add fast path for when component has no prop 2022-06-13 09:51:31 +02:00
Géry Debongnie d046913a01 [IMP] app: small scale perf improvement 2022-06-13 09:51:31 +02:00
Géry Debongnie 0e6059467f [REF] move component function to app, improve some code 2022-06-13 09:51:31 +02:00
Géry Debongnie 51538c2fea [IMP] compiler: remove useless ; in compiled output 2022-06-13 09:51:31 +02:00
67 changed files with 4419 additions and 2029 deletions
+2
View File
@@ -159,6 +159,7 @@ For each key, a `prop` definition is either a boolean, a constructor, a list of
- a boolean: indicate that the props exists, and is mandatory.
- a constructor: this should describe the type, for example: `id: Number` describe
the props `id` as a number
- an object describing a value as type. This is done by using the `value` key. For example, `{value: false}` specifies that the corresponding value should be equal to false.
- a list of constructors. In that case, this means that we allow more than one
type. For example, `id: [Number, String]` means that `id` can be either a string
or a number.
@@ -240,6 +241,7 @@ class ComponentB extends owl.Component {
size: {
validate: e => ["small", "medium", "large"].includes(e)
},
someId: [Number, {value: false}], // either a number or false
};
```
+9
View File
@@ -540,6 +540,15 @@ This can be used to define variables scoped to a sub template:
<!-- "var" does not exist here -->
```
Note: by default, the rendering context for a sub template is simply the current
rendering context (so, the current component). However, it may be useful to be
able to specify a specific object as context. This can be done by using the
`t-call-context` directive:
```xml
<t t-call="other-template" t-call-context="obj"/>
```
### Dynamic sub templates
The `t-call` directive can also be used to dynamically call a sub template,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@odoo/owl",
"version": "2.0.0-beta-9",
"version": "2.0.0-beta-10",
"description": "Odoo Web Library (OWL)",
"main": "dist/owl.cjs.js",
"browser": "dist/owl.iife.js",
+37 -14
View File
@@ -140,6 +140,7 @@ interface Context {
tKeyExpr: string | null;
nameSpace?: string;
tModelSelectedExpr?: string;
ctxVar?: string;
}
function createContext(parentCtx: Context, params?: Partial<Context>) {
@@ -265,7 +266,8 @@ export class CodeGenerator {
});
// define blocks and utility functions
let mainCode = [
` let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;`,
` "use strict";`,
`let { text, createBlock, list, multi, html, toggler, comment } = bdom;`,
];
if (this.helpers.size) {
mainCode.push(`let { ${[...this.helpers].join(", ")} } = helpers;`);
@@ -284,6 +286,7 @@ export class CodeGenerator {
for (let block of this.blocks) {
if (block.dom) {
let xmlString = block.asXmlString();
xmlString = xmlString.replace(/`/g, "\\`");
if (block.dynamicTagName) {
xmlString = xmlString.replace(/^<\w+/, `<\${tag || '${block.dom.nodeName}'}`);
xmlString = xmlString.replace(/\w+>$/, `\${tag || '${block.dom.nodeName}'}>`);
@@ -968,16 +971,21 @@ export class CodeGenerator {
compileTCall(ast: ASTTCall, ctx: Context) {
let { block, forceNewBlock } = ctx;
let ctxVar = ctx.ctxVar || "ctx";
if (ast.context) {
ctxVar = generateId("ctx");
this.addLine(`let ${ctxVar} = ${compileExpr(ast.context)};`);
}
if (ast.body) {
this.addLine(`ctx = Object.create(ctx);`);
this.addLine(`ctx[isBoundary] = 1;`);
this.addLine(`${ctxVar} = Object.create(${ctxVar});`);
this.addLine(`${ctxVar}[isBoundary] = 1;`);
this.helpers.add("isBoundary");
const nextId = BlockDescription.nextBlockId;
const subCtx: Context = createContext(ctx, { preventRoot: true });
const subCtx: Context = createContext(ctx, { preventRoot: true, ctxVar });
this.compileAST({ type: ASTType.Multi, content: ast.body }, subCtx);
if (nextId !== BlockDescription.nextBlockId) {
this.helpers.add("zero");
this.addLine(`ctx[zero] = b${nextId};`);
this.addLine(`${ctxVar}[zero] = b${nextId};`);
}
}
const isDynamic = INTERP_REGEXP.test(ast.name);
@@ -995,7 +1003,7 @@ export class CodeGenerator {
}
this.define(templateVar, subTemplate);
block = this.createBlock(block, "multi", ctx);
this.insertBlock(`call(this, ${templateVar}, ctx, node, ${key})`, block!, {
this.insertBlock(`call(this, ${templateVar}, ${ctxVar}, node, ${key})`, block!, {
...ctx,
forceNewBlock: !block,
});
@@ -1003,13 +1011,13 @@ export class CodeGenerator {
const id = generateId(`callTemplate_`);
this.staticDefs.push({ id, expr: `app.getTemplate(${subTemplate})` });
block = this.createBlock(block, "multi", ctx);
this.insertBlock(`${id}.call(this, ctx, node, ${key})`, block!, {
this.insertBlock(`${id}.call(this, ${ctxVar}, node, ${key})`, block!, {
...ctx,
forceNewBlock: !block,
});
}
if (ast.body && !ctx.isLast) {
this.addLine(`ctx = ctx.__proto__;`);
this.addLine(`${ctxVar} = ${ctxVar}.__proto__;`);
}
}
@@ -1032,7 +1040,7 @@ export class CodeGenerator {
this.helpers.add("LazyValue");
const bodyAst: AST = { type: ASTType.Multi, content: ast.body };
const name = this.compileInNewTarget("value", bodyAst, ctx);
let value = `new LazyValue(${name}, ctx, node)`;
let value = `new LazyValue(${name}, ctx, this, node)`;
value = ast.value ? (value ? `withDefault(${expr}, ${value})` : expr) : value;
this.addLine(`ctx[\`${ast.name}\`] = ${value};`);
} else {
@@ -1047,7 +1055,7 @@ export class CodeGenerator {
value = expr;
}
this.helpers.add("setContextValue");
this.addLine(`setContextValue(ctx, "${ast.name}", ${value});`);
this.addLine(`setContextValue(${ctx.ctxVar || "ctx"}, "${ast.name}", ${value});`);
}
}
@@ -1178,8 +1186,17 @@ 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}, ${
!ast.props && !ast.dynamicProps
})`,
});
let blockExpr = `${id}(${propString}, ${keyArg}, node, this, ${ast.isDynamic ? expr : null})`;
if (ast.isDynamic) {
blockExpr = `toggler(${expr}, ${blockExpr})`;
}
@@ -1268,10 +1285,16 @@ export class CodeGenerator {
if (this.target.loopLevel || !this.hasSafeContext) {
ctxStr = generateId("ctx");
this.helpers.add("capture");
this.define(ctxStr, `capture(ctx);`);
this.define(ctxStr, `capture(ctx)`);
}
let id = generateId("comp");
this.staticDefs.push({
id,
expr: `app.createComponent(null, false, true, false, 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);
}
+2 -3
View File
@@ -86,9 +86,8 @@ const STATIC_TOKEN_MAP: { [key: string]: TKind } = Object.assign(Object.create(n
// note that the space after typeof is relevant. It makes sure that the formatted
// expression has a space after typeof. Currently we don't support delete and void
const OPERATORS = "...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ".split(
","
);
const OPERATORS =
"...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");
type Tokenizer = (expr: string) => Token | false;
+6 -2
View File
@@ -115,6 +115,7 @@ export interface ASTTCall {
type: ASTType.TCall;
name: string;
body: AST[] | null;
context: string | null;
}
interface SlotDefinition {
@@ -557,11 +558,13 @@ function parseTCall(node: Element, ctx: ParsingContext): AST | null {
return null;
}
const subTemplate = node.getAttribute("t-call")!;
const context = node.getAttribute("t-call-context");
node.removeAttribute("t-call");
node.removeAttribute("t-call-context");
if (node.tagName !== "t") {
const ast = parseNode(node, ctx);
const tcall: AST = { type: ASTType.TCall, name: subTemplate, body: null };
const tcall: AST = { type: ASTType.TCall, name: subTemplate, body: null, context };
if (ast && ast.type === ASTType.DomNode) {
ast.content = [tcall];
return ast;
@@ -579,6 +582,7 @@ function parseTCall(node: Element, ctx: ParsingContext): AST | null {
type: ASTType.TCall,
name: subTemplate,
body: body.length ? body : null,
context,
};
}
+66 -5
View File
@@ -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,66 @@ export class App<
this.root.destroy();
}
}
createComponent<P extends Props>(
name: string | null,
isStatic: boolean,
hasSlotsProp: boolean,
hasDynamicPropList: boolean,
hasNoProp: 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
? (_1: any, _2: any) => true
: hasNoProp
? (_1: any, _2: any) => false
: _arePropsDifferent;
const updateAndRender = ComponentNode.prototype.updateAndRender;
const initiateRender = ComponentNode.prototype.initiateRender;
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 || (isDynamic && node.component.constructor !== C))
) {
node = undefined;
}
const parentFiber = ctx.fiber!;
if (node) {
if (arePropsDifferent(node.props, props) || parentFiber.deep || node.forceNextRender) {
node.forceNextRender = false;
updateAndRender.call(node, 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;
initiateRender.call(node, new Fiber(node, parentFiber));
}
parentFiber.childrenMap[key] = node;
return node;
};
}
}
export async function mount<
+4
View File
@@ -93,6 +93,10 @@ function toClassObj(expr: string | number | { [c: string]: any }) {
for (let key in expr as any) {
const value = (expr as any)[key];
if (value) {
key = trim.call(key);
if (!key) {
continue;
}
const words = split.call(key, wordRegexp);
for (let word of words) {
result[word] = value;
+1 -1
View File
@@ -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;
+19 -81
View File
@@ -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<P extends object>(props: P, defaultProps: Partial<P>): P {
const result = Object.assign({} as any, props);
function applyDefaultProps<P extends object>(props: P, defaultProps: Partial<P>) {
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<T extends object>(state: T): Reactive<T> | 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<P extends Props>(
name: string | ComponentConstructor<P>,
props: P,
key: string,
ctx: ComponentNode,
parent: any
): ComponentNode<P> {
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<P extends Props = any, E = any> implements VNode<Comp
this.parentKey = parentKey;
this.level = parent ? parent.level + 1 : 0;
const defaultProps = C.defaultProps;
props = Object.assign({}, props);
if (defaultProps) {
props = applyDefaultProps(props, defaultProps);
applyDefaultProps(props, defaultProps);
}
const env = (parent && parent.childEnv) || app.env;
this.childEnv = env;
@@ -297,13 +229,14 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
async updateAndRender(props: P, parentFiber: Fiber) {
const rawProps = props;
props = Object.assign({}, props);
// update
const fiber = makeChildFiber(this, parentFiber);
this.fiber = fiber;
const component = this.component;
const defaultProps = (component.constructor as any).defaultProps;
if (defaultProps) {
props = applyDefaultProps(props, defaultProps);
applyDefaultProps(props, defaultProps);
}
currentNode = this;
@@ -388,10 +321,15 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
}
}
_patch() {
const hasChildren = Object.keys(this.children).length > 0;
this.children = this.fiber!.childrenMap;
this.bdom!.patch(this!.fiber!.bdom!, hasChildren);
this.fiber!.appliedToDom = true;
let hasChildren = false;
for (let _k in this.children) {
hasChildren = true;
break;
}
const fiber = this.fiber!;
this.children = fiber.childrenMap;
this.bdom!.patch(fiber.bdom!, hasChildren);
fiber.appliedToDom = true;
this.fiber = null;
}
+13 -8
View File
@@ -5,6 +5,7 @@ import { isOptional, validateSchema } from "./validation";
import type { ComponentConstructor } from "./component";
import { markRaw } from "./reactivity";
const ObjectCreate = Object.create;
/**
* This file contains utility functions that will be injected in each template,
* to perform various useful tasks in the compiled code.
@@ -26,7 +27,7 @@ function callSlot(
key = key + "__slot_" + name;
const slots = ctx.props.slots || {};
const { __render, __ctx, __scope } = slots[name] || {};
const slotScope = Object.create(__ctx || {});
const slotScope = ObjectCreate(__ctx || {});
if (__scope) {
slotScope[__scope] = extra;
}
@@ -46,7 +47,7 @@ function callSlot(
function capture(ctx: any): any {
const component = ctx.__owl__.component;
const result = Object.create(component);
const result = ObjectCreate(component);
for (let k in ctx) {
result[k] = ctx[k];
}
@@ -107,15 +108,17 @@ function shallowEqual(l1: any[], l2: any[]): boolean {
class LazyValue {
fn: any;
ctx: any;
component: any;
node: any;
constructor(fn: any, ctx: any, node: any) {
constructor(fn: any, ctx: any, component: any, node: any) {
this.fn = fn;
this.ctx = capture(ctx);
this.component = component;
this.node = node;
}
evaluate(): any {
return this.fn(this.ctx, this.node);
return this.fn.call(this.component, this.ctx, this.node);
}
toString() {
@@ -161,18 +164,20 @@ export function safeOutput(value: any): ReturnType<typeof toggler> {
}
let boundFunctions = new WeakMap();
const WeakMapGet = WeakMap.prototype.get;
const WeakMapSet = WeakMap.prototype.set;
function bind(ctx: any, fn: Function): Function {
let component = ctx.__owl__.component;
let boundFnMap = boundFunctions.get(component);
let boundFnMap = WeakMapGet.call(boundFunctions, component);
if (!boundFnMap) {
boundFnMap = new WeakMap();
boundFunctions.set(component, boundFnMap);
WeakMapSet.call(boundFunctions, component, boundFnMap);
}
let boundFn = boundFnMap.get(fn);
let boundFn = WeakMapGet.call(boundFnMap, fn);
if (!boundFn) {
boundFn = fn.bind(component);
boundFnMap.set(fn, boundFn);
WeakMapSet.call(boundFnMap, fn, boundFn);
}
return boundFn;
}
+3 -3
View File
@@ -1,10 +1,10 @@
import { createBlock, html, list, multi, text, toggler, comment } from "./blockdom";
import { compile, Template, TemplateFunction } from "../compiler";
import { comment, createBlock, html, list, multi, text, toggler } from "./blockdom";
import { getCurrent } from "./component_node";
import { Portal, portalTemplate } from "./portal";
import { component, getCurrent } from "./component_node";
import { helpers } from "./template_helpers";
const bdom = { text, createBlock, list, multi, html, toggler, component, comment };
const bdom = { text, createBlock, list, multi, html, toggler, comment };
function parseXML(xml: string): Document {
const parser = new DOMParser();
+10 -4
View File
@@ -8,9 +8,6 @@ type BaseType =
| true
| "*";
type UnionType = (TypeInfo | BaseType)[];
type TypeDescription = BaseType | UnionType | TypeInfo;
interface TypeInfo {
type?: TypeDescription;
optional?: boolean;
@@ -19,6 +16,9 @@ interface TypeInfo {
element?: TypeDescription;
}
type ValueType = { value: any };
type TypeDescription = BaseType | TypeInfo | ValueType | TypeDescription[];
type SimplifiedSchema = string[];
type NormalizedSchema = { [key: string]: TypeDescription };
export type Schema = SimplifiedSchema | NormalizedSchema;
@@ -26,8 +26,10 @@ export type Schema = SimplifiedSchema | NormalizedSchema;
// -----------------------------------------------------------------------------
// helpers
// -----------------------------------------------------------------------------
const isUnionType = (t: TypeDescription): t is UnionType => Array.isArray(t);
const isUnionType = (t: TypeDescription): t is TypeDescription[] => Array.isArray(t);
const isBaseType = (t: TypeDescription): t is BaseType => typeof t !== "object";
const isValueType = (t: TypeDescription): t is ValueType =>
typeof t === "object" && t && "value" in t;
export function isOptional(t: TypeDescription): Boolean {
return typeof t === "object" && "optional" in t ? t.optional || false : false;
@@ -42,6 +44,8 @@ function describe(info: TypeDescription): string {
return describeType(info);
} else if (isUnionType(info)) {
return info.map(describe).join(" or ");
} else if (isValueType(info)) {
return String(info.value);
}
if ("element" in info) {
return `list of ${describe({ type: info.element, optional: false })}s`;
@@ -134,6 +138,8 @@ function validateType(key: string, value: any, descr: TypeDescription): string |
return isOptional(descr) ? null : `'${key}' is undefined (should be a ${describe(descr)})`;
} else if (isBaseType(descr)) {
return validateBaseType(key, value, descr);
} else if (isValueType(descr)) {
return value === descr.value ? null : `'${key}' is not equal to '${descr.value}'`;
} else if (isUnionType(descr)) {
let validDescr = descr.find((p) => !validateType(key, value, p));
return validDescr ? null : `'${key}' is not a ${describe(descr)}`;
+58 -29
View File
@@ -49,14 +49,16 @@ exports[`Reactivity: useState concurrent renderings 3`] = `
exports[`Reactivity: useState destroyed component before being mounted is inactive 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -66,7 +68,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -80,14 +83,16 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -97,7 +102,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -111,7 +117,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -126,12 +133,14 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
let txt1 = ctx['contextObj'].b;
return block1([txt1], [b2]);
}
@@ -141,7 +150,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -218,13 +228,16 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
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, this, null);
const b3 = comp2({}, key + \`__2\`, node, this, null);
return block1([], [b2, b3]);
}
}"
@@ -233,7 +246,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -247,13 +261,16 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
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, this, null);
const b3 = comp2({}, key + \`__2\`, node, this, null);
return block1([], [b2, b3]);
}
}"
@@ -262,7 +279,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -276,13 +294,16 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Parent\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
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, this, null);
const b3 = comp2({}, key + \`__2\`, node, this, null);
return block1([], [b2, b3]);
}
}"
@@ -291,7 +312,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -305,12 +327,14 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -319,7 +343,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -333,8 +358,10 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Quantity\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/> Total: <block-text-0/> Count: <block-text-1/></div>\`);
@@ -344,7 +371,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, this, null), key1);
}
ctx = ctx.__proto__;
const b2 = list(c_block2);
@@ -358,7 +385,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -372,7 +400,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
+8 -4
View File
@@ -3,7 +3,8 @@
exports[`app App supports env with getters/setters 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
@@ -18,7 +19,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -32,7 +34,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -45,7 +48,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -3,7 +3,8 @@
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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
@@ -17,7 +18,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -31,7 +33,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"value\\"/>\`);
@@ -45,7 +48,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\" class=\\"hello\\"/>\`);
@@ -59,7 +63,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
@@ -73,7 +78,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -87,7 +93,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -101,7 +108,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"data-action-id\\"/>\`);
@@ -115,7 +123,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -126,10 +135,26 @@ exports[`attributes dynamic attributes 1`] = `
}"
`;
exports[`attributes dynamic attributes with backticks 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = \`bar\`;
return block1([attr1]);
}
}"
`;
exports[`attributes dynamic class attribute 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -143,7 +168,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -154,10 +180,56 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = `
}"
`;
exports[`attributes dynamic class attribute that starts and ends with a space 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = ctx['c'];
return block1([attr1]);
}
}"
`;
exports[`attributes dynamic class attribute which is only a space 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = ctx['c'];
return block1([attr1]);
}
}"
`;
exports[`attributes dynamic class attribute with multiple consecutive spaces 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = ctx['c'];
return block1([attr1]);
}
}"
`;
exports[`attributes dynamic empty class attribute 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -171,7 +243,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"aria-label\\"/>\`);
@@ -185,7 +258,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -199,7 +273,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"thing\\"/>\`);
@@ -213,7 +288,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -227,7 +303,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -241,7 +318,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -255,7 +333,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -269,7 +348,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -283,7 +363,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><span block-attribute-0=\\"class\\"/></div>\`);
@@ -301,7 +382,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
@@ -319,7 +401,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><span block-attribute-0=\\"class\\"/></div>\`);
@@ -337,7 +420,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
@@ -351,7 +435,8 @@ exports[`attributes object 1`] = `
exports[`attributes static attributes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div foo=\\"a\\" bar=\\"b\\" baz=\\"c\\"/>\`);
@@ -364,7 +449,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<img src=\\"/test.skip.jpg\\" alt=\\"Test\\"/>\`);
@@ -374,10 +460,25 @@ exports[`attributes static attributes on void elements 1`] = `
}"
`;
exports[`attributes static attributes with backticks 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div foo=\\"\\\\\`bar\\\\\`\\"/>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`attributes static attributes with dashes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div aria-label=\\"Close\\"/>\`);
@@ -390,7 +491,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
@@ -404,7 +506,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
@@ -418,7 +521,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -432,7 +536,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -443,10 +548,26 @@ exports[`attributes t-att-class with multiple classes 2`] = `
}"
`;
exports[`attributes t-att-class with multiple classes 3`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = {'a b c':ctx['value']};
return block1([attr1]);
}
}"
`;
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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -460,7 +581,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"static\\" block-attribute-0=\\"class\\"/>\`);
@@ -471,10 +593,41 @@ exports[`attributes t-att-class with object 1`] = `
}"
`;
exports[`attributes t-att-class with object 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = {' a ':ctx['value']};
return block1([attr1]);
}
}"
`;
exports[`attributes t-att-class with object 3`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
return function template(ctx, node, key = \\"\\") {
let attr1 = {' ':ctx['value']};
return block1([attr1]);
}
}"
`;
exports[`attributes t-attf-class 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -488,7 +641,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
@@ -502,7 +656,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -516,7 +671,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -530,7 +686,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
@@ -544,7 +701,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
@@ -558,7 +716,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"a b\\"/>\`);
@@ -571,7 +730,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\" block-attribute-1=\\"bar\\"/>\`);
@@ -586,7 +746,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
@@ -600,7 +761,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div foo=\\"&lt;foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
@@ -616,7 +778,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div> &lt; </div>\`);
@@ -629,7 +792,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"indeterminate\\"/>\`);
@@ -643,7 +807,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
@@ -657,7 +822,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
@@ -671,7 +837,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<select block-attribute-0=\\"value\\"><option value=\\"potato\\">Potato</option><option value=\\"tomato\\">Tomato</option><option value=\\"onion\\">Onion</option></select>\`);
@@ -685,7 +852,8 @@ 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;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<textarea block-attribute-0=\\"value\\"/>\`);
@@ -699,7 +867,8 @@ exports[`special cases for some specific html attributes/properties textarea wit
exports[`special cases for some specific html attributes/properties various boolean html attributes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><input type=\\"checkbox\\" checked=\\"checked\\"/><input checked=\\"checked\\"/><div checked=\\"checked\\"/><div selected=\\"selected\\"/><option selected=\\"selected\\" other=\\"1\\"/><input readonly=\\"readonly\\"/><button disabled=\\"disabled\\"/></div>\`);
@@ -3,7 +3,8 @@
exports[`comments only a comment 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return comment(\` comment\`);
@@ -14,7 +15,8 @@ exports[`comments only a comment 1`] = `
exports[`comments properly handle comments 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>hello <!-- comment-->owl</div>\`);
@@ -27,7 +29,8 @@ exports[`comments properly handle comments 1`] = `
exports[`comments properly handle comments between t-if/t-else 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block2 = createBlock(\`<span>true</span>\`);
@@ -3,7 +3,8 @@
exports[`t-on can bind event handler 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -17,7 +18,8 @@ exports[`t-on can bind event handler 1`] = `
exports[`t-on can bind handlers with arguments 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -32,7 +34,8 @@ exports[`t-on can bind handlers with arguments 1`] = `
exports[`t-on can bind handlers with empty object 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -47,7 +50,8 @@ exports[`t-on can bind handlers with empty object 1`] = `
exports[`t-on can bind handlers with empty object (with non empty inner string) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -62,7 +66,8 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
exports[`t-on can bind handlers with empty object (with non empty inner string) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
@@ -89,7 +94,8 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
exports[`t-on can bind handlers with object arguments 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -104,7 +110,8 @@ exports[`t-on can bind handlers with object arguments 1`] = `
exports[`t-on can bind two event handlers 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\" block-handler-1=\\"dblclick\\">Click</button>\`);
@@ -119,7 +126,8 @@ exports[`t-on can bind two event handlers 1`] = `
exports[`t-on handler is bound to proper owner 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -133,7 +141,8 @@ exports[`t-on handler is bound to proper owner 1`] = `
exports[`t-on handler is bound to proper owner, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block2 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -155,7 +164,8 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = `
exports[`t-on handler is bound to proper owner, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
return function template(ctx, node, key = \\"\\") {
@@ -167,7 +177,8 @@ exports[`t-on handler is bound to proper owner, part 3 1`] = `
exports[`t-on handler is bound to proper owner, part 3 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -181,7 +192,8 @@ exports[`t-on handler is bound to proper owner, part 3 2`] = `
exports[`t-on handler is bound to proper owner, part 4 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -205,7 +217,8 @@ exports[`t-on handler is bound to proper owner, part 4 1`] = `
exports[`t-on handler is bound to proper owner, part 4 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -219,7 +232,8 @@ exports[`t-on handler is bound to proper owner, part 4 2`] = `
exports[`t-on receive event in first argument 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -233,7 +247,8 @@ exports[`t-on receive event in first argument 1`] = `
exports[`t-on t-on modifiers (native listener) basic support for native listener 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"myClass\\" block-handler-0=\\"click\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
@@ -248,7 +263,8 @@ exports[`t-on t-on modifiers (native listener) basic support for native listener
exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-text-1/></button></div>\`);
@@ -263,7 +279,8 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-child-0/></button></div>\`);
@@ -279,7 +296,8 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-handler-0=\\"click.capture\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
@@ -294,7 +312,8 @@ exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] =
exports[`t-on t-on modifiers (native listener) t-on with empty handler (only modifiers) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button</button></div>\`);
@@ -308,7 +327,8 @@ exports[`t-on t-on modifiers (native listener) t-on with empty handler (only mod
exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifiers (order matters) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent.self\\"><span>Button</span></button></div>\`);
@@ -322,7 +342,8 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifi
exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop modifiers 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button 1</button><button block-handler-1=\\"click.stop\\">Button 2</button><button block-handler-2=\\"click.prevent.stop\\">Button 3</button></div>\`);
@@ -338,7 +359,8 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop mod
exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -365,7 +387,8 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifiers (order matters) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click.self.prevent\\"><span>Button</span></button></div>\`);
@@ -379,7 +402,8 @@ exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifi
exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><span>Button</span></button><button block-handler-1=\\"click.self\\"><span>Button</span></button></div>\`);
@@ -394,7 +418,8 @@ exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-handler-0=\\"click.synthetic\\"><button block-handler-1=\\"click.synthetic\\">Button</button></div>\`);
@@ -409,7 +434,8 @@ exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`
exports[`t-on t-on with inline statement (function call) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -424,7 +450,8 @@ exports[`t-on t-on with inline statement (function call) 1`] = `
exports[`t-on t-on with inline statement 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
@@ -439,7 +466,8 @@ exports[`t-on t-on with inline statement 1`] = `
exports[`t-on t-on with inline statement, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
@@ -454,7 +482,8 @@ exports[`t-on t-on with inline statement, part 2 1`] = `
exports[`t-on t-on with inline statement, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Toggle</button>\`);
@@ -470,7 +499,8 @@ exports[`t-on t-on with inline statement, part 3 1`] = `
exports[`t-on t-on with t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -485,7 +515,8 @@ exports[`t-on t-on with t-call 1`] = `
exports[`t-on t-on with t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
@@ -499,7 +530,8 @@ exports[`t-on t-on with t-call 2`] = `
exports[`t-on t-on, with arguments and t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -514,7 +546,8 @@ exports[`t-on t-on, with arguments and t-call 1`] = `
exports[`t-on t-on, with arguments and t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
+18 -9
View File
@@ -3,8 +3,10 @@
exports[`misc complex template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`SlotButton\`, true, false, false, false);
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><div block-attribute-1=\\"class\\"><div class=\\"batch_header\\"><a block-attribute-2=\\"href\\" block-attribute-3=\\"class\\" title=\\"View Batch\\"><block-text-4/><block-child-0/><i class=\\"arrow fa fa-window-maximize\\"/></a></div><block-child-1/><div class=\\"batch_slots\\"><block-child-2/><block-child-3/></div><div class=\\"batch_commits\\"><block-child-4/></div></div></div>\`);
let block2 = createBlock(\`<i class=\\"fa fa-exclamation-triangle\\"/>\`);
@@ -34,7 +36,7 @@ exports[`misc complex template 1`] = `
for (let i1 = 0; i1 < l_block4; i1++) {
ctx[\`slot\`] = v_block4[i1];
const key1 = ctx['slot'].id;
c_block4[i1] = withKey(component(\`SlotButton\`, {class: ctx['slot_container'],slot: ctx['slot']}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block4[i1] = withKey(comp1({class: ctx['slot_container'],slot: ctx['slot']}, key + \`__1__\${key1}\`, node, this, null), key1);
}
ctx = ctx.__proto__;
b4 = list(c_block4);
@@ -81,7 +83,8 @@ exports[`misc complex template 1`] = `
exports[`misc global 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, zero, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`_callee-uses-foo\`);
const callTemplate_2 = app.getTemplate(\`_callee-uses-foo\`);
@@ -133,7 +136,8 @@ exports[`misc global 1`] = `
exports[`misc global 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { withDefault } = helpers;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -148,7 +152,8 @@ exports[`misc global 2`] = `
exports[`misc global 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<año block-attribute-0=\\"falló\\"><block-child-0/></año>\`);
@@ -164,7 +169,8 @@ exports[`misc global 3`] = `
exports[`misc global 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput, withDefault } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -180,9 +186,12 @@ exports[`misc global 4`] = `
exports[`misc other complex template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`LOAD_INFOS_TEMPLATE\`);
const comp1 = app.createComponent(\`BundlesList\`, true, false, false, false);
const comp2 = app.createComponent(\`BundlesList\`, true, false, false, false);
let block1 = createBlock(\`<div><header><nav class=\\"navbar navbar-expand-md navbar-light bg-light\\"><a block-attribute-0=\\"href\\"><b style=\\"color:#777;\\"><block-text-1/></b></a><button type=\\"button\\" class=\\"navbar-toggler\\" data-toggle=\\"collapse\\" data-target=\\"#top_menu_collapse\\"><span class=\\"navbar-toggler-icon\\"/></button><div class=\\"collapse navbar-collapse\\" id=\\"top_menu_collapse\\" aria-expanded=\\"false\\"><ul class=\\"nav navbar-nav ml-auto text-right\\" id=\\"top_menu\\"><block-child-0/><li class=\\"nav-item divider\\"/><block-child-1/></ul><div><div class=\\"input-group input-group-sm\\"><div class=\\"input-group-prepend input-group-sm\\"><button class=\\"btn btn-default fa fa-cog\\" title=\\"Settings\\" block-handler-2=\\"click\\"/><button class=\\"btn btn-default\\" block-handler-3=\\"click\\"> More </button><block-child-2/></div><input class=\\"form-control\\" type=\\"text\\" placeholder=\\"Search\\" aria-label=\\"Search\\" name=\\"search\\" block-attribute-4=\\"value\\" block-handler-5=\\"keyup\\" block-handler-6=\\"change\\" block-ref=\\"7\\"/><div class=\\"input-group-append\\"><button class=\\"btn btn-default fa fa-eraser\\" block-handler-8=\\"click\\"/></div></div></div></div></nav></header><div class=\\"container-fluid\\" block-ref=\\"9\\"><div class=\\"row\\"><!--div class=\\"form-group col-md-6\\">
<h5>Search options</h5>
@@ -316,8 +325,8 @@ exports[`misc other complex template 1`] = `
if (!ctx['project']) {
b24 = block24();
} else {
const b26 = component(\`BundlesList\`, {bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__2\`, node, ctx);
const b27 = component(\`BundlesList\`, {bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__3\`, node, ctx);
const b26 = comp1({bundles: ctx['bundles'].sticky,category_custom_views: ctx['category_custom_views'],search: ctx['search']}, key + \`__2\`, node, this, null);
const b27 = comp2({bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__3\`, node, this, null);
b25 = block25([], [b26, b27]);
}
return block1([attr1, txt1, hdlr2, hdlr3, attr8, hdlr4, hdlr5, ref1, hdlr6, ref2], [b2, b4, b14, b17, b22, b23, b24, b25]);
@@ -3,7 +3,8 @@
exports[`memory t-foreach does not leak stuff in global scope 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<p><block-child-0/></p>\`);
@@ -3,7 +3,8 @@
exports[`simple templates, mostly static can render a table row 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<tr><td>cell</td></tr>\`);
@@ -16,7 +17,8 @@ exports[`simple templates, mostly static can render a table row 1`] = `
exports[`simple templates, mostly static div with a class attribute 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"abc\\">foo</div>\`);
@@ -29,7 +31,8 @@ exports[`simple templates, mostly static div with a class attribute 1`] = `
exports[`simple templates, mostly static div with a class attribute with a quote 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"a'bc\\">word</div>\`);
@@ -42,7 +45,8 @@ exports[`simple templates, mostly static div with a class attribute with a quote
exports[`simple templates, mostly static div with a span child node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span>word</span></div>\`);
@@ -55,7 +59,8 @@ exports[`simple templates, mostly static div with a span child node 1`] = `
exports[`simple templates, mostly static div with an arbitrary attribute with a quote 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div abc=\\"a'bc\\">word</div>\`);
@@ -68,7 +73,8 @@ exports[`simple templates, mostly static div with an arbitrary attribute with a
exports[`simple templates, mostly static div with an empty class attribute 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>word</div>\`);
@@ -81,7 +87,8 @@ exports[`simple templates, mostly static div with an empty class attribute 1`] =
exports[`simple templates, mostly static div with content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>foo</div>\`);
@@ -94,7 +101,8 @@ exports[`simple templates, mostly static div with content 1`] = `
exports[`simple templates, mostly static dom node with t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -108,7 +116,8 @@ exports[`simple templates, mostly static dom node with t-esc 1`] = `
exports[`simple templates, mostly static dom node with t-esc 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -122,7 +131,8 @@ exports[`simple templates, mostly static dom node with t-esc 2`] = `
exports[`simple templates, mostly static dynamic text value 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['text']);
@@ -133,7 +143,8 @@ exports[`simple templates, mostly static dynamic text value 1`] = `
exports[`simple templates, mostly static empty div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -146,7 +157,8 @@ exports[`simple templates, mostly static empty div 1`] = `
exports[`simple templates, mostly static empty string 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -157,7 +169,8 @@ exports[`simple templates, mostly static empty string 1`] = `
exports[`simple templates, mostly static empty string in a template set 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -168,7 +181,8 @@ exports[`simple templates, mostly static empty string in a template set 1`] = `
exports[`simple templates, mostly static inline template string in t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`text\`);
@@ -179,7 +193,8 @@ exports[`simple templates, mostly static inline template string in t-esc 1`] = `
exports[`simple templates, mostly static inline template string with content in t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -194,7 +209,8 @@ exports[`simple templates, mostly static inline template string with content in
exports[`simple templates, mostly static inline template string with variable in context 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`text \${ctx['v']}\`);
@@ -205,7 +221,8 @@ exports[`simple templates, mostly static inline template string with variable in
exports[`simple templates, mostly static multiple root nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<div>foo</div>\`);
let block3 = createBlock(\`<span>hey</span>\`);
@@ -221,7 +238,8 @@ exports[`simple templates, mostly static multiple root nodes 1`] = `
exports[`simple templates, mostly static simple string 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`hello vdom\`);
@@ -232,7 +250,8 @@ exports[`simple templates, mostly static simple string 1`] = `
exports[`simple templates, mostly static simple string in t tag 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`hello vdom\`);
@@ -243,7 +262,8 @@ exports[`simple templates, mostly static simple string in t tag 1`] = `
exports[`simple templates, mostly static static text and dynamic text (no t tag) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`hello \`);
@@ -256,7 +276,8 @@ exports[`simple templates, mostly static static text and dynamic text (no t tag)
exports[`simple templates, mostly static static text and dynamic text 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`hello \`);
@@ -269,7 +290,8 @@ exports[`simple templates, mostly static static text and dynamic text 1`] = `
exports[`simple templates, mostly static t-esc in dom node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -283,7 +305,8 @@ exports[`simple templates, mostly static t-esc in dom node 1`] = `
exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>hello <block-text-0/></div>\`);
@@ -297,7 +320,8 @@ exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>hello <block-text-0/> world</div>\`);
@@ -311,7 +335,8 @@ exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
exports[`simple templates, mostly static template with multiple t tag with multiple content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/>Loading<block-text-2/></div>\`);
@@ -327,7 +352,8 @@ exports[`simple templates, mostly static template with multiple t tag with multi
exports[`simple templates, mostly static template with t tag with multiple content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>Loading<block-child-0/></div>\`);
@@ -344,7 +370,8 @@ exports[`simple templates, mostly static template with t tag with multiple conte
exports[`simple templates, mostly static two t-escs next to each other 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['text1']);
@@ -357,7 +384,8 @@ exports[`simple templates, mostly static two t-escs next to each other 1`] = `
exports[`simple templates, mostly static two t-escs next to each other 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['text1']);
@@ -370,7 +398,8 @@ exports[`simple templates, mostly static two t-escs next to each other 2`] = `
exports[`simple templates, mostly static two t-escs next to each other, in a div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
+18 -9
View File
@@ -3,7 +3,8 @@
exports[`properly support svg add proper namespace to g tags 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<g block-ns=\\"http://www.w3.org/2000/svg\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </g>\`);
@@ -16,7 +17,8 @@ exports[`properly support svg add proper namespace to g tags 1`] = `
exports[`properly support svg add proper namespace to svg 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\" width=\\"100px\\" height=\\"90px\\"><circle cx=\\"50\\" cy=\\"50\\" r=\\"4\\" stroke=\\"green\\" stroke-width=\\"1\\" fill=\\"yellow\\"/> </svg>\`);
@@ -29,7 +31,8 @@ exports[`properly support svg add proper namespace to svg 1`] = `
exports[`properly support svg namespace to g tags not added if already in svg namespace 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><g/></svg>\`);
@@ -42,7 +45,8 @@ exports[`properly support svg namespace to g tags not added if already in svg na
exports[`properly support svg namespace to svg tags added even if already in svg namespace 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><svg/></svg>\`);
@@ -55,7 +59,8 @@ exports[`properly support svg namespace to svg tags added even if already in svg
exports[`properly support svg svg creates new block if it is within html -- 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/><block-child-0/></svg>\`);
@@ -75,7 +80,8 @@ exports[`properly support svg svg creates new block if it is within html -- 2 1`
exports[`properly support svg svg creates new block if it is within html 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><polygon fill=\\"#000000\\" points=\\"0 0 4 4 8 0\\" transform=\\"translate(5 7)\\"/></svg>\`);
@@ -90,7 +96,8 @@ exports[`properly support svg svg creates new block if it is within html 1`] = `
exports[`properly support svg svg namespace added to sub templates if root tag is path 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`path\`);
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><block-child-0/></svg>\`);
@@ -105,7 +112,8 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
exports[`properly support svg svg namespace added to sub templates if root tag is path 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
@@ -118,7 +126,8 @@ exports[`properly support svg svg namespace added to sub templates if root tag i
exports[`properly support svg svg namespace added to sub-blocks 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<svg block-ns=\\"http://www.w3.org/2000/svg\\"><block-child-0/></svg>\`);
let block2 = createBlock(\`<path block-ns=\\"http://www.w3.org/2000/svg\\"/>\`);
+209 -56
View File
@@ -3,7 +3,8 @@
exports[`t-call (template calling) basic caller 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -18,7 +19,8 @@ exports[`t-call (template calling) basic caller 1`] = `
exports[`t-call (template calling) basic caller 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>ok</span>\`);
@@ -31,7 +33,8 @@ exports[`t-call (template calling) basic caller 2`] = `
exports[`t-call (template calling) basic caller, no parent node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
return function template(ctx, node, key = \\"\\") {
@@ -43,7 +46,8 @@ exports[`t-call (template calling) basic caller, no parent node 1`] = `
exports[`t-call (template calling) basic caller, no parent node 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>ok</span>\`);
@@ -56,7 +60,8 @@ exports[`t-call (template calling) basic caller, no parent node 2`] = `
exports[`t-call (template calling) call with several sub nodes on same line 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -81,7 +86,8 @@ exports[`t-call (template calling) call with several sub nodes on same line 1`]
exports[`t-call (template calling) call with several sub nodes on same line 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -96,7 +102,8 @@ exports[`t-call (template calling) call with several sub nodes on same line 2`]
exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`subTemplate\`);
@@ -121,7 +128,8 @@ exports[`t-call (template calling) cascading t-call t-out='0' 1`] = `
exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`subSubTemplate\`);
@@ -144,7 +152,8 @@ exports[`t-call (template calling) cascading t-call t-out='0' 2`] = `
exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`finalTemplate\`);
@@ -167,7 +176,8 @@ exports[`t-call (template calling) cascading t-call t-out='0' 3`] = `
exports[`t-call (template calling) cascading t-call t-out='0' 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<div><span>cascade 2</span><block-child-0/></div>\`);
@@ -182,7 +192,8 @@ exports[`t-call (template calling) cascading t-call t-out='0' 4`] = `
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`subTemplate\`);
@@ -205,7 +216,8 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`subSubTemplate\`);
@@ -226,7 +238,8 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`finalTemplate\`);
@@ -247,7 +260,8 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
exports[`t-call (template calling) cascading t-call t-out='0', without external divs 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block2 = createBlock(\`<span>cascade 2</span>\`);
@@ -263,7 +277,8 @@ exports[`t-call (template calling) cascading t-call t-out='0', without external
exports[`t-call (template calling) dynamic t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const call = app.callTemplate.bind(app);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -279,7 +294,8 @@ exports[`t-call (template calling) dynamic t-call 1`] = `
exports[`t-call (template calling) dynamic t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<foo><block-text-0/></foo>\`);
@@ -293,7 +309,8 @@ exports[`t-call (template calling) dynamic t-call 2`] = `
exports[`t-call (template calling) dynamic t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<bar><block-text-0/></bar>\`);
@@ -307,7 +324,8 @@ exports[`t-call (template calling) dynamic t-call 3`] = `
exports[`t-call (template calling) inherit context 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -326,7 +344,8 @@ exports[`t-call (template calling) inherit context 1`] = `
exports[`t-call (template calling) inherit context 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['foo']);
@@ -337,7 +356,8 @@ exports[`t-call (template calling) inherit context 2`] = `
exports[`t-call (template calling) recursive template, part 1 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`recursive\`);
let block1 = createBlock(\`<div><span>hey</span><block-child-0/></div>\`);
@@ -355,7 +375,8 @@ exports[`t-call (template calling) recursive template, part 1 1`] = `
exports[`t-call (template calling) recursive template, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -376,7 +397,8 @@ exports[`t-call (template calling) recursive template, part 2 1`] = `
exports[`t-call (template calling) recursive template, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -410,7 +432,8 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
exports[`t-call (template calling) recursive template, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -431,7 +454,8 @@ exports[`t-call (template calling) recursive template, part 3 1`] = `
exports[`t-call (template calling) recursive template, part 3 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -465,7 +489,8 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
exports[`t-call (template calling) recursive template, part 4: with t-set recursive index 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -487,7 +512,8 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
exports[`t-call (template calling) recursive template, part 4: with t-set recursive index 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`nodeTemplate\`);
@@ -523,7 +549,8 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
exports[`t-call (template calling) scoped parameters 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -546,7 +573,8 @@ exports[`t-call (template calling) scoped parameters 1`] = `
exports[`t-call (template calling) scoped parameters 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`ok\`);
@@ -557,7 +585,8 @@ exports[`t-call (template calling) scoped parameters 2`] = `
exports[`t-call (template calling) scoped parameters, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -581,7 +610,8 @@ exports[`t-call (template calling) scoped parameters, part 2 1`] = `
exports[`t-call (template calling) scoped parameters, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['foo']);
@@ -592,7 +622,8 @@ exports[`t-call (template calling) scoped parameters, part 2 2`] = `
exports[`t-call (template calling) t-call allowed on a non t node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -607,7 +638,8 @@ exports[`t-call (template calling) t-call allowed on a non t node 1`] = `
exports[`t-call (template calling) t-call allowed on a non t node 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>ok</span>\`);
@@ -617,10 +649,43 @@ exports[`t-call (template calling) t-call allowed on a non t node 2`] = `
}"
`;
exports[`t-call (template calling) t-call on a div with t-call-context 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let ctx1 = ctx['obj'];
const b2 = callTemplate_1.call(this, ctx1, node, key + \`__1\`);
return block1([], [b2]);
}
}"
`;
exports[`t-call (template calling) t-call on a div with t-call-context 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
}
}"
`;
exports[`t-call (template calling) t-call with body content as root of a template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`antony\`);
@@ -639,7 +704,8 @@ exports[`t-call (template calling) t-call with body content as root of a templat
exports[`t-call (template calling) t-call with body content as root of a template 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<foo><block-child-0/></foo>\`);
@@ -654,7 +720,8 @@ exports[`t-call (template calling) t-call with body content as root of a templat
exports[`t-call (template calling) t-call with t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -672,7 +739,8 @@ exports[`t-call (template calling) t-call with t-if 1`] = `
exports[`t-call (template calling) t-call with t-if 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>ok</span>\`);
@@ -685,7 +753,8 @@ exports[`t-call (template calling) t-call with t-if 2`] = `
exports[`t-call (template calling) t-call with t-set inside and body text content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -706,7 +775,8 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
exports[`t-call (template calling) t-call with t-set inside and body text content 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p><block-text-0/></p>\`);
@@ -720,7 +790,8 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -754,7 +825,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside 1`] = `
exports[`t-call (template calling) t-call with t-set inside and outside 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -768,7 +840,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside 2`] = `
exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`main\`);
@@ -787,7 +860,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 1`] =
exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -821,7 +895,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 2`] =
exports[`t-call (template calling) t-call with t-set inside and outside. 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<span><block-text-0/></span>\`);
@@ -837,7 +912,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 3`] =
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`callee1\`);
const callTemplate_2 = app.getTemplate(\`callee2\`);
@@ -866,7 +942,8 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>callee1</div>\`);
@@ -879,7 +956,8 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
exports[`t-call (template calling) t-call, conditional and t-set in t-call body 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>callee2 <block-text-0/></div>\`);
@@ -890,10 +968,76 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
}"
`;
exports[`t-call (template calling) t-call-context 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
return function template(ctx, node, key = \\"\\") {
let ctx1 = ctx['obj'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
}"
`;
exports[`t-call (template calling) t-call-context 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value'];
return block1([txt1]);
}
}"
`;
exports[`t-call (template calling) t-call-context and value in body 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let ctx1 = ctx['obj'];
ctx1 = Object.create(ctx1);
ctx1[isBoundary] = 1;
setContextValue(ctx1, \\"value2\\", ctx['aaron']);
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
}"
`;
exports[`t-call (template calling) t-call-context and value in body 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['value1'];
let txt2 = ctx['value2'];
return block1([txt1, txt2]);
}
}"
`;
exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -912,7 +1056,8 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 1`] =
exports[`t-call (template calling) t-esc inside t-call, with t-set outside 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -926,7 +1071,8 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 2`] =
exports[`t-call (template calling) with unused body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -943,7 +1089,8 @@ exports[`t-call (template calling) with unused body 1`] = `
exports[`t-call (template calling) with unused body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>ok</div>\`);
@@ -956,7 +1103,8 @@ exports[`t-call (template calling) with unused body 2`] = `
exports[`t-call (template calling) with unused setbody 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -974,7 +1122,8 @@ exports[`t-call (template calling) with unused setbody 1`] = `
exports[`t-call (template calling) with unused setbody 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>ok</div>\`);
@@ -987,7 +1136,8 @@ exports[`t-call (template calling) with unused setbody 2`] = `
exports[`t-call (template calling) with used body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -1004,7 +1154,8 @@ exports[`t-call (template calling) with used body 1`] = `
exports[`t-call (template calling) with used body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<h1><block-text-0/></h1>\`);
@@ -1019,7 +1170,8 @@ exports[`t-call (template calling) with used body 2`] = `
exports[`t-call (template calling) with used setbody 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -1040,7 +1192,8 @@ exports[`t-call (template calling) with used setbody 1`] = `
exports[`t-call (template calling) with used setbody 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['foo']);
@@ -3,7 +3,8 @@
exports[`debugging t-debug 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<span>hey</span>\`);
@@ -23,7 +24,8 @@ exports[`debugging t-debug 1`] = `
exports[`debugging t-debug on sub template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p>coucou</p>\`);
@@ -37,7 +39,8 @@ exports[`debugging t-debug on sub template 1`] = `
exports[`debugging t-debug on sub template 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -52,7 +55,8 @@ exports[`debugging t-debug on sub template 2`] = `
exports[`debugging t-log 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div/>\`);
+25 -13
View File
@@ -3,7 +3,8 @@
exports[`t-esc div with falsy values 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p><p><block-text-2/></p><p><block-text-3/></p><p><block-text-4/></p></div>\`);
@@ -21,7 +22,8 @@ exports[`t-esc div with falsy values 1`] = `
exports[`t-esc escaping 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -35,7 +37,8 @@ exports[`t-esc escaping 1`] = `
exports[`t-esc escaping on a node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -49,7 +52,8 @@ exports[`t-esc escaping on a node 1`] = `
exports[`t-esc escaping on a node with a body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { withDefault } = helpers;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -64,7 +68,8 @@ exports[`t-esc escaping on a node with a body 1`] = `
exports[`t-esc escaping on a node with a body, as a default 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { withDefault } = helpers;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -79,7 +84,8 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = `
exports[`t-esc falsy values in text nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['v1']);
@@ -99,7 +105,8 @@ exports[`t-esc falsy values in text nodes 1`] = `
exports[`t-esc literal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -113,7 +120,8 @@ exports[`t-esc literal 1`] = `
exports[`t-esc t-esc is escaped 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -126,7 +134,7 @@ exports[`t-esc t-esc is escaped 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`var\`] = new LazyValue(value1, ctx, node);
ctx[\`var\`] = new LazyValue(value1, ctx, this, node);
let txt1 = ctx['var'];
return block1([txt1]);
}
@@ -136,7 +144,8 @@ exports[`t-esc t-esc is escaped 1`] = `
exports[`t-esc t-esc work with spread operator 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -150,7 +159,8 @@ exports[`t-esc t-esc work with spread operator 1`] = `
exports[`t-esc t-esc=0 is escaped 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -171,7 +181,8 @@ exports[`t-esc t-esc=0 is escaped 1`] = `
exports[`t-esc t-esc=0 is escaped 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -186,7 +197,8 @@ exports[`t-esc t-esc=0 is escaped 2`] = `
exports[`t-esc variable 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -3,7 +3,8 @@
exports[`t-foreach does not pollute the rendering context 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -25,7 +26,8 @@ exports[`t-foreach does not pollute the rendering context 1`] = `
exports[`t-foreach iterate on items (on a element node) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -49,7 +51,8 @@ exports[`t-foreach iterate on items (on a element node) 1`] = `
exports[`t-foreach iterate on items 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -80,7 +83,8 @@ exports[`t-foreach iterate on items 1`] = `
exports[`t-foreach iterate, dict param 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -111,7 +115,8 @@ exports[`t-foreach iterate, dict param 1`] = `
exports[`t-foreach iterate, position 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -147,7 +152,8 @@ exports[`t-foreach iterate, position 1`] = `
exports[`t-foreach simple iteration (in a node) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -169,7 +175,8 @@ exports[`t-foreach simple iteration (in a node) 1`] = `
exports[`t-foreach simple iteration 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -188,7 +195,8 @@ exports[`t-foreach simple iteration 1`] = `
exports[`t-foreach simple iteration with two nodes inside 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block3 = createBlock(\`<span>a<block-text-0/></span>\`);
@@ -214,7 +222,8 @@ exports[`t-foreach simple iteration with two nodes inside 1`] = `
exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, isBoundary, withDefault, setContextValue, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -267,7 +276,8 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\` [\`);
@@ -285,7 +295,8 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 2`] = `
exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -332,7 +343,8 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -354,7 +366,8 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 2`] = `
exports[`t-foreach t-foreach in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -388,7 +401,8 @@ exports[`t-foreach t-foreach in t-foreach 1`] = `
exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block3 = createBlock(\`<span><block-text-0/></span>\`);
@@ -414,7 +428,8 @@ exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
exports[`t-foreach t-foreach with t-if inside 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -442,7 +457,8 @@ exports[`t-foreach t-foreach with t-if inside 1`] = `
exports[`t-foreach t-key on t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -465,7 +481,8 @@ exports[`t-foreach t-key on t-foreach 1`] = `
exports[`t-foreach throws error if invalid loop expression 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -490,7 +507,8 @@ exports[`t-foreach throws error if invalid loop expression 1`] = `
exports[`t-foreach with t-memo 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
+52 -26
View File
@@ -3,7 +3,8 @@
exports[`t-if a t-if next to a div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<div>foo</div>\`);
@@ -21,7 +22,8 @@ exports[`t-if a t-if next to a div 1`] = `
exports[`t-if a t-if with two inner nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<span>yip</span>\`);
let block4 = createBlock(\`<div>yip</div>\`);
@@ -41,7 +43,8 @@ exports[`t-if a t-if with two inner nodes 1`] = `
exports[`t-if boolean value condition elif (no outside node) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4,b5;
@@ -62,7 +65,8 @@ exports[`t-if boolean value condition elif (no outside node) 1`] = `
exports[`t-if boolean value condition elif 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/></div>\`);
@@ -85,7 +89,8 @@ exports[`t-if boolean value condition elif 1`] = `
exports[`t-if boolean value condition else 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
@@ -104,7 +109,8 @@ exports[`t-if boolean value condition else 1`] = `
exports[`t-if boolean value condition false else 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span>begin</span><block-child-0/><block-child-1/><span>end</span></div>\`);
@@ -123,7 +129,8 @@ exports[`t-if boolean value condition false else 1`] = `
exports[`t-if boolean value condition missing 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -140,7 +147,8 @@ exports[`t-if boolean value condition missing 1`] = `
exports[`t-if can use some boolean operators in expressions 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-2/><block-child-3/><block-child-4/><block-child-5/><block-child-6/><block-child-7/></div>\`);
@@ -178,7 +186,8 @@ exports[`t-if can use some boolean operators in expressions 1`] = `
exports[`t-if div containing a t-if with two inner nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<span>yip</span>\`);
@@ -199,7 +208,8 @@ exports[`t-if div containing a t-if with two inner nodes 1`] = `
exports[`t-if dynamic content after t-if with two children nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
let block3 = createBlock(\`<p>1</p>\`);
@@ -221,7 +231,8 @@ exports[`t-if dynamic content after t-if with two children nodes 1`] = `
exports[`t-if just a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2;
@@ -236,7 +247,8 @@ exports[`t-if just a t-if 1`] = `
exports[`t-if simple t-if/t-else 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2,b3;
@@ -253,7 +265,8 @@ exports[`t-if simple t-if/t-else 1`] = `
exports[`t-if simple t-if/t-else in a div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -272,7 +285,8 @@ exports[`t-if simple t-if/t-else in a div 1`] = `
exports[`t-if t-esc with t-elif 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -291,7 +305,8 @@ exports[`t-if t-esc with t-elif 1`] = `
exports[`t-if t-esc with t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -308,7 +323,8 @@ exports[`t-if t-esc with t-if 1`] = `
exports[`t-if t-if and t-else with two nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block4 = createBlock(\`<span>a</span>\`);
let block5 = createBlock(\`<span>b</span>\`);
@@ -330,7 +346,8 @@ exports[`t-if t-if and t-else with two nodes 1`] = `
exports[`t-if t-if in a div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -347,7 +364,8 @@ exports[`t-if t-if in a div 1`] = `
exports[`t-if t-if in a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<span>1<block-child-0/></span>\`);
@@ -369,7 +387,8 @@ exports[`t-if t-if in a t-if 1`] = `
exports[`t-if t-if with empty content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2,b3;
@@ -385,7 +404,8 @@ exports[`t-if t-if with empty content 1`] = `
exports[`t-if t-if/t-else with more content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2,b3;
@@ -404,7 +424,8 @@ exports[`t-if t-if/t-else with more content 1`] = `
exports[`t-if t-set, then t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -425,7 +446,8 @@ exports[`t-if t-set, then t-if 1`] = `
exports[`t-if t-set, then t-if, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -448,7 +470,8 @@ exports[`t-if t-set, then t-if, part 2 1`] = `
exports[`t-if t-set, then t-if, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -474,7 +497,8 @@ exports[`t-if t-set, then t-if, part 3 1`] = `
exports[`t-if two consecutive t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
let b2,b3;
@@ -492,7 +516,8 @@ exports[`t-if two consecutive t-if 1`] = `
exports[`t-if two consecutive t-if in a div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -512,7 +537,8 @@ exports[`t-if two consecutive t-if in a div 1`] = `
exports[`t-if two t-ifs next to each other 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block2 = createBlock(\`<span><block-text-0/></span>\`);
@@ -3,7 +3,8 @@
exports[`t-key can use t-key directive on a node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -18,7 +19,8 @@ exports[`t-key can use t-key directive on a node 1`] = `
exports[`t-key can use t-key directive on a node 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -33,7 +35,8 @@ exports[`t-key can use t-key directive on a node 2 1`] = `
exports[`t-key can use t-key directive on a node as a function 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -48,7 +51,8 @@ exports[`t-key can use t-key directive on a node as a function 1`] = `
exports[`t-key t-key directive in a list 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
@@ -72,7 +76,8 @@ exports[`t-key t-key directive in a list 1`] = `
exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block2 = createBlock(\`<span/>\`);
@@ -93,7 +98,8 @@ exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
exports[`t-key t-key on sub dom node pushes a child block in its parent 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><h1/></div>\`);
+62 -32
View File
@@ -3,7 +3,8 @@
exports[`t-out literal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -18,7 +19,8 @@ exports[`t-out literal 1`] = `
exports[`t-out literal, no outside html element 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -30,7 +32,8 @@ exports[`t-out literal, no outside html element 1`] = `
exports[`t-out multiple calls to t-out 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -51,7 +54,8 @@ exports[`t-out multiple calls to t-out 1`] = `
exports[`t-out multiple calls to t-out 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<div><block-child-0/><div>Greeter</div><block-child-1/></div>\`);
@@ -67,7 +71,8 @@ exports[`t-out multiple calls to t-out 2`] = `
exports[`t-out not escaping 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -82,7 +87,8 @@ exports[`t-out not escaping 1`] = `
exports[`t-out number literal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -97,7 +103,8 @@ exports[`t-out number literal 1`] = `
exports[`t-out t-out 0 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const callTemplate_1 = app.getTemplate(\`_basic-callee\`);
@@ -118,7 +125,8 @@ exports[`t-out t-out 0 1`] = `
exports[`t-out t-out 0 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { zero } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -133,7 +141,8 @@ exports[`t-out t-out 0 2`] = `
exports[`t-out t-out and another sibling node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><span>hello</span><block-child-0/></span>\`);
@@ -148,7 +157,8 @@ exports[`t-out t-out and another sibling node 1`] = `
exports[`t-out t-out bdom 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><span><block-child-0/></span></div>\`);
@@ -161,7 +171,7 @@ exports[`t-out t-out bdom 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`var\`] = new LazyValue(value1, ctx, node);
ctx[\`var\`] = new LazyValue(value1, ctx, this, node);
const b3 = safeOutput(ctx['var']);
return block1([], [b3]);
}
@@ -171,7 +181,8 @@ exports[`t-out t-out bdom 1`] = `
exports[`t-out t-out block 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -186,7 +197,8 @@ exports[`t-out t-out block 1`] = `
exports[`t-out t-out escaped 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -201,7 +213,8 @@ exports[`t-out t-out escaped 1`] = `
exports[`t-out t-out markedup 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -216,7 +229,8 @@ exports[`t-out t-out markedup 1`] = `
exports[`t-out t-out on a node with a body, as a default 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput, withDefault } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -232,7 +246,8 @@ exports[`t-out t-out on a node with a body, as a default 1`] = `
exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput, withDefault } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -249,7 +264,8 @@ exports[`t-out t-out on a node with a dom node in body, as a default 1`] = `
exports[`t-out t-out switch escaped 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -264,7 +280,8 @@ exports[`t-out t-out switch escaped 1`] = `
exports[`t-out t-out switch escaped on markup 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -279,7 +296,8 @@ exports[`t-out t-out switch escaped on markup 1`] = `
exports[`t-out t-out switch markup 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -294,7 +312,8 @@ exports[`t-out t-out switch markup 1`] = `
exports[`t-out t-out switch markup on bdom 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -310,7 +329,7 @@ exports[`t-out t-out switch markup on bdom 1`] = `
ctx = Object.create(ctx);
ctx[isBoundary] = 1
let b3,b5;
ctx[\`bdom\`] = new LazyValue(value1, ctx, node);
ctx[\`bdom\`] = new LazyValue(value1, ctx, this, node);
if (ctx['hasBdom']) {
const b4 = safeOutput(ctx['bdom']);
b3 = block3([], [b4]);
@@ -326,7 +345,8 @@ exports[`t-out t-out switch markup on bdom 1`] = `
exports[`t-out t-out switch markup on escaped 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -341,7 +361,8 @@ exports[`t-out t-out switch markup on escaped 1`] = `
exports[`t-out t-out with a <t/> in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -353,7 +374,8 @@ exports[`t-out t-out with a <t/> in body 1`] = `
exports[`t-out t-out with arbitrary object 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -368,7 +390,8 @@ exports[`t-out t-out with arbitrary object 1`] = `
exports[`t-out t-out with arbitrary object 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -383,7 +406,8 @@ exports[`t-out t-out with arbitrary object 2 1`] = `
exports[`t-out t-out with comment 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -398,7 +422,8 @@ exports[`t-out t-out with comment 1`] = `
exports[`t-out t-out with just a t-set t-value in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -410,7 +435,8 @@ exports[`t-out t-out with just a t-set t-value in body 1`] = `
exports[`t-out variable 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -425,7 +451,8 @@ exports[`t-out variable 1`] = `
exports[`t-out with a String class 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -440,7 +467,8 @@ exports[`t-out with a String class 1`] = `
exports[`t-out with an extended String class 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -455,7 +483,8 @@ exports[`t-out with an extended String class 1`] = `
exports[`t-raw is deprecated should warn 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -470,7 +499,8 @@ exports[`t-raw is deprecated should warn 1`] = `
exports[`t-raw is deprecated t-out is actually called in t-raw's place 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -3,7 +3,8 @@
exports[`t-ref can get a dynamic ref on a node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
@@ -19,7 +20,8 @@ exports[`t-ref can get a dynamic ref on a node 1`] = `
exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
@@ -35,7 +37,8 @@ exports[`t-ref can get a dynamic ref on a node, alternate syntax 1`] = `
exports[`t-ref can get a ref on a node 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span block-ref=\\"0\\"/></div>\`);
@@ -50,7 +53,8 @@ exports[`t-ref can get a ref on a node 1`] = `
exports[`t-ref ref in a t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -65,7 +69,8 @@ exports[`t-ref ref in a t-call 1`] = `
exports[`t-ref ref in a t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>1<span block-ref=\\"0\\"/>2</div>\`);
@@ -80,7 +85,8 @@ exports[`t-ref ref in a t-call 2`] = `
exports[`t-ref ref in a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<span block-ref=\\"0\\"/>\`);
@@ -100,7 +106,8 @@ exports[`t-ref ref in a t-if 1`] = `
exports[`t-ref refs in a loop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -128,7 +135,8 @@ exports[`t-ref refs in a loop 1`] = `
exports[`t-ref two refs, one in a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/><p block-ref=\\"0\\"/></div>\`);
let block2 = createBlock(\`<span block-ref=\\"0\\"/>\`);
+65 -36
View File
@@ -3,7 +3,8 @@
exports[`t-set evaluate value expression 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -21,7 +22,8 @@ exports[`t-set evaluate value expression 1`] = `
exports[`t-set evaluate value expression, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -39,7 +41,8 @@ exports[`t-set evaluate value expression, part 2 1`] = `
exports[`t-set set from attribute literal (no outside div) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -54,7 +57,8 @@ exports[`t-set set from attribute literal (no outside div) 1`] = `
exports[`t-set set from attribute literal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -72,7 +76,8 @@ exports[`t-set set from attribute literal 1`] = `
exports[`t-set set from attribute lookup 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -90,7 +95,8 @@ exports[`t-set set from attribute lookup 1`] = `
exports[`t-set set from body literal (with t-if/t-else 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
function value1(ctx, node, key = \\"\\") {
@@ -106,7 +112,7 @@ exports[`t-set set from body literal (with t-if/t-else 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`value\`] = new LazyValue(value1, ctx, node);
ctx[\`value\`] = new LazyValue(value1, ctx, this, node);
return text(ctx['value']);
}
}"
@@ -115,7 +121,8 @@ exports[`t-set set from body literal (with t-if/t-else 1`] = `
exports[`t-set set from body literal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -130,7 +137,8 @@ exports[`t-set set from body literal 1`] = `
exports[`t-set set from body lookup 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -142,7 +150,7 @@ exports[`t-set set from body lookup 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`stuff\`] = new LazyValue(value1, ctx, node);
ctx[\`stuff\`] = new LazyValue(value1, ctx, this, node);
let txt1 = ctx['stuff'];
return block1([txt1]);
}
@@ -152,7 +160,8 @@ exports[`t-set set from body lookup 1`] = `
exports[`t-set set from empty body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -170,7 +179,8 @@ exports[`t-set set from empty body 1`] = `
exports[`t-set t-set and t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -191,7 +201,8 @@ exports[`t-set t-set and t-if 1`] = `
exports[`t-set t-set body is evaluated immediately 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -206,7 +217,7 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"v1\\", 'before');
ctx[\`v2\`] = new LazyValue(value1, ctx, node);
ctx[\`v2\`] = new LazyValue(value1, ctx, this, node);
setContextValue(ctx, \\"v1\\", 'after');
const b3 = safeOutput(ctx['v2']);
return block1([], [b3]);
@@ -217,7 +228,8 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
exports[`t-set t-set can't alter from within callee 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -238,7 +250,8 @@ exports[`t-set t-set can't alter from within callee 1`] = `
exports[`t-set t-set can't alter from within callee 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -257,7 +270,8 @@ exports[`t-set t-set can't alter from within callee 2`] = `
exports[`t-set t-set can't alter in t-call body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`sub\`);
@@ -282,7 +296,8 @@ exports[`t-set t-set can't alter in t-call body 1`] = `
exports[`t-set t-set can't alter in t-call body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -301,7 +316,8 @@ exports[`t-set t-set can't alter in t-call body 2`] = `
exports[`t-set t-set does not modify render context existing key values 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -319,7 +335,8 @@ exports[`t-set t-set does not modify render context existing key values 1`] = `
exports[`t-set t-set evaluates an expression only once 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -338,7 +355,8 @@ exports[`t-set t-set evaluates an expression only once 1`] = `
exports[`t-set t-set outside modified in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
@@ -368,7 +386,8 @@ exports[`t-set t-set outside modified in t-foreach 1`] = `
exports[`t-set t-set outside modified in t-foreach increment-after operator 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
@@ -398,7 +417,8 @@ exports[`t-set t-set outside modified in t-foreach increment-after operator 1`]
exports[`t-set t-set outside modified in t-foreach increment-before operator 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/><p>EndLoop: <block-text-0/></p></div>\`);
@@ -428,7 +448,8 @@ exports[`t-set t-set outside modified in t-foreach increment-before operator 1`]
exports[`t-set t-set should reuse variable if possible 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -457,7 +478,8 @@ exports[`t-set t-set should reuse variable if possible 1`] = `
exports[`t-set t-set with content and sub t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -471,7 +493,7 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`setvar\`] = new LazyValue(value1, ctx, node);
ctx[\`setvar\`] = new LazyValue(value1, ctx, this, node);
let txt1 = ctx['setvar'];
return block1([txt1]);
}
@@ -481,7 +503,8 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
exports[`t-set t-set with t-value (falsy) and body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -497,7 +520,7 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
ctx[isBoundary] = 1
setContextValue(ctx, \\"v3\\", false);
setContextValue(ctx, \\"v1\\", 'before');
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, node));
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
setContextValue(ctx, \\"v1\\", 'after');
setContextValue(ctx, \\"v3\\", true);
const b3 = safeOutput(ctx['v2']);
@@ -509,7 +532,8 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
exports[`t-set t-set with t-value (truthy) and body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -525,7 +549,7 @@ exports[`t-set t-set with t-value (truthy) and body 1`] = `
ctx[isBoundary] = 1
setContextValue(ctx, \\"v3\\", 'Truthy');
setContextValue(ctx, \\"v1\\", 'before');
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, node));
ctx[\`v2\`] = withDefault(ctx['v3'], new LazyValue(value1, ctx, this, node));
setContextValue(ctx, \\"v1\\", 'after');
setContextValue(ctx, \\"v3\\", false);
const b3 = safeOutput(ctx['v2']);
@@ -537,7 +561,8 @@ exports[`t-set t-set with t-value (truthy) and body 1`] = `
exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
@@ -559,7 +584,8 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-text-0/></div>\`);
@@ -581,7 +607,8 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -602,7 +629,8 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 3 1`] = `
exports[`t-set value priority (with non text body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -615,7 +643,7 @@ exports[`t-set value priority (with non text body 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`value\`] = withDefault(1, new LazyValue(value1, ctx, node));
ctx[\`value\`] = withDefault(1, new LazyValue(value1, ctx, this, node));
let txt1 = ctx['value'];
return block1([txt1]);
}
@@ -625,7 +653,8 @@ exports[`t-set value priority (with non text body 1`] = `
exports[`t-set value priority 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -3,7 +3,8 @@
exports[`qweb t-tag can fallback if falsy tag 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 'fallback'}/>\`);
@@ -17,7 +18,8 @@ exports[`qweb t-tag can fallback if falsy tag 1`] = `
exports[`qweb t-tag can update 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
@@ -31,7 +33,8 @@ exports[`qweb t-tag can update 1`] = `
exports[`qweb t-tag simple usecases 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'}/>\`);
@@ -45,7 +48,8 @@ exports[`qweb t-tag simple usecases 1`] = `
exports[`qweb t-tag simple usecases 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'}>text</\${tag || 't'}>\`);
@@ -59,7 +63,8 @@ exports[`qweb t-tag simple usecases 2`] = `
exports[`qweb t-tag with multiple attributes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'} class=\\"blueberry\\" taste=\\"raspberry\\">gooseberry</\${tag || 't'}>\`);
@@ -73,7 +78,8 @@ exports[`qweb t-tag with multiple attributes 1`] = `
exports[`qweb t-tag with multiple child nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'}> pear <span>apple</span> strawberry </\${tag || 't'}>\`);
@@ -87,7 +93,8 @@ exports[`qweb t-tag with multiple child nodes 1`] = `
exports[`qweb t-tag with multiple t-tag in same template 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = tag => createBlock(\`<\${tag || 't'}><block-child-0/></\${tag || 't'}>\`);
let block2 = tag => createBlock(\`<\${tag || 't'}>baz</\${tag || 't'}>\`);
@@ -104,7 +111,8 @@ exports[`qweb t-tag with multiple t-tag in same template 1`] = `
exports[`qweb t-tag with multiple t-tag in same template, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = tag => createBlock(\`<\${tag || 't'}>bar</\${tag || 't'}>\`);
let block3 = tag => createBlock(\`<\${tag || 't'}>baz</\${tag || 't'}>\`);
@@ -3,7 +3,8 @@
exports[`loading templates addTemplates does not modify its xml document in place 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -17,7 +18,8 @@ exports[`loading templates addTemplates does not modify its xml document in plac
exports[`loading templates can initialize qweb with a string 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>jupiler</div>\`);
@@ -30,7 +32,8 @@ exports[`loading templates can initialize qweb with a string 1`] = `
exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>jupiler</div>\`);
@@ -43,7 +46,8 @@ exports[`loading templates can initialize qweb with an XMLDocument 1`] = `
exports[`loading templates can load a few templates from a xml string 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`items\`);
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
@@ -58,7 +62,8 @@ exports[`loading templates can load a few templates from a xml string 1`] = `
exports[`loading templates can load a few templates from a xml string 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<li>ok</li>\`);
let block3 = createBlock(\`<li>foo</li>\`);
@@ -74,7 +79,8 @@ exports[`loading templates can load a few templates from a xml string 2`] = `
exports[`loading templates can load a few templates from an XMLDocument 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`items\`);
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
@@ -89,7 +95,8 @@ exports[`loading templates can load a few templates from an XMLDocument 1`] = `
exports[`loading templates can load a few templates from an XMLDocument 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<li>ok</li>\`);
let block3 = createBlock(\`<li>foo</li>\`);
@@ -3,7 +3,8 @@
exports[`translation support can set and remove translatable attributes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div tomato=\\"word\\" potato=\\"mot\\" title=\\"mot\\" label=\\"word\\">text</div>\`);
@@ -16,7 +17,8 @@ exports[`translation support can set and remove translatable attributes 1`] = `
exports[`translation support can translate node content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>mot</div>\`);
@@ -29,7 +31,8 @@ exports[`translation support can translate node content 1`] = `
exports[`translation support does not translate node content if disabled 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span>mot</span><span>word</span></div>\`);
@@ -42,7 +45,8 @@ exports[`translation support does not translate node content if disabled 1`] = `
exports[`translation support some attributes are translated 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><p label=\\"mot\\">mot</p><p title=\\"mot\\">mot</p><p placeholder=\\"mot\\">mot</p><p alt=\\"mot\\">mot</p><p something=\\"word\\">mot</p></div>\`);
@@ -55,7 +59,8 @@ exports[`translation support some attributes are translated 1`] = `
exports[`translation support translation is done on the trimmed text, with extra spaces readded after 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div> mot </div>\`);
@@ -3,7 +3,8 @@
exports[`white space handling consecutives whitespaces are condensed into a single space 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div> abc </div>\`);
@@ -16,7 +17,8 @@ exports[`white space handling consecutives whitespaces are condensed into a sing
exports[`white space handling nothing is done in pre tags 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<pre> </pre>\`);
@@ -29,7 +31,8 @@ exports[`white space handling nothing is done in pre tags 1`] = `
exports[`white space handling nothing is done in pre tags 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<pre>
some text
@@ -44,7 +47,8 @@ exports[`white space handling nothing is done in pre tags 2`] = `
exports[`white space handling nothing is done in pre tags 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<pre>
@@ -59,7 +63,8 @@ exports[`white space handling nothing is done in pre tags 3`] = `
exports[`white space handling pre inside a div with a new line 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><pre>SomeText</pre></div>\`);
@@ -72,7 +77,8 @@ exports[`white space handling pre inside a div with a new line 1`] = `
exports[`white space handling white space only text nodes are condensed into a single space 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div> </div>\`);
@@ -85,7 +91,8 @@ exports[`white space handling white space only text nodes are condensed into a s
exports[`white space handling whitespace only text nodes with newlines are removed 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><span>abc</span></div>\`);
+42
View File
@@ -22,6 +22,12 @@ describe("attributes", () => {
expect(renderToString(template)).toBe(`<div aria-label="Close"></div>`);
});
test("static attributes with backticks", () => {
const template = '<div foo="`bar`"></div>';
const result = renderToString(template);
expect(result).toBe('<div foo="`bar`"></div>');
});
test("static attributes on void elements", () => {
const template = `<img src="/test.skip.jpg" alt="Test"/>`;
expect(renderToString(template)).toBe(`<img src="/test.skip.jpg" alt="Test">`);
@@ -33,6 +39,12 @@ describe("attributes", () => {
expect(result).toBe(`<div foo="bar"></div>`);
});
test("dynamic attributes with backticks", () => {
const template = '<div t-att-foo="`bar`"/>';
const result = renderToString(template);
expect(result).toBe(`<div foo="bar"></div>`);
});
test("two dynamic attributes", () => {
const template = `<div t-att-foo="'bar'" t-att-bar="'foo'"/>`;
const result = renderToString(template);
@@ -51,6 +63,24 @@ describe("attributes", () => {
expect(result).toBe(`<div></div>`);
});
test("dynamic class attribute which is only a space", () => {
const template = `<div t-att-class="c"/>`;
const result = renderToString(template, { c: " " });
expect(result).toBe(`<div></div>`);
});
test("dynamic class attribute with multiple consecutive spaces", () => {
const template = `<div t-att-class="c"/>`;
const result = renderToString(template, { c: "a b" });
expect(result).toBe(`<div class="a b"></div>`);
});
test("dynamic class attribute that starts and ends with a space", () => {
const template = `<div t-att-class="c"/>`;
const result = renderToString(template, { c: " a " });
expect(result).toBe(`<div class="a"></div>`);
});
test("dynamic undefined generic attribute", () => {
const template = `<div t-att-thing="c"/>`;
const result = renderToString(template, { c: undefined });
@@ -248,6 +278,14 @@ describe("attributes", () => {
const template = `<div class="static" t-att-class="{a: b, c: d, e: f}"/>`;
const result = renderToString(template, { b: true, d: false, f: true });
expect(result).toBe(`<div class="static a e"></div>`);
// leading and trailing space in the key
expect(renderToString(`<div t-att-class="{' a ': value}" />`, { value: true })).toBe(
'<div class="a"></div>'
);
// whitespace only key
expect(renderToString(`<div t-att-class="{' ': value}" />`, { value: true })).toBe(
"<div></div>"
);
});
test("t-att-class with multiple classes", () => {
@@ -257,6 +295,10 @@ describe("attributes", () => {
expect(renderToString(`<div t-att-class="{['a b c']: value}" />`, { value: true })).toBe(
'<div class="a b c"></div>'
);
// multiple spaces between classes
expect(renderToString(`<div t-att-class="{'a b c': value}" />`, { value: true })).toBe(
'<div class="a b c"></div>'
);
});
test("t-att-class with multiple classes, some of which are duplicate", () => {
@@ -221,4 +221,11 @@ describe("expression evaluation", () => {
expect(compileExpr("a.c in b")).toBe("ctx['a'].c in ctx['b']");
expect(compileExpr("typeof val")).toBe("typeof ctx['val']");
});
test("binary operators", () => {
expect(compileExpr("1 | 1")).toBe("1|1");
expect(compileExpr("1 & 1")).toBe("1&1");
expect(compileExpr("1 ^ 1")).toBe("1^1");
expect(compileExpr("~1")).toBe("~1");
});
});
+15 -1
View File
@@ -1033,6 +1033,7 @@ describe("qweb parser", () => {
type: ASTType.TCall,
name: "blap",
body: null,
context: null,
},
memo: "",
hasNoFirst: false,
@@ -1070,6 +1071,7 @@ describe("qweb parser", () => {
type: ASTType.TCall,
name: "blabla",
body: null,
context: null,
});
});
@@ -1077,10 +1079,20 @@ describe("qweb parser", () => {
expect(parse(`<t t-call="sub">ok</t>`)).toEqual({
type: ASTType.TCall,
name: "sub",
context: null,
body: [{ type: ASTType.Text, value: "ok" }],
});
});
test("t-call expression with t-call-context", async () => {
expect(parse(`<t t-call="blabla" t-call-context="someContext"/>`)).toEqual({
type: ASTType.TCall,
name: "blabla",
body: null,
context: "someContext",
});
});
test("t-call on a div node", async () => {
expect(parse(`<div t-call="blabla" />`)).toEqual({
type: ASTType.DomNode,
@@ -1096,6 +1108,7 @@ describe("qweb parser", () => {
type: ASTType.TCall,
name: "blabla",
body: null,
context: null,
},
],
});
@@ -1111,6 +1124,7 @@ describe("qweb parser", () => {
type: ASTType.TCall,
name: "blabla",
body: null,
context: null,
},
});
});
@@ -1547,7 +1561,7 @@ describe("qweb parser", () => {
on: null,
slots: {
default: {
content: { body: null, name: "subTemplate", type: ASTType.TCall },
content: { body: null, name: "subTemplate", type: ASTType.TCall, context: null },
attrs: null,
scope: null,
on: null,
+34
View File
@@ -445,4 +445,38 @@ describe("t-call (template calling)", () => {
const expected2 = "<div><bar>quux</bar></div>";
expect(context.renderToString("main", { template: "bar", val: "quux" })).toBe(expected2);
});
test("t-call-context", () => {
const context = new TestContext();
context.addTemplate("sub", `<span><t t-esc="value"/></span>`);
context.addTemplate("main", `<t t-call="sub" t-call-context="obj"/>`);
expect(context.renderToString("main", { obj: { value: 123 } })).toBe("<span>123</span>");
});
test("t-call on a div with t-call-context", () => {
const context = new TestContext();
context.addTemplate("sub", `<span><t t-esc="value"/></span>`);
context.addTemplate("main", `<div t-call="sub" t-call-context="obj"/>`);
expect(context.renderToString("main", { obj: { value: 123 } })).toBe(
"<div><span>123</span></div>"
);
});
test("t-call-context and value in body", () => {
const context = new TestContext();
context.addTemplate("sub", `<span><t t-esc="value1"/><t t-esc="value2"/></span>`);
context.addTemplate(
"main",
`
<t t-call="sub" t-call-context="obj">
<t t-set="value2" t-value="aaron" />
</t>`
);
expect(context.renderToString("main", { obj: { value1: 123 }, aaron: "lucas" })).toBe(
"<span>123lucas</span>"
);
});
});
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,7 +3,8 @@
exports[`event handling Invalid handler throws an error 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\">click</button>\`);
@@ -17,7 +18,8 @@ exports[`event handling Invalid handler throws an error 1`] = `
exports[`event handling handler is not called if component is destroyed 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span block-handler-0=\\"click\\"/>\`);
@@ -31,13 +33,15 @@ exports[`event handling handler is not called if component is destroyed 1`] = `
exports[`event handling handler receive the event as argument 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<span block-handler-0=\\"click\\"><block-child-0/><block-text-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['inc'], ctx];
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
let txt1 = ctx['state'].value;
return block1([hdlr1, txt1], [b2]);
}
@@ -47,7 +51,8 @@ exports[`event handling handler receive the event as argument 1`] = `
exports[`event handling handler receive the event as argument 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>simple vnode</div>\`);
@@ -60,14 +65,16 @@ exports[`event handling handler receive the event as argument 2`] = `
exports[`event handling input blur event is not called if component is destroyed 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><textarea/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].cond) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -77,7 +84,8 @@ exports[`event handling input blur event is not called if component is destroyed
exports[`event handling input blur event is not called if component is destroyed 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<input block-handler-0=\\"blur\\"/>\`);
@@ -91,7 +99,8 @@ exports[`event handling input blur event is not called if component is destroyed
exports[`event handling objects from scope are properly captured by t-on 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -117,7 +126,8 @@ exports[`event handling objects from scope are properly captured by t-on 1`] = `
exports[`event handling support for callable expression in event handler 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
@@ -132,7 +142,8 @@ exports[`event handling support for callable expression in event handler 1`] = `
exports[`event handling t-on with handler bound to dynamic argument on a t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -3,10 +3,12 @@
exports[`basics basic use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {p: 1}, key + \`__1\`, node, ctx);
return comp1({p: 1}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -14,7 +16,8 @@ exports[`basics basic use 1`] = `
exports[`basics basic use 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child<block-text-0/></span>\`);
@@ -28,15 +31,18 @@ exports[`basics basic use 2`] = `
exports[`basics can select a sub widget 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['env'].options.flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
if (!ctx['env'].options.flag) {
b3 = component(\`OtherChild\`, {}, key + \`__2\`, node, ctx);
b3 = comp2({}, key + \`__2\`, node, this, null);
}
return multi([b2, b3]);
}
@@ -46,7 +52,8 @@ exports[`basics can select a sub widget 1`] = `
exports[`basics can select a sub widget 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>CHILD 1</span>\`);
@@ -59,7 +66,8 @@ exports[`basics can select a sub widget 2`] = `
exports[`basics can select a sub widget 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>CHILD 2</div>\`);
@@ -72,15 +80,18 @@ exports[`basics can select a sub widget 3`] = `
exports[`basics can select a sub widget, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`OtherChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
if (!ctx['state'].flag) {
b3 = component(\`OtherChild\`, {}, key + \`__2\`, node, ctx);
b3 = comp2({}, key + \`__2\`, node, this, null);
}
return multi([b2, b3]);
}
@@ -90,7 +101,8 @@ exports[`basics can select a sub widget, part 2 1`] = `
exports[`basics can select a sub widget, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>CHILD 1</span>\`);
@@ -103,7 +115,8 @@ exports[`basics can select a sub widget, part 2 2`] = `
exports[`basics can select a sub widget, part 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>CHILD 2</div>\`);
@@ -116,10 +129,12 @@ exports[`basics can select a sub widget, part 2 3`] = `
exports[`basics sub widget is interactive 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {p: 1}, key + \`__1\`, node, ctx);
return comp1({p: 1}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -127,7 +142,8 @@ exports[`basics sub widget is interactive 1`] = `
exports[`basics sub widget is interactive 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><button block-handler-0=\\"click\\">click</button>child<block-text-1/></span>\`);
@@ -142,12 +158,14 @@ exports[`basics sub widget is interactive 2`] = `
exports[`basics top level sub widget with a parent 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentB\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`ComponentB\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -156,10 +174,12 @@ exports[`basics top level sub widget with a parent 1`] = `
exports[`basics top level sub widget with a parent 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ComponentC\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`ComponentC\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -167,7 +187,8 @@ exports[`basics top level sub widget with a parent 2`] = `
exports[`basics top level sub widget with a parent 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>Hello</span>\`);
@@ -3,7 +3,8 @@
exports[`hooks autofocus hook input in a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><block-child-0/></div>\`);
let block2 = createBlock(\`<input block-ref=\\"0\\"/>\`);
@@ -24,7 +25,8 @@ exports[`hooks autofocus hook input in a t-if 1`] = `
exports[`hooks autofocus hook simple input 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><input block-ref=\\"0\\"/><input block-ref=\\"1\\"/></div>\`);
@@ -40,10 +42,12 @@ exports[`hooks autofocus hook simple input 1`] = `
exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`MyComponent\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx);
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -51,7 +55,8 @@ exports[`hooks can use onWillStart, onWillUpdateProps 1`] = `
exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -65,7 +70,8 @@ exports[`hooks can use onWillStart, onWillUpdateProps 2`] = `
exports[`hooks can use useComponent 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -78,7 +84,8 @@ exports[`hooks can use useComponent 1`] = `
exports[`hooks can use useEnv 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -92,7 +99,8 @@ exports[`hooks can use useEnv 1`] = `
exports[`hooks mounted callbacks should be called in reverse order from willUnmount callbacks 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
@@ -106,11 +114,13 @@ exports[`hooks mounted callbacks should be called in reverse order from willUnmo
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['env'].val);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -119,7 +129,8 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 1`] = `
exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<div><block-text-0/></div>\`);
@@ -137,11 +148,13 @@ exports[`hooks parent and child env (with useChildSubEnv then useSubEnv) 2`] = `
exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['env'].val);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -150,7 +163,8 @@ exports[`hooks parent and child env (with useChildSubEnv) 1`] = `
exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -164,11 +178,13 @@ exports[`hooks parent and child env (with useChildSubEnv) 2`] = `
exports[`hooks parent and child env (with useSubEnv) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['env'].val);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -177,7 +193,8 @@ exports[`hooks parent and child env (with useSubEnv) 1`] = `
exports[`hooks parent and child env (with useSubEnv) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -191,7 +208,8 @@ exports[`hooks parent and child env (with useSubEnv) 2`] = `
exports[`hooks two different call to willPatch/patched should work 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
@@ -205,7 +223,8 @@ exports[`hooks two different call to willPatch/patched should work 1`] = `
exports[`hooks useChildSubEnv does not pollute user env 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -219,10 +238,12 @@ exports[`hooks useChildSubEnv does not pollute user env 1`] = `
exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -230,7 +251,8 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 1`] = `
exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
@@ -245,7 +267,8 @@ exports[`hooks useChildSubEnv supports arbitrary descriptor 2`] = `
exports[`hooks useEffect hook dependencies prevent effects from rerunning when unchanged 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -258,7 +281,8 @@ exports[`hooks useEffect hook dependencies prevent effects from rerunning when u
exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
@@ -277,7 +301,8 @@ exports[`hooks useEffect hook effect can depend on stuff in dom 1`] = `
exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and is cleaned up on unmount and before reapplying 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -290,7 +315,8 @@ exports[`hooks useEffect hook effect runs on mount, is reapplied on patch, and i
exports[`hooks useEffect hook effect with empty dependency list never reruns 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -304,7 +330,8 @@ exports[`hooks useEffect hook effect with empty dependency list never reruns 1`]
exports[`hooks useEffect hook properly behaves when the effect function throws 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -317,12 +344,14 @@ exports[`hooks useEffect hook properly behaves when the effect function throws 1
exports[`hooks useExternalListener 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`MyComponent\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`MyComponent\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -332,7 +361,8 @@ exports[`hooks useExternalListener 1`] = `
exports[`hooks useExternalListener 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -346,7 +376,8 @@ exports[`hooks useExternalListener 2`] = `
exports[`hooks useRef hook: basic use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><button block-ref=\\"0\\"><block-text-1/></button></div>\`);
@@ -362,7 +393,8 @@ exports[`hooks useRef hook: basic use 1`] = `
exports[`hooks useSubEnv modifies user env 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -376,10 +408,12 @@ exports[`hooks useSubEnv modifies user env 1`] = `
exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -387,7 +421,8 @@ exports[`hooks useSubEnv supports arbitrary descriptor 1`] = `
exports[`hooks useSubEnv supports arbitrary descriptor 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
@@ -3,7 +3,8 @@
exports[`lifecycle hooks basic checks for a component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>test</span>\`);
@@ -16,13 +17,16 @@ exports[`lifecycle hooks basic checks for a component 1`] = `
exports[`lifecycle hooks component semantics 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, true);
const comp2 = app.createComponent(\`C\`, true, false, false, true);
let block1 = createBlock(\`<div>A<block-child-0/><block-child-1/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`B\`, {}, key + \`__1\`, node, ctx);
const b3 = component(\`C\`, {}, key + \`__2\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
const b3 = comp2({}, key + \`__2\`, node, this, null);
return block1([], [b2, b3]);
}
}"
@@ -31,7 +35,8 @@ exports[`lifecycle hooks component semantics 1`] = `
exports[`lifecycle hooks component semantics 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>B</div>\`);
@@ -44,17 +49,21 @@ exports[`lifecycle hooks component semantics 2`] = `
exports[`lifecycle hooks component semantics 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`D\`, true, false, false, true);
const comp2 = app.createComponent(\`E\`, true, false, false, true);
const comp3 = app.createComponent(\`F\`, true, false, false, true);
let block1 = createBlock(\`<div>C<block-child-0/><block-child-1/><block-child-2/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4;
b2 = component(\`D\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
if (ctx['state'].flag) {
b3 = component(\`E\`, {}, key + \`__2\`, node, ctx);
b3 = comp2({}, key + \`__2\`, node, this, null);
} else {
b4 = component(\`F\`, {}, key + \`__3\`, node, ctx);
b4 = comp3({}, key + \`__3\`, node, this, null);
}
return block1([], [b2, b3, b4]);
}
@@ -64,7 +73,8 @@ exports[`lifecycle hooks component semantics 3`] = `
exports[`lifecycle hooks component semantics 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>D</div>\`);
@@ -77,7 +87,8 @@ exports[`lifecycle hooks component semantics 4`] = `
exports[`lifecycle hooks component semantics 5`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>E</div>\`);
@@ -90,7 +101,8 @@ exports[`lifecycle hooks component semantics 5`] = `
exports[`lifecycle hooks component semantics 6`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>F</div>\`);
@@ -103,14 +115,16 @@ exports[`lifecycle hooks component semantics 6`] = `
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block2 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
const b3 = component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
const b3 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
b2 = block2([], [b3]);
}
return multi([b2]);
@@ -121,7 +135,8 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
exports[`lifecycle hooks components are unmounted and destroyed if no longer in DOM, even after updateprops 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -135,12 +150,14 @@ exports[`lifecycle hooks components are unmounted and destroyed if no longer in
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].ok) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -150,7 +167,8 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -163,13 +181,15 @@ exports[`lifecycle hooks components are unmounted destroyed if no longer in DOM
exports[`lifecycle hooks destroy new children before being mountged 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2,b3,b4;
b2 = text(\`before\`);
if (ctx['state'].flag) {
b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b3 = comp1({}, key + \`__1\`, node, this, null);
}
b4 = text(\`after\`);
return multi([b2, b3, b4]);
@@ -180,7 +200,8 @@ exports[`lifecycle hooks destroy new children before being mountged 1`] = `
exports[`lifecycle hooks destroy new children before being mountged 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -191,12 +212,14 @@ exports[`lifecycle hooks destroy new children before being mountged 2`] = `
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -205,7 +228,8 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
exports[`lifecycle hooks hooks are called in proper order in widget creation/destruction 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -218,10 +242,12 @@ exports[`lifecycle hooks hooks are called in proper order in widget creation/des
exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Test\`, {rev: ctx['rev']}, key + \`__1\`, node, ctx);
return comp1({rev: ctx['rev']}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -229,7 +255,8 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 1`] = `
exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].rev);
@@ -240,12 +267,14 @@ exports[`lifecycle hooks lifecycle callbacks are bound to component 2`] = `
exports[`lifecycle hooks lifecycle semantics 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {a: ctx['state'].a}, key + \`__1\`, node, ctx);
const b2 = comp1({a: ctx['state'].a}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -254,7 +283,8 @@ exports[`lifecycle hooks lifecycle semantics 1`] = `
exports[`lifecycle hooks lifecycle semantics 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -267,12 +297,14 @@ exports[`lifecycle hooks lifecycle semantics 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -282,10 +314,12 @@ exports[`lifecycle hooks lifecycle semantics, part 2 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -293,7 +327,8 @@ exports[`lifecycle hooks lifecycle semantics, part 2 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -306,12 +341,14 @@ exports[`lifecycle hooks lifecycle semantics, part 2 3`] = `
exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -321,12 +358,14 @@ exports[`lifecycle hooks lifecycle semantics, part 3 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -336,10 +375,12 @@ exports[`lifecycle hooks lifecycle semantics, part 4 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`GrandChild\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`GrandChild\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -347,7 +388,8 @@ exports[`lifecycle hooks lifecycle semantics, part 4 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -360,12 +402,14 @@ exports[`lifecycle hooks lifecycle semantics, part 4 3`] = `
exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -375,7 +419,8 @@ exports[`lifecycle hooks lifecycle semantics, part 5 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -388,10 +433,12 @@ exports[`lifecycle hooks lifecycle semantics, part 5 2`] = `
exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx);
return comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -399,7 +446,8 @@ exports[`lifecycle hooks lifecycle semantics, part 6 1`] = `
exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -412,7 +460,8 @@ exports[`lifecycle hooks lifecycle semantics, part 6 2`] = `
exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -425,12 +474,14 @@ exports[`lifecycle hooks mounted hook is called if mounted in DOM 1`] = `
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasChild) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -440,7 +491,8 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
exports[`lifecycle hooks mounted hook is called on every mount, not just the first one 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child</div>\`);
@@ -453,12 +505,14 @@ exports[`lifecycle hooks mounted hook is called on every mount, not just the fir
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -467,7 +521,8 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
exports[`lifecycle hooks mounted hook is called on subcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -480,14 +535,16 @@ exports[`lifecycle hooks mounted hook is called on subcomponents, in proper orde
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -497,12 +554,14 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`ChildChild\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -511,7 +570,8 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper order 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -524,10 +584,12 @@ exports[`lifecycle hooks mounted hook is called on subsubcomponents, in proper o
exports[`lifecycle hooks onWillRender 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {someValue: ctx['state'].value}, key + \`__1\`, node, ctx);
return comp1({someValue: ctx['state'].value}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -535,7 +597,8 @@ exports[`lifecycle hooks onWillRender 1`] = `
exports[`lifecycle hooks onWillRender 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"><block-text-1/></button>\`);
@@ -550,12 +613,14 @@ exports[`lifecycle hooks onWillRender 2`] = `
exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {a: ctx['state'].a}, key + \`__1\`, node, ctx);
const b2 = comp1({a: ctx['state'].a}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -564,7 +629,8 @@ exports[`lifecycle hooks patched hook is called after updateProps 1`] = `
exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -577,7 +643,8 @@ exports[`lifecycle hooks patched hook is called after updateProps 2`] = `
exports[`lifecycle hooks patched hook is called after updating State 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -591,7 +658,8 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
exports[`lifecycle hooks render in mounted 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -605,7 +673,8 @@ exports[`lifecycle hooks render in mounted 1`] = `
exports[`lifecycle hooks render in patched 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -619,7 +688,8 @@ exports[`lifecycle hooks render in patched 1`] = `
exports[`lifecycle hooks render in willPatch 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -633,12 +703,14 @@ exports[`lifecycle hooks render in willPatch 1`] = `
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -648,7 +720,8 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -661,7 +734,8 @@ exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly calle
exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span/>\`);
@@ -674,12 +748,14 @@ exports[`lifecycle hooks timeout in onWillStart emits a warning 1`] = `
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const props1 = {prop: ctx['state'].prop};
helpers.validateProps(\`Child\`, props1, ctx);
return component(\`Child\`, props1, key + \`__1\`, node, ctx);
return comp1(props1, key + \`__1\`, node, this, null);
}
}"
`;
@@ -687,7 +763,8 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 1`] = `
exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -698,12 +775,14 @@ exports[`lifecycle hooks timeout in onWillUpdateProps emits a warning 2`] = `
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
const b2 = comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -712,12 +791,14 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`ChildChild\`, {n: ctx['props'].n}, key + \`__1\`, node, ctx);
const b2 = comp1({n: ctx['props'].n}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -726,7 +807,8 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -740,10 +822,12 @@ exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents,
exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -751,7 +835,8 @@ exports[`lifecycle hooks willStart hook is called on sub component 1`] = `
exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -764,7 +849,8 @@ exports[`lifecycle hooks willStart hook is called on sub component 2`] = `
exports[`lifecycle hooks willStart is called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>simple vnode</span>\`);
@@ -777,7 +863,8 @@ exports[`lifecycle hooks willStart is called 1`] = `
exports[`lifecycle hooks willStart is called with component as this 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>simple vnode</span>\`);
@@ -790,7 +877,9 @@ exports[`lifecycle hooks willStart is called with component as this 1`] = `
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
let block3 = createBlock(\`<div/>\`);
@@ -798,7 +887,7 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['state'].ok) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
} else {
b3 = block3();
}
@@ -810,7 +899,8 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is mounted in some other position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -823,10 +913,12 @@ exports[`lifecycle hooks willStart, mounted on subwidget rendered after main is
exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {n: ctx['state'].n}, key + \`__1\`, node, ctx);
return comp1({n: ctx['state'].n}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -834,7 +926,8 @@ exports[`lifecycle hooks willUpdateProps hook is called 1`] = `
exports[`lifecycle hooks willUpdateProps hook is called 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -3,12 +3,14 @@
exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {greetings: ctx['greetings']}, key + \`__1\`, node, ctx);
const b2 = comp1({greetings: ctx['greetings']}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -17,7 +19,8 @@ exports[`basics accept ES6-like syntax for props (with getters) 1`] = `
exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -31,8 +34,10 @@ exports[`basics accept ES6-like syntax for props (with getters) 2`] = `
exports[`basics arrow functions as prop correctly capture their scope 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
@@ -42,7 +47,7 @@ exports[`basics arrow functions as prop correctly capture their scope 1`] = `
const key1 = ctx['item'].val;
const v1 = ctx['onClick'];
const v2 = ctx['item'];
c_block1[i1] = withKey(component(\`Child\`, {onClick: _ev=>v1(v2.val,_ev)}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block1[i1] = withKey(comp1({onClick: _ev=>v1(v2.val,_ev)}, key + \`__1__\${key1}\`, node, this, null), key1);
}
return list(c_block1);
}
@@ -52,7 +57,8 @@ exports[`basics arrow functions as prop correctly capture their scope 1`] = `
exports[`basics arrow functions as prop correctly capture their scope 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
@@ -66,12 +72,14 @@ exports[`basics arrow functions as prop correctly capture their scope 2`] = `
exports[`basics explicit object prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {value: ctx['state'].val}, key + \`__1\`, node, ctx);
const b2 = comp1({value: ctx['state'].val}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -80,7 +88,8 @@ exports[`basics explicit object prop 1`] = `
exports[`basics explicit object prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -94,10 +103,12 @@ exports[`basics explicit object prop 2`] = `
exports[`basics prop names can contain - 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {'prop-name': 7}, key + \`__1\`, node, ctx);
return comp1({'prop-name': 7}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -105,7 +116,8 @@ exports[`basics prop names can contain - 1`] = `
exports[`basics prop names can contain - 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -119,10 +131,12 @@ exports[`basics prop names can contain - 2`] = `
exports[`basics support prop names that aren't valid bare object property names 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {'some-dashed-prop': 5}, key + \`__1\`, node, ctx);
return comp1({'some-dashed-prop': 5}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -130,7 +144,8 @@ exports[`basics support prop names that aren't valid bare object property names
exports[`basics support prop names that aren't valid bare object property names 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button block-handler-0=\\"click\\"/>\`);
@@ -144,8 +159,10 @@ exports[`basics support prop names that aren't valid bare object property names
exports[`basics t-set with a body expression can be passed in props, and then t-out 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<p>43</p>\`);
@@ -157,8 +174,8 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`abc\`] = new LazyValue(value1, ctx, node);
const b3 = component(\`Child\`, {val: ctx['abc']}, key + \`__1\`, node, ctx);
ctx[\`abc\`] = new LazyValue(value1, ctx, this, node);
const b3 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
return block1([], [b3]);
}
}"
@@ -167,7 +184,8 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
exports[`basics t-set with a body expression can be passed in props, and then t-out 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { safeOutput } = helpers;
let block1 = createBlock(\`<span><block-text-0/><block-child-0/></span>\`);
@@ -183,8 +201,10 @@ exports[`basics t-set with a body expression can be passed in props, and then t-
exports[`basics t-set with a body expression can be used as textual prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -192,7 +212,7 @@ exports[`basics t-set with a body expression can be used as textual prop 1`] = `
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"abc\\", \`42\`);
const b2 = component(\`Child\`, {val: ctx['abc']}, key + \`__1\`, node, ctx);
const b2 = comp1({val: ctx['abc']}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -201,7 +221,8 @@ exports[`basics t-set with a body expression can be used as textual prop 1`] = `
exports[`basics t-set with a body expression can be used as textual prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -215,8 +236,10 @@ exports[`basics t-set with a body expression can be used as textual prop 2`] = `
exports[`basics t-set works 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -224,7 +247,7 @@ exports[`basics t-set works 1`] = `
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"val\\", 42);
const b2 = component(\`Child\`, {val: ctx['val']}, key + \`__1\`, node, ctx);
const b2 = comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -233,7 +256,8 @@ exports[`basics t-set works 1`] = `
exports[`basics t-set works 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -247,10 +271,12 @@ exports[`basics t-set works 2`] = `
exports[`basics template string in prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {propName: \`1\${ctx['someVal']}3\`}, key + \`__1\`, node, ctx);
return comp1({propName: \`1\${ctx['someVal']}3\`}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -258,7 +284,8 @@ exports[`basics template string in prop 1`] = `
exports[`basics template string in prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -269,11 +296,13 @@ exports[`basics template string in prop 2`] = `
exports[`bound functions is referentially equal after update 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { bind } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val,fn: bind(ctx, ctx['someFunction'])}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val,fn: bind(ctx, ctx['someFunction'])}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -281,7 +310,8 @@ exports[`bound functions is referentially equal after update 1`] = `
exports[`bound functions is referentially equal after update 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].val);
@@ -292,11 +322,13 @@ exports[`bound functions is referentially equal after update 2`] = `
exports[`can bind function prop with bind suffix 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { bind } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {doSomething: bind(ctx, ctx['doSomething'])}, key + \`__1\`, node, ctx);
return comp1({doSomething: bind(ctx, ctx['doSomething'])}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -304,7 +336,8 @@ exports[`can bind function prop with bind suffix 1`] = `
exports[`can bind function prop with bind suffix 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
File diff suppressed because it is too large Load Diff
@@ -3,12 +3,14 @@
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].renderChild) {
b2 = component(\`Child\`, {state: ctx['state']}, key + \`__1\`, node, ctx);
b2 = comp1({state: ctx['state']}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -18,7 +20,8 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
exports[`reactivity in lifecycle Child component doesn't render when state they depend on changes but their parent is about to unmount them 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].state.content.a);
@@ -29,10 +32,12 @@ exports[`reactivity in lifecycle Child component doesn't render when state they
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {obj: ctx['obj'],reactiveObj: ctx['reactiveObj']}, key + \`__1\`, node, ctx);
return comp1({obj: ctx['obj'],reactiveObj: ctx['reactiveObj']}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -40,7 +45,8 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
exports[`reactivity in lifecycle Component is automatically subscribed to reactive object received as prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['props'].obj.a);
@@ -53,7 +59,8 @@ exports[`reactivity in lifecycle Component is automatically subscribed to reacti
exports[`reactivity in lifecycle can use a state hook 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -67,7 +74,8 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
exports[`reactivity in lifecycle can use a state hook 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -81,7 +89,8 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -95,7 +104,8 @@ exports[`reactivity in lifecycle can use a state hook on Map 1`] = `
exports[`reactivity in lifecycle change state while mounting component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -109,14 +119,16 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
b2 = comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -126,7 +138,8 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
exports[`reactivity in lifecycle state changes in willUnmount do not trigger rerender 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
@@ -3,7 +3,8 @@
exports[`refs basic use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-ref=\\"0\\"/>\`);
@@ -18,7 +19,8 @@ exports[`refs basic use 1`] = `
exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { multiRefSetter } = helpers;
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
@@ -41,7 +43,9 @@ exports[`refs can use 2 refs with same name in a t-if/t-else situation 1`] = `
exports[`refs refs and recursive templates 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Test\`, true, false, false, false);
let block1 = createBlock(\`<p block-ref=\\"0\\"><block-text-1/><block-child-0/></p>\`);
@@ -51,7 +55,7 @@ exports[`refs refs and recursive templates 1`] = `
let b2;
let txt1 = ctx['props'].tree.value;
if (ctx['props'].tree.child) {
b2 = component(\`Test\`, {tree: ctx['props'].tree.child}, key + \`__1\`, node, ctx);
b2 = comp1({tree: ctx['props'].tree.child}, key + \`__1\`, node, this, null);
}
return block1([ref1, txt1], [b2]);
}
@@ -61,8 +65,10 @@ exports[`refs refs and recursive templates 1`] = `
exports[`refs refs are properly bound in slots 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Dialog\`, true, true, false, true);
let block1 = createBlock(\`<div><span class=\\"counter\\"><block-text-0/></span><block-child-0/></div>\`);
let block2 = createBlock(\`<button block-handler-0=\\"click\\" block-ref=\\"1\\">do something</button>\`);
@@ -77,7 +83,7 @@ exports[`refs refs are properly bound in slots 1`] = `
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].val;
const ctx1 = capture(ctx);
const b3 = component(\`Dialog\`, {slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, ctx);
const b3 = comp1({slots: markRaw({'footer': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return block1([txt1], [b3]);
}
}"
@@ -86,7 +92,8 @@ exports[`refs refs are properly bound in slots 1`] = `
exports[`refs refs are properly bound in slots 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -101,7 +108,8 @@ exports[`refs refs are properly bound in slots 2`] = `
exports[`refs throws if there are 2 same refs at the same time 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { multiRefSetter } = helpers;
let block2 = createBlock(\`<div block-ref=\\"0\\"/>\`);
@@ -3,11 +3,13 @@
exports[`children, default props and renderings 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['state'].value);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -16,7 +18,8 @@ exports[`children, default props and renderings 1`] = `
exports[`children, default props and renderings 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -27,10 +30,12 @@ exports[`children, default props and renderings 2`] = `
exports[`force render in case of existing render 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`B\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -38,10 +43,12 @@ exports[`force render in case of existing render 1`] = `
exports[`force render in case of existing render 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`C\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
const b3 = text(ctx['props'].val);
return multi([b2, b3]);
}
@@ -51,7 +58,8 @@ exports[`force render in case of existing render 2`] = `
exports[`force render in case of existing render 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`C\`);
@@ -62,11 +70,13 @@ exports[`force render in case of existing render 3`] = `
exports[`rendering semantics can force a render to update sub tree 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['state'].value);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -75,7 +85,8 @@ exports[`rendering semantics can force a render to update sub tree 1`] = `
exports[`rendering semantics can force a render to update sub tree 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -86,11 +97,13 @@ exports[`rendering semantics can force a render to update sub tree 2`] = `
exports[`rendering semantics can render a parent without rendering child 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['state'].value);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -99,7 +112,8 @@ exports[`rendering semantics can render a parent without rendering child 1`] = `
exports[`rendering semantics can render a parent without rendering child 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -110,10 +124,12 @@ exports[`rendering semantics can render a parent without rendering child 2`] = `
exports[`rendering semantics props are reactive (nested prop) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {a: ctx['state']}, key + \`__1\`, node, ctx);
return comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -121,7 +137,8 @@ exports[`rendering semantics props are reactive (nested prop) 1`] = `
exports[`rendering semantics props are reactive (nested prop) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].a.b.c);
@@ -132,10 +149,12 @@ exports[`rendering semantics props are reactive (nested prop) 2`] = `
exports[`rendering semantics props are reactive 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {a: ctx['state']}, key + \`__1\`, node, ctx);
return comp1({a: ctx['state']}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -143,7 +162,8 @@ exports[`rendering semantics props are reactive 1`] = `
exports[`rendering semantics props are reactive 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].a.b);
@@ -154,11 +174,13 @@ exports[`rendering semantics props are reactive 2`] = `
exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['state'].value);
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -167,7 +189,8 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 1`] = `
exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child\`);
@@ -178,12 +201,14 @@ exports[`rendering semantics render need a boolean = true to be 'deep' 2`] = `
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`parent\`);
const b3 = text(ctx['state'].value);
const b4 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b4 = comp1({}, key + \`__1\`, node, this, null);
return multi([b2, b3, b4]);
}
}"
@@ -192,7 +217,8 @@ exports[`rendering semantics render with deep=true followed by render with deep=
exports[`rendering semantics render with deep=true followed by render with deep=false work as expected 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`child\`);
@@ -205,11 +231,13 @@ exports[`rendering semantics render with deep=true followed by render with deep=
exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`B\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['state'].obj.val);
const b3 = component(\`B\`, {obj: ctx['state'].obj}, key + \`__1\`, node, ctx);
const b3 = comp1({obj: ctx['state'].obj}, key + \`__1\`, node, this, null);
return multi([b2, b3]);
}
}"
@@ -218,10 +246,12 @@ exports[`rendering semantics rendering is atomic (for one subtree) 1`] = `
exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`C\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`C\`, {obj: ctx['props'].obj}, key + \`__1\`, node, ctx);
return comp1({obj: ctx['props'].obj}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -229,7 +259,8 @@ exports[`rendering semantics rendering is atomic (for one subtree) 2`] = `
exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(ctx['props'].obj.val);
@@ -240,10 +271,12 @@ exports[`rendering semantics rendering is atomic (for one subtree) 3`] = `
exports[`rendering semantics works as expected for dynamic number of props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, Object.assign({}, ctx['state']), key + \`__1\`, node, ctx);
return comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
}
}"
`;
@@ -251,7 +284,8 @@ exports[`rendering semantics works as expected for dynamic number of props 1`] =
exports[`rendering semantics works as expected for dynamic number of props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(Object.keys(ctx['props']).length);
File diff suppressed because it is too large Load Diff
@@ -3,10 +3,12 @@
exports[`style and class handling can set class on multi root component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'fromparent'}, key + \`__1\`, node, ctx);
return comp1({class: 'fromparent'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -14,7 +16,8 @@ exports[`style and class handling can set class on multi root component 1`] = `
exports[`style and class handling can set class on multi root component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block2 = createBlock(\`<div>a</div>\`);
let block3 = createBlock(\`<span block-attribute-0=\\"class\\">b</span>\`);
@@ -31,10 +34,12 @@ exports[`style and class handling can set class on multi root component 2`] = `
exports[`style and class handling can set class on sub component, as prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'some-class'}, key + \`__1\`, node, ctx);
return comp1({class: 'some-class'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -42,7 +47,8 @@ exports[`style and class handling can set class on sub component, as prop 1`] =
exports[`style and class handling can set class on sub component, as prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
@@ -56,10 +62,12 @@ exports[`style and class handling can set class on sub component, as prop 2`] =
exports[`style and class handling can set class on sub sub component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'fromparent'}, key + \`__1\`, node, ctx);
return comp1({class: 'fromparent'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -67,10 +75,12 @@ exports[`style and class handling can set class on sub sub component 1`] = `
exports[`style and class handling can set class on sub sub component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildChild\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`ChildChild\`, {class: (ctx['props'].class||'')+' fromchild'}, key + \`__1\`, node, ctx);
return comp1({class: (ctx['props'].class||'')+' fromchild'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -78,7 +88,8 @@ exports[`style and class handling can set class on sub sub component 2`] = `
exports[`style and class handling can set class on sub sub component 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">childchild</div>\`);
@@ -92,10 +103,12 @@ exports[`style and class handling can set class on sub sub component 3`] = `
exports[`style and class handling can set more than one class on sub component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'a b'}, key + \`__1\`, node, ctx);
return comp1({class: 'a b'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -103,7 +116,8 @@ exports[`style and class handling can set more than one class on sub component 1
exports[`style and class handling can set more than one class on sub component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
@@ -117,7 +131,8 @@ exports[`style and class handling can set more than one class on sub component 2
exports[`style and class handling can set style and class inside component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div style=\\"font-weight:bold;\\" class=\\"some-class\\">world</div>\`);
@@ -130,7 +145,8 @@ exports[`style and class handling can set style and class inside component 1`] =
exports[`style and class handling class on components do not interfere with user defined classes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -144,10 +160,12 @@ exports[`style and class handling class on components do not interfere with user
exports[`style and class handling class on sub component, which is switched to another 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'someclass',child: ctx['state'].child}, key + \`__1\`, node, ctx);
return comp1({class: 'someclass',child: ctx['state'].child}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -155,14 +173,17 @@ exports[`style and class handling class on sub component, which is switched to a
exports[`style and class handling class on sub component, which is switched to another 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`ChildA\`, true, false, false, false);
const comp2 = app.createComponent(\`ChildB\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
let b2,b3;
if (ctx['props'].child==='a') {
b2 = component(\`ChildA\`, {class: ctx['props'].class}, key + \`__1\`, node, ctx);
b2 = comp1({class: ctx['props'].class}, key + \`__1\`, node, this, null);
} else {
b3 = component(\`ChildB\`, {class: ctx['props'].class}, key + \`__2\`, node, ctx);
b3 = comp2({class: ctx['props'].class}, key + \`__2\`, node, this, null);
}
return multi([b2, b3]);
}
@@ -172,7 +193,8 @@ exports[`style and class handling class on sub component, which is switched to a
exports[`style and class handling class on sub component, which is switched to another 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">a</div>\`);
@@ -186,7 +208,8 @@ exports[`style and class handling class on sub component, which is switched to a
exports[`style and class handling class on sub component, which is switched to another 4`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span block-attribute-0=\\"class\\">b</span>\`);
@@ -200,12 +223,14 @@ exports[`style and class handling class on sub component, which is switched to a
exports[`style and class handling class with extra whitespaces (variation) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<p><block-child-0/></p>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {class: 'a b c d'}, key + \`__1\`, node, ctx);
const b2 = comp1({class: 'a b c d'}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -214,7 +239,8 @@ exports[`style and class handling class with extra whitespaces (variation) 1`] =
exports[`style and class handling class with extra whitespaces (variation) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -228,10 +254,12 @@ exports[`style and class handling class with extra whitespaces (variation) 2`] =
exports[`style and class handling class with extra whitespaces 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'a b c d'}, key + \`__1\`, node, ctx);
return comp1({class: 'a b c d'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -239,7 +267,8 @@ exports[`style and class handling class with extra whitespaces 1`] = `
exports[`style and class handling class with extra whitespaces 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
@@ -253,10 +282,12 @@ exports[`style and class handling class with extra whitespaces 2`] = `
exports[`style and class handling component class and parent class combine together 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'from parent'}, key + \`__1\`, node, ctx);
return comp1({class: 'from parent'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -264,7 +295,8 @@ exports[`style and class handling component class and parent class combine toget
exports[`style and class handling component class and parent class combine together 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div class=\\"child\\" block-attribute-0=\\"class\\">child</div>\`);
@@ -305,12 +337,14 @@ exports[`style and class handling dynamic t-att-style is properly added and upda
exports[`style and class handling empty class attribute is not added on widget root el 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {class: undefined}, key + \`__1\`, node, ctx);
const b2 = comp1({class: undefined}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -319,7 +353,8 @@ exports[`style and class handling empty class attribute is not added on widget r
exports[`style and class handling empty class attribute is not added on widget root el 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span block-attribute-0=\\"class\\"/>\`);
@@ -333,10 +368,12 @@ exports[`style and class handling empty class attribute is not added on widget r
exports[`style and class handling error in subcomponent with class 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'a'}, key + \`__1\`, node, ctx);
return comp1({class: 'a'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -344,7 +381,8 @@ exports[`style and class handling error in subcomponent with class 1`] = `
exports[`style and class handling error in subcomponent with class 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"><block-text-1/></div>\`);
@@ -359,10 +397,12 @@ exports[`style and class handling error in subcomponent with class 2`] = `
exports[`style and class handling no class is set is child ignores it 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: 'hey'}, key + \`__1\`, node, ctx);
return comp1({class: 'hey'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -370,7 +410,8 @@ exports[`style and class handling no class is set is child ignores it 1`] = `
exports[`style and class handling no class is set is child ignores it 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child</div>\`);
@@ -383,10 +424,12 @@ exports[`style and class handling no class is set is child ignores it 2`] = `
exports[`style and class handling no class is set is parent does not give it as prop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -394,7 +437,8 @@ exports[`style and class handling no class is set is parent does not give it as
exports[`style and class handling no class is set is parent does not give it as prop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"class\\">child</div>\`);
@@ -408,10 +452,12 @@ exports[`style and class handling no class is set is parent does not give it as
exports[`style and class handling style is properly added on widget root el 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {style: 'font-weight: bold;'}, key + \`__1\`, node, ctx);
return comp1({style: 'font-weight: bold;'}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -419,7 +465,8 @@ exports[`style and class handling style is properly added on widget root el 1`]
exports[`style and class handling style is properly added on widget root el 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"style\\"/>\`);
@@ -433,12 +480,14 @@ exports[`style and class handling style is properly added on widget root el 2`]
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {class: {b:ctx['state'].b}}, key + \`__1\`, node, ctx);
const b2 = comp1({class: {b:ctx['state'].b}}, key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -447,7 +496,8 @@ exports[`style and class handling t-att-class is properly added/removed on widge
exports[`style and class handling t-att-class is properly added/removed on widget root el (v2) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
@@ -461,10 +511,12 @@ exports[`style and class handling t-att-class is properly added/removed on widge
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {class: {a:true,b:ctx['state'].b}}, key + \`__1\`, node, ctx);
return comp1({class: {a:true,b:ctx['state'].b}}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -472,7 +524,8 @@ exports[`style and class handling t-att-class is properly added/removed on widge
exports[`style and class handling t-att-class is properly added/removed on widget root el (v3) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span class=\\"c\\" block-attribute-0=\\"class\\"/>\`);
@@ -3,7 +3,8 @@
exports[`t-call dynamic t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, zero } = helpers;
const call = app.callTemplate.bind(app);
@@ -21,7 +22,8 @@ exports[`t-call dynamic t-call 1`] = `
exports[`t-call dynamic t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>foo</div>\`);
@@ -34,7 +36,8 @@ exports[`t-call dynamic t-call 2`] = `
exports[`t-call dynamic t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`bar\`);
@@ -45,11 +48,13 @@ exports[`t-call dynamic t-call 3`] = `
exports[`t-call dynamic t-call: key is propagated 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const call = app.callTemplate.bind(app);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
const template1 = (ctx['sub']);
const b3 = call(this, template1, ctx, node, key + \`__2\`);
return multi([b2, b3]);
@@ -60,7 +65,8 @@ exports[`t-call dynamic t-call: key is propagated 1`] = `
exports[`t-call dynamic t-call: key is propagated 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-attribute-0=\\"id\\"/>\`);
@@ -74,10 +80,12 @@ exports[`t-call dynamic t-call: key is propagated 2`] = `
exports[`t-call dynamic t-call: key is propagated 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -85,7 +93,8 @@ exports[`t-call dynamic t-call: key is propagated 3`] = `
exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const call = app.callTemplate.bind(app);
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
@@ -102,7 +111,8 @@ exports[`t-call handlers are properly bound through a dynamic t-call 1`] = `
exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
@@ -116,7 +126,8 @@ exports[`t-call handlers are properly bound through a dynamic t-call 2`] = `
exports[`t-call handlers are properly bound through a t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
@@ -132,7 +143,8 @@ exports[`t-call handlers are properly bound through a t-call 1`] = `
exports[`t-call handlers are properly bound through a t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
@@ -146,7 +158,8 @@ exports[`t-call handlers are properly bound through a t-call 2`] = `
exports[`t-call handlers with arguments are properly bound through a t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -161,7 +174,8 @@ exports[`t-call handlers with arguments are properly bound through a t-call 1`]
exports[`t-call handlers with arguments are properly bound through a t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
@@ -176,7 +190,8 @@ exports[`t-call handlers with arguments are properly bound through a t-call 2`]
exports[`t-call parent is set within t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -191,10 +206,12 @@ exports[`t-call parent is set within t-call 1`] = `
exports[`t-call parent is set within t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -202,7 +219,8 @@ exports[`t-call parent is set within t-call 2`] = `
exports[`t-call parent is set within t-call 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>lucas</span>\`);
@@ -215,7 +233,8 @@ exports[`t-call parent is set within t-call 3`] = `
exports[`t-call parent is set within t-call with no parentNode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
return function template(ctx, node, key = \\"\\") {
@@ -227,10 +246,12 @@ exports[`t-call parent is set within t-call with no parentNode 1`] = `
exports[`t-call parent is set within t-call with no parentNode 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -238,7 +259,8 @@ exports[`t-call parent is set within t-call with no parentNode 2`] = `
exports[`t-call parent is set within t-call with no parentNode 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>lucas</span>\`);
@@ -251,7 +273,8 @@ exports[`t-call parent is set within t-call with no parentNode 3`] = `
exports[`t-call recursive t-call binding this -- static t-call 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`recursive\`);
@@ -272,7 +295,8 @@ exports[`t-call recursive t-call binding this -- static t-call 1`] = `
exports[`t-call recursive t-call binding this -- static t-call 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`recursive\`);
@@ -301,7 +325,8 @@ exports[`t-call recursive t-call binding this -- static t-call 2`] = `
exports[`t-call sub components in two t-calls 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`sub\`);
const callTemplate_2 = app.getTemplate(\`sub\`);
@@ -323,10 +348,12 @@ exports[`t-call sub components in two t-calls 1`] = `
exports[`t-call sub components in two t-calls 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -334,7 +361,8 @@ exports[`t-call sub components in two t-calls 2`] = `
exports[`t-call sub components in two t-calls 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -348,7 +376,8 @@ exports[`t-call sub components in two t-calls 3`] = `
exports[`t-call t-call in t-foreach and children component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const callTemplate_1 = app.getTemplate(\`__template__999\`);
@@ -375,10 +404,12 @@ exports[`t-call t-call in t-foreach and children component 1`] = `
exports[`t-call t-call in t-foreach and children component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['val']}, key + \`__1\`, node, ctx);
return comp1({val: ctx['val']}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -386,7 +417,8 @@ exports[`t-call t-call in t-foreach and children component 2`] = `
exports[`t-call t-call in t-foreach and children component 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -396,3 +428,75 @@ exports[`t-call t-call in t-foreach and children component 3`] = `
}
}"
`;
exports[`t-call t-call with t-call-context and subcomponent 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
return function template(ctx, node, key = \\"\\") {
let ctx1 = ctx['subctx'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
}"
`;
exports[`t-call t-call with t-call-context and subcomponent 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const b2 = comp1({name: ctx['aab']}, key + \`__1\`, node, this, null);
const b3 = comp2({name: ctx['lpe']}, key + \`__2\`, node, this, null);
return multi([b2, b3]);
}
}"
`;
exports[`t-call t-call with t-call-context and subcomponent 3`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`child\`);
const b3 = text(ctx['props'].name);
return multi([b2, b3]);
}
}"
`;
exports[`t-call t-call with t-call-context, simple use 1`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`someTemplate\`);
return function template(ctx, node, key = \\"\\") {
let ctx1 = ctx['subctx'];
return callTemplate_1.call(this, ctx1, node, key + \`__1\`);
}
}"
`;
exports[`t-call t-call with t-call-context, simple use 2`] = `
"function anonymous(app, bdom, helpers
) {
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
const b2 = text(ctx['aab']);
const b3 = text(ctx['lpe']);
return multi([b2, b3]);
}
}"
`;
@@ -3,7 +3,8 @@
exports[`t-call-block simple t-call-block with static text 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -3,13 +3,15 @@
exports[`t-component can switch between dynamic components without the need for a t-key 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const Comp1 = ctx['constructor'].components[ctx['state'].child];
const b2 = toggler(Comp1, component(Comp1, {}, key + \`__1\`, node, ctx));
const b2 = toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
return block1([], [b2]);
}
}"
@@ -18,7 +20,8 @@ exports[`t-component can switch between dynamic components without the need for
exports[`t-component can switch between dynamic components without the need for a t-key 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child a</span>\`);
@@ -31,7 +34,8 @@ exports[`t-component can switch between dynamic components without the need for
exports[`t-component can switch between dynamic components without the need for a t-key 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child b</span>\`);
@@ -44,12 +48,14 @@ exports[`t-component can switch between dynamic components without the need for
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['state'].child;
const Comp1 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp1, component(Comp1, {}, tKey_1 + key + \`__1\`, node, ctx)));
return toggler(tKey_1, toggler(Comp1, comp1({}, tKey_1 + key + \`__1\`, node, this, Comp1)));
}
}"
`;
@@ -57,7 +63,8 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child a</span>\`);
@@ -70,7 +77,8 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
exports[`t-component can use dynamic components (the class) if given (with different root tagname) 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child b</div>\`);
@@ -83,12 +91,14 @@ exports[`t-component can use dynamic components (the class) if given (with diffe
exports[`t-component can use dynamic components (the class) if given 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['state'].child;
const Comp1 = ctx['myComponent'];
return toggler(tKey_1, toggler(Comp1, component(Comp1, {}, tKey_1 + key + \`__1\`, node, ctx)));
return toggler(tKey_1, toggler(Comp1, comp1({}, tKey_1 + key + \`__1\`, node, this, Comp1)));
}
}"
`;
@@ -96,7 +106,8 @@ exports[`t-component can use dynamic components (the class) if given 1`] = `
exports[`t-component can use dynamic components (the class) if given 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child a</span>\`);
@@ -109,7 +120,8 @@ exports[`t-component can use dynamic components (the class) if given 2`] = `
exports[`t-component can use dynamic components (the class) if given 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>child b</span>\`);
@@ -122,13 +134,15 @@ exports[`t-component can use dynamic components (the class) if given 3`] = `
exports[`t-component modifying a sub widget 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const Comp1 = ctx['Counter'];
const b2 = toggler(Comp1, component(Comp1, {}, key + \`__1\`, node, ctx));
const b2 = toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
return block1([], [b2]);
}
}"
@@ -137,7 +151,8 @@ exports[`t-component modifying a sub widget 1`] = `
exports[`t-component modifying a sub widget 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><button block-handler-1=\\"click\\">Inc</button></div>\`);
@@ -153,11 +168,13 @@ exports[`t-component modifying a sub widget 2`] = `
exports[`t-component switching dynamic component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
return function template(ctx, node, key = \\"\\") {
const Comp1 = ctx['Child'];
return toggler(Comp1, component(Comp1, {}, key + \`__1\`, node, ctx));
return toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
}
}"
`;
@@ -165,7 +182,8 @@ exports[`t-component switching dynamic component 1`] = `
exports[`t-component switching dynamic component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child a</div>\`);
@@ -178,7 +196,8 @@ exports[`t-component switching dynamic component 2`] = `
exports[`t-component switching dynamic component 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`child b\`);
@@ -189,11 +208,13 @@ exports[`t-component switching dynamic component 3`] = `
exports[`t-component t-component works in simple case 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(null, false, false, false, true);
return function template(ctx, node, key = \\"\\") {
const Comp1 = ctx['Child'];
return toggler(Comp1, component(Comp1, {}, key + \`__1\`, node, ctx));
return toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
}
}"
`;
@@ -201,7 +222,8 @@ exports[`t-component t-component works in simple case 1`] = `
exports[`t-component t-component works in simple case 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>child</div>\`);
@@ -3,8 +3,10 @@
exports[`list of components components in a node in a t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><ul><block-child-0/></ul></div>\`);
let block3 = createBlock(\`<li><block-child-0/></li>\`);
@@ -15,7 +17,7 @@ exports[`list of components components in a node in a t-foreach 1`] = `
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`item\`] = v_block2[i1];
const key1 = 'li_'+ctx['item'];
const b4 = component(\`Child\`, {item: ctx['item']}, key + \`__1__\${key1}\`, node, ctx);
const b4 = comp1({item: ctx['item']}, key + \`__1__\${key1}\`, node, this, null);
c_block2[i1] = withKey(block3([], [b4]), key1);
}
const b2 = list(c_block2);
@@ -27,7 +29,8 @@ exports[`list of components components in a node in a t-foreach 1`] = `
exports[`list of components components in a node in a t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -41,8 +44,10 @@ exports[`list of components components in a node in a t-foreach 2`] = `
exports[`list of components crash on duplicate key in dev mode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
@@ -55,7 +60,7 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
keys1.add(key1);
const props1 = {};
helpers.validateProps(\`Child\`, props1, ctx);
c_block1[i1] = withKey(component(\`Child\`, props1, key + \`__1__\${key1}\`, node, ctx), key1);
c_block1[i1] = withKey(comp1(props1, key + \`__1__\${key1}\`, node, this, null), key1);
}
return list(c_block1);
}
@@ -65,7 +70,8 @@ exports[`list of components crash on duplicate key in dev mode 1`] = `
exports[`list of components crash on duplicate key in dev mode 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`\`);
@@ -76,8 +82,10 @@ exports[`list of components crash on duplicate key in dev mode 2`] = `
exports[`list of components list of sub components inside other nodes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`SubComponent\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<div><block-child-0/></div>\`);
@@ -88,7 +96,7 @@ exports[`list of components list of sub components inside other nodes 1`] = `
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`blip\`] = v_block2[i1];
const key1 = ctx['blip'].id;
const b4 = component(\`SubComponent\`, {}, key + \`__1__\${key1}\`, node, ctx);
const b4 = comp1({}, key + \`__1__\${key1}\`, node, this, null);
c_block2[i1] = withKey(block3([], [b4]), key1);
}
const b2 = list(c_block2);
@@ -100,7 +108,8 @@ exports[`list of components list of sub components inside other nodes 1`] = `
exports[`list of components list of sub components inside other nodes 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span>asdf</span>\`);
@@ -113,8 +122,10 @@ exports[`list of components list of sub components inside other nodes 2`] = `
exports[`list of components reconciliation alg works for t-foreach in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -131,7 +142,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
ctx[\`blip\`] = v_block3[i2];
ctx[\`blip_index\`] = i2;
const key2 = ctx['blip_index'];
c_block3[i2] = withKey(component(\`Child\`, {blip: ctx['blip']}, key + \`__1__\${key1}__\${key2}\`, node, ctx), key2);
c_block3[i2] = withKey(comp1({blip: ctx['blip']}, key + \`__1__\${key1}__\${key2}\`, node, this, null), key2);
}
ctx = ctx.__proto__;
c_block2[i1] = withKey(list(c_block3), key1);
@@ -145,7 +156,8 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
exports[`list of components reconciliation alg works for t-foreach in t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -159,8 +171,10 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<p><block-child-0/></p>\`);
@@ -177,7 +191,7 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
for (let i2 = 0; i2 < l_block4; i2++) {
ctx[\`col\`] = v_block4[i2];
const key2 = ctx['col'];
const b6 = component(\`Child\`, {row: ctx['row'],col: ctx['col']}, key + \`__1__\${key1}__\${key2}\`, node, ctx);
const b6 = comp1({row: ctx['row'],col: ctx['col']}, key + \`__1__\${key1}__\${key2}\`, node, this, null);
c_block4[i2] = withKey(block5([], [b6]), key2);
}
ctx = ctx.__proto__;
@@ -193,7 +207,8 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
exports[`list of components reconciliation alg works for t-foreach in t-foreach, 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -207,8 +222,10 @@ exports[`list of components reconciliation alg works for t-foreach in t-foreach,
exports[`list of components simple list 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
@@ -216,7 +233,7 @@ exports[`list of components simple list 1`] = `
for (let i1 = 0; i1 < l_block1; i1++) {
ctx[\`elem\`] = v_block1[i1];
const key1 = ctx['elem'].id;
c_block1[i1] = withKey(component(\`Child\`, {value: ctx['elem'].value}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block1[i1] = withKey(comp1({value: ctx['elem'].value}, key + \`__1__\${key1}\`, node, this, null), key1);
}
return list(c_block1);
}
@@ -226,7 +243,8 @@ exports[`list of components simple list 1`] = `
exports[`list of components simple list 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -240,8 +258,10 @@ exports[`list of components simple list 2`] = `
exports[`list of components sub components rendered in a loop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -251,7 +271,7 @@ exports[`list of components sub components rendered in a loop 1`] = `
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`number\`] = v_block2[i1];
const key1 = ctx['number'];
c_block2[i1] = withKey(component(\`Child\`, {n: ctx['number']}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block2[i1] = withKey(comp1({n: ctx['number']}, key + \`__1__\${key1}\`, node, this, null), key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -262,7 +282,8 @@ exports[`list of components sub components rendered in a loop 1`] = `
exports[`list of components sub components rendered in a loop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p><block-text-0/></p>\`);
@@ -276,8 +297,10 @@ exports[`list of components sub components rendered in a loop 2`] = `
exports[`list of components sub components with some state rendered in a loop 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -287,7 +310,7 @@ exports[`list of components sub components with some state rendered in a loop 1`
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`number\`] = v_block2[i1];
const key1 = ctx['number'];
c_block2[i1] = withKey(component(\`Child\`, {}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block2[i1] = withKey(comp1({}, key + \`__1__\${key1}\`, node, this, null), key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -298,7 +321,8 @@ exports[`list of components sub components with some state rendered in a loop 1`
exports[`list of components sub components with some state rendered in a loop 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p><block-text-0/></p>\`);
@@ -312,8 +336,10 @@ exports[`list of components sub components with some state rendered in a loop 2`
exports[`list of components switch component position 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -323,7 +349,7 @@ exports[`list of components switch component position 1`] = `
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`c\`] = v_block2[i1];
const key1 = ctx['c'];
c_block2[i1] = withKey(component(\`Child\`, {key: ctx['c']}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block2[i1] = withKey(comp1({key: ctx['c']}, key + \`__1__\${key1}\`, node, this, null), key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -334,7 +360,8 @@ exports[`list of components switch component position 1`] = `
exports[`list of components switch component position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -348,8 +375,10 @@ exports[`list of components switch component position 2`] = `
exports[`list of components t-foreach with t-component, and update 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -360,7 +389,7 @@ exports[`list of components t-foreach with t-component, and update 1`] = `
ctx[\`n\`] = v_block2[i1];
ctx[\`n_index\`] = i1;
const key1 = ctx['n_index'];
c_block2[i1] = withKey(component(\`Child\`, {val: ctx['n_index']}, key + \`__1__\${key1}\`, node, ctx), key1);
c_block2[i1] = withKey(comp1({val: ctx['n_index']}, key + \`__1__\${key1}\`, node, this, null), key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -371,7 +400,8 @@ exports[`list of components t-foreach with t-component, and update 1`] = `
exports[`list of components t-foreach with t-component, and update 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
@@ -3,8 +3,10 @@
exports[`t-key t-foreach with t-key switch component position 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -15,7 +17,7 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
ctx[\`c\`] = v_block2[i1];
const key1 = ctx['c'];
const tKey_1 = ctx['key1'];
c_block2[i1] = withKey(component(\`Child\`, {key: ctx['c']+ctx['key1']}, tKey_1 + key + \`__1__\${key1}\`, node, ctx), tKey_1 + key1);
c_block2[i1] = withKey(comp1({key: ctx['c']+ctx['key1']}, tKey_1 + key + \`__1__\${key1}\`, node, this, null), tKey_1 + key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -26,7 +28,8 @@ exports[`t-key t-foreach with t-key switch component position 1`] = `
exports[`t-key t-foreach with t-key switch component position 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -40,11 +43,13 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
exports[`t-key t-key on Component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
return toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__1\`, node, ctx));
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
}
}"
`;
@@ -52,7 +57,8 @@ exports[`t-key t-key on Component 1`] = `
exports[`t-key t-key on Component 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -66,13 +72,15 @@ exports[`t-key t-key on Component 2`] = `
exports[`t-key t-key on Component as a function 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
const b2 = toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__1\`, node, ctx));
const b2 = toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
return block1([], [b2]);
}
}"
@@ -81,7 +89,8 @@ exports[`t-key t-key on Component as a function 1`] = `
exports[`t-key t-key on Component as a function 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -95,15 +104,18 @@ exports[`t-key t-key on Component as a function 2`] = `
exports[`t-key t-key on multiple Components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key1'];
const b2 = toggler(tKey_1, component(\`Child\`, {key: ctx['key1']}, tKey_1 + key + \`__1\`, node, ctx));
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
const tKey_2 = ctx['key2'];
const b3 = toggler(tKey_2, component(\`Child\`, {key: ctx['key2']}, tKey_2 + key + \`__2\`, node, ctx));
const b3 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
return block1([], [b2, b3]);
}
}"
@@ -112,7 +124,8 @@ exports[`t-key t-key on multiple Components 1`] = `
exports[`t-key t-key on multiple Components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -126,7 +139,8 @@ exports[`t-key t-key on multiple Components 2`] = `
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
const callTemplate_2 = app.getTemplate(\`calledTemplate\`);
@@ -153,11 +167,13 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key'];
return toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__1\`, node, ctx));
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
}
}"
`;
@@ -165,7 +181,8 @@ exports[`t-key t-key on multiple Components with t-call 1 2`] = `
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -179,7 +196,8 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
let block1 = createBlock(\`<span><block-child-0/></span>\`);
@@ -194,13 +212,16 @@ exports[`t-key t-key on multiple Components with t-call 2 1`] = `
exports[`t-key t-key on multiple Components with t-call 2 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
return function template(ctx, node, key = \\"\\") {
const tKey_1 = ctx['key1'];
const b2 = toggler(tKey_1, component(\`Child\`, {key: ctx['key1']}, tKey_1 + key + \`__1\`, node, ctx));
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
const tKey_2 = ctx['key2'];
const b3 = toggler(tKey_2, component(\`Child\`, {key: ctx['key2']}, tKey_2 + key + \`__2\`, node, ctx));
const b3 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
return multi([b2, b3]);
}
}"
@@ -209,7 +230,8 @@ exports[`t-key t-key on multiple Components with t-call 2 2`] = `
exports[`t-key t-key on multiple Components with t-call 2 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -3,7 +3,8 @@
exports[`t-model directive .lazy modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"change\\"/><span><block-text-2/></span></div>\`);
@@ -22,7 +23,8 @@ exports[`t-model directive .lazy modifier 1`] = `
exports[`t-model directive .number modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -41,7 +43,8 @@ exports[`t-model directive .number modifier 1`] = `
exports[`t-model directive .trim modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -60,7 +63,8 @@ exports[`t-model directive .trim modifier 1`] = `
exports[`t-model directive basic use, on an input 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -79,7 +83,8 @@ exports[`t-model directive basic use, on an input 1`] = `
exports[`t-model directive basic use, on an input with bracket expression 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -98,7 +103,8 @@ exports[`t-model directive basic use, on an input with bracket expression 1`] =
exports[`t-model directive basic use, on another key in component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -117,7 +123,8 @@ exports[`t-model directive basic use, on another key in component 1`] = `
exports[`t-model directive can also define t-on directive on same event, part 1 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-handler-0=\\"input\\" block-attribute-1=\\"value\\" block-handler-2=\\"input\\"/></div>\`);
@@ -136,7 +143,8 @@ exports[`t-model directive can also define t-on directive on same event, part 1
exports[`t-model directive can also define t-on directive on same event, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-handler-0=\\"click\\" block-attribute-1=\\"checked\\" block-handler-2=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-handler-3=\\"click\\" block-attribute-4=\\"checked\\" block-handler-5=\\"click\\"/><input type=\\"radio\\" id=\\"three\\" value=\\"Three\\" block-handler-6=\\"click\\" block-attribute-7=\\"checked\\" block-handler-8=\\"click\\"/></div>\`);
@@ -165,7 +173,8 @@ exports[`t-model directive can also define t-on directive on same event, part 2
exports[`t-model directive following a scope protecting directive (e.g. t-set) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/></div>\`);
@@ -186,7 +195,8 @@ exports[`t-model directive following a scope protecting directive (e.g. t-set) 1
exports[`t-model directive in a t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -213,7 +223,8 @@ exports[`t-model directive in a t-foreach 1`] = `
exports[`t-model directive in a t-foreach, part 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -241,7 +252,8 @@ exports[`t-model directive in a t-foreach, part 2 1`] = `
exports[`t-model directive in a t-foreach, part 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, toNumber, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -269,7 +281,8 @@ exports[`t-model directive in a t-foreach, part 3 1`] = `
exports[`t-model directive on a select 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"\\">Please select one</option><option value=\\"red\\">Red</option><option value=\\"blue\\">Blue</option></select><span>Choice: <block-text-2/></span></div>\`);
@@ -288,7 +301,8 @@ exports[`t-model directive on a select 1`] = `
exports[`t-model directive on a select, initial state 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"\\">Please select one</option><option value=\\"red\\">Red</option><option value=\\"blue\\">Blue</option></select></div>\`);
@@ -306,7 +320,8 @@ exports[`t-model directive on a select, initial state 1`] = `
exports[`t-model directive on a sub state key 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -325,7 +340,8 @@ exports[`t-model directive on a sub state key 1`] = `
exports[`t-model directive on an input type=radio 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/><span>Choice: <block-text-4/></span></div>\`);
@@ -348,7 +364,8 @@ exports[`t-model directive on an input type=radio 1`] = `
exports[`t-model directive on an input type=radio, with initial value 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input type=\\"radio\\" id=\\"one\\" value=\\"One\\" block-attribute-0=\\"checked\\" block-handler-1=\\"click\\"/><input type=\\"radio\\" id=\\"two\\" value=\\"Two\\" block-attribute-2=\\"checked\\" block-handler-3=\\"click\\"/></div>\`);
@@ -370,7 +387,8 @@ exports[`t-model directive on an input type=radio, with initial value 1`] = `
exports[`t-model directive on an input, type=checkbox 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input type=\\"checkbox\\" block-attribute-0=\\"checked\\" block-handler-1=\\"input\\"/><span><block-child-0/><block-child-1/></span></div>\`);
@@ -394,7 +412,8 @@ exports[`t-model directive on an input, type=checkbox 1`] = `
exports[`t-model directive on an textarea 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><textarea block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -413,7 +432,8 @@ exports[`t-model directive on an textarea 1`] = `
exports[`t-model directive t-model on an input with an undefined value 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/>\`);
@@ -431,7 +451,8 @@ exports[`t-model directive t-model on an input with an undefined value 1`] = `
exports[`t-model directive t-model on select with static options 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-attribute-0=\\"value\\" block-handler-1=\\"change\\"><option value=\\"a\\"><block-text-2/></option><option value=\\"b\\"><block-text-3/></option><option value=\\"c\\"><block-text-4/></option></select></div>\`);
@@ -452,7 +473,8 @@ exports[`t-model directive t-model on select with static options 1`] = `
exports[`t-model directive t-model with dynamic values on select options -- 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option></select></div>\`);
@@ -476,7 +498,8 @@ exports[`t-model directive t-model with dynamic values on select options -- 2 1`
exports[`t-model directive t-model with dynamic values on select options -- 3 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option value=\\"b\\" block-attribute-4=\\"selected\\"><block-text-5/></option></select></div>\`);
@@ -499,7 +522,8 @@ exports[`t-model directive t-model with dynamic values on select options -- 3 1`
exports[`t-model directive t-model with dynamic values on select options 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><option block-attribute-1=\\"value\\" block-attribute-2=\\"selected\\"><block-text-3/></option><option block-attribute-4=\\"value\\" block-attribute-5=\\"selected\\"><block-text-6/></option></select></div>\`);
@@ -523,7 +547,8 @@ exports[`t-model directive t-model with dynamic values on select options 1`] = `
exports[`t-model directive t-model with dynamic values on select options in foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><select block-handler-0=\\"change\\"><block-child-0/></select></div>\`);
@@ -553,7 +578,8 @@ exports[`t-model directive t-model with dynamic values on select options in fore
exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -584,7 +610,8 @@ exports[`t-model directive two inputs in a div alternating with a t-if 1`] = `
exports[`t-model directive with expression having a changing key 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { toNumber } = helpers;
let block1 = createBlock(\`<div><input block-attribute-0=\\"value\\" block-handler-1=\\"input\\"/><span><block-text-2/></span></div>\`);
@@ -3,7 +3,8 @@
exports[`t-on t-on expression captured in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -33,7 +34,8 @@ exports[`t-on t-on expression captured in t-foreach 1`] = `
exports[`t-on t-on expression in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -62,7 +64,8 @@ exports[`t-on t-on expression in t-foreach 1`] = `
exports[`t-on t-on expression in t-foreach with t-set 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -96,7 +99,8 @@ exports[`t-on t-on expression in t-foreach with t-set 1`] = `
exports[`t-on t-on method call in t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, withKey } = helpers;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -124,15 +128,17 @@ exports[`t-on t-on method call in t-foreach 1`] = `
exports[`t-on t-on on component next to t-on on div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click\\":0});
let block1 = createBlock(\`<div><block-child-0/><p block-handler-0=\\"click\\">dec</p></div>\`);
return function template(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
const b2 = catcher1(component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx), [hdlr1]);
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
let hdlr2 = [ctx['decrement'], ctx];
return block1([hdlr2], [b2]);
}
@@ -142,7 +148,8 @@ exports[`t-on t-on on component next to t-on on div 1`] = `
exports[`t-on t-on on component next to t-on on div 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button><block-text-0/></button>\`);
@@ -156,13 +163,15 @@ exports[`t-on t-on on component next to t-on on div 2`] = `
exports[`t-on t-on on components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click\\":0});
return function template(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
return catcher1(component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx), [hdlr1]);
return catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
}
}"
`;
@@ -170,7 +179,8 @@ exports[`t-on t-on on components 1`] = `
exports[`t-on t-on on components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button><block-text-0/></button>\`);
@@ -184,8 +194,10 @@ exports[`t-on t-on on components 2`] = `
exports[`t-on t-on on components and t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, createCatcher, withKey } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click\\":0});
return function template(ctx, node, key = \\"\\") {
@@ -196,7 +208,7 @@ exports[`t-on t-on on components and t-foreach 1`] = `
const key1 = ctx['name'];
const v1 = ctx['name'];
const hdlr1 = [()=>this.log(v1), ctx];
c_block1[i1] = withKey(catcher1(component(\`Child\`, {value: ctx['name']}, key + \`__1__\${key1}\`, node, ctx), [hdlr1]), key1);
c_block1[i1] = withKey(catcher1(comp1({value: ctx['name']}, key + \`__1__\${key1}\`, node, this, null), [hdlr1]), key1);
}
return list(c_block1);
}
@@ -206,7 +218,8 @@ exports[`t-on t-on on components and t-foreach 1`] = `
exports[`t-on t-on on components and t-foreach 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -220,15 +233,17 @@ exports[`t-on t-on on components and t-foreach 2`] = `
exports[`t-on t-on on components, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click\\":0});
let block1 = createBlock(\`<div><span/><block-child-0/><p/></div>\`);
return function template(ctx, node, key = \\"\\") {
const hdlr1 = [ctx['increment'], ctx];
const b2 = catcher1(component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx), [hdlr1]);
const b2 = catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
return block1([], [b2]);
}
}"
@@ -237,7 +252,8 @@ exports[`t-on t-on on components, variation 1`] = `
exports[`t-on t-on on components, variation 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button><block-text-0/></button>\`);
@@ -251,13 +267,15 @@ exports[`t-on t-on on components, variation 2`] = `
exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { createCatcher } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click.prevent\\":0});
return function template(ctx, node, key = \\"\\") {
const hdlr1 = [\\"prevent\\", ctx['increment'], ctx];
return catcher1(component(\`Child\`, {value: ctx['state'].value}, key + \`__1\`, node, ctx), [hdlr1]);
return catcher1(comp1({value: ctx['state'].value}, key + \`__1\`, node, this, null), [hdlr1]);
}
}"
`;
@@ -265,7 +283,8 @@ exports[`t-on t-on on components, with 'prevent' modifier 1`] = `
exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button><block-text-0/></button>\`);
@@ -279,8 +298,10 @@ exports[`t-on t-on on components, with 'prevent' modifier 2`] = `
exports[`t-on t-on on components, with a handler update 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, createCatcher } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const catcher1 = createCatcher({\\"click\\":0});
return function template(ctx, node, key = \\"\\") {
@@ -289,7 +310,7 @@ exports[`t-on t-on on components, with a handler update 1`] = `
setContextValue(ctx, \\"name\\", ctx['state'].name);
const v1 = ctx['name'];
const hdlr1 = [()=>this.log(v1), ctx];
return catcher1(component(\`Child\`, {value: ctx['name']}, key + \`__1\`, node, ctx), [hdlr1]);
return catcher1(comp1({value: ctx['name']}, key + \`__1\`, node, this, null), [hdlr1]);
}
}"
`;
@@ -297,7 +318,8 @@ exports[`t-on t-on on components, with a handler update 1`] = `
exports[`t-on t-on on components, with a handler update 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -311,14 +333,16 @@ exports[`t-on t-on on components, with a handler update 2`] = `
exports[`t-on t-on on destroyed components 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2]);
}
@@ -328,7 +352,8 @@ exports[`t-on t-on on destroyed components 1`] = `
exports[`t-on t-on on destroyed components 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-handler-0=\\"click\\"/>\`);
@@ -342,8 +367,10 @@ exports[`t-on t-on on destroyed components 2`] = `
exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block1 = createBlock(\`<button>button</button>\`);
@@ -352,7 +379,7 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
}
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, ctx);
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -360,7 +387,8 @@ exports[`t-on t-on on slot, with 'prevent' modifier 1`] = `
exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, createCatcher } = helpers;
const catcher1 = createCatcher({\\"click.prevent\\":0});
@@ -374,9 +402,11 @@ exports[`t-on t-on on slot, with 'prevent' modifier 2`] = `
exports[`t-on t-on on t-set-slots 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, createCatcher, markRaw } = helpers;
const catcher1 = createCatcher({\\"click\\":0});
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block6 = createBlock(\`<p>something</p>\`);
let block7 = createBlock(\`<p>paragraph</p>\`);
@@ -393,7 +423,7 @@ exports[`t-on t-on on t-set-slots 1`] = `
const b3 = text(ctx['state'].count);
const b4 = text(\`] \`);
const ctx1 = capture(ctx);
const b8 = component(\`Child\`, {slots: markRaw({'myslot': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, ctx);
const b8 = comp1({slots: markRaw({'myslot': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
return multi([b2, b3, b4, b8]);
}
}"
@@ -402,7 +432,8 @@ exports[`t-on t-on on t-set-slots 1`] = `
exports[`t-on t-on on t-set-slots 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -414,8 +445,10 @@ exports[`t-on t-on on t-set-slots 2`] = `
exports[`t-on t-on on t-slots 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, true, false, true);
let block1 = createBlock(\`<p>something</p>\`);
@@ -424,7 +457,7 @@ exports[`t-on t-on on t-slots 1`] = `
}
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, ctx);
return comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__1\`, node, this, null);
}
}"
`;
@@ -432,7 +465,8 @@ exports[`t-on t-on on t-slots 1`] = `
exports[`t-on t-on on t-slots 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot, createCatcher } = helpers;
const catcher1 = createCatcher({\\"click\\":0});
@@ -3,12 +3,14 @@
exports[`t-props basic use 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, Object.assign({}, ctx['some'].obj), key + \`__1\`, node, ctx);
const b2 = comp1(Object.assign({}, ctx['some'].obj), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -17,7 +19,8 @@ exports[`t-props basic use 1`] = `
exports[`t-props basic use 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -31,10 +34,12 @@ exports[`t-props basic use 2`] = `
exports[`t-props child receives a copy of the t-props object, not the original 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
return function template(ctx, node, key = \\"\\") {
return component(\`Child\`, Object.assign({}, ctx['childProps']), key + \`__1\`, node, ctx);
return comp1(Object.assign({}, ctx['childProps']), key + \`__1\`, node, this, null);
}
}"
`;
@@ -42,7 +47,8 @@ exports[`t-props child receives a copy of the t-props object, not the original 1
exports[`t-props child receives a copy of the t-props object, not the original 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -55,12 +61,14 @@ exports[`t-props child receives a copy of the t-props object, not the original 2
exports[`t-props t-props and other props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Comp\`, Object.assign({}, ctx['state1'], {a: ctx['a']}), key + \`__1\`, node, ctx);
const b2 = comp1(Object.assign({}, ctx['state1'], {a: ctx['a']}), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -69,7 +77,8 @@ exports[`t-props t-props and other props 1`] = `
exports[`t-props t-props and other props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -84,12 +93,14 @@ exports[`t-props t-props and other props 2`] = `
exports[`t-props t-props only 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Comp\`, Object.assign({}, ctx['state']), key + \`__1\`, node, ctx);
const b2 = comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -98,7 +109,8 @@ exports[`t-props t-props only 1`] = `
exports[`t-props t-props only 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div><block-text-0/></div>\`);
@@ -112,12 +124,14 @@ exports[`t-props t-props only 2`] = `
exports[`t-props t-props with props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = component(\`Child\`, Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, ctx);
const b2 = comp1(Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, this, null);
return block1([], [b2]);
}
}"
@@ -126,7 +140,8 @@ exports[`t-props t-props with props 1`] = `
exports[`t-props t-props with props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
@@ -3,8 +3,10 @@
exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue, capture, markRaw } = helpers;
const comp1 = app.createComponent(\`Childcomp\`, true, true, false, true);
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
@@ -21,7 +23,7 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
setContextValue(ctx, \\"iter\\", 'source');
let txt1 = ctx['iter'];
const ctx1 = capture(ctx);
const b2 = component(\`Childcomp\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, ctx);
const b2 = comp1({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__1\`, node, this, null);
let txt2 = ctx['iter'];
return block1([txt1, txt2], [b2]);
}
@@ -31,7 +33,8 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 1`] = `
exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -50,25 +53,28 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
exports[`t-set slots with a t-set with a component in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
const comp1 = app.createComponent(\`C\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, node);
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
const b3 = text(\` in slot \`);
const b4 = safeOutput(ctx['v']);
return multi([b3, b4]);
}
function value1(ctx, node, key = \\"\\") {
return component(\`C\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return component(\`Child\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, ctx);
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
}"
`;
@@ -76,7 +82,8 @@ exports[`t-set slots with a t-set with a component in body 1`] = `
exports[`t-set slots with a t-set with a component in body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -90,7 +97,8 @@ exports[`t-set slots with a t-set with a component in body 2`] = `
exports[`t-set slots with a t-set with a component in body 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`C\`);
@@ -101,29 +109,32 @@ exports[`t-set slots with a t-set with a component in body 3`] = `
exports[`t-set slots with an t-set with a component in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, safeOutput, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Blorg\`, true, true, false, true);
let block4 = createBlock(\`<div>coffee</div>\`);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, node);
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
const b5 = text(\` tea \`);
const b6 = safeOutput(ctx['v']);
return multi([b5, b6]);
}
function value1(ctx, node, key = \\"\\") {
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
const b4 = block4();
return multi([b3, b4]);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return component(\`Blorg\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, ctx);
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
}"
`;
@@ -131,7 +142,8 @@ exports[`t-set slots with an t-set with a component in body 1`] = `
exports[`t-set slots with an t-set with a component in body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -145,7 +157,8 @@ exports[`t-set slots with an t-set with a component in body 2`] = `
exports[`t-set slots with an t-set with a component in body 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`Child\`);
@@ -156,23 +169,26 @@ exports[`t-set slots with an t-set with a component in body 3`] = `
exports[`t-set slots with an unused t-set with a component in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { capture, isBoundary, withDefault, LazyValue, markRaw } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
function slot1(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, node);
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
return text(\` in slot \`);
}
function value1(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const ctx1 = capture(ctx);
return component(\`Child\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, ctx);
return comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2\`, node, this, null);
}
}"
`;
@@ -180,7 +196,8 @@ exports[`t-set slots with an unused t-set with a component in body 1`] = `
exports[`t-set slots with an unused t-set with a component in body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
return function template(ctx, node, key = \\"\\") {
@@ -194,7 +211,8 @@ exports[`t-set slots with an unused t-set with a component in body 2`] = `
exports[`t-set t-set can't alter component even if key in component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p></div>\`);
@@ -213,7 +231,8 @@ exports[`t-set t-set can't alter component even if key in component 1`] = `
exports[`t-set t-set can't alter component if key not in component 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p></div>\`);
@@ -232,7 +251,8 @@ exports[`t-set t-set can't alter component if key not in component 1`] = `
exports[`t-set t-set in t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
@@ -257,8 +277,10 @@ exports[`t-set t-set in t-if 1`] = `
exports[`t-set t-set not altered by child comp 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
const comp1 = app.createComponent(\`Childcomp\`, true, false, false, true);
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
@@ -267,7 +289,7 @@ exports[`t-set t-set not altered by child comp 1`] = `
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 'source');
let txt1 = ctx['iter'];
const b2 = component(\`Childcomp\`, {}, key + \`__1\`, node, ctx);
const b2 = comp1({}, key + \`__1\`, node, this, null);
let txt2 = ctx['iter'];
return block1([txt1, txt2], [b2]);
}
@@ -277,7 +299,8 @@ exports[`t-set t-set not altered by child comp 1`] = `
exports[`t-set t-set not altered by child comp 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
@@ -296,7 +319,8 @@ exports[`t-set t-set not altered by child comp 2`] = `
exports[`t-set t-set outside modified in t-if 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, setContextValue } = helpers;
let block1 = createBlock(\`<div><block-child-0/><block-child-0/><block-child-0/><p><block-text-0/></p></div>\`);
@@ -322,19 +346,21 @@ exports[`t-set t-set outside modified in t-if 1`] = `
exports[`t-set t-set with a component in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
function value1(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, node);
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
const b3 = safeOutput(ctx['v']);
return block1([], [b3]);
}
@@ -344,7 +370,8 @@ exports[`t-set t-set with a component in body 1`] = `
exports[`t-set t-set with a component in body 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
return function template(ctx, node, key = \\"\\") {
return text(\`Child\`);
@@ -355,7 +382,8 @@ exports[`t-set t-set with a component in body 2`] = `
exports[`t-set t-set with something in body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { isBoundary, withDefault, LazyValue, safeOutput } = helpers;
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
@@ -368,7 +396,7 @@ exports[`t-set t-set with something in body 1`] = `
return function template(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
ctx[\`v\`] = new LazyValue(value1, ctx, node);
ctx[\`v\`] = new LazyValue(value1, ctx, this, node);
const b3 = safeOutput(ctx['v']);
return block1([], [b3]);
}
+1 -1
View File
@@ -121,7 +121,7 @@ describe("basics", () => {
class Test extends Component {
static template = xml`<span>simple vnode</span>`;
setup() {
expect(toRaw(this.props)).toBe(p);
expect(toRaw(this.props)).not.toBe(p);
}
}
+43
View File
@@ -244,4 +244,47 @@ describe("t-call", () => {
}
expect(clickCount).toBe(2);
});
test("t-call with t-call-context, simple use", async () => {
class Root extends Component {
static template = xml`
<t t-call="someTemplate" t-call-context="subctx"/>`;
subctx = { aab: "aaron", lpe: "lucas" };
}
await mount(Root, fixture, {
templates: `
<templates>
<t t-name="someTemplate"><t t-esc="aab"/><t t-esc="lpe"/></t>
</templates>`,
});
expect(fixture.innerHTML).toBe("aaronlucas");
});
test("t-call with t-call-context and subcomponent", async () => {
class Child extends Component {
static template = xml`child<t t-esc="props.name"/>`;
}
class Root extends Component {
static template = xml`
<t t-call="someTemplate" t-call-context="subctx"/>`;
static components = { Child };
subctx = { aab: "aaron", lpe: "lucas" };
}
await mount(Root, fixture, {
templates: `
<templates>
<t t-name="someTemplate">
<Child name="aab"/>
<Child name="lpe"/>
</t>
</templates>`,
});
expect(fixture.innerHTML).toBe("childaaronchildlucas");
});
});
+5 -1
View File
@@ -91,7 +91,11 @@ export function renderToBdom(template: string, context: any = {}, node?: any): B
snapshottedTemplates.add(template);
expect(fn.toString()).toMatchSnapshot();
}
return fn(null as any, blockDom, helpers)(context, node);
const app = {
createComponent() {},
createDynamicComponent() {},
};
return fn(app as any, blockDom, helpers)(context, node);
}
export function renderToString(template: string, context: any = {}, node?: any): string {
+175 -91
View File
@@ -3,9 +3,11 @@
exports[`Portal Add and remove portals 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
function slot1(ctx, node, key = \\"\\") {
const b3 = text(\` Portal\`);
@@ -19,8 +21,8 @@ exports[`Portal Add and remove portals 1`] = `
for (let i1 = 0; i1 < l_block1; i1++) {
ctx[\`portalId\`] = v_block1[i1];
const key1 = ctx['portalId'];
const ctx1 = capture(ctx);;
c_block1[i1] = withKey(component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx), key1);
const ctx1 = capture(ctx);
c_block1[i1] = withKey(comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal), key1);
}
return list(c_block1);
}
@@ -30,9 +32,11 @@ exports[`Portal Add and remove portals 1`] = `
exports[`Portal Add and remove portals on div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<div> Portal<block-text-0/></div>\`);
@@ -47,8 +51,8 @@ exports[`Portal Add and remove portals on div 1`] = `
for (let i1 = 0; i1 < l_block1; i1++) {
ctx[\`portalId\`] = v_block1[i1];
const key1 = ctx['portalId'];
const ctx1 = capture(ctx);;
c_block1[i1] = withKey(component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx), key1);
const ctx1 = capture(ctx);
c_block1[i1] = withKey(comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal), key1);
}
return list(c_block1);
}
@@ -58,9 +62,11 @@ exports[`Portal Add and remove portals on div 1`] = `
exports[`Portal Add and remove portals with t-foreach 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<div><block-text-0/><block-child-0/></div>\`);
@@ -77,8 +83,8 @@ exports[`Portal Add and remove portals with t-foreach 1`] = `
ctx[\`portalId\`] = v_block1[i1];
const key1 = ctx['portalId'];
let txt1 = ctx['portalId'];
const ctx1 = capture(ctx);;
const b6 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx);
const ctx1 = capture(ctx);
const b6 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal);
c_block1[i1] = withKey(block2([txt1], [b6]), key1);
}
return list(c_block1);
@@ -89,9 +95,11 @@ exports[`Portal Add and remove portals with t-foreach 1`] = `
exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<div><block-text-0/><block-child-0/></div>\`);
@@ -108,8 +116,8 @@ exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
ctx[\`portalId\`] = v_block1[i1];
const key1 = ctx['portalId'];
let txt1 = ctx['portalId'];
const ctx1 = capture(ctx);;
const b6 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx);
const ctx1 = capture(ctx);
const b6 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal);
c_block1[i1] = withKey(block2([txt1], [b6]), key1);
}
return list(c_block1);
@@ -120,9 +128,11 @@ exports[`Portal Add and remove portals with t-foreach and destroy 1`] = `
exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<div><block-text-0/><block-child-0/></div>\`);
@@ -140,8 +150,8 @@ exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
ctx[\`portalId\`] = v_block2[i1];
const key1 = ctx['portalId'];
let txt1 = ctx['portalId'];
const ctx1 = capture(ctx);;
const b7 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx);
const ctx1 = capture(ctx);
const b7 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal);
c_block2[i1] = withKey(block3([txt1], [b7]), key1);
}
const b2 = list(c_block2);
@@ -153,17 +163,20 @@ exports[`Portal Add and remove portals with t-foreach inside div 1`] = `
exports[`Portal Portal composed with t-slot 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { markRaw } = helpers;
const comp1 = app.createComponent(\`Child2\`, true, false, false, false);
const comp2 = app.createComponent(\`Child\`, true, true, false, true);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child2\`, {customHandler: ctx['_handled']}, key + \`__1\`, node, ctx);
return comp1({customHandler: ctx['_handled']}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(\`Child\`, {slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, ctx);
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
return block1([], [b3]);
}
}"
@@ -172,16 +185,18 @@ exports[`Portal Portal composed with t-slot 1`] = `
exports[`Portal Portal composed with t-slot 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { callSlot } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
function slot1(ctx, node, key = \\"\\") {
return callSlot(ctx, node, key, 'default', false, {});
}
return function template(ctx, node, key = \\"\\") {
return component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
return comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
}
}"
`;
@@ -189,7 +204,8 @@ exports[`Portal Portal composed with t-slot 2`] = `
exports[`Portal Portal composed with t-slot 3`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div block-handler-0=\\"custom\\"><span id=\\"childSpan\\">child2</span></div>\`);
@@ -203,8 +219,10 @@ exports[`Portal Portal composed with t-slot 3`] = `
exports[`Portal basic use of portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<p>2</p>\`);
@@ -214,7 +232,7 @@ exports[`Portal basic use of portal 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -223,8 +241,10 @@ exports[`Portal basic use of portal 1`] = `
exports[`Portal basic use of portal in dev mode 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<p>2</p>\`);
@@ -234,7 +254,7 @@ exports[`Portal basic use of portal in dev mode 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -243,8 +263,10 @@ exports[`Portal basic use of portal in dev mode 1`] = `
exports[`Portal basic use of portal on div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<div><p>2</p></div>\`);
@@ -254,7 +276,7 @@ exports[`Portal basic use of portal on div 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -263,8 +285,10 @@ exports[`Portal basic use of portal on div 1`] = `
exports[`Portal basic use of portal, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<p>2</p>\`);
@@ -274,7 +298,7 @@ exports[`Portal basic use of portal, variation 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: ctx['target'],slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: ctx['target'],slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -283,20 +307,23 @@ exports[`Portal basic use of portal, variation 1`] = `
exports[`Portal conditional use of Portal (with sub Component) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<span>1</span>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
let b2,b4;
b2 = block2();
if (ctx['state'].hasPortal) {
b4 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
b4 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
}
return multi([b2, b4]);
}
@@ -306,7 +333,8 @@ exports[`Portal conditional use of Portal (with sub Component) 1`] = `
exports[`Portal conditional use of Portal (with sub Component) 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<p><block-text-0/></p>\`);
@@ -320,8 +348,10 @@ exports[`Portal conditional use of Portal (with sub Component) 2`] = `
exports[`Portal conditional use of Portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<span>1</span>\`);
let block3 = createBlock(\`<p>2</p>\`);
@@ -334,7 +364,7 @@ exports[`Portal conditional use of Portal 1`] = `
let b2,b4;
b2 = block2();
if (ctx['state'].hasPortal) {
b4 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
b4 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
}
return multi([b2, b4]);
}
@@ -344,12 +374,14 @@ exports[`Portal conditional use of Portal 1`] = `
exports[`Portal conditional use of Portal with child and div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
b2 = comp1({}, key + \`__1\`, node, this, null);
}
return multi([b2]);
}
@@ -359,9 +391,11 @@ exports[`Portal conditional use of Portal with child and div 1`] = `
exports[`Portal conditional use of Portal with child and div 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>hasPortal</span><block-child-0/></div>\`);
let block3 = createBlock(\`<p>thePortal</p>\`);
@@ -376,8 +410,8 @@ exports[`Portal conditional use of Portal with child and div 2`] = `
for (let i1 = 0; i1 < l_block2; i1++) {
ctx[\`elem\`] = v_block2[i1];
const key1 = ctx['elem'];
const ctx1 = capture(ctx);;
c_block2[i1] = withKey(component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx), key1);
const ctx1 = capture(ctx);
c_block2[i1] = withKey(comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal), key1);
}
const b2 = list(c_block2);
return block1([], [b2]);
@@ -388,14 +422,16 @@ exports[`Portal conditional use of Portal with child and div 2`] = `
exports[`Portal conditional use of Portal with child and div, variation 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
let block2 = createBlock(\`<div><block-child-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
const b3 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
const b3 = comp1({}, key + \`__1\`, node, this, null);
b2 = block2([], [b3]);
}
return multi([b2]);
@@ -406,9 +442,11 @@ exports[`Portal conditional use of Portal with child and div, variation 1`] = `
exports[`Portal conditional use of Portal with child and div, variation 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let { prepareList, capture, withKey } = helpers;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<span>hasPortal</span>\`);
let block4 = createBlock(\`<p>thePortal</p>\`);
@@ -424,8 +462,8 @@ exports[`Portal conditional use of Portal with child and div, variation 2`] = `
for (let i1 = 0; i1 < l_block3; i1++) {
ctx[\`elem\`] = v_block3[i1];
const key1 = ctx['elem'];
const ctx1 = capture(ctx);;
c_block3[i1] = withKey(component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx), key1);
const ctx1 = capture(ctx);
c_block3[i1] = withKey(comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx1}}}, key + \`__1__\${key1}\`, node, ctx, Portal), key1);
}
const b3 = list(c_block3);
return multi([b2, b3]);
@@ -436,8 +474,10 @@ exports[`Portal conditional use of Portal with child and div, variation 2`] = `
exports[`Portal conditional use of Portal with div 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block2 = createBlock(\`<div><span>hasPortal</span><block-child-0/></div>\`);
let block3 = createBlock(\`<p>thePortal</p>\`);
@@ -449,7 +489,7 @@ exports[`Portal conditional use of Portal with div 1`] = `
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].hasPortal) {
const b4 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
b2 = block2([], [b4]);
}
return multi([b2]);
@@ -460,19 +500,22 @@ exports[`Portal conditional use of Portal with div 1`] = `
exports[`Portal lifecycle hooks of portal sub component are properly called 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
let b3;
if (ctx['state'].hasChild) {
b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
b3 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
}
return block1([], [b3]);
}
@@ -482,7 +525,8 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 1`]
exports[`Portal lifecycle hooks of portal sub component are properly called 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -496,8 +540,10 @@ exports[`Portal lifecycle hooks of portal sub component are properly called 2`]
exports[`Portal portal could have dynamically no content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<span><block-text-0/></span>\`);
@@ -512,7 +558,7 @@ exports[`Portal portal could have dynamically no content 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b4 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b4]);
}
}"
@@ -521,17 +567,20 @@ exports[`Portal portal could have dynamically no content 1`] = `
exports[`Portal portal destroys on crash 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {error: ctx['state'].error}, key + \`__1\`, node, ctx);
return comp1({error: ctx['state'].error}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -540,7 +589,8 @@ exports[`Portal portal destroys on crash 1`] = `
exports[`Portal portal destroys on crash 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -554,17 +604,20 @@ exports[`Portal portal destroys on crash 2`] = `
exports[`Portal portal with child and props 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -573,7 +626,8 @@ exports[`Portal portal with child and props 1`] = `
exports[`Portal portal with child and props 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<span><block-text-0/></span>\`);
@@ -587,8 +641,10 @@ exports[`Portal portal with child and props 2`] = `
exports[`Portal portal with dynamic body 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<span><block-text-0/></span>\`);
@@ -606,7 +662,7 @@ exports[`Portal portal with dynamic body 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b5 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b5 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b5]);
}
}"
@@ -615,8 +671,10 @@ exports[`Portal portal with dynamic body 1`] = `
exports[`Portal portal with many children 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<div>1</div>\`);
@@ -629,7 +687,7 @@ exports[`Portal portal with many children 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b5 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b5 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b5]);
}
}"
@@ -638,8 +696,10 @@ exports[`Portal portal with many children 1`] = `
exports[`Portal portal with no content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -652,7 +712,7 @@ exports[`Portal portal with no content 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b4 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b4 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b4]);
}
}"
@@ -661,8 +721,10 @@ exports[`Portal portal with no content 1`] = `
exports[`Portal portal with only text as content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
@@ -671,7 +733,7 @@ exports[`Portal portal with only text as content 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -680,8 +742,10 @@ exports[`Portal portal with only text as content 1`] = `
exports[`Portal portal with target not in dom 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<div>2</div>\`);
@@ -691,7 +755,7 @@ exports[`Portal portal with target not in dom 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#does-not-exist',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#does-not-exist',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -700,17 +764,20 @@ exports[`Portal portal with target not in dom 1`] = `
exports[`Portal portal's parent's env is not polluted 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
const comp2 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {}, key + \`__1\`, node, ctx);
return comp1({}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -719,7 +786,8 @@ exports[`Portal portal's parent's env is not polluted 1`] = `
exports[`Portal portal's parent's env is not polluted 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<button>child</button>\`);
@@ -732,7 +800,9 @@ exports[`Portal portal's parent's env is not polluted 2`] = `
exports[`Portal simple catchError with portal 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
@@ -741,7 +811,7 @@ exports[`Portal simple catchError with portal 1`] = `
if (ctx['error']) {
b2 = text(\`Error\`);
} else {
b3 = component(\`Boom\`, {}, key + \`__1\`, node, ctx);
b3 = comp1({}, key + \`__1\`, node, this, null);
}
return block1([], [b2, b3]);
}
@@ -751,8 +821,10 @@ exports[`Portal simple catchError with portal 1`] = `
exports[`Portal simple catchError with portal 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<p><block-text-0/></p>\`);
@@ -763,7 +835,7 @@ exports[`Portal simple catchError with portal 2`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -772,8 +844,10 @@ exports[`Portal simple catchError with portal 2`] = `
exports[`Portal with target in template (after portal) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><span>1</span><block-child-0/><div id=\\"local-target\\"/></div>\`);
let block2 = createBlock(\`<p>2</p>\`);
@@ -783,7 +857,7 @@ exports[`Portal with target in template (after portal) 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#local-target',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#local-target',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -792,8 +866,10 @@ exports[`Portal with target in template (after portal) 1`] = `
exports[`Portal with target in template (before portal) 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><div id=\\"local-target\\"/><span>1</span><block-child-0/></div>\`);
let block2 = createBlock(\`<p>2</p>\`);
@@ -803,7 +879,7 @@ exports[`Portal with target in template (before portal) 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#local-target',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: '#local-target',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -812,8 +888,10 @@ exports[`Portal with target in template (before portal) 1`] = `
exports[`Portal: Props validation target must be a valid selector 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<div>2</div>\`);
@@ -823,7 +901,7 @@ exports[`Portal: Props validation target must be a valid selector 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: ' ',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: ' ',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -832,8 +910,10 @@ exports[`Portal: Props validation target must be a valid selector 1`] = `
exports[`Portal: Props validation target must be a valid selector 2 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block2 = createBlock(\`<div>2</div>\`);
@@ -843,7 +923,7 @@ exports[`Portal: Props validation target must be a valid selector 2 1`] = `
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: 'aa',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx);
const b3 = comp1({target: 'aa',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__1\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -852,17 +932,20 @@ exports[`Portal: Props validation target must be a valid selector 2 1`] = `
exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const Portal = app.Portal;
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
const comp2 = app.createComponent(null, false, true, false, false);
let block1 = createBlock(\`<div><block-child-0/></div>\`);
function slot1(ctx, node, key = \\"\\") {
return component(\`Child\`, {val: ctx['state'].val}, key + \`__1\`, node, ctx);
return comp1({val: ctx['state'].val}, key + \`__1\`, node, this, null);
}
return function template(ctx, node, key = \\"\\") {
const b3 = component(Portal, {target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx);
const b3 = comp2({target: '#outside',slots: {'default': {__render: slot1, __ctx: ctx}}}, key + \`__2\`, node, ctx, Portal);
return block1([], [b3]);
}
}"
@@ -871,7 +954,8 @@ exports[`Portal: UI/UX focus is kept across re-renders 1`] = `
exports[`Portal: UI/UX focus is kept across re-renders 2`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
\\"use strict\\";
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<input id=\\"target-me\\" block-attribute-0=\\"placeholder\\"/>\`);
+26
View File
@@ -248,4 +248,30 @@ describe("validateSchema", () => {
expect(validateSchema({ size: "sall" }, schema)).toEqual(["'size' is not valid"]);
expect(validateSchema({ size: 1 }, schema)).toEqual(["'size' is not a string"]);
});
test("value as type", () => {
expect(validateSchema({ a: false }, { a: { value: false } })).toEqual([]);
expect(validateSchema({ a: true }, { a: { value: false } })).toEqual([
"'a' is not equal to 'false'",
]);
});
test("value as type (some other values)", () => {
expect(validateSchema({ a: null }, { a: { value: null } })).toEqual([]);
expect(validateSchema({ a: false }, { a: { value: null } })).toEqual([
"'a' is not equal to 'null'",
]);
expect(validateSchema({ a: "hey" }, { a: { value: "hey" } })).toEqual([]);
expect(validateSchema({ a: true }, { a: { value: "hey" } })).toEqual([
"'a' is not equal to 'hey'",
]);
});
test("value as type work in union type", () => {
expect(validateSchema({ a: false }, { a: [String, { value: false }] })).toEqual([]);
expect(validateSchema({ a: true }, { a: [String, { value: false }] })).toEqual([
"'a' is not a string or false",
]);
expect(validateSchema({ a: "string" }, { a: [String, { value: false }] })).toEqual([]);
});
});