fix: consistently read latest value from let tags (#2920)

This commit is contained in:
Ryan Turnquist 2025-10-31 16:06:05 -07:00 committed by GitHub
parent fd3ff2b011
commit 2bed9ef7d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
621 changed files with 4890 additions and 5461 deletions

View File

@ -0,0 +1,5 @@
---
"@marko/runtime-tags": patch
---
Consistently read latest value from let tags

View File

@ -7,68 +7,68 @@
{
"name": "*",
"total": {
"min": 19419,
"brotli": 7382
"min": 19294,
"brotli": 7309
}
},
{
"name": "counter",
"user": {
"min": 184,
"brotli": 141
"min": 178,
"brotli": 151
},
"runtime": {
"min": 4014,
"brotli": 1791
"min": 3984,
"brotli": 1778
},
"total": {
"min": 4198,
"brotli": 1932
"min": 4162,
"brotli": 1929
}
},
{
"name": "counter 💧",
"user": {
"min": 106,
"brotli": 97
"min": 100,
"brotli": 95
},
"runtime": {
"min": 2191,
"brotli": 1149
"min": 2156,
"brotli": 1123
},
"total": {
"min": 2297,
"brotli": 1246
"min": 2256,
"brotli": 1218
}
},
{
"name": "comments",
"user": {
"min": 809,
"brotli": 446
"min": 789,
"brotli": 431
},
"runtime": {
"min": 7062,
"brotli": 3034
"min": 6963,
"brotli": 3012
},
"total": {
"min": 7871,
"brotli": 3480
"min": 7752,
"brotli": 3443
}
},
{
"name": "comments 💧",
"user": {
"min": 142,
"brotli": 125
"min": 139,
"brotli": 112
},
"runtime": {
"min": 2343,
"brotli": 1185
"min": 2308,
"brotli": 1169
},
"total": {
"min": 2485,
"brotli": 1310
"min": 2447,
"brotli": 1281
}
}
]

View File

@ -1,63 +1,52 @@
// size: 809 (min) 446 (brotli)
// size: 789 (min) 431 (brotli)
const $if_content__setup = ($scope) => {
($scope[0],
$if_content__comment_comments._($scope),
$if_content__id._($scope));
},
$if_content__comment_comments = _if_closure(
8,
4,
0,
($scope, comment_comments) => $input_comments($scope[0], comment_comments),
$if_content__comment_comments = _if_closure(4, 0, ($scope) =>
$input_comments($scope[0], $scope._[8]),
),
$if_content__id = _if_closure(11, 4, 0, ($scope, id) =>
$input_path($scope[0], id),
$if_content__id = _if_closure(4, 0, ($scope) =>
$input_path($scope[0], $scope._[11]),
),
$if_content = _content_branch("<ul></ul>", "/ b&", $if_content__setup),
$for_content__id = _const(11, ($scope, id) => {
(_attr($scope[0], "id", id), $if_content__id($scope));
$for_content__id = _const(11, ($scope) => {
(_attr($scope[0], "id", $scope[11]), $if_content__id($scope));
}),
$for_content__input_path__OR__i = _or(10, ($scope) => {
let {
_: { 4: input_path },
9: i,
} = $scope;
$for_content__id($scope, `${input_path || "c"}-${i}`);
}),
$for_content__input_path = _for_closure(
4,
0,
$for_content__input_path__OR__i,
$for_content__input_path__OR__i = _or(10, ($scope) =>
$for_content__id($scope, `${$scope._[4] || "c"}-${$scope[9]}`),
),
$for_content__input_path = _for_closure(0, $for_content__input_path__OR__i),
$for_content__i = _const(9, $for_content__input_path__OR__i),
$for_content__open__script = _script("a0", ($scope, { 12: open }) =>
$for_content__open__script = _script("a0", ($scope) =>
_on($scope[2], "click", function () {
$for_content__open($scope, (open = !open));
$for_content__open($scope, !$scope[12]);
}),
),
$for_content__open = _let(12, ($scope, open) => {
(_attr($scope[0], "hidden", !open),
_text($scope[3], open ? "[-]" : "[+]"),
$for_content__open = _let(12, ($scope) => {
(_attr($scope[0], "hidden", !$scope[12]),
_text($scope[3], $scope[12] ? "[-]" : "[+]"),
$for_content__open__script($scope));
}),
$for_content__setup = ($scope) => {
($for_content__input_path._($scope), $for_content__open($scope, !0));
},
$for_content__comment_text = _const(7, ($scope, comment_text) =>
_text($scope[1], comment_text),
$for_content__comment_text = _const(7, ($scope) =>
_text($scope[1], $scope[7]),
),
$for_content__if = _if(4, $if_content),
$for_content__comment_comments = _const(8, ($scope, comment_comments) => {
($for_content__if($scope, comment_comments ? 0 : 1),
$for_content__comment_comments = _const(8, ($scope) => {
($for_content__if($scope, $scope[8] ? 0 : 1),
$if_content__comment_comments($scope));
}),
$for_content__$params = _const(5, ($scope, $params2) => {
($for_content__comment($scope, $params2[0]),
$for_content__i($scope, $params2[1]));
$for_content__$params = _const(5, ($scope) => {
($for_content__comment($scope, $scope[5][0]),
$for_content__i($scope, $scope[5][1]));
}),
$for_content__comment = _const(6, ($scope, comment) => {
($for_content__comment_text($scope, comment?.text),
$for_content__comment_comments($scope, comment?.comments));
$for_content__comment = _const(6, ($scope) => {
($for_content__comment_text($scope, $scope[6]?.text),
$for_content__comment_comments($scope, $scope[6]?.comments));
}),
$for = _for_of(
0,
@ -68,9 +57,7 @@ const $if_content__setup = ($scope) => {
$for_content__$params,
),
),
$input_comments = _const(3, ($scope, input_comments) =>
$for($scope, [input_comments]),
),
$input_comments = _const(3, ($scope) => $for($scope, [$scope[3]])),
$input_path = _const(4, $for_content__input_path);
function $setup($scope) {
$scope[0];
@ -80,8 +67,8 @@ _template(
"<ul></ul>",
"/ b&",
$setup,
_const(2, ($scope, input) => {
const $comments_input_spread = input;
_const(2, ($scope) => {
const $comments_input_spread = $scope[2];
($input_comments($scope[0], $comments_input_spread.comments),
$input_path($scope[0], $comments_input_spread.path));
}),

View File

@ -1,12 +1,12 @@
// size: 142 (min) 125 (brotli)
const $for_content__open__script = _script("a0", ($scope, { 12: open }) =>
// size: 139 (min) 112 (brotli)
const $for_content__open__script = _script("a0", ($scope) =>
_on($scope[2], "click", function () {
$for_content__open($scope, (open = !open));
$for_content__open($scope, !$scope[12]);
}),
),
$for_content__open = _let(12, ($scope, open) => {
(_attr($scope[0], "hidden", !open),
_text($scope[3], open ? "[-]" : "[+]"),
$for_content__open = _let(12, ($scope) => {
(_attr($scope[0], "hidden", !$scope[12]),
_text($scope[3], $scope[12] ? "[-]" : "[+]"),
$for_content__open__script($scope));
});
init();

View File

@ -1,11 +1,11 @@
// size: 184 (min) 141 (brotli)
const $clickCount__script = _script("a0", ($scope, { 2: clickCount }) =>
// size: 178 (min) 151 (brotli)
const $clickCount__script = _script("a0", ($scope) =>
_on($scope[0], "click", function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
}),
),
$clickCount = _let(2, ($scope, clickCount) => {
(_text($scope[1], clickCount), $clickCount__script($scope));
$clickCount = _let(2, ($scope) => {
(_text($scope[1], $scope[2]), $clickCount__script($scope));
});
function $setup($scope) {
$clickCount($scope, 0);

View File

@ -1,10 +1,10 @@
// size: 106 (min) 97 (brotli)
const $clickCount__script = _script("a0", ($scope, { 2: clickCount }) =>
// size: 100 (min) 95 (brotli)
const $clickCount__script = _script("a0", ($scope) =>
_on($scope[0], "click", function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
}),
),
$clickCount = _let(2, ($scope, clickCount) => {
(_text($scope[1], clickCount), $clickCount__script($scope));
$clickCount = _let(2, ($scope) => {
(_text($scope[1], $scope[2]), $clickCount__script($scope));
});
init();

View File

@ -1,4 +1,4 @@
// size: 19419 (min) 7382 (brotli)
// size: 19294 (min) 7309 (brotli)
var empty = [],
rest = Symbol();
function attrTag(attrs) {
@ -306,7 +306,6 @@ function init(runtimeId = "M") {
else if ("number" == typeof serialized)
registeredValues[lastEffect](
(scopeLookup[serialized] ||= { l: scopeId }),
scopeLookup[serialized],
);
else
for (let scope of serialized(serializeContext))
@ -627,27 +626,25 @@ function triggerMacroTask() {
channel.port2.postMessage(0));
}
function _let(valueAccessor, fn) {
let valueChangeAccessor = "o" + valueAccessor,
update = (scope, value) => {
scope[valueAccessor] !== value &&
((scope[valueAccessor] = value), fn && fn(scope, value));
};
let valueChangeAccessor = "o" + valueAccessor;
return (scope, value, valueChange) => (
rendering
? (((scope[valueChangeAccessor] = valueChange) &&
scope[valueAccessor] !== value) ||
scope.n) &&
((scope[valueAccessor] = value), fn && fn(scope, value))
((scope[valueAccessor] = value), fn && fn(scope))
: scope[valueChangeAccessor]
? scope[valueChangeAccessor](value)
: (schedule(), queueRender(scope, update, valueAccessor, value)),
: scope[valueAccessor] !== (scope[valueAccessor] = value) &&
fn &&
(schedule(), queueRender(scope, fn, valueAccessor)),
value
);
}
function _const(valueAccessor, fn = () => {}) {
return (scope, value) => {
(!(valueAccessor in scope) || scope[valueAccessor] !== value) &&
((scope[valueAccessor] = value), fn(scope, value));
((scope[valueAccessor] = value), fn(scope));
};
}
function _or(id, fn, defaultPending = 1, scopeIdAccessor = "l") {
@ -659,9 +656,8 @@ function _or(id, fn, defaultPending = 1, scopeIdAccessor = "l") {
: queueRender(scope, fn, id, 0, scope[scopeIdAccessor]);
};
}
function _for_closure(valueAccessor, ownerLoopNodeAccessor, fn) {
let childSignal = closure(valueAccessor, fn),
loopScopeAccessor = "l" + ownerLoopNodeAccessor,
function _for_closure(ownerLoopNodeAccessor, fn) {
let loopScopeAccessor = "l" + ownerLoopNodeAccessor,
loopScopeMapAccessor = "m" + ownerLoopNodeAccessor,
ownerSignal = (ownerScope) => {
let scopes = (ownerScope[loopScopeAccessor] ||= ownerScope[
@ -674,28 +670,26 @@ function _for_closure(valueAccessor, ownerLoopNodeAccessor, fn) {
queueRender(
ownerScope,
() => {
for (let scope of scopes)
!scope.n && !scope.z && childSignal(scope);
for (let scope of scopes) !scope.n && !scope.z && fn(scope);
},
-1,
0,
firstScope.l,
);
};
return ((ownerSignal._ = childSignal), ownerSignal);
return ((ownerSignal._ = fn), ownerSignal);
}
function _if_closure(valueAccessor, ownerConditionalNodeAccessor, branch, fn) {
let childSignal = closure(valueAccessor, fn),
scopeAccessor = "d" + ownerConditionalNodeAccessor,
function _if_closure(ownerConditionalNodeAccessor, branch, fn) {
let scopeAccessor = "d" + ownerConditionalNodeAccessor,
branchAccessor = "c" + ownerConditionalNodeAccessor,
ownerSignal = (scope) => {
let ifScope = scope[scopeAccessor];
ifScope &&
!ifScope.n &&
(scope[branchAccessor] || 0) === branch &&
queueRender(ifScope, childSignal, -1);
queueRender(ifScope, fn, -1);
};
return ((ownerSignal._ = childSignal), ownerSignal);
return ((ownerSignal._ = fn), ownerSignal);
}
function subscribeToScopeSet(ownerScope, accessor, scope) {
let subscribers = (ownerScope[accessor] ||= new Set());
@ -721,27 +715,21 @@ function _closure(...closureSignals) {
};
}
function _closure_get(valueAccessor, fn, getOwnerScope) {
let childSignal = closure(valueAccessor, fn, getOwnerScope),
closureSignal = (scope) => {
((scope[closureSignal.E] = closureSignal.K),
childSignal(scope),
subscribeToScopeSet(
getOwnerScope ? getOwnerScope(scope) : scope._,
closureSignal.D,
scope,
));
};
let closureSignal = (scope) => {
((scope[closureSignal.E] = closureSignal.K),
fn(scope),
subscribeToScopeSet(
getOwnerScope ? getOwnerScope(scope) : scope._,
closureSignal.D,
scope,
));
};
return (
(closureSignal.D = "a" + valueAccessor),
(closureSignal.E = "b" + valueAccessor),
closureSignal
);
}
function closure(valueAccessor, fn, getOwnerScope) {
return (scope) => {
fn(scope, (getOwnerScope ? getOwnerScope(scope) : scope._)[valueAccessor]);
};
}
function _child_setup(setup) {
return (
(setup._ = (scope, owner) => {
@ -1683,8 +1671,7 @@ function prepareEffects(fn) {
return preparedEffects;
}
var runEffects = (effects) => {
for (let scope, i = 0; i < effects.length; )
effects[i++]((scope = effects[i++]), scope);
for (let i = 0; i < effects.length; ) effects[i++](effects[i++]);
};
function runRenders() {
for (; pendingRenders.length; ) {

View File

@ -1,21 +1,19 @@
// size: 330 (min) 206 (brotli)
const $pattern2 = _._const(4, ($scope, $pattern) => {
($foo2($scope, $pattern.foo), $fooChange2($scope, $pattern.fooChange));
// size: 327 (min) 201 (brotli)
const $pattern2 = _._const(4, ($scope) => {
($foo2($scope, $scope[4].foo), $fooChange2($scope, $scope[4].fooChange));
}),
$bar = _._let(3, ($scope, bar) => {
(_._text($scope[2], bar),
$pattern2($scope, { foo: bar, fooChange: $foo($scope) }));
$bar = _._let(3, ($scope) => {
(_._text($scope[2], $scope[3]),
$pattern2($scope, { foo: $scope[3], fooChange: $foo($scope) }));
}),
$foo__OR__fooChange__script = _._script(
"a1",
($scope, { 5: foo, 6: $fooChange }) =>
_._on($scope[0], "click", function () {
$fooChange(++foo);
}),
$foo__OR__fooChange__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$scope[6]($scope[5] + 1);
}),
),
$foo__OR__fooChange = _._or(7, $foo__OR__fooChange__script),
$foo2 = _._const(5, ($scope, foo) => {
(_._text($scope[1], foo), $foo__OR__fooChange($scope));
$foo2 = _._const(5, ($scope) => {
(_._text($scope[1], $scope[5]), $foo__OR__fooChange($scope));
}),
$fooChange2 = _._const(6, $foo__OR__fooChange);
function $foo($scope) {

View File

@ -1,29 +1,26 @@
export const $template = "<button><!>:<!></button>";
export const $walks = /* get, next(1), replace, over(2), replace, out(1) */" D%c%l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $pattern2 = /* @__PURE__ */_._const("$pattern", ($scope, $pattern) => {
$foo2($scope, $pattern.foo);
$fooChange2($scope, $pattern.fooChange);
const $pattern2 = /* @__PURE__ */_._const("$pattern", $scope => {
$foo2($scope, $scope.$pattern.foo);
$fooChange2($scope, $scope.$pattern.fooChange);
});
const $bar = /* @__PURE__ */_._let("bar/3", ($scope, bar) => {
_._text($scope["#text/2"], bar);
const $bar = /* @__PURE__ */_._let("bar/3", $scope => {
_._text($scope["#text/2"], $scope.bar);
$pattern2($scope, {
foo: bar,
foo: $scope.bar,
fooChange: $foo($scope)
});
});
export function $setup($scope) {
$bar($scope, 0);
}
const $foo__OR__fooChange__script = _._script("__tests__/template.marko_0_foo_$fooChange", ($scope, {
foo,
$fooChange
}) => _._on($scope["#button/0"], "click", function () {
$fooChange(++foo);
const $foo__OR__fooChange__script = _._script("__tests__/template.marko_0_foo_$fooChange", $scope => _._on($scope["#button/0"], "click", function () {
$scope.$fooChange($scope.foo + 1);
}));
const $foo__OR__fooChange = /* @__PURE__ */_._or(7, $foo__OR__fooChange__script);
const $foo2 = /* @__PURE__ */_._const("foo", ($scope, foo) => {
_._text($scope["#text/1"], foo);
const $foo2 = /* @__PURE__ */_._const("foo", $scope => {
_._text($scope["#text/1"], $scope.foo);
$foo__OR__fooChange($scope);
});
const $fooChange2 = /* @__PURE__ */_._const("$fooChange", $foo__OR__fooChange);

View File

@ -1,14 +1,12 @@
// size: 193 (min) 160 (brotli)
const $bar__OR__fooChange__script = _._script(
"a1",
($scope, { 3: bar, 6: $fooChange }) =>
_._on($scope[0], "click", function () {
$fooChange(bar + 1);
}),
// size: 186 (min) 139 (brotli)
const $bar__OR__fooChange__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$scope[6]($scope[3] + 1);
}),
),
$bar__OR__fooChange = _._or(7, $bar__OR__fooChange__script),
$bar = _._let(3, ($scope, bar) => {
(_._text($scope[2], bar), $bar__OR__fooChange($scope));
$bar = _._let(3, ($scope) => {
(_._text($scope[2], $scope[3]), $bar__OR__fooChange($scope));
});
(_._resume("a0", function ($scope) {
return function (v) {

View File

@ -1,20 +1,17 @@
export const $template = "<button><!>:<!></button>";
export const $walks = /* get, next(1), replace, over(2), replace, out(1) */" D%c%l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $bar__OR__fooChange__script = _._script("__tests__/template.marko_0_bar_$fooChange", ($scope, {
bar,
$fooChange
}) => _._on($scope["#button/0"], "click", function () {
$fooChange(bar + 1);
const $bar__OR__fooChange__script = _._script("__tests__/template.marko_0_bar_$fooChange", $scope => _._on($scope["#button/0"], "click", function () {
$scope.$fooChange($scope.bar + 1);
}));
const $bar__OR__fooChange = /* @__PURE__ */_._or(7, $bar__OR__fooChange__script);
const $bar = /* @__PURE__ */_._let("bar/3", ($scope, bar) => {
_._text($scope["#text/2"], bar);
const $bar = /* @__PURE__ */_._let("bar/3", $scope => {
_._text($scope["#text/2"], $scope.bar);
$bar__OR__fooChange($scope);
});
const $pattern2 = /* @__PURE__ */_._const("$pattern", ($scope, $pattern) => {
$foo2($scope, $pattern.foo);
$fooChange2($scope, $pattern.fooChange);
const $pattern2 = /* @__PURE__ */_._const("$pattern", $scope => {
$foo2($scope, $scope.$pattern.foo);
$fooChange2($scope, $scope.$pattern.fooChange);
});
export function $setup($scope) {
$bar($scope, 0);
@ -23,7 +20,7 @@ export function $setup($scope) {
fooChange: $foo($scope)
});
}
const $foo2 = /* @__PURE__ */_._const("foo", ($scope, foo) => _._text($scope["#text/1"], foo));
const $foo2 = /* @__PURE__ */_._const("foo", $scope => _._text($scope["#text/1"], $scope.foo));
const $fooChange2 = /* @__PURE__ */_._const("$fooChange", $bar__OR__fooChange);
function $foo($scope) {
return function (v) {

View File

@ -0,0 +1,16 @@
{
"vars": {
"props": {
"$_": "t",
"$init": "o",
"$$bar__OR__fooChange__script": "r",
"$$bar__OR__fooChange": "m",
"$$bar": "n",
"$$count__script": "i",
"$$count": "a",
"$$resetCount2__script": "c",
"$$resetCount2": "s",
"$$resetCount": "_"
}
}
}

View File

@ -0,0 +1,43 @@
# Render
```html
<button>
0
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
2
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
4
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
6
</button>
<button />
```

View File

@ -0,0 +1,60 @@
# Render
```html
<button>
0
</button>
<button />
```
# Mutations
```
INSERT button0, button1
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
2
</button>
<button />
```
# Mutations
```
UPDATE button0/#text "0" => "2"
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
4
</button>
<button />
```
# Mutations
```
UPDATE button0/#text "2" => "4"
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
6
</button>
<button />
```
# Mutations
```
UPDATE button0/#text "4" => "6"
```

View File

@ -0,0 +1,22 @@
// size: 273 (min) 186 (brotli)
const $resetCount2__script = _._script("a1", ($scope) =>
_._on($scope[2], "click", $scope[4]),
),
$resetCount2 = _._const(4, $resetCount2__script),
$count__script = _._script("a2", ($scope) => {
(_._on($scope[0], "click", function () {
($count($scope, $scope[3] + 1), $count($scope, $scope[3] + 1));
}),
$scope[3]);
}),
$count = _._let(3, ($scope) => {
(_._text($scope[1], $scope[3]),
$resetCount2($scope, $resetCount($scope)),
$count__script($scope));
});
function $resetCount($scope) {
return function () {
$scope[3] > 0 && $count($scope, 0);
};
}
(_._resume("a0", $resetCount), init());

View File

@ -0,0 +1,29 @@
export const $template = "<button> </button><button></button>";
export const $walks = /* get, next(1), get, out(1), get, over(1) */" D l b";
import * as _ from "@marko/runtime-tags/debug/dom";
const $resetCount2__script = _._script("__tests__/template.marko_0_resetCount", $scope => _._on($scope["#button/2"], "click", $scope.resetCount));
const $resetCount2 = /* @__PURE__ */_._const("resetCount", $resetCount2__script);
const $count__script = _._script("__tests__/template.marko_0_count", $scope => {
_._on($scope["#button/0"], "click", function () {
$count($scope, $scope.count + 1);
$count($scope, $scope.count + 1);
});
$scope.count;
});
const $count = /* @__PURE__ */_._let("count/3", $scope => {
_._text($scope["#text/1"], $scope.count);
$resetCount2($scope, $resetCount($scope));
$count__script($scope);
});
export function $setup($scope) {
$count($scope, 0);
}
function $resetCount($scope) {
return function () {
if ($scope.count > 0) {
$count($scope, 0);
}
};
}
_._resume("__tests__/template.marko_0/resetCount", $resetCount);
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);

View File

@ -0,0 +1,21 @@
import * as _ from "@marko/runtime-tags/debug/html";
export default _._template("__tests__/template.marko", input => {
const $scope0_id = _._scope_id();
let count = 0;
const resetCount = _._resume(function () {
if (count > 0) {
count = 0;
}
}, "__tests__/template.marko_0/resetCount", $scope0_id);
_._html(`<button>${_._escape(count)}${_._el_resume($scope0_id, "#text/1")}</button>${_._el_resume($scope0_id, "#button/0")}<button></button>${_._el_resume($scope0_id, "#button/2")}`);
_._script($scope0_id, "__tests__/template.marko_0_resetCount");
_._script($scope0_id, "__tests__/template.marko_0_count");
_._scope($scope0_id, {
count,
resetCount
}, "__tests__/template.marko", 0, {
count: "1:6",
resetCount: "2:8"
});
_._resume_branch($scope0_id);
});

View File

@ -0,0 +1,43 @@
# Render
```html
<button>
0
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
2
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
4
</button>
<button />
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
6
</button>
<button />
```

View File

@ -0,0 +1,144 @@
# Render
```html
<html>
<head />
<body>
<button>
0
<!--M_*1 #text/1-->
</button>
<!--M_*1 #button/0-->
<button />
<!--M_*1 #button/2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, _.a = {
count: 0
}], _.a.resetCount = _._[
"__tests__/template.marko_0/resetCount"
](_.a), _.b),
"__tests__/template.marko_0_resetCount",
1,
"__tests__/template.marko_0_count",
1
];
M._.w()
</script>
</body>
</html>
```
# Render
```js
container.querySelector("button").click();
```
```html
<html>
<head />
<body>
<button>
2
<!--M_*1 #text/1-->
</button>
<!--M_*1 #button/0-->
<button />
<!--M_*1 #button/2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, _.a = {
count: 0
}], _.a.resetCount = _._[
"__tests__/template.marko_0/resetCount"
](_.a), _.b),
"__tests__/template.marko_0_resetCount",
1,
"__tests__/template.marko_0_count",
1
];
M._.w()
</script>
</body>
</html>
```
# Mutations
```
UPDATE html/body/button0/#text "0" => "2"
```
# Render
```js
container.querySelector("button").click();
```
```html
<html>
<head />
<body>
<button>
4
<!--M_*1 #text/1-->
</button>
<!--M_*1 #button/0-->
<button />
<!--M_*1 #button/2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, _.a = {
count: 0
}], _.a.resetCount = _._[
"__tests__/template.marko_0/resetCount"
](_.a), _.b),
"__tests__/template.marko_0_resetCount",
1,
"__tests__/template.marko_0_count",
1
];
M._.w()
</script>
</body>
</html>
```
# Mutations
```
UPDATE html/body/button0/#text "2" => "4"
```
# Render
```js
container.querySelector("button").click();
```
```html
<html>
<head />
<body>
<button>
6
<!--M_*1 #text/1-->
</button>
<!--M_*1 #button/0-->
<button />
<!--M_*1 #button/2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, _.a = {
count: 0
}], _.a.resetCount = _._[
"__tests__/template.marko_0/resetCount"
](_.a), _.b),
"__tests__/template.marko_0_resetCount",
1,
"__tests__/template.marko_0_count",
1
];
M._.w()
</script>
</body>
</html>
```
# Mutations
```
UPDATE html/body/button0/#text "4" => "6"
```

View File

@ -0,0 +1,7 @@
# Render End
```html
<button>
0
</button>
<button />
```

View File

@ -0,0 +1,49 @@
# Write
```html
<button>0<!--M_*1 #text/1--></button><!--M_*1 #button/0--><button></button><!--M_*1 #button/2--><script>WALKER_RUNTIME("M")("_");M._.r=[_=>(_.b=[0,_.a={count:0}],_.a.resetCount=_._["__tests__/template.marko_0/resetCount"](_.a),_.b),"__tests__/template.marko_0_resetCount",1,"__tests__/template.marko_0_count",1];M._.w()</script>
```
# Render End
```html
<html>
<head />
<body>
<button>
0
<!--M_*1 #text/1-->
</button>
<!--M_*1 #button/0-->
<button />
<!--M_*1 #button/2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, _.a = {
count: 0
}], _.a.resetCount = _._[
"__tests__/template.marko_0/resetCount"
](_.a), _.b),
"__tests__/template.marko_0_resetCount",
1,
"__tests__/template.marko_0_count",
1
];
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button0
INSERT html/body/button0/#text
INSERT html/body/button0/#comment
INSERT html/body/#comment0
INSERT html/body/button1
INSERT html/body/#comment1
INSERT html/body/script
INSERT html/body/script/#text
```

View File

@ -0,0 +1,6 @@
<let/count=0>
<const/resetCount() { if (count > 0) { count = 0 }}>
<button onClick() { count++; count++ }>${count}</button>
<button onClick=resetCount/>
<script>count;</script>

View File

@ -0,0 +1,5 @@
export const steps = [{}, click, click, click];
function click(container: Element) {
container.querySelector("button")!.click();
}

View File

@ -1,4 +1,4 @@
// size: 164 (min) 130 (brotli)
// size: 163 (min) 128 (brotli)
const $if_content__setup = _._script("a0", ($scope) =>
_._on($scope[0], "click", function () {
$hide($scope._, !0);
@ -10,5 +10,5 @@ const $if_content__setup = _._script("a0", ($scope) =>
$if_content__setup,
),
$if = _._if(0, $if_content),
$hide = _._let(1, ($scope, hide) => $if($scope, hide ? 1 : 0));
$hide = _._let(1, ($scope) => $if($scope, $scope[1] ? 1 : 0));
init();

View File

@ -7,7 +7,7 @@ const $if_content__setup__script = _._script("__tests__/template.marko_1", $scop
const $if_content__setup = $if_content__setup__script;
const $if_content = /* @__PURE__ */_._content_branch("<button></button>", /* get, over(1) */" b", $if_content__setup);
const $if = /* @__PURE__ */_._if("#text/0", $if_content);
const $hide = /* @__PURE__ */_._let("hide/1", ($scope, hide) => $if($scope, !hide ? 0 : 1));
const $hide = /* @__PURE__ */_._let("hide/1", $scope => $if($scope, !$scope.hide ? 0 : 1));
export function $setup($scope) {
$hide($scope, undefined);
}

View File

@ -1,7 +1,5 @@
// size: 191 (min) 131 (brotli)
const $liveCount = _2._let(2, ($scope, liveCount) =>
_2._text($scope[1], liveCount),
),
// size: 190 (min) 140 (brotli)
const $liveCount = _2._let(2, ($scope) => _2._text($scope[1], $scope[2])),
$count = _2._let(3);
(_2._script("a1", ($scope) =>
_2._on($scope[0], "click", function (_, el) {

View File

@ -1,7 +1,7 @@
export const $template = "<button>Before</button><div> </div>";
export const $walks = /* get, over(1), next(1), get, out(1) */" bD l";
import * as _2 from "@marko/runtime-tags/debug/dom";
const $liveCount = /* @__PURE__ */_2._let("liveCount/2", ($scope, liveCount) => _2._text($scope["#text/1"], liveCount));
const $liveCount = /* @__PURE__ */_2._let("liveCount/2", $scope => _2._text($scope["#text/1"], $scope.liveCount));
const $count = /* @__PURE__ */_2._let("count/3");
const $setup__script = _2._script("__tests__/template.marko_0", $scope => _2._on($scope["#button/0"], "click", function (_, el) {
el.textContent = "" + $count($scope, 1);

View File

@ -8,14 +8,14 @@ const $await_content__setup = $scope => {
$setup($scope["#childScope/0"]);
$await_content__input_level($scope);
};
const $await_content__input_level = /* @__PURE__ */_._closure_get("input_level", ($scope, input_level) => $input_level($scope["#childScope/0"], input_level - 1), $scope => $scope._._._);
const $await_content__input_level = /* @__PURE__ */_._closure_get("input_level", $scope => $input_level($scope["#childScope/0"], $scope._._._.input_level - 1), $scope => $scope._._._);
const $await_content = /* @__PURE__ */_._content_branch(`<!>${$template}<!>`, /* over(1), beginChild, $walks, endChild, over(1) */`b/${$walks}&b`, $await_content__setup);
const $try_content__await = /* @__PURE__ */_._await("#text/0", $await_content);
const $try_content__setup = $scope => {
$try_content__await($scope, new Promise(setImmediate));
};
const $try_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content__setup);
const $if_content__input_level = /* @__PURE__ */_._if_closure("input_level", "#text/0", 0, ($scope, input_level) => _._attr($scope["#div/0"], "data-level", input_level));
const $if_content__input_level = /* @__PURE__ */_._if_closure("#text/0", 0, $scope => _._attr($scope["#div/0"], "data-level", $scope._.input_level));
const $if_content__try = /* @__PURE__ */_._try("#text/1", $try_content);
const $if_content__setup = $scope => {
$if_content__input_level._($scope);
@ -28,10 +28,10 @@ const $if_content__setup = $scope => {
const $if_content = /* @__PURE__ */_._content_branch("<div><!></div>", /* get, next(1), replace, out(1) */" D%l", $if_content__setup);
const $if = /* @__PURE__ */_._if("#text/0", $if_content);
const $input_level__closure = /* @__PURE__ */_._closure($await_content__input_level);
export const $input_level = /* @__PURE__ */_._const("input_level", ($scope, input_level) => {
$if($scope, input_level ? 0 : 1);
export const $input_level = /* @__PURE__ */_._const("input_level", $scope => {
$if($scope, $scope.input_level ? 0 : 1);
$if_content__input_level($scope);
$input_level__closure($scope);
});
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_level($scope, input.level));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_level($scope, $scope.input.level));
export default /* @__PURE__ */_._template("__tests__/tags/recurse.marko", $template, $walks, $setup, $input);

View File

@ -1,38 +1,38 @@
// size: 857 (min) 259 (brotli)
// size: 878 (min) 262 (brotli)
const multiply = (multiplier, n) => resolveAfter(multiplier * n, n),
$await_content5__result = _._const(2, ($scope, result) =>
_._text($scope[0], result),
$await_content5__result = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content5__$params = _._const(1, ($scope, $params6) =>
$await_content5__result($scope, $params6[0]),
$await_content5__$params = _._const(1, ($scope) =>
$await_content5__result($scope, $scope[1][0]),
),
$await_content5 = _._content_branch(" ", " b", 0, $await_content5__$params),
$await_content4__result = _._const(2, ($scope, result) =>
_._text($scope[0], result),
$await_content4__result = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content4__$params = _._const(1, ($scope, $params5) =>
$await_content4__result($scope, $params5[0]),
$await_content4__$params = _._const(1, ($scope) =>
$await_content4__result($scope, $scope[1][0]),
),
$await_content4 = _._content_branch(" ", " b", 0, $await_content4__$params),
$await_content3__result = _._const(2, ($scope, result) =>
_._text($scope[0], result),
$await_content3__result = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content3__$params = _._const(1, ($scope, $params4) =>
$await_content3__result($scope, $params4[0]),
$await_content3__$params = _._const(1, ($scope) =>
$await_content3__result($scope, $scope[1][0]),
),
$await_content3 = _._content_branch(" ", " b", 0, $await_content3__$params),
$await_content2__result = _._const(2, ($scope, result) =>
_._text($scope[0], result),
$await_content2__result = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content2__$params = _._const(1, ($scope, $params3) =>
$await_content2__result($scope, $params3[0]),
$await_content2__$params = _._const(1, ($scope) =>
$await_content2__result($scope, $scope[1][0]),
),
$await_content2 = _._content_branch(" ", " b", 0, $await_content2__$params),
$await_content__result = _._const(2, ($scope, result) =>
_._text($scope[0], result),
$await_content__result = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content__$params = _._const(1, ($scope, $params2) =>
$await_content__result($scope, $params2[0]),
$await_content__$params = _._const(1, ($scope) =>
$await_content__result($scope, $scope[1][0]),
),
$await_content = _._content_branch(" ", " b", 0, $await_content__$params),
$await = _._await(2, $await_content),
@ -40,22 +40,22 @@ const multiply = (multiplier, n) => resolveAfter(multiplier * n, n),
$await3 = _._await(6, $await_content3),
$await4 = _._await(8, $await_content4),
$await5 = _._await(10, $await_content5),
$n__script = _._script("a0", ($scope, { 11: n }) =>
$n__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", function () {
$n($scope, ++n);
$n($scope, $scope[11] + 1);
}),
),
$n = _._let(11, ($scope, n) => {
(_._text($scope[1], n),
_._text($scope[3], n),
_._text($scope[5], n),
_._text($scope[7], n),
_._text($scope[9], n),
$await($scope, multiply(1, n)),
$await2($scope, multiply(2, n)),
$await3($scope, multiply(3, n)),
$await4($scope, multiply(4, n)),
$await5($scope, multiply(5, n)),
$n = _._let(11, ($scope) => {
(_._text($scope[1], $scope[11]),
_._text($scope[3], $scope[11]),
_._text($scope[5], $scope[11]),
_._text($scope[7], $scope[11]),
_._text($scope[9], $scope[11]),
$await($scope, multiply(1, $scope[11])),
$await2($scope, multiply(2, $scope[11])),
$await3($scope, multiply(3, $scope[11])),
$await4($scope, multiply(4, $scope[11])),
$await5($scope, multiply(5, $scope[11])),
$n__script($scope));
});
init();

View File

@ -3,42 +3,40 @@ export const $walks = /* get, over(1), next(1), over(1), replace, over(2), repla
import { resolveAfter } from "../../utils/resolve";
const multiply = (multiplier, n) => resolveAfter(multiplier * n, n);
import * as _ from "@marko/runtime-tags/debug/dom";
const $await_content5__result = /* @__PURE__ */_._const("result", ($scope, result) => _._text($scope["#text/0"], result));
const $await_content5__$params = /* @__PURE__ */_._const("$params6", ($scope, $params6) => $await_content5__result($scope, $params6[0]));
const $await_content5__result = /* @__PURE__ */_._const("result", $scope => _._text($scope["#text/0"], $scope.result));
const $await_content5__$params = /* @__PURE__ */_._const("$params6", $scope => $await_content5__result($scope, $scope.$params6[0]));
const $await_content5 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content5__$params);
const $await_content4__result = /* @__PURE__ */_._const("result", ($scope, result) => _._text($scope["#text/0"], result));
const $await_content4__$params = /* @__PURE__ */_._const("$params5", ($scope, $params5) => $await_content4__result($scope, $params5[0]));
const $await_content4__result = /* @__PURE__ */_._const("result", $scope => _._text($scope["#text/0"], $scope.result));
const $await_content4__$params = /* @__PURE__ */_._const("$params5", $scope => $await_content4__result($scope, $scope.$params5[0]));
const $await_content4 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content4__$params);
const $await_content3__result = /* @__PURE__ */_._const("result", ($scope, result) => _._text($scope["#text/0"], result));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $await_content3__result($scope, $params4[0]));
const $await_content3__result = /* @__PURE__ */_._const("result", $scope => _._text($scope["#text/0"], $scope.result));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $await_content3__result($scope, $scope.$params4[0]));
const $await_content3 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content3__$params);
const $await_content2__result = /* @__PURE__ */_._const("result", ($scope, result) => _._text($scope["#text/0"], result));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__result($scope, $params3[0]));
const $await_content2__result = /* @__PURE__ */_._const("result", $scope => _._text($scope["#text/0"], $scope.result));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__result($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content2__$params);
const $await_content__result = /* @__PURE__ */_._const("result", ($scope, result) => _._text($scope["#text/0"], result));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__result($scope, $params2[0]));
const $await_content__result = /* @__PURE__ */_._const("result", $scope => _._text($scope["#text/0"], $scope.result));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__result($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content__$params);
const $await = /* @__PURE__ */_._await("#text/2", $await_content);
const $await2 = /* @__PURE__ */_._await("#text/4", $await_content2);
const $await3 = /* @__PURE__ */_._await("#text/6", $await_content3);
const $await4 = /* @__PURE__ */_._await("#text/8", $await_content4);
const $await5 = /* @__PURE__ */_._await("#text/10", $await_content5);
const $n__script = _._script("__tests__/template.marko_0_n", ($scope, {
n
}) => _._on($scope["#button/0"], "click", function () {
$n($scope, ++n);
const $n__script = _._script("__tests__/template.marko_0_n", $scope => _._on($scope["#button/0"], "click", function () {
$n($scope, $scope.n + 1);
}));
const $n = /* @__PURE__ */_._let("n/11", ($scope, n) => {
_._text($scope["#text/1"], n);
_._text($scope["#text/3"], n);
_._text($scope["#text/5"], n);
_._text($scope["#text/7"], n);
_._text($scope["#text/9"], n);
$await($scope, multiply(1, n));
$await2($scope, multiply(2, n));
$await3($scope, multiply(3, n));
$await4($scope, multiply(4, n));
$await5($scope, multiply(5, n));
const $n = /* @__PURE__ */_._let("n/11", $scope => {
_._text($scope["#text/1"], $scope.n);
_._text($scope["#text/3"], $scope.n);
_._text($scope["#text/5"], $scope.n);
_._text($scope["#text/7"], $scope.n);
_._text($scope["#text/9"], $scope.n);
$await($scope, multiply(1, $scope.n));
$await2($scope, multiply(2, $scope.n));
$await3($scope, multiply(3, $scope.n));
$await4($scope, multiply(4, $scope.n));
$await5($scope, multiply(5, $scope.n));
$n__script($scope);
});
export function $setup($scope) {

View File

@ -2,39 +2,39 @@ export const $template = "a<!>g<!>m";
export const $walks = /* over(1), replace, over(2), replace, over(2) */"b%c%c";
import { resolveAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
const $await_content6__result = /* @__PURE__ */_._const("result6", ($scope, result6) => _._text($scope["#text/0"], result6));
const $await_content6__$params = /* @__PURE__ */_._const("$params7", ($scope, $params7) => $await_content6__result($scope, $params7[0]));
const $await_content6__result = /* @__PURE__ */_._const("result6", $scope => _._text($scope["#text/0"], $scope.result6));
const $await_content6__$params = /* @__PURE__ */_._const("$params7", $scope => $await_content6__result($scope, $scope.$params7[0]));
const $await_content6 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content6__$params);
const $await_content5__result = /* @__PURE__ */_._const("result5", ($scope, result5) => _._text($scope["#text/0"], result5));
const $await_content5__result = /* @__PURE__ */_._const("result5", $scope => _._text($scope["#text/0"], $scope.result5));
const $await_content5__await = /* @__PURE__ */_._await("#text/1", $await_content6);
const $await_content5__setup = $scope => {
$await_content5__await($scope, resolveAfter("j", 1));
};
const $await_content5__$params = /* @__PURE__ */_._const("$params6", ($scope, $params6) => $await_content5__result($scope, $params6[0]));
const $await_content5__$params = /* @__PURE__ */_._const("$params6", $scope => $await_content5__result($scope, $scope.$params6[0]));
const $await_content5 = /* @__PURE__ */_._content_branch("<!><!>k", /* replace, over(1), replace, over(2) */"%b%c", $await_content5__setup, $await_content5__$params);
const $await_content4__result = /* @__PURE__ */_._const("result4", ($scope, result4) => _._text($scope["#text/0"], result4));
const $await_content4__result = /* @__PURE__ */_._const("result4", $scope => _._text($scope["#text/0"], $scope.result4));
const $await_content4__await = /* @__PURE__ */_._await("#text/1", $await_content5);
const $await_content4__setup = $scope => {
$await_content4__await($scope, resolveAfter("i", 1));
};
const $await_content4__$params = /* @__PURE__ */_._const("$params5", ($scope, $params5) => $await_content4__result($scope, $params5[0]));
const $await_content4__$params = /* @__PURE__ */_._const("$params5", $scope => $await_content4__result($scope, $scope.$params5[0]));
const $await_content4 = /* @__PURE__ */_._content_branch("<!><!>l", /* replace, over(1), replace, over(2) */"%b%c", $await_content4__setup, $await_content4__$params);
const $await_content3__result = /* @__PURE__ */_._const("result3", ($scope, result3) => _._text($scope["#text/0"], result3));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $await_content3__result($scope, $params4[0]));
const $await_content3__result = /* @__PURE__ */_._const("result3", $scope => _._text($scope["#text/0"], $scope.result3));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $await_content3__result($scope, $scope.$params4[0]));
const $await_content3 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content3__$params);
const $await_content2__result = /* @__PURE__ */_._const("result2", ($scope, result2) => _._text($scope["#text/0"], result2));
const $await_content2__result = /* @__PURE__ */_._const("result2", $scope => _._text($scope["#text/0"], $scope.result2));
const $await_content2__await = /* @__PURE__ */_._await("#text/1", $await_content3);
const $await_content2__setup = $scope => {
$await_content2__await($scope, resolveAfter("d", 1));
};
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__result($scope, $params3[0]));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__result($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch("<!><!>e", /* replace, over(1), replace, over(2) */"%b%c", $await_content2__setup, $await_content2__$params);
const $await_content__result = /* @__PURE__ */_._const("result1", ($scope, result1) => _._text($scope["#text/0"], result1));
const $await_content__result = /* @__PURE__ */_._const("result1", $scope => _._text($scope["#text/0"], $scope.result1));
const $await_content__await = /* @__PURE__ */_._await("#text/1", $await_content2);
const $await_content__setup = $scope => {
$await_content__await($scope, resolveAfter("c", 1));
};
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__result($scope, $params2[0]));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__result($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch("<!><!>f", /* replace, over(1), replace, over(2) */"%b%c", $await_content__setup, $await_content__$params);
const $await = /* @__PURE__ */_._await("#text/0", $await_content);
const $await2 = /* @__PURE__ */_._await("#text/1", $await_content4);

View File

@ -5,12 +5,12 @@ import * as _ from "@marko/runtime-tags/debug/dom";
_._enable_catch();
_._enable_catch();
_._enable_catch();
const $await_content3__v = /* @__PURE__ */_._const("v", ($scope, v) => _._text($scope["#text/0"], v));
const $await_content3__v = /* @__PURE__ */_._const("v", $scope => _._text($scope["#text/0"], $scope.v));
const $await_content3__setup__script = _._script("__tests__/template.marko_9", $scope => _._on($scope["#button/1"], "click", function () {
document.querySelector("button").textContent = "After";
}));
const $await_content3__setup = $await_content3__setup__script;
const $await_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $await_content3__v($scope, $params4[0]));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $await_content3__v($scope, $scope.$params4[0]));
const $await_content3 = /* @__PURE__ */_._content_branch("<div>Resolved C: <!></div><button>Before</button>", /* next(1), over(1), replace, out(1), get, over(1) */"Db%l b", $await_content3__setup, $await_content3__$params);
const $catch_content3 = _._content_resume("__tests__/template.marko_8_content", "Rejected C", /* over(1) */"b");
const $try_content3__await = /* @__PURE__ */_._await("#text/0", $await_content3);
@ -18,8 +18,8 @@ const $try_content3__setup = $scope => {
$try_content3__await($scope, resolveAfter("C Value", 2));
};
const $try_content3 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content3__setup);
const $await_content2__v = /* @__PURE__ */_._const("v", ($scope, v) => _._text($scope["#text/0"], v));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__v($scope, $params3[0]));
const $await_content2__v = /* @__PURE__ */_._const("v", $scope => _._text($scope["#text/0"], $scope.v));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__v($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch("<div>Resolved B: <!></div>", /* next(1), over(1), replace, out(1) */"Db%l", 0, $await_content2__$params);
const $catch_content2 = _._content_resume("__tests__/template.marko_5_content", "Rejected B", /* over(1) */"b");
const $try_content2__await = /* @__PURE__ */_._await("#text/0", $await_content2);
@ -27,8 +27,8 @@ const $try_content2__setup = $scope => {
$try_content2__await($scope, rejectAfter(new Error("rejected b"), 1));
};
const $try_content2 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content2__setup);
const $await_content__v = /* @__PURE__ */_._const("v", ($scope, v) => _._text($scope["#text/0"], v));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__v($scope, $params2[0]));
const $await_content__v = /* @__PURE__ */_._const("v", $scope => _._text($scope["#text/0"], $scope.v));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__v($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch("<div>Resolved A: <!></div>", /* next(1), over(1), replace, out(1) */"Db%l", 0, $await_content__$params);
const $catch_content = _._content_resume("__tests__/template.marko_2_content", "Rejected A", /* over(1) */"b");
const $try_content__await = /* @__PURE__ */_._await("#text/0", $await_content);

View File

@ -4,8 +4,8 @@ import { resolveAfter, rejectAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
_._enable_catch();
_._enable_catch();
const $await_content2__v = /* @__PURE__ */_._const("v", ($scope, v) => _._text($scope["#text/0"], v));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__v($scope, $params3[0]));
const $await_content2__v = /* @__PURE__ */_._const("v", $scope => _._text($scope["#text/0"], $scope.v));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__v($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch("<div>Resolved B: <!></div>", /* next(1), over(1), replace, out(1) */"Db%l", 0, $await_content2__$params);
const $catch_content2 = _._content_resume("__tests__/template.marko_5_content", "Rejected B", /* over(1) */"b");
const $try_content2__await = /* @__PURE__ */_._await("#text/0", $await_content2);
@ -13,8 +13,8 @@ const $try_content2__setup = $scope => {
$try_content2__await($scope, rejectAfter(new Error("rejected b"), 1));
};
const $try_content2 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content2__setup);
const $await_content__v = /* @__PURE__ */_._const("v", ($scope, v) => _._text($scope["#text/0"], v));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__v($scope, $params2[0]));
const $await_content__v = /* @__PURE__ */_._const("v", $scope => _._text($scope["#text/0"], $scope.v));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__v($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch("<div>Resolved A: <!></div>", /* next(1), over(1), replace, out(1) */"Db%l", 0, $await_content__$params);
const $catch_content = _._content_resume("__tests__/template.marko_2_content", "Rejected A", /* over(1) */"b");
const $try_content__await = /* @__PURE__ */_._await("#text/0", $await_content);

View File

@ -6,16 +6,16 @@ _._enable_catch();
_._enable_catch();
_._enable_catch();
_._enable_catch();
const $await_content4__value = /* @__PURE__ */_._const("value", ($scope, value) => _._attr_class($scope["#div/0"], value));
const $await_content4__$params = /* @__PURE__ */_._const("$params5", ($scope, $params5) => $await_content4__value($scope, $params5[0]));
const $await_content4__value = /* @__PURE__ */_._const("value", $scope => _._attr_class($scope["#div/0"], $scope.value));
const $await_content4__$params = /* @__PURE__ */_._const("$params5", $scope => $await_content4__value($scope, $scope.$params5[0]));
const $await_content4 = /* @__PURE__ */_._content_branch("<div level=4></div>", /* get, over(1) */" b", 0, $await_content4__$params);
const $placeholder_content4 = _._content_resume("__tests__/template.marko_11_content", "LOADING B2", /* over(1) */"b");
const $placeholder_content3 = _._content_resume("__tests__/template.marko_10_content", "LOADING B1", /* over(1) */"b");
const $try_content4__await = /* @__PURE__ */_._await("#text/0", $await_content4);
const $try_content4__promiseB = /* @__PURE__ */_._closure_get("promiseB", $try_content4__await, $scope => $scope._._._);
const $try_content4__promiseB = /* @__PURE__ */_._closure_get("promiseB", $scope => $try_content4__await($scope, $scope._._._.promiseB), $scope => $scope._._._);
const $try_content4__setup = $try_content4__promiseB;
const $try_content4 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content4__setup);
const $await_content3__value = /* @__PURE__ */_._const("value", ($scope, value) => _._attr_class($scope["#div/0"], value));
const $await_content3__value = /* @__PURE__ */_._const("value", $scope => _._attr_class($scope["#div/0"], $scope.value));
const $await_content3__try = /* @__PURE__ */_._try("#text/1", $try_content4);
const $await_content3__setup = $scope => {
$await_content3__try($scope, {
@ -24,13 +24,13 @@ const $await_content3__setup = $scope => {
})
});
};
const $await_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $await_content3__value($scope, $params4[0]));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $await_content3__value($scope, $scope.$params4[0]));
const $await_content3 = /* @__PURE__ */_._content_branch("<div level=3><!></div>", /* get, next(1), replace, out(1) */" D%l", $await_content3__setup, $await_content3__$params);
const $try_content3__await = /* @__PURE__ */_._await("#text/0", $await_content3);
const $try_content3__promiseB = /* @__PURE__ */_._closure_get("promiseB", $try_content3__await);
const $try_content3__promiseB = /* @__PURE__ */_._closure_get("promiseB", $scope => $try_content3__await($scope, $scope._.promiseB));
const $try_content3__setup = $try_content3__promiseB;
const $try_content3 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content3__setup);
const $await_content2__value = /* @__PURE__ */_._const("value", ($scope, value) => _._attr_class($scope["#div/0"], value));
const $await_content2__value = /* @__PURE__ */_._const("value", $scope => _._attr_class($scope["#div/0"], $scope.value));
const $await_content2__promiseB = /* @__PURE__ */_._const("promiseB");
const $await_content2__try = /* @__PURE__ */_._try("#text/1", $try_content3);
const $await_content2__setup = $scope => {
@ -41,15 +41,15 @@ const $await_content2__setup = $scope => {
})
});
};
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__value($scope, $params3[0]));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__value($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch("<div level=2><!></div>", /* get, next(1), replace, out(1) */" D%l", $await_content2__setup, $await_content2__$params);
const $placeholder_content2 = _._content_resume("__tests__/template.marko_5_content", "LOADING A2", /* over(1) */"b");
const $placeholder_content = _._content_resume("__tests__/template.marko_4_content", "LOADING A1", /* over(1) */"b");
const $try_content2__await = /* @__PURE__ */_._await("#text/0", $await_content2);
const $try_content2__promiseA = /* @__PURE__ */_._closure_get("promiseA", $try_content2__await, $scope => $scope._._._);
const $try_content2__promiseA = /* @__PURE__ */_._closure_get("promiseA", $scope => $try_content2__await($scope, $scope._._._.promiseA), $scope => $scope._._._);
const $try_content2__setup = $try_content2__promiseA;
const $try_content2 = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content2__setup);
const $await_content__value = /* @__PURE__ */_._const("value", ($scope, value) => _._attr_class($scope["#div/0"], value));
const $await_content__value = /* @__PURE__ */_._const("value", $scope => _._attr_class($scope["#div/0"], $scope.value));
const $await_content__try = /* @__PURE__ */_._try("#text/1", $try_content2);
const $await_content__setup = $scope => {
$await_content__try($scope, {
@ -58,10 +58,10 @@ const $await_content__setup = $scope => {
})
});
};
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__value($scope, $params2[0]));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__value($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch("<div level=1><!></div>", /* get, next(1), replace, out(1) */" D%l", $await_content__setup, $await_content__$params);
const $try_content__await = /* @__PURE__ */_._await("#text/0", $await_content);
const $try_content__promiseA = /* @__PURE__ */_._closure_get("promiseA", $try_content__await);
const $try_content__promiseA = /* @__PURE__ */_._closure_get("promiseA", $scope => $try_content__await($scope, $scope._.promiseA));
const $try_content__setup = $try_content__promiseA;
const $try_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content__setup);
const $promiseA = /* @__PURE__ */_._const("promiseA");

View File

@ -2,11 +2,11 @@ export const $template = "a<!>c<!>e";
export const $walks = /* over(1), replace, over(2), replace, over(2) */"b%c%c";
import { resolveAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
const $await_content2__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__value($scope, $params3[0]));
const $await_content2__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__value($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content2__$params);
const $await_content__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__value($scope, $params2[0]));
const $await_content__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__value($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content__$params);
const $await = /* @__PURE__ */_._await("#text/0", $await_content);
const $await2 = /* @__PURE__ */_._await("#text/1", $await_content2);

View File

@ -2,11 +2,11 @@ export const $template = "a<!>c<!>e";
export const $walks = /* over(1), replace, over(2), replace, over(2) */"b%c%c";
import { resolveAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
const $await_content2__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__value($scope, $params3[0]));
const $await_content2__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__value($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content2__$params);
const $await_content__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__value($scope, $params2[0]));
const $await_content__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__value($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content__$params);
const $await = /* @__PURE__ */_._await("#text/0", $await_content);
const $await2 = /* @__PURE__ */_._await("#text/1", $await_content2);

View File

@ -1,21 +1,21 @@
// size: 345 (min) 207 (brotli)
// size: 339 (min) 209 (brotli)
_._enable_catch();
const $await_content__value = _._const(2, ($scope, value) =>
_._text($scope[0], value),
const $await_content__value = _._const(2, ($scope) =>
_._text($scope[0], $scope[2]),
),
$await_content__$params = _._const(1, ($scope, $params2) =>
$await_content__value($scope, $params2[0]),
$await_content__$params = _._const(1, ($scope) =>
$await_content__value($scope, $scope[1][0]),
),
$await_content = _._content_branch(" ", " b", 0, $await_content__$params);
_._content_resume("a0", "LOADING...", "b");
const $try_content__await = _._await(0, $await_content),
$try_content__clickCount = _._closure_get(2, ($scope, clickCount) =>
$try_content__await($scope, resolveAfter(clickCount, 1)),
$try_content__clickCount = _._closure_get(2, ($scope) =>
$try_content__await($scope, resolveAfter($scope._[2], 1)),
),
$clickCount__closure = _._closure($try_content__clickCount),
$clickCount__script = _._script("a1", ($scope, { 2: clickCount }) =>
$clickCount__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
}),
),
$clickCount = _._let(2, ($scope) => {

View File

@ -3,19 +3,17 @@ export const $walks = /* get, over(1), replace, over(2) */" b%c";
import { resolveAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
_._enable_catch();
const $await_content__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__value($scope, $params2[0]));
const $await_content__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__value($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch(" ", /* get, over(1) */" b", 0, $await_content__$params);
const $placeholder_content = _._content_resume("__tests__/template.marko_2_content", "LOADING...", /* over(1) */"b");
const $try_content__await = /* @__PURE__ */_._await("#text/0", $await_content);
const $try_content__clickCount = /* @__PURE__ */_._closure_get("clickCount", ($scope, clickCount) => $try_content__await($scope, resolveAfter(clickCount, 1)));
const $try_content__clickCount = /* @__PURE__ */_._closure_get("clickCount", $scope => $try_content__await($scope, resolveAfter($scope._.clickCount, 1)));
const $try_content__setup = $try_content__clickCount;
const $try_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", $try_content__setup);
const $clickCount__closure = /* @__PURE__ */_._closure($try_content__clickCount);
const $clickCount__script = _._script("__tests__/template.marko_0_clickCount", ($scope, {
clickCount
}) => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, ++clickCount);
const $clickCount__script = _._script("__tests__/template.marko_0_clickCount", $scope => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, $scope.clickCount + 1);
}));
const $clickCount = /* @__PURE__ */_._let("clickCount/2", $scope => {
$clickCount__closure($scope);

View File

@ -3,11 +3,11 @@ export const $walks = /* over(1), replace, over(1), next(1), get, out(1) */"b%bD
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
export const $content = /* @__PURE__ */_._const("content", $dynamicTag);
export const $x = /* @__PURE__ */_._const("x", ($scope, x) => _._text($scope["#text/1"], x));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $thing2($scope, input.thing));
export const $thing2 = /* @__PURE__ */_._const("$thing", ($scope, $thing) => {
$x($scope, $thing.x);
$content($scope, $thing.content);
export const $content = /* @__PURE__ */_._const("content", $scope => $dynamicTag($scope, $scope.content));
export const $x = /* @__PURE__ */_._const("x", $scope => _._text($scope["#text/1"], $scope.x));
export const $input = /* @__PURE__ */_._const("input", $scope => $thing2($scope, $scope.input.thing));
export const $thing2 = /* @__PURE__ */_._const("$thing", $scope => {
$x($scope, $scope.$thing.x);
$content($scope, $scope.$thing.content);
});
export default /* @__PURE__ */_._template("__tests__/tags/custom-tag/index.marko", $template, $walks, $setup, $input);

View File

@ -7,9 +7,9 @@ const $thing_content = /* @__PURE__ */_._content("__tests__/template.marko_1_con
export function $setup($scope) {
_customTag($scope["#childScope/0"]);
}
export const $x = /* @__PURE__ */_._const("x", ($scope, x) => {
export const $x = /* @__PURE__ */_._const("x", $scope => {
let $thing;
if (x) {
if ($scope.x) {
$thing = _.attrTag({
x: 1,
content: $thing_content($scope)
@ -22,5 +22,5 @@ export const $x = /* @__PURE__ */_._const("x", ($scope, x) => {
}
_customTag_input_thing($scope["#childScope/0"], $thing);
});
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $x($scope, input.x));
export const $input = /* @__PURE__ */_._const("input", $scope => $x($scope, $scope.input.x));
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

View File

@ -3,16 +3,16 @@ export const $walks = /* over(1), replace, over(1), replace, over(2) */"b%b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $for_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $for_content__dynamicTag);
const $for_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $for_content__item($scope, $params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", ($scope, item) => $for_content__item_content($scope, item?.content));
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $scope => $for_content__dynamicTag($scope, $scope.item_content));
const $for_content__$params = /* @__PURE__ */_._const("$params2", $scope => $for_content__item($scope, $scope.$params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", $scope => $for_content__item_content($scope, $scope.item?.content));
const $for_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", 0, $for_content__$params);
const $for = /* @__PURE__ */_._for_of("#text/0", $for_content);
export const $input_item = /* @__PURE__ */_._const("input_item", ($scope, input_item) => $for($scope, [input_item]));
export const $input_item = /* @__PURE__ */_._const("input_item", $scope => $for($scope, [$scope.input_item]));
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
export const $input_other = /* @__PURE__ */_._const("input_other", $dynamicTag);
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_item($scope, input.item);
$input_other($scope, input.other);
export const $input_other = /* @__PURE__ */_._const("input_other", $scope => $dynamicTag($scope, $scope.input_other));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_item($scope, $scope.input.item);
$input_other($scope, $scope.input.other);
});
export default /* @__PURE__ */_._template("__tests__/tags/hello/index.marko", $template, $walks, $setup, $input);

View File

@ -4,11 +4,11 @@ import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _hello, $input_other as _hello_input_other, $input_item as _hello_input_item, $template as _hello_template, $walks as _hello_walks } from "./tags/hello/index.marko";
const $other_content = /* @__PURE__ */_._content("__tests__/template.marko_2_content", "other", /* over(1) */"b");
const $item_content = /* @__PURE__ */_._content_closures(/* @__PURE__ */_._content("__tests__/template.marko_1_content", "<!>:<!>", /* replace, over(2), replace, over(1) */"%c%b"), {
a($scope, a) {
_._text($scope["#text/0"], a);
a($scope) {
_._text($scope["#text/0"], $scope.a);
},
v($scope, v) {
_._text($scope["#text/1"], v);
v($scope) {
_._text($scope["#text/1"], $scope.v);
}
});
export function $setup($scope) {

View File

@ -2,25 +2,25 @@ export const $template = "<header><!></header><main><!></main><footer><!></foote
export const $walks = /* get, next(1), replace, out(1), next(1), replace, out(1), get, next(1), replace, out(1) */" D%lD%l D%l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
export const $input_header_class = /* @__PURE__ */_._const("input_header_class", ($scope, input_header_class) => _._attr_class($scope["#header/0"], input_header_class));
export const $input_header_class = /* @__PURE__ */_._const("input_header_class", $scope => _._attr_class($scope["#header/0"], $scope.input_header_class));
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
export const $input_header_content = /* @__PURE__ */_._const("input_header_content", $dynamicTag);
export const $input_header_content = /* @__PURE__ */_._const("input_header_content", $scope => $dynamicTag($scope, $scope.input_header_content));
const $dynamicTag2 = /* @__PURE__ */_._dynamic_tag("#text/2");
export const $input_content = /* @__PURE__ */_._const("input_content", $dynamicTag2);
export const $input_footer_class = /* @__PURE__ */_._const("input_footer_class", ($scope, input_footer_class) => _._attr_class($scope["#footer/3"], input_footer_class));
export const $input_content = /* @__PURE__ */_._const("input_content", $scope => $dynamicTag2($scope, $scope.input_content));
export const $input_footer_class = /* @__PURE__ */_._const("input_footer_class", $scope => _._attr_class($scope["#footer/3"], $scope.input_footer_class));
const $dynamicTag3 = /* @__PURE__ */_._dynamic_tag("#text/4");
export const $input_footer_content = /* @__PURE__ */_._const("input_footer_content", $dynamicTag3);
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_header($scope, input.header);
$input_content($scope, input.content);
$input_footer($scope, input.footer);
export const $input_footer_content = /* @__PURE__ */_._const("input_footer_content", $scope => $dynamicTag3($scope, $scope.input_footer_content));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_header($scope, $scope.input.header);
$input_content($scope, $scope.input.content);
$input_footer($scope, $scope.input.footer);
});
export const $input_header = /* @__PURE__ */_._const("input_header", ($scope, input_header) => {
$input_header_class($scope, input_header?.class);
$input_header_content($scope, input_header?.content);
export const $input_header = /* @__PURE__ */_._const("input_header", $scope => {
$input_header_class($scope, $scope.input_header?.class);
$input_header_content($scope, $scope.input_header?.content);
});
export const $input_footer = /* @__PURE__ */_._const("input_footer", ($scope, input_footer) => {
$input_footer_class($scope, input_footer?.class);
$input_footer_content($scope, input_footer?.content);
export const $input_footer = /* @__PURE__ */_._const("input_footer", $scope => {
$input_footer_class($scope, $scope.input_footer?.class);
$input_footer_content($scope, $scope.input_footer?.content);
});
export default /* @__PURE__ */_._template("__tests__/tags/hello/index.marko", $template, $walks, $setup, $input);

View File

@ -3,6 +3,6 @@ export const $walks = /* over(1), replace, over(2) */"b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0", 0, 0, 1);
export const $input_item = /* @__PURE__ */_._const("input_item", ($scope, input_item) => $dynamicTag($scope, input_item, () => [1]));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_item($scope, input.item));
export const $input_item = /* @__PURE__ */_._const("input_item", $scope => $dynamicTag($scope, $scope.input_item, () => [1]));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_item($scope, $scope.input.item));
export default /* @__PURE__ */_._template("__tests__/tags/hello/index.marko", $template, $walks, $setup, $input);

View File

@ -1,21 +1,21 @@
// size: 324 (min) 200 (brotli)
// size: 313 (min) 205 (brotli)
const $dynamicTag = _._dynamic_tag(0, 0, 0, 1),
$input_item = _._const(3, ($scope, input_item) =>
$dynamicTag($scope, input_item, () => [1]),
$input_item = _._const(3, ($scope) =>
$dynamicTag($scope, $scope[3], () => [1]),
),
$item_content__y = _._const(2, ($scope, y) => _._text($scope[0], y)),
$item_content__$params = _._const(1, ($scope, $params2) =>
$item_content__y($scope, $params2[0]),
$item_content__y = _._const(2, ($scope) => _._text($scope[0], $scope[2])),
$item_content__$params = _._const(1, ($scope) =>
$item_content__y($scope, $scope[1][0]),
),
$item_content = _._content("b0", "y: <!>", "b%b", 0, $item_content__$params),
$x__script = _._script("b1", ($scope, { 2: x }) =>
$x__script = _._script("b1", ($scope) =>
_._on($scope[1], "click", function () {
$x($scope, (x = !x));
$x($scope, !$scope[2]);
}),
),
$x = _._let(2, ($scope, x) => {
$x = _._let(2, ($scope) => {
let $item;
(x && ($item = _.attrTag({ content: $item_content($scope) })),
($scope[2] && ($item = _.attrTag({ content: $item_content($scope) })),
$input_item($scope[0], $item),
$x__script($scope));
});

View File

@ -2,17 +2,15 @@ export const $template = `<!>${_hello_template}<button>Toggle</button>`;
export const $walks = /* over(1), beginChild, _hello_walks, endChild, get, over(1) */`b/${_hello_walks}& b`;
import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _hello, $input_item as _hello_input_item, $template as _hello_template, $walks as _hello_walks } from "./tags/hello/index.marko";
const $item_content__y = /* @__PURE__ */_._const("y", ($scope, y) => _._text($scope["#text/0"], y));
const $item_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $item_content__y($scope, $params2[0]));
const $item_content__y = /* @__PURE__ */_._const("y", $scope => _._text($scope["#text/0"], $scope.y));
const $item_content__$params = /* @__PURE__ */_._const("$params2", $scope => $item_content__y($scope, $scope.$params2[0]));
const $item_content = /* @__PURE__ */_._content("__tests__/template.marko_1_content", "y: <!>", /* over(1), replace, over(1) */"b%b", 0, $item_content__$params);
const $x__script = _._script("__tests__/template.marko_0_x", ($scope, {
x
}) => _._on($scope["#button/1"], "click", function () {
$x($scope, x = !x);
const $x__script = _._script("__tests__/template.marko_0_x", $scope => _._on($scope["#button/1"], "click", function () {
$x($scope, !$scope.x);
}));
const $x = /* @__PURE__ */_._let("x/2", ($scope, x) => {
const $x = /* @__PURE__ */_._let("x/2", $scope => {
let $item;
if (x) {
if ($scope.x) {
$item = _.attrTag({
content: $item_content($scope)
});

View File

@ -3,48 +3,48 @@ export const $walks = /* over(1), replace, over(1), replace, over(2) */"b%b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $for_content3__row__script = _._script("__tests__/tags/hello/index.marko_3_row", $scope => _._attrs_script($scope, "#div/0"));
const $for_content3__row = /* @__PURE__ */_._const("row", ($scope, row) => {
_._attrs_partial($scope, "#div/0", row, {
const $for_content3__row = /* @__PURE__ */_._const("row", $scope => {
_._attrs_partial($scope, "#div/0", $scope.row, {
class: 1
});
$for_content3__row_content($scope, row?.content);
$for_content3__row_content($scope, $scope.row?.content);
$for_content3__row__script($scope);
});
const $for_content3__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
const $for_content3__row_content = /* @__PURE__ */_._const("row_content", $for_content3__dynamicTag);
const $for_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $for_content3__row($scope, $params4[0]));
const $for_content3__row_content = /* @__PURE__ */_._const("row_content", $scope => $for_content3__dynamicTag($scope, $scope.row_content));
const $for_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $for_content3__row($scope, $scope.$params4[0]));
const $for_content3 = /* @__PURE__ */_._content_branch("<div class=row><!></div>", /* get, next(1), replace, out(1) */" D%l", 0, $for_content3__$params);
const $for_content2__col__script = _._script("__tests__/tags/hello/index.marko_2_col", $scope => _._attrs_script($scope, "#div/0"));
const $for_content2__col = /* @__PURE__ */_._const("col", ($scope, col) => {
_._attrs_partial_content($scope, "#div/0", col, {
const $for_content2__col = /* @__PURE__ */_._const("col", $scope => {
_._attrs_partial_content($scope, "#div/0", $scope.col, {
class: 1
});
$for_content2__col_row($scope, col?.row);
$for_content2__col_row($scope, $scope.col?.row);
$for_content2__col__script($scope);
});
const $for_content2__for = /* @__PURE__ */_._for_of("#text/1", $for_content3);
const $for_content2__col_row = /* @__PURE__ */_._const("col_row", ($scope, col_row) => $for_content2__for($scope, [col_row]));
const $for_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $for_content2__col($scope, $params3[0]));
const $for_content2__col_row = /* @__PURE__ */_._const("col_row", $scope => $for_content2__for($scope, [$scope.col_row]));
const $for_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $for_content2__col($scope, $scope.$params3[0]));
const $for_content2 = /* @__PURE__ */_._content_branch("<div class=col></div><!><!>", /* get, over(1), replace, over(2) */" b%c", 0, $for_content2__$params);
const $for_content__item__script = _._script("__tests__/tags/hello/index.marko_1_item", $scope => _._attrs_script($scope, "#div/0"));
const $for_content__item = /* @__PURE__ */_._const("item", ($scope, item) => {
_._attrs_partial($scope, "#div/0", item, {
const $for_content__item = /* @__PURE__ */_._const("item", $scope => {
_._attrs_partial($scope, "#div/0", $scope.item, {
class: 1
});
$for_content__item_content($scope, item?.content);
$for_content__item_content($scope, $scope.item?.content);
$for_content__item__script($scope);
});
const $for_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $for_content__dynamicTag);
const $for_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $for_content__item($scope, $params2[0]));
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $scope => $for_content__dynamicTag($scope, $scope.item_content));
const $for_content__$params = /* @__PURE__ */_._const("$params2", $scope => $for_content__item($scope, $scope.$params2[0]));
const $for_content = /* @__PURE__ */_._content_branch("<div class=item><!></div>", /* get, next(1), replace, out(1) */" D%l", 0, $for_content__$params);
const $for = /* @__PURE__ */_._for_of("#text/0", $for_content);
export const $input_list_item = /* @__PURE__ */_._const("input_list_item", ($scope, input_list_item) => $for($scope, [input_list_item]));
export const $input_list_item = /* @__PURE__ */_._const("input_list_item", $scope => $for($scope, [$scope.input_list_item]));
const $for2 = /* @__PURE__ */_._for_of("#text/1", $for_content2);
export const $input_col = /* @__PURE__ */_._const("input_col", ($scope, input_col) => $for2($scope, [input_col]));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_list($scope, input.list);
$input_col($scope, input.col);
export const $input_col = /* @__PURE__ */_._const("input_col", $scope => $for2($scope, [$scope.input_col]));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_list($scope, $scope.input.list);
$input_col($scope, $scope.input.col);
});
export const $input_list = /* @__PURE__ */_._const("input_list", ($scope, input_list) => $input_list_item($scope, input_list?.item));
export const $input_list = /* @__PURE__ */_._const("input_list", $scope => $input_list_item($scope, $scope.input_list?.item));
export default /* @__PURE__ */_._template("__tests__/tags/hello/index.marko", $template, $walks, $setup, $input);

View File

@ -4,8 +4,8 @@ import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _hello, $input_list_item as _hello_input_list_item, $input_col as _hello_input_col, $template as _hello_template, $walks as _hello_walks } from "./tags/hello/index.marko";
const $row_content2 = _._content_resume("__tests__/template.marko_4_content", "Outside", /* over(1) */"b");
const $row_content = /* @__PURE__ */_._content_closures(_._content_resume("__tests__/template.marko_3_content", " ", /* get, over(1) */" b"), {
row($scope, row) {
_._text($scope["#text/0"], row);
row($scope) {
_._text($scope["#text/0"], $scope.row);
}
});
const $item_content2 = _._content_resume("__tests__/template.marko_2_content", "bar", /* over(1) */"b");

View File

@ -3,11 +3,11 @@ export const $walks = /* over(1), replace, over(2) */"b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $for_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $for_content__dynamicTag);
const $for_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $for_content__item($scope, $params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", ($scope, item) => $for_content__item_content($scope, item?.content));
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $scope => $for_content__dynamicTag($scope, $scope.item_content));
const $for_content__$params = /* @__PURE__ */_._const("$params2", $scope => $for_content__item($scope, $scope.$params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", $scope => $for_content__item_content($scope, $scope.item?.content));
const $for_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", 0, $for_content__$params);
const $for = /* @__PURE__ */_._for_of("#text/0", $for_content);
export const $input_item = /* @__PURE__ */_._const("input_item", ($scope, input_item) => $for($scope, [input_item]));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_item($scope, input.item));
export const $input_item = /* @__PURE__ */_._const("input_item", $scope => $for($scope, [$scope.input_item]));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_item($scope, $scope.input.item));
export default /* @__PURE__ */_._template("__tests__/tags/list/index.marko", $template, $walks, $setup, $input);

View File

@ -3,17 +3,17 @@ export const $walks = /* over(1), beginChild, _list_walks, endChild, over(1) */`
import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _list, $input_item as _list_input_item, $template as _list_template, $walks as _list_walks } from "./tags/list/index.marko";
const $item_content = /* @__PURE__ */_._content_closures(/* @__PURE__ */_._content("__tests__/template.marko_1_content", " ", /* get, over(1) */" b"), {
item($scope, item) {
_._text($scope["#text/0"], item);
zzz($scope) {
_._text($scope["#text/0"], $scope.zzz);
}
});
export function $setup($scope) {
_list($scope["#childScope/0"]);
let $item;
_.forOf([1, 2, 3], item => {
_.forOf([1, 2, 3], zzz => {
$item = _.attrTags($item, {
content: $item_content($scope, {
item
zzz
})
});
});

View File

@ -3,11 +3,11 @@ import _list from "./tags/list/index.marko";
export default _._template("__tests__/template.marko", input => {
const $scope0_id = _._scope_id();
let $item;
_.forOf([1, 2, 3], item => {
_.forOf([1, 2, 3], zzz => {
$item = _.attrTags($item, {
content: _._content("__tests__/template.marko_1_content", () => {
const $scope1_id = _._scope_id();
_._html(`${_._escape(item)}${_._el_resume($scope1_id, "#text/0")}`);
_._html(`${_._escape(zzz)}${_._el_resume($scope1_id, "#text/0")}`);
_._scope($scope1_id, {}, "__tests__/template.marko", "3:5");
})
});

View File

@ -1,3 +1,3 @@
list
for|item| of=[1, 2, 3]
@item -- ${item}
for|zzz| of=[1, 2, 3]
@item -- ${zzz}

View File

@ -3,11 +3,11 @@ export const $walks = /* over(1), replace, over(2) */"b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $for_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $for_content__dynamicTag);
const $for_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $for_content__item($scope, $params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", ($scope, item) => $for_content__item_content($scope, item?.content));
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $scope => $for_content__dynamicTag($scope, $scope.item_content));
const $for_content__$params = /* @__PURE__ */_._const("$params2", $scope => $for_content__item($scope, $scope.$params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", $scope => $for_content__item_content($scope, $scope.item?.content));
const $for_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", 0, $for_content__$params);
const $for = /* @__PURE__ */_._for_of("#text/0", $for_content);
export const $input_item = /* @__PURE__ */_._const("input_item", ($scope, input_item) => $for($scope, [input_item]));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_item($scope, input.item));
export const $input_item = /* @__PURE__ */_._const("input_item", $scope => $for($scope, [$scope.input_item]));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_item($scope, $scope.input.item));
export default /* @__PURE__ */_._template("__tests__/tags/list/index.marko", $template, $walks, $setup, $input);

View File

@ -1,19 +1,17 @@
// size: 218 (min) 161 (brotli)
const $item_content__mult__OR__item = _._or(1, ($scope) => {
let {
_: { 3: mult },
5: item,
} = $scope;
_._text($scope[0], item * mult);
}),
// size: 199 (min) 149 (brotli)
const $item_content__mult__OR__item = _._or(1, ($scope) =>
_._text($scope[0], $scope[5] * $scope._[3]),
),
$item_content__mult = _._closure_get(3, $item_content__mult__OR__item),
$mult__closure = _._closure($item_content__mult),
$mult__script = _._script("b1", ($scope, { 3: mult }) =>
$mult__script = _._script("b1", ($scope) =>
_._on($scope[1], "click", function () {
$mult($scope, ++mult);
$mult($scope, $scope[3] + 1);
}),
),
$mult = _._let(3, ($scope, mult) => {
(_._text($scope[2], mult), $mult__closure($scope), $mult__script($scope));
$mult = _._let(3, ($scope) => {
(_._text($scope[2], $scope[3]),
$mult__closure($scope),
$mult__script($scope));
});
init();

View File

@ -2,28 +2,18 @@ export const $template = `<!>${_list_template}<button>Multiplier: <!></button>`;
export const $walks = /* over(1), beginChild, _list_walks, endChild, get, next(1), over(1), replace, out(1) */`b/${_list_walks}& Db%l`;
import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _list, $input_item as _list_input_item, $template as _list_template, $walks as _list_walks } from "./tags/list/index.marko";
const $item_content__mult__OR__item = /* @__PURE__ */_._or(1, $scope => {
let {
_: {
mult
},
item
} = $scope;
_._text($scope["#text/0"], item * mult);
});
const $item_content__mult__OR__item = /* @__PURE__ */_._or(1, $scope => _._text($scope["#text/0"], $scope.item * $scope._.mult));
const $item_content__mult = /* @__PURE__ */_._closure_get("mult", $item_content__mult__OR__item);
const $item_content__setup = $item_content__mult;
const $item_content = /* @__PURE__ */_._content_closures(/* @__PURE__ */_._content("__tests__/template.marko_1_content", " ", /* get, over(1) */" b", $item_content__setup), {
item: $item_content__mult__OR__item
});
const $mult__closure = /* @__PURE__ */_._closure($item_content__mult);
const $mult__script = _._script("__tests__/template.marko_0_mult", ($scope, {
mult
}) => _._on($scope["#button/1"], "click", function () {
$mult($scope, ++mult);
const $mult__script = _._script("__tests__/template.marko_0_mult", $scope => _._on($scope["#button/1"], "click", function () {
$mult($scope, $scope.mult + 1);
}));
const $mult = /* @__PURE__ */_._let("mult/3", ($scope, mult) => {
_._text($scope["#text/2"], mult);
const $mult = /* @__PURE__ */_._let("mult/3", $scope => {
_._text($scope["#text/2"], $scope.mult);
$mult__closure($scope);
$mult__script($scope);
});

View File

@ -3,11 +3,11 @@ export const $walks = /* over(1), replace, over(2) */"b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $for_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $for_content__dynamicTag);
const $for_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $for_content__item($scope, $params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", ($scope, item) => $for_content__item_content($scope, item?.content));
const $for_content__item_content = /* @__PURE__ */_._const("item_content", $scope => $for_content__dynamicTag($scope, $scope.item_content));
const $for_content__$params = /* @__PURE__ */_._const("$params2", $scope => $for_content__item($scope, $scope.$params2[0]));
const $for_content__item = /* @__PURE__ */_._const("item", $scope => $for_content__item_content($scope, $scope.item?.content));
const $for_content = /* @__PURE__ */_._content_branch("<!><!><!>", /* over(1), replace, over(2) */"b%c", 0, $for_content__$params);
const $for = /* @__PURE__ */_._for_of("#text/0", $for_content);
export const $input_item = /* @__PURE__ */_._const("input_item", ($scope, input_item) => $for($scope, [input_item]));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_item($scope, input.item));
export const $input_item = /* @__PURE__ */_._const("input_item", $scope => $for($scope, [$scope.input_item]));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_item($scope, $scope.input.item));
export default /* @__PURE__ */_._template("__tests__/tags/list/index.marko", $template, $walks, $setup, $input);

View File

@ -3,6 +3,6 @@ export const $walks = /* over(1), replace, over(2) */"b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0");
export const $input_foo = /* @__PURE__ */_._const("input_foo", $dynamicTag);
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_foo($scope, input.foo));
export const $input_foo = /* @__PURE__ */_._const("input_foo", $scope => $dynamicTag($scope, $scope.input_foo));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_foo($scope, $scope.input.foo));
export default /* @__PURE__ */_._template("__tests__/tags/hello/index.marko", $template, $walks, $setup, $input);

View File

@ -1,12 +1,12 @@
// size: 169 (min) 130 (brotli)
const $disabled__script = _._script("a0", ($scope, { 3: disabled }) =>
// size: 164 (min) 123 (brotli)
const $disabled__script = _._script("a0", ($scope) =>
_._on($scope[1], "click", function () {
$disabled($scope, (disabled = !disabled));
$disabled($scope, !$scope[3]);
}),
),
$disabled = _._let(3, ($scope, disabled) => {
(_._attr($scope[0], "disabled", disabled),
_._text($scope[2], disabled ? "enable" : "disable"),
$disabled = _._let(3, ($scope) => {
(_._attr($scope[0], "disabled", $scope[3]),
_._text($scope[2], $scope[3] ? "enable" : "disable"),
$disabled__script($scope));
});
init();

View File

@ -1,14 +1,12 @@
export const $template = "<input><button> </button>";
export const $walks = /* get, over(1), get, next(1), get, out(1) */" b D l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $disabled__script = _._script("__tests__/template.marko_0_disabled", ($scope, {
disabled
}) => _._on($scope["#button/1"], "click", function () {
$disabled($scope, disabled = !disabled);
const $disabled__script = _._script("__tests__/template.marko_0_disabled", $scope => _._on($scope["#button/1"], "click", function () {
$disabled($scope, !$scope.disabled);
}));
const $disabled = /* @__PURE__ */_._let("disabled/3", ($scope, disabled) => {
_._attr($scope["#input/0"], "disabled", disabled);
_._text($scope["#text/2"], disabled ? "enable" : "disable");
const $disabled = /* @__PURE__ */_._let("disabled/3", $scope => {
_._attr($scope["#input/0"], "disabled", $scope.disabled);
_._text($scope["#text/2"], $scope.disabled ? "enable" : "disable");
$disabled__script($scope);
});
export function $setup($scope) {

View File

@ -2,24 +2,24 @@ export const $template = "<div></div><!><!>";
export const $walks = /* get, over(1), replace, over(2) */" b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $if_content__input_test_class = /* @__PURE__ */_._if_closure("input_test_class", "#text/1", 0, ($scope, input_test_class) => _._attr_class($scope["#div/0"], input_test_class));
const $if_content__input_test_class = /* @__PURE__ */_._if_closure("#text/1", 0, $scope => _._attr_class($scope["#div/0"], $scope._.input_test_class));
const $if_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
const $if_content__input_test_content = /* @__PURE__ */_._if_closure("input_test_content", "#text/1", 0, $if_content__dynamicTag);
const $if_content__input_test_content = /* @__PURE__ */_._if_closure("#text/1", 0, $scope => $if_content__dynamicTag($scope, $scope._.input_test_content));
const $if_content__setup = $scope => {
$if_content__input_test_class._($scope);
$if_content__input_test_content._($scope);
};
const $if_content = /* @__PURE__ */_._content_branch("<div id=test><!></div>", /* get, next(1), replace, out(1) */" D%l", $if_content__setup);
export const $input_class = /* @__PURE__ */_._const("input_class", ($scope, input_class) => _._attr_class($scope["#div/0"], input_class));
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#div/0"], $scope.input_class));
const $if = /* @__PURE__ */_._if("#text/1", $if_content);
export const $input_test = /* @__PURE__ */_._const("input_test", ($scope, input_test) => {
$input_test_class($scope, input_test?.class);
$input_test_content($scope, input_test?.content);
$if($scope, input_test ? 0 : 1);
export const $input_test = /* @__PURE__ */_._const("input_test", $scope => {
$input_test_class($scope, $scope.input_test?.class);
$input_test_content($scope, $scope.input_test?.content);
$if($scope, $scope.input_test ? 0 : 1);
});
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_class($scope, input.class);
$input_test($scope, input.test);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_class($scope, $scope.input.class);
$input_test($scope, $scope.input.test);
});
const $input_test_class = /* @__PURE__ */_._const("input_test_class", $if_content__input_test_class);
const $input_test_content = /* @__PURE__ */_._const("input_test_content", $if_content__input_test_content);

View File

@ -7,27 +7,23 @@ import { $setup as _customTag, $input_class as _customTag_input_class, $input_te
const $test_content = _._content_resume("__tests__/template.marko_1_content", "Hello", /* over(1) */"b");
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/3");
const $c__OR__d = /* @__PURE__ */_._or(8, $scope => {
let {
c,
d
} = $scope;
_._attr_class_items($scope["#div/0"], {
b: c,
d: d
b: $scope.c,
d: $scope.d
});
_customTag_input_class($scope["#childScope/1"], ["a", {
b: c,
d
b: $scope.c,
d: $scope.d
}]);
$dynamicTag($scope, TestTag, () => ({
class: ["a", {
b: c,
d
b: $scope.c,
d: $scope.d
}],
test: _.attrTag({
class: ["a", {
b: c,
d
b: $scope.c,
d: $scope.d
}],
content: $test_content($scope)
})
@ -42,8 +38,8 @@ export function $setup($scope) {
_customTag_input_class($scope["#childScope/2"], ["a", false, "b"]);
_customTag_input_test($scope["#childScope/2"], void 0);
}
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$c($scope, input.c);
$d($scope, input.d);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$c($scope, $scope.input.c);
$d($scope, $scope.input.d);
});
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

View File

@ -2,24 +2,18 @@ export const $template = "<div></div>";
export const $walks = /* get, over(1) */" b";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $input_foo__OR__input_bar = /* @__PURE__ */_._or(5, $scope => {
let {
input_foo,
input_bar
} = $scope;
_._attr($scope["#div/0"], "nested", `a ${input_foo + ` nested ${input_bar}`} b`);
});
export const $input_foo = /* @__PURE__ */_._const("input_foo", ($scope, input_foo) => {
_._attr_class($scope["#div/0"], input_foo);
_._attr($scope["#div/0"], "foo", 'a' + input_foo + 'b');
const $input_foo__OR__input_bar = /* @__PURE__ */_._or(5, $scope => _._attr($scope["#div/0"], "nested", `a ${$scope.input_foo + ` nested ${$scope.input_bar}`} b`));
export const $input_foo = /* @__PURE__ */_._const("input_foo", $scope => {
_._attr_class($scope["#div/0"], $scope.input_foo);
_._attr($scope["#div/0"], "foo", 'a' + $scope.input_foo + 'b');
$input_foo__OR__input_bar($scope);
});
export const $input_bar = /* @__PURE__ */_._const("input_bar", ($scope, input_bar) => {
_._attr($scope["#div/0"], "bar", `a ${input_bar} b`);
export const $input_bar = /* @__PURE__ */_._const("input_bar", $scope => {
_._attr($scope["#div/0"], "bar", `a ${$scope.input_bar} b`);
$input_foo__OR__input_bar($scope);
});
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_foo($scope, input.foo);
$input_bar($scope, input.bar);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_foo($scope, $scope.input.foo);
$input_bar($scope, $scope.input.bar);
});
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

View File

@ -2,24 +2,24 @@ export const $template = "<div></div><!><!>";
export const $walks = /* get, over(1), replace, over(2) */" b%c";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $if_content__input_test_style = /* @__PURE__ */_._if_closure("input_test_style", "#text/1", 0, ($scope, input_test_style) => _._attr_style($scope["#div/0"], input_test_style));
const $if_content__input_test_style = /* @__PURE__ */_._if_closure("#text/1", 0, $scope => _._attr_style($scope["#div/0"], $scope._.input_test_style));
const $if_content__dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
const $if_content__input_test_content = /* @__PURE__ */_._if_closure("input_test_content", "#text/1", 0, $if_content__dynamicTag);
const $if_content__input_test_content = /* @__PURE__ */_._if_closure("#text/1", 0, $scope => $if_content__dynamicTag($scope, $scope._.input_test_content));
const $if_content__setup = $scope => {
$if_content__input_test_style._($scope);
$if_content__input_test_content._($scope);
};
const $if_content = /* @__PURE__ */_._content_branch("<div id=test><!></div>", /* get, next(1), replace, out(1) */" D%l", $if_content__setup);
export const $input_style = /* @__PURE__ */_._const("input_style", ($scope, input_style) => _._attr_style($scope["#div/0"], input_style));
export const $input_style = /* @__PURE__ */_._const("input_style", $scope => _._attr_style($scope["#div/0"], $scope.input_style));
const $if = /* @__PURE__ */_._if("#text/1", $if_content);
export const $input_test = /* @__PURE__ */_._const("input_test", ($scope, input_test) => {
$input_test_style($scope, input_test?.style);
$input_test_content($scope, input_test?.content);
$if($scope, input_test ? 0 : 1);
export const $input_test = /* @__PURE__ */_._const("input_test", $scope => {
$input_test_style($scope, $scope.input_test?.style);
$input_test_content($scope, $scope.input_test?.content);
$if($scope, $scope.input_test ? 0 : 1);
});
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_style($scope, input.style);
$input_test($scope, input.test);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$input_style($scope, $scope.input.style);
$input_test($scope, $scope.input.test);
});
const $input_test_style = /* @__PURE__ */_._const("input_test_style", $if_content__input_test_style);
const $input_test_content = /* @__PURE__ */_._const("input_test_content", $if_content__input_test_content);

View File

@ -5,10 +5,10 @@ const TestTag = CustomTag;
import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _customTag, $input_style as _customTag_input_style, $input_test as _customTag_input_test, $template as _customTag_template, $walks as _customTag_walks } from "./tags/custom-tag.marko";
const $test_content = _._content_resume("__tests__/template.marko_1_content", "Hello", /* over(1) */"b");
export const $input_color = /* @__PURE__ */_._const("input_color", ($scope, input_color) => {
_._attr_style_item($scope["#div/0"], "color", input_color);
export const $input_color = /* @__PURE__ */_._const("input_color", $scope => {
_._attr_style_item($scope["#div/0"], "color", $scope.input_color);
_customTag_input_style($scope["#childScope/1"], {
color: input_color
color: $scope.input_color
});
});
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/4");
@ -35,5 +35,5 @@ export function $setup($scope) {
})
}));
}
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_color($scope, input.color));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_color($scope, $scope.input.color));
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

View File

@ -2,6 +2,6 @@ export const $template = "<div></div>";
export const $walks = /* get, over(1) */" b";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
export const $input_name = /* @__PURE__ */_._const("input_name", ($scope, input_name) => _._attr($scope["#div/0"], "foo", `Hello ${input_name}`));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $input_name($scope, input.name));
export const $input_name = /* @__PURE__ */_._const("input_name", $scope => _._attr($scope["#div/0"], "foo", `Hello ${$scope.input_name}`));
export const $input = /* @__PURE__ */_._const("input", $scope => $input_name($scope, $scope.input.name));
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

View File

@ -1,21 +1,21 @@
// size: 256 (min) 134 (brotli)
const $await_content3__count = _._closure_get(4, ($scope, count) =>
_._text($scope[1], count),
// size: 254 (min) 145 (brotli)
const $await_content3__count = _._closure_get(4, ($scope) =>
_._text($scope[1], $scope._[4]),
),
$await_content2__count = _._closure_get(4, ($scope, count) =>
_._text($scope[1], count),
$await_content2__count = _._closure_get(4, ($scope) =>
_._text($scope[1], $scope._[4]),
),
$await_content__count = _._closure_get(4, ($scope, count) =>
_._text($scope[1], count),
$await_content__count = _._closure_get(4, ($scope) =>
_._text($scope[1], $scope._[4]),
),
$count__closure = _._closure(
$await_content__count,
$await_content2__count,
$await_content3__count,
),
$count__script = _._script("a0", ($scope, { 4: count }) =>
$count__script = _._script("a0", ($scope) =>
_._on($scope[3], "click", function () {
$count($scope, ++count);
$count($scope, $scope[4] + 1);
}),
),
$count = _._let(4, ($scope) => {

View File

@ -2,26 +2,24 @@ export const $template = "<div><!><!><!><button>Inc</button></div>";
export const $walks = /* next(1), replace, over(1), replace, over(1), replace, over(1), get, out(1) */"D%b%b%b l";
import { resolveAfter } from "../../utils/resolve";
import * as _ from "@marko/runtime-tags/debug/dom";
const $await_content3__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content3__count = /* @__PURE__ */_._closure_get("count", ($scope, count) => _._text($scope["#text/1"], count));
const $await_content3__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content3__count = /* @__PURE__ */_._closure_get("count", $scope => _._text($scope["#text/1"], $scope._.count));
const $await_content3__setup = $await_content3__count;
const $await_content3__$params = /* @__PURE__ */_._const("$params4", ($scope, $params4) => $await_content3__value($scope, $params4[0]));
const $await_content3__$params = /* @__PURE__ */_._const("$params4", $scope => $await_content3__value($scope, $scope.$params4[0]));
const $await_content3 = /* @__PURE__ */_._content_branch("Got: <!> <!>", /* over(1), replace, over(2), replace, over(1) */"b%c%b", $await_content3__setup, $await_content3__$params);
const $await_content2__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content2__count = /* @__PURE__ */_._closure_get("count", ($scope, count) => _._text($scope["#text/1"], count));
const $await_content2__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content2__count = /* @__PURE__ */_._closure_get("count", $scope => _._text($scope["#text/1"], $scope._.count));
const $await_content2__setup = $await_content2__count;
const $await_content2__$params = /* @__PURE__ */_._const("$params3", ($scope, $params3) => $await_content2__value($scope, $params3[0]));
const $await_content2__$params = /* @__PURE__ */_._const("$params3", $scope => $await_content2__value($scope, $scope.$params3[0]));
const $await_content2 = /* @__PURE__ */_._content_branch("Got: <!> <!>", /* over(1), replace, over(2), replace, over(1) */"b%c%b", $await_content2__setup, $await_content2__$params);
const $await_content__value = /* @__PURE__ */_._const("value", ($scope, value) => _._text($scope["#text/0"], value));
const $await_content__count = /* @__PURE__ */_._closure_get("count", ($scope, count) => _._text($scope["#text/1"], count));
const $await_content__value = /* @__PURE__ */_._const("value", $scope => _._text($scope["#text/0"], $scope.value));
const $await_content__count = /* @__PURE__ */_._closure_get("count", $scope => _._text($scope["#text/1"], $scope._.count));
const $await_content__setup = $await_content__count;
const $await_content__$params = /* @__PURE__ */_._const("$params2", ($scope, $params2) => $await_content__value($scope, $params2[0]));
const $await_content__$params = /* @__PURE__ */_._const("$params2", $scope => $await_content__value($scope, $scope.$params2[0]));
const $await_content = /* @__PURE__ */_._content_branch("Got: <!> <!>", /* over(1), replace, over(2), replace, over(1) */"b%c%b", $await_content__setup, $await_content__$params);
const $count__closure = /* @__PURE__ */_._closure($await_content__count, $await_content2__count, $await_content3__count);
const $count__script = _._script("__tests__/template.marko_0_count", ($scope, {
count
}) => _._on($scope["#button/3"], "click", function () {
$count($scope, ++count);
const $count__script = _._script("__tests__/template.marko_0_count", $scope => _._on($scope["#button/3"], "click", function () {
$count($scope, $scope.count + 1);
}));
const $count = /* @__PURE__ */_._let("count/4", $scope => {
$count__closure($scope);

View File

@ -1,9 +1,9 @@
export const $template = "<div> </div>";
export const $walks = /* next(1), get, out(1) */"D l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $z = /* @__PURE__ */_._const("z", ($scope, z) => _._text($scope["#text/0"], z));
const $y = /* @__PURE__ */_._const("y", ($scope, y) => $z($scope, y * 3));
const $x = /* @__PURE__ */_._let("x/1", ($scope, x) => $y($scope, x * 2));
const $z = /* @__PURE__ */_._const("z", $scope => _._text($scope["#text/0"], $scope.z));
const $y = /* @__PURE__ */_._const("y", $scope => $z($scope, $scope.y * 3));
const $x = /* @__PURE__ */_._let("x/1", $scope => $y($scope, $scope.x * 2));
export function $setup($scope) {
$x($scope, 1);
}

View File

@ -2,13 +2,11 @@ export const $template = "<button> </button>";
export const $walks = /* get, next(1), get, out(1) */" D l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
export const $text = /* @__PURE__ */_._const("text", ($scope, text) => _._text($scope["#text/1"], text));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$onClick($scope, input.onClick);
$text($scope, input.text);
export const $text = /* @__PURE__ */_._const("text", $scope => _._text($scope["#text/1"], $scope.text));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$onClick($scope, $scope.input.onClick);
$text($scope, $scope.input.text);
});
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,15 +1,15 @@
// size: 226 (min) 161 (brotli)
const $onClick__script = _._script("a0", ($scope, { 4: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 214 (min) 160 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[4]),
),
$onClick$1 = _._const(4, $onClick__script),
$text = _._const(5, ($scope, text) => _._text($scope[1], text)),
$clickCount = _._let(1, ($scope, clickCount) => {
($text($scope[0], clickCount), $onClick$1($scope[0], $onClick($scope)));
$text = _._const(5, ($scope) => _._text($scope[1], $scope[5])),
$clickCount = _._let(1, ($scope) => {
($text($scope[0], $scope[1]), $onClick$1($scope[0], $onClick($scope)));
});
function $onClick($scope, { 1: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[1] + 1);
};
}
(_._resume("b0", $onClick), init());

View File

@ -2,19 +2,17 @@ export const $template = _myButton_template;
export const $walks = /* beginChild, _myButton_walks, endChild */`/${_myButton_walks}&`;
import { $setup as _myButton, $text as _myButton_input_text, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks } from "./tags/my-button.marko";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount = /* @__PURE__ */_._let("clickCount/1", ($scope, clickCount) => {
_myButton_input_text($scope["#childScope/0"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/1", $scope => {
_myButton_input_text($scope["#childScope/0"], $scope.clickCount);
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
});
export function $setup($scope) {
_myButton($scope["#childScope/0"]);
$clickCount($scope, 0);
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick", $onClick);

View File

@ -2,13 +2,11 @@ export const $template = "<button> </button>";
export const $walks = /* get, next(1), get, out(1) */" D l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
export const $text = /* @__PURE__ */_._const("text", ($scope, text) => _._text($scope["#text/1"], text));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$text($scope, input.text);
$onClick($scope, input.onClick);
export const $text = /* @__PURE__ */_._const("text", $scope => _._text($scope["#text/1"], $scope.text));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$text($scope, $scope.input.text);
$onClick($scope, $scope.input.onClick);
});
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,15 +1,15 @@
// size: 226 (min) 161 (brotli)
const $onClick__script = _._script("a0", ($scope, { 5: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 214 (min) 160 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[5]),
),
$onClick$1 = _._const(5, $onClick__script),
$text = _._const(4, ($scope, text) => _._text($scope[1], text)),
$clickCount = _._let(1, ($scope, clickCount) => {
($text($scope[0], clickCount), $onClick$1($scope[0], $onClick($scope)));
$text = _._const(4, ($scope) => _._text($scope[1], $scope[4])),
$clickCount = _._let(1, ($scope) => {
($text($scope[0], $scope[1]), $onClick$1($scope[0], $onClick($scope)));
});
function $onClick($scope, { 1: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[1] + 1);
};
}
(_._resume("b0", $onClick), init());

View File

@ -2,19 +2,17 @@ export const $template = _myButton_template;
export const $walks = /* beginChild, _myButton_walks, endChild */`/${_myButton_walks}&`;
import { $setup as _myButton, $text as _myButton_input_text, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks } from "./tags/my-button.marko";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount = /* @__PURE__ */_._let("clickCount/1", ($scope, clickCount) => {
_myButton_input_text($scope["#childScope/0"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/1", $scope => {
_myButton_input_text($scope["#childScope/0"], $scope.clickCount);
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
});
export function $setup($scope) {
_myButton($scope["#childScope/0"]);
$clickCount($scope, 0);
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick", $onClick);

View File

@ -2,20 +2,18 @@ export const $template = "<button><!> <!></button>";
export const $walks = /* get, next(1), replace, over(2), replace, out(1) */" D%c%l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
export const $text = /* @__PURE__ */_._const("text", ($scope, text) => {
_._text($scope["#text/1"], text);
$textAlias($scope, text);
export const $text = /* @__PURE__ */_._const("text", $scope => {
_._text($scope["#text/1"], $scope.text);
$textAlias($scope, $scope.text);
});
const $textAlias = ($scope, textAlias) => {
_._text($scope["#text/2"], textAlias);
const $textAlias = $scope => {
_._text($scope["#text/2"], $scope.text);
};
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$onClick($scope, input.onClick);
$value2($scope, input.value);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$onClick($scope, $scope.input.onClick);
$value2($scope, $scope.input.value);
});
export const $value2 = /* @__PURE__ */_._const("$value", ($scope, $value) => $text($scope, $value.text));
export const $value2 = /* @__PURE__ */_._const("$value", $scope => $text($scope, $scope.$value.text));
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,29 +1,29 @@
// size: 393 (min) 210 (brotli)
const $onClick__script = _._script("a0", ($scope, { 5: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 380 (min) 212 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[5]),
),
$onClick$1 = _._const(5, $onClick__script),
$text = _._const(7, ($scope, text) => {
(_._text($scope[1], text), $textAlias($scope, text));
$text = _._const(7, ($scope) => {
(_._text($scope[1], $scope[7]), $textAlias($scope, $scope[7]));
}),
$textAlias = ($scope, textAlias) => {
_._text($scope[2], textAlias);
$textAlias = ($scope) => {
_._text($scope[2], $scope[7]);
},
$value2 = _._const(6, ($scope, $value) => $text($scope, $value.text)),
$clickCount = _._let(2, ($scope, clickCount) => {
($value2($scope[0], { text: clickCount }),
$value2 = _._const(6, ($scope) => $text($scope, $scope[6].text)),
$clickCount = _._let(2, ($scope) => {
($value2($scope[0], { text: $scope[2] }),
$onClick$1($scope[0], $onClick($scope)),
$text($scope[1], clickCount),
$text($scope[1], $scope[2]),
$onClick$1($scope[1], $onClick2($scope)));
});
function $onClick2($scope, { 2: clickCount } = $scope) {
function $onClick2($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
};
}
function $onClick($scope, { 2: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
};
}
(_._resume("b1", $onClick2), _._resume("b0", $onClick), init());

View File

@ -2,12 +2,12 @@ export const $template = `${_myButton_template}${_myButton_template}`;
export const $walks = /* beginChild, _myButton_walks, endChild, beginChild, _myButton_walks, endChild */`/${_myButton_walks}&/${_myButton_walks}&`;
import { $setup as _myButton, $value2 as _myButton_input_value, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks, $text as _myButton_input_value_text } from "./tags/my-button.marko";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount = /* @__PURE__ */_._let("clickCount/2", ($scope, clickCount) => {
const $clickCount = /* @__PURE__ */_._let("clickCount/2", $scope => {
_myButton_input_value($scope["#childScope/0"], {
text: clickCount
text: $scope.clickCount
});
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
_myButton_input_value_text($scope["#childScope/1"], clickCount);
_myButton_input_value_text($scope["#childScope/1"], $scope.clickCount);
_myButton_input_onClick($scope["#childScope/1"], $onClick2($scope));
});
export function $setup($scope) {
@ -15,18 +15,14 @@ export function $setup($scope) {
_myButton($scope["#childScope/1"]);
$clickCount($scope, 0);
}
function $onClick2($scope, {
clickCount
} = $scope) {
function $onClick2($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick2", $onClick2);

View File

@ -2,19 +2,17 @@ export const $template = "<button><!> <!></button>";
export const $walks = /* get, next(1), replace, over(2), replace, out(1) */" D%c%l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
export const $text = /* @__PURE__ */_._const("text", ($scope, text) => {
_._text($scope["#text/1"], text);
$textAlias($scope, text);
export const $text = /* @__PURE__ */_._const("text", $scope => {
_._text($scope["#text/1"], $scope.text);
$textAlias($scope, $scope.text);
});
const $textAlias = ($scope, textAlias) => {
_._text($scope["#text/2"], textAlias);
const $textAlias = $scope => {
_._text($scope["#text/2"], $scope.text);
};
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$onClick($scope, input.onClick);
$text($scope, input.text);
export const $input = /* @__PURE__ */_._const("input", $scope => {
$onClick($scope, $scope.input.onClick);
$text($scope, $scope.input.text);
});
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,20 +1,20 @@
// size: 262 (min) 175 (brotli)
const $onClick__script = _._script("a0", ($scope, { 5: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 252 (min) 178 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[5]),
),
$onClick$1 = _._const(5, $onClick__script),
$text = _._const(6, ($scope, text) => {
(_._text($scope[1], text), $textAlias($scope, text));
$text = _._const(6, ($scope) => {
(_._text($scope[1], $scope[6]), $textAlias($scope, $scope[6]));
}),
$textAlias = ($scope, textAlias) => {
_._text($scope[2], textAlias);
$textAlias = ($scope) => {
_._text($scope[2], $scope[6]);
},
$clickCount = _._let(1, ($scope, clickCount) => {
($text($scope[0], clickCount), $onClick$1($scope[0], $onClick($scope)));
$clickCount = _._let(1, ($scope) => {
($text($scope[0], $scope[1]), $onClick$1($scope[0], $onClick($scope)));
});
function $onClick($scope, { 1: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[1] + 1);
};
}
(_._resume("b0", $onClick), init());

View File

@ -2,19 +2,17 @@ export const $template = _myButton_template;
export const $walks = /* beginChild, _myButton_walks, endChild */`/${_myButton_walks}&`;
import { $setup as _myButton, $text as _myButton_input_text, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks } from "./tags/my-button.marko";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount = /* @__PURE__ */_._let("clickCount/1", ($scope, clickCount) => {
_myButton_input_text($scope["#childScope/0"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/1", $scope => {
_myButton_input_text($scope["#childScope/0"], $scope.clickCount);
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
});
export function $setup($scope) {
_myButton($scope["#childScope/0"]);
$clickCount($scope, 0);
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick", $onClick);

View File

@ -2,13 +2,11 @@ export const $template = "<button> </button>";
export const $walks = /* get, next(1), get, out(1) */" D l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
export const $text = /* @__PURE__ */_._const("text", ($scope, text) => _._text($scope["#text/1"], text));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$onClick($scope, input.onClick);
$text($scope, input.text);
export const $text = /* @__PURE__ */_._const("text", $scope => _._text($scope["#text/1"], $scope.text));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$onClick($scope, $scope.input.onClick);
$text($scope, $scope.input.text);
});
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,15 +1,15 @@
// size: 226 (min) 161 (brotli)
const $onClick__script = _._script("a0", ($scope, { 4: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 214 (min) 160 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[4]),
),
$onClick$1 = _._const(4, $onClick__script),
$text = _._const(5, ($scope, text) => _._text($scope[1], text)),
$clickCount = _._let(1, ($scope, clickCount) => {
($text($scope[0], clickCount), $onClick$1($scope[0], $onClick($scope)));
$text = _._const(5, ($scope) => _._text($scope[1], $scope[5])),
$clickCount = _._let(1, ($scope) => {
($text($scope[0], $scope[1]), $onClick$1($scope[0], $onClick($scope)));
});
function $onClick($scope, { 1: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[1] + 1);
};
}
(_._resume("b0", $onClick), init());

View File

@ -2,19 +2,17 @@ export const $template = _myButton_template;
export const $walks = /* beginChild, _myButton_walks, endChild */`/${_myButton_walks}&`;
import { $setup as _myButton, $text as _myButton_input_text, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks } from "./tags/my-button.marko";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount = /* @__PURE__ */_._let("clickCount/1", ($scope, clickCount) => {
_myButton_input_text($scope["#childScope/0"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/1", $scope => {
_myButton_input_text($scope["#childScope/0"], $scope.clickCount);
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
});
export function $setup($scope) {
_myButton($scope["#childScope/0"]);
$clickCount($scope, 0);
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick", $onClick);

View File

@ -2,14 +2,12 @@ export const $template = "<button><!></button>";
export const $walks = /* get, next(1), replace, out(1) */" D%l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", ($scope, {
onClick
}) => _._on($scope["#button/0"], "click", onClick));
const $onClick__script = _._script("__tests__/tags/my-button.marko_0_onClick", $scope => _._on($scope["#button/0"], "click", $scope.onClick));
export const $onClick = /* @__PURE__ */_._const("onClick", $onClick__script);
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
export const $content = /* @__PURE__ */_._const("content", $dynamicTag);
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$onClick($scope, input.onClick);
$content($scope, input.content);
export const $content = /* @__PURE__ */_._const("content", $scope => $dynamicTag($scope, $scope.content));
export const $input = /* @__PURE__ */_._const("input", $scope => {
$onClick($scope, $scope.input.onClick);
$content($scope, $scope.input.content);
});
export default /* @__PURE__ */_._template("__tests__/tags/my-button.marko", $template, $walks, $setup, $input);

View File

@ -1,18 +1,18 @@
// size: 243 (min) 159 (brotli)
const $onClick__script = _._script("a0", ($scope, { 4: onClick }) =>
_._on($scope[0], "click", onClick),
// size: 230 (min) 158 (brotli)
const $onClick__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", $scope[4]),
),
$onClick$1 = _._const(4, $onClick__script),
$mybutton_content__clickCount = _._closure_get(1, ($scope, clickCount) =>
_._text($scope[0], clickCount),
$mybutton_content__clickCount = _._closure_get(1, ($scope) =>
_._text($scope[0], $scope._[1]),
),
$clickCount__closure = _._closure($mybutton_content__clickCount),
$clickCount = _._let(1, ($scope, clickCount) => {
$clickCount = _._let(1, ($scope) => {
($onClick$1($scope[0], $onClick($scope)), $clickCount__closure($scope));
});
function $onClick($scope, { 1: clickCount } = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[1] + 1);
};
}
(_._resume("b0", $onClick), init());

View File

@ -2,11 +2,11 @@ export const $template = _myButton_template;
export const $walks = /* beginChild, _myButton_walks, endChild */`/${_myButton_walks}&`;
import * as _ from "@marko/runtime-tags/debug/dom";
import { $setup as _myButton, $content as _myButton_input_content, $onClick as _myButton_input_onClick, $template as _myButton_template, $walks as _myButton_walks } from "./tags/my-button.marko";
const $mybutton_content__clickCount = /* @__PURE__ */_._closure_get("clickCount", ($scope, clickCount) => _._text($scope["#text/0"], clickCount));
const $mybutton_content__clickCount = /* @__PURE__ */_._closure_get("clickCount", $scope => _._text($scope["#text/0"], $scope._.clickCount));
const $mybutton_content__setup = $mybutton_content__clickCount;
const $mybutton_content = /* @__PURE__ */_._content("__tests__/template.marko_1_content", " ", /* get, over(1) */" b", $mybutton_content__setup);
const $clickCount__closure = /* @__PURE__ */_._closure($mybutton_content__clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/1", ($scope, clickCount) => {
const $clickCount = /* @__PURE__ */_._let("clickCount/1", $scope => {
_myButton_input_onClick($scope["#childScope/0"], $onClick($scope));
$clickCount__closure($scope);
});
@ -15,11 +15,9 @@ export function $setup($scope) {
_myButton_input_content($scope["#childScope/0"], $mybutton_content($scope));
$clickCount($scope, 0);
}
function $onClick($scope, {
clickCount
} = $scope) {
function $onClick($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/onClick", $onClick);

View File

@ -1,13 +1,11 @@
export const $template = "<button> </button>";
export const $walks = /* get, next(1), get, out(1) */" D l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount__script = _._script("__tests__/tags/counter.marko_0_clickCount", ($scope, {
clickCount
}) => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, ++clickCount);
const $clickCount__script = _._script("__tests__/tags/counter.marko_0_clickCount", $scope => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, $scope.clickCount + 1);
}));
const $clickCount = /* @__PURE__ */_._let("clickCount/2", ($scope, clickCount) => {
_._text($scope["#text/1"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/2", $scope => {
_._text($scope["#text/1"], $scope.clickCount);
$clickCount__script($scope);
});
export function $setup($scope) {

View File

@ -1,10 +1,10 @@
// size: 122 (min) 107 (brotli)
const $clickCount__script = _._script("a0", ($scope, { 2: clickCount }) =>
// size: 116 (min) 104 (brotli)
const $clickCount__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
}),
),
$clickCount = _._let(2, ($scope, clickCount) => {
(_._text($scope[1], clickCount), $clickCount__script($scope));
$clickCount = _._let(2, ($scope) => {
(_._text($scope[1], $scope[2]), $clickCount__script($scope));
});
init();

View File

@ -1,6 +1,6 @@
// size: 326 (min) 192 (brotli)
const $if_content__count = _._if_closure(4, 2, 0, ($scope, count) =>
_._text($scope[0], count),
// size: 312 (min) 195 (brotli)
const $if_content__count = _._if_closure(2, 0, ($scope) =>
_._text($scope[0], $scope._[4]),
),
$if_content__setup = $if_content__count,
$if_content = _._content_branch(
@ -9,17 +9,17 @@ const $if_content__count = _._if_closure(4, 2, 0, ($scope, count) =>
$if_content__setup,
),
$if = _._if(2, $if_content),
$show__script = _._script("a0", ($scope, { 3: show }) =>
$show__script = _._script("a0", ($scope) =>
_._on($scope[1], "click", function () {
$show($scope, (show = !show));
$show($scope, !$scope[3]);
}),
),
$show = _._let(3, ($scope, show) => {
($if($scope, show ? 0 : 1), $show__script($scope));
$show = _._let(3, ($scope) => {
($if($scope, $scope[3] ? 0 : 1), $show__script($scope));
}),
$count__script = _._script("a1", ($scope, { 4: count }) =>
$count__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$count($scope, ++count);
$count($scope, $scope[4] + 1);
}),
),
$count = _._let(4, ($scope) => {

View File

@ -1,23 +1,19 @@
export const $template = "<button class=inc></button><button class=toggle></button><!><!>";
export const $walks = /* get, over(1), get, over(1), replace, over(2) */" b b%c";
import * as _ from "@marko/runtime-tags/debug/dom";
const $if_content__count = /* @__PURE__ */_._if_closure("count", "#text/2", 0, ($scope, count) => _._text($scope["#text/0"], count));
const $if_content__count = /* @__PURE__ */_._if_closure("#text/2", 0, $scope => _._text($scope["#text/0"], $scope._.count));
const $if_content__setup = $if_content__count;
const $if_content = /* @__PURE__ */_._content_branch("The count is <!>", /* over(1), replace, over(1) */"b%b", $if_content__setup);
const $if = /* @__PURE__ */_._if("#text/2", $if_content);
const $show__script = _._script("__tests__/template.marko_0_show", ($scope, {
show
}) => _._on($scope["#button/1"], "click", function () {
$show($scope, show = !show);
const $show__script = _._script("__tests__/template.marko_0_show", $scope => _._on($scope["#button/1"], "click", function () {
$show($scope, !$scope.show);
}));
const $show = /* @__PURE__ */_._let("show/3", ($scope, show) => {
$if($scope, show ? 0 : 1);
const $show = /* @__PURE__ */_._let("show/3", $scope => {
$if($scope, $scope.show ? 0 : 1);
$show__script($scope);
});
const $count__script = _._script("__tests__/template.marko_0_count", ($scope, {
count
}) => _._on($scope["#button/0"], "click", function () {
$count($scope, ++count);
const $count__script = _._script("__tests__/template.marko_0_count", $scope => _._on($scope["#button/0"], "click", function () {
$count($scope, $scope.count + 1);
}));
const $count = /* @__PURE__ */_._let("count/4", $scope => {
$if_content__count($scope);

View File

@ -1,21 +1,21 @@
// size: 324 (min) 189 (brotli)
const $if_content__count = _._if_closure(4, 2, 0, ($scope, count) =>
_._text($scope[0], count),
// size: 310 (min) 195 (brotli)
const $if_content__count = _._if_closure(2, 0, ($scope) =>
_._text($scope[0], $scope._[4]),
),
$if_content__setup = $if_content__count,
$if_content = _._content_branch("<span> </span>", "D l", $if_content__setup),
$if = _._if(2, $if_content),
$show__script = _._script("a0", ($scope, { 3: show }) =>
$show__script = _._script("a0", ($scope) =>
_._on($scope[1], "click", function () {
$show($scope, (show = !show));
$show($scope, !$scope[3]);
}),
),
$show = _._let(3, ($scope, show) => {
($if($scope, show ? 0 : 1), $show__script($scope));
$show = _._let(3, ($scope) => {
($if($scope, $scope[3] ? 0 : 1), $show__script($scope));
}),
$count__script = _._script("a1", ($scope, { 4: count }) =>
$count__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$count($scope, ++count);
$count($scope, $scope[4] + 1);
}),
),
$count = _._let(4, ($scope) => {

View File

@ -1,23 +1,19 @@
export const $template = "<button class=inc></button><button class=toggle></button><!><!>";
export const $walks = /* get, over(1), get, over(1), replace, over(2) */" b b%c";
import * as _ from "@marko/runtime-tags/debug/dom";
const $if_content__count = /* @__PURE__ */_._if_closure("count", "#text/2", 0, ($scope, count) => _._text($scope["#text/0"], count));
const $if_content__count = /* @__PURE__ */_._if_closure("#text/2", 0, $scope => _._text($scope["#text/0"], $scope._.count));
const $if_content__setup = $if_content__count;
const $if_content = /* @__PURE__ */_._content_branch("<span> </span>", /* next(1), get, out(1) */"D l", $if_content__setup);
const $if = /* @__PURE__ */_._if("#text/2", $if_content);
const $show__script = _._script("__tests__/template.marko_0_show", ($scope, {
show
}) => _._on($scope["#button/1"], "click", function () {
$show($scope, show = !show);
const $show__script = _._script("__tests__/template.marko_0_show", $scope => _._on($scope["#button/1"], "click", function () {
$show($scope, !$scope.show);
}));
const $show = /* @__PURE__ */_._let("show/3", ($scope, show) => {
$if($scope, show ? 0 : 1);
const $show = /* @__PURE__ */_._let("show/3", $scope => {
$if($scope, $scope.show ? 0 : 1);
$show__script($scope);
});
const $count__script = _._script("__tests__/template.marko_0_count", ($scope, {
count
}) => _._on($scope["#button/0"], "click", function () {
$count($scope, ++count);
const $count__script = _._script("__tests__/template.marko_0_count", $scope => _._on($scope["#button/0"], "click", function () {
$count($scope, $scope.count + 1);
}));
const $count = /* @__PURE__ */_._let("count/4", $scope => {
$if_content__count($scope);

View File

@ -1,17 +1,9 @@
export const $template = "<!><!><!>";
export const $walks = /* over(1), replace, over(2) */"b%c";
import * as _ from "@marko/runtime-tags/debug/dom";
const $if_content__a__OR__b = /* @__PURE__ */_._or(1, $scope => {
let {
_: {
a,
b
}
} = $scope;
_._text($scope["#text/0"], a + b);
});
const $if_content__a = /* @__PURE__ */_._if_closure("a", "#text/0", 0, $if_content__a__OR__b);
const $if_content__b = /* @__PURE__ */_._if_closure("b", "#text/0", 0, $if_content__a__OR__b);
const $if_content__a__OR__b = /* @__PURE__ */_._or(1, $scope => _._text($scope["#text/0"], $scope._.a + $scope._.b));
const $if_content__a = /* @__PURE__ */_._if_closure("#text/0", 0, $if_content__a__OR__b);
const $if_content__b = /* @__PURE__ */_._if_closure("#text/0", 0, $if_content__a__OR__b);
const $if_content__setup = $scope => {
$if_content__a._($scope);
$if_content__b._($scope);

View File

@ -1,14 +1,14 @@
// size: 192 (min) 146 (brotli)
const $increment2__script = _._script("a1", ($scope, { 3: increment }) =>
_._on($scope[0], "click", increment),
// size: 181 (min) 152 (brotli)
const $increment2__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", $scope[3]),
),
$increment2 = _._const(3, $increment2__script),
$clickCount = _._let(2, ($scope, clickCount) => {
(_._text($scope[1], clickCount), $increment2($scope, $increment($scope)));
$clickCount = _._let(2, ($scope) => {
(_._text($scope[1], $scope[2]), $increment2($scope, $increment($scope)));
});
function $increment($scope, { 2: clickCount } = $scope) {
function $increment($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
};
}
(_._resume("a0", $increment), init());

View File

@ -1,22 +1,18 @@
export const $template = "<button> </button>";
export const $walks = /* get, next(1), get, out(1) */" D l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $increment2__script = _._script("__tests__/template.marko_0_increment", ($scope, {
increment
}) => _._on($scope["#button/0"], "click", increment));
const $increment2__script = _._script("__tests__/template.marko_0_increment", $scope => _._on($scope["#button/0"], "click", $scope.increment));
const $increment2 = /* @__PURE__ */_._const("increment", $increment2__script);
const $clickCount = /* @__PURE__ */_._let("clickCount/2", ($scope, clickCount) => {
_._text($scope["#text/1"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/2", $scope => {
_._text($scope["#text/1"], $scope.clickCount);
$increment2($scope, $increment($scope));
});
export function $setup($scope) {
$clickCount($scope, 0);
}
function $increment($scope, {
clickCount
} = $scope) {
function $increment($scope) {
return function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope.clickCount + 1);
};
}
_._resume("__tests__/template.marko_0/increment", $increment);

View File

@ -1,26 +1,23 @@
// size: 301 (min) 171 (brotli)
const $multipliedCount = _._const(7, ($scope, multipliedCount) =>
_._text($scope[3], multipliedCount),
// size: 278 (min) 159 (brotli)
const $multipliedCount = _._const(7, ($scope) => _._text($scope[3], $scope[7])),
$count__OR__multiplier = _._or(6, ($scope) =>
$multipliedCount($scope, $scope[4] * $scope[5]),
),
$count__OR__multiplier = _._or(6, ($scope) => {
let { 4: count, 5: multiplier } = $scope;
$multipliedCount($scope, count * multiplier);
}),
$count__script = _._script("a0", ($scope, { 4: count }) =>
$count__script = _._script("a0", ($scope) =>
_._on($scope[2], "click", function () {
$count($scope, ++count);
$count($scope, $scope[4] + 1);
}),
),
$count = _._let(4, ($scope) => {
($count__OR__multiplier($scope), $count__script($scope));
}),
$multiplier__script = _._script("a1", ($scope, { 5: multiplier }) =>
$multiplier__script = _._script("a1", ($scope) =>
_._on($scope[0], "click", function () {
$multiplier($scope, ++multiplier);
$multiplier($scope, $scope[5] + 1);
}),
),
$multiplier = _._let(5, ($scope, multiplier) => {
(_._text($scope[1], multiplier),
$multiplier = _._let(5, ($scope) => {
(_._text($scope[1], $scope[5]),
$count__OR__multiplier($scope),
$multiplier__script($scope));
});

View File

@ -1,30 +1,20 @@
export const $template = "<button id=multiplier>increase multiplier (<!>)</button><button id=count>increase count</button><div> </div>";
export const $walks = /* get, next(1), over(1), replace, out(1), get, over(1), next(1), get, out(1) */" Db%l bD l";
import * as _ from "@marko/runtime-tags/debug/dom";
const $multipliedCount = /* @__PURE__ */_._const("multipliedCount", ($scope, multipliedCount) => _._text($scope["#text/3"], multipliedCount));
const $count__OR__multiplier = /* @__PURE__ */_._or(6, $scope => {
let {
count,
multiplier
} = $scope;
$multipliedCount($scope, count * multiplier);
});
const $count__script = _._script("__tests__/template.marko_0_count", ($scope, {
count
}) => _._on($scope["#button/2"], "click", function () {
$count($scope, ++count);
const $multipliedCount = /* @__PURE__ */_._const("multipliedCount", $scope => _._text($scope["#text/3"], $scope.multipliedCount));
const $count__OR__multiplier = /* @__PURE__ */_._or(6, $scope => $multipliedCount($scope, $scope.count * $scope.multiplier));
const $count__script = _._script("__tests__/template.marko_0_count", $scope => _._on($scope["#button/2"], "click", function () {
$count($scope, $scope.count + 1);
}));
const $count = /* @__PURE__ */_._let("count/4", $scope => {
$count__OR__multiplier($scope);
$count__script($scope);
});
const $multiplier__script = _._script("__tests__/template.marko_0_multiplier", ($scope, {
multiplier
}) => _._on($scope["#button/0"], "click", function () {
$multiplier($scope, ++multiplier);
const $multiplier__script = _._script("__tests__/template.marko_0_multiplier", $scope => _._on($scope["#button/0"], "click", function () {
$multiplier($scope, $scope.multiplier + 1);
}));
const $multiplier = /* @__PURE__ */_._let("multiplier/5", ($scope, multiplier) => {
_._text($scope["#text/1"], multiplier);
const $multiplier = /* @__PURE__ */_._let("multiplier/5", $scope => {
_._text($scope["#text/1"], $scope.multiplier);
$count__OR__multiplier($scope);
$multiplier__script($scope);
});

View File

@ -1,10 +1,10 @@
// size: 122 (min) 107 (brotli)
const $clickCount__script = _._script("a0", ($scope, { 2: clickCount }) =>
// size: 116 (min) 104 (brotli)
const $clickCount__script = _._script("a0", ($scope) =>
_._on($scope[0], "click", function () {
$clickCount($scope, ++clickCount);
$clickCount($scope, $scope[2] + 1);
}),
),
$clickCount = _._let(2, ($scope, clickCount) => {
(_._text($scope[1], clickCount), $clickCount__script($scope));
$clickCount = _._let(2, ($scope) => {
(_._text($scope[1], $scope[2]), $clickCount__script($scope));
});
init();

View File

@ -1,13 +1,11 @@
export const $template = "<div><button> </button></div>";
export const $walks = /* next(1), get, next(1), get, out(2) */"D D m";
import * as _ from "@marko/runtime-tags/debug/dom";
const $clickCount__script = _._script("__tests__/template.marko_0_clickCount", ($scope, {
clickCount
}) => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, ++clickCount);
const $clickCount__script = _._script("__tests__/template.marko_0_clickCount", $scope => _._on($scope["#button/0"], "click", function () {
$clickCount($scope, $scope.clickCount + 1);
}));
const $clickCount = /* @__PURE__ */_._let("clickCount/2", ($scope, clickCount) => {
_._text($scope["#text/1"], clickCount);
const $clickCount = /* @__PURE__ */_._let("clickCount/2", $scope => {
_._text($scope["#text/1"], $scope.clickCount);
$clickCount__script($scope);
});
export function $setup($scope) {

View File

@ -4,8 +4,8 @@ export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
const $tagName_content = _._content_resume("__tests__/template.marko_1_content", "Hello World", /* over(1) */"b");
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/0", $tagName_content);
export const $tagName = /* @__PURE__ */_._const("tagName", ($scope, tagName) => $dynamicTag($scope, tagName, () => ({
export const $tagName = /* @__PURE__ */_._const("tagName", $scope => $dynamicTag($scope, $scope.tagName, () => ({
class: ["a", "b"]
})));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => $tagName($scope, input.tagName));
export const $input = /* @__PURE__ */_._const("input", $scope => $tagName($scope, $scope.input.tagName));
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);

Some files were not shown because too many files have changed in this diff Show More