chore: text fixture supports async flushes, cleanup extraneous snapshot files

This commit is contained in:
Ryan Turnquist 2025-11-19 12:27:07 -08:00 committed by Dylan Piercey
parent e721a9ded5
commit a414d6b67a
67 changed files with 1714 additions and 716 deletions

View File

@ -1,14 +0,0 @@
// size: 164 (min) 130 (brotli)
const $if_content__setup = _._script("a0", ($scope) =>
_._on($scope[0], "click", function () {
$hide($scope._, !0);
}),
),
$if_content = _._content_branch(
"<button></button>",
" b",
$if_content__setup,
),
$if = _._if(0, $if_content),
$hide = _._let(1, ($scope, hide) => $if($scope, hide ? 1 : 0));
init();

View File

@ -69,10 +69,3 @@
</body>
</html>
```
# Mutations
```
INSERT html/body/div/div/#text
INSERT html/body/div/#text
INSERT html/body/div/div/div/#text
```

View File

@ -1,4 +1,40 @@
# Render End
# Render ASYNC
```html
<div
data-level="4"
>
<div
data-level="3"
>
LOADING...
</div>
</div>
```
# Render ASYNC
```html
<div
data-level="4"
>
<div
data-level="3"
>
<div
data-level="2"
>
<div
data-level="1"
>
LOADING...
</div>
</div>
</div>
</div>
```
# Render ASYNC
```html
<div
data-level="4"

View File

@ -13,7 +13,172 @@
<t M_=e></t><script>M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<div
data-level="4"
>
<!--M_[-->
<div
data-level="3"
>
<!--M_[-->
<!--M_!^b-->
LOADING...
<!--M_!b-->
<!--M_]7 #text/1 8-->
</div>
<!--M_]3 #text/1 4-->
</div>
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 3, _.a = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.c), _.b), _ =&gt; (_.e = [3, _.d = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.f = {}
}], _.d["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.f), _.e)];
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/div
INSERT html/body/div/div/#comment0
INSERT html/body/div/div/#comment1
INSERT html/body/div/div/#text
INSERT html/body/div/div/#comment2
INSERT html/body/div/div/#comment3
INSERT html/body/div/#comment1
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#comment
REMOVE html/head/style after html/body/div
INSERT html/head/style
REMOVE t after html/body/div
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<div
data-level="4"
>
<!--M_[-->
<div
data-level="3"
>
<!--M_[-->
<div
data-level="2"
>
<!--M_[-->
<div
data-level="1"
>
<!--M_[-->
<!--M_!^d-->
LOADING...
<!--M_!d-->
<!--M_]16 #text/1 17-->
</div>
<!--M_]12 #text/1 13-->
</div>
<!--M_]7 #text/1 8-->
</div>
<!--M_]3 #text/1 4-->
</div>
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 3, _.a = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.c), _.b), _ =&gt; (_.e = [3, _.d = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.f = {}
}], _.d["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.f), _.e)];
REORDER_RUNTIME(M._);
M._.w()
</script>
<script>
M._.r.push(_ =&gt; (_.h = [4, _.g = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.i = {}
}], _.g["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.i), _.h), _ =&gt; (_.k = [3, _.j = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.l = {}
}], _.j["#PlaceholderContent"] = _._[
"__tests__/tags/recurse.marko_4_content"
](_.l), _.k));
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT t
INSERT html/body/div/div/div
INSERT html/body/div/div/div/#comment0
INSERT html/body/div/div/div/div
INSERT html/body/div/div/div/div/#comment0
INSERT html/body/div/div/div/div/#comment1
INSERT html/body/div/div/div/div/#text
INSERT html/body/div/div/div/div/#comment2
INSERT html/body/div/div/div/div/#comment3
INSERT html/body/div/div/div/#comment1
INSERT t
INSERT t/#comment
REMOVE t after html/body/script0
REMOVE #text after #comment
REMOVE #comment after html/body/div/div/#comment0
REMOVE #comment after html/body/div/div/#comment0
INSERT html/body/div/div/div
REMOVE t after html/body/script0
INSERT html/body/script1
```
# Render ASYNC
```html
<html>
<head>
@ -87,52 +252,10 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/div
INSERT html/body/div/div/#comment0
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/div/div/#comment1
INSERT html/body/div/#comment1
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT #comment
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/div
INSERT html/head/style
REMOVE t after html/body/div
INSERT t
INSERT html/body/div/div/div
INSERT html/body/div/div/div/#comment0
INSERT html/body/div/div/div/div
INSERT html/body/div/div/div/div/#comment0
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/div/div/div/div/#comment1
INSERT html/body/div/div/div/#comment1
INSERT t
INSERT #comment
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/script0
REMOVE #text after #comment
REMOVE #comment after html/body/div/div/#comment0
REMOVE #comment after html/body/div/div/#comment0
INSERT html/body/div/div/div
REMOVE t after html/body/script0
INSERT t
INSERT html/body/script2
INSERT html/body/script2/#text
REMOVE t after html/body/script1
REMOVE #text after #comment
REMOVE #comment after html/body/div/div/div/div/#comment0
REMOVE #comment after html/body/div/div/div/div/#comment0
INSERT html/body/script2
```

View File

@ -84,14 +84,6 @@
</html>
```
# Mutations
```
INSERT html/body/p0/#text4
INSERT html/body/p1/#text4
INSERT html/body/p2/#text4
INSERT html/body/p3/#text4
INSERT html/body/p4/#text4
```
# Render
```js

View File

@ -1,4 +1,15 @@
# Render End
# Render ASYNC
```html
<button>
increment
</button>
<p>
1 * 2 =
</p>
```
# Render ASYNC
```html
<button>
increment

View File

@ -8,7 +8,51 @@
<!--M_[-->2<!--M_*2 #text/0--><!--M_]1 #text/2 2--></p><p>2 * <!>2<!--M_*1 #text/3--> = <!--M_[-->4<!--M_*3 #text/0--><!--M_]1 #text/4 3--></p><p>3 * <!>2<!--M_*1 #text/5--> = <!--M_[-->6<!--M_*4 #text/0--><!--M_]1 #text/6 4--></p><p>4 * <!>2<!--M_*1 #text/7--> = <!--M_[-->8<!--M_*5 #text/0--><!--M_]1 #text/8 5--></p><p>5 * <!>2<!--M_*1 #text/9--> = <!--M_[-->10<!--M_*6 #text/0--><!--M_]1 #text/10 6--></p><script>M._.r.push(_=>(_.b=[{}]),_=>(_.c=[{}]),_=>(_.d=[{}]),_=>(_.e=[{}]),_=>(_.f=[{}]),"__tests__/template.marko_0_n",1);M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
<button>
increment
</button>
<!--M_*1 #button/0-->
<p>
1 *
<!---->
2
<!--M_*1 #text/1-->
=
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.a = [0,
{
n: 2
}])]
</script>
</p>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment
INSERT html/body/p
INSERT html/body/p/#text0
INSERT html/body/p/#comment0
INSERT html/body/p/#text1
INSERT html/body/p/#comment1
INSERT html/body/p/#text2
INSERT html/body/p/script
```
# Render ASYNC
```html
<html>
<head />
@ -96,20 +140,6 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment
INSERT html/body/p0
INSERT html/body/p0/#text0
INSERT html/body/p0/#comment0
INSERT html/body/p0/#text1
INSERT html/body/p0/#comment1
INSERT html/body/p0/#text2
INSERT html/body/p0/script
INSERT html/body/p0/script/#text
INSERT html/body/p0/#comment2
INSERT html/body/p0/#text3
INSERT html/body/p0/#comment3
@ -155,5 +185,4 @@ INSERT html/body/p4/#text3
INSERT html/body/p4/#comment3
INSERT html/body/p4/#comment4
INSERT html/body/script
INSERT html/body/script/#text
```

View File

@ -1,4 +1,22 @@
# Render End
# Render ASYNC
```html
a
```
# Render ASYNC
```html
ab
```
# Render ASYNC
```html
abc
```
# Render ASYNC
```html
abcdefghijklm
```

View File

@ -18,7 +18,55 @@
defghijklm
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
```
# Render ASYNC
```html
<html>
<head />
<body>
ab
</body>
</html>
```
# Mutations
```
INSERT html/body/#text1
```
# Render ASYNC
```html
<html>
<head />
<body>
abc
</body>
</html>
```
# Mutations
```
INSERT html/body/#text2
```
# Render ASYNC
```html
<html>
<head />
@ -30,8 +78,5 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
INSERT html/body/#text3
```

View File

@ -1,8 +1,16 @@
# Render
```html
<!--M_!^b-->
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.d = [0, 1, _.a = {
@ -20,14 +28,6 @@
"__tests__/template.marko_8_content"
](_.e), _.d)]
</script>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<script>
REORDER_RUNTIME(M._);
M._.w()
@ -64,24 +64,23 @@
</html>
```
# Mutations
```
REMOVE html/body/#comment0 before #comment
INSERT html/body/#comment0
INSERT html/body/#text0
INSERT html/body/#text2
INSERT html/body/#text3
INSERT html/body/#text4
```
# Render
```js
container.querySelector("button").click();
```
```html
<!--M_!^b-->
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.d = [0, 1, _.a = {
@ -99,14 +98,6 @@ container.querySelector("button").click();
"__tests__/template.marko_8_content"
](_.e), _.d)]
</script>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<script>
REORDER_RUNTIME(M._);
M._.w()

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
# Render ASYNC
# Render ASYNC
```html
<div>
Resolved A: A Value

View File

@ -13,12 +13,13 @@
<div>Resolved A: A Value</div><!--M_!b--><!--M_]1 #text/0 2--><!--M_[--><!--M_!^c--><!--M_!c--><!--M_]1 #text/1 3--><!--M_[--><!--M_!^d--><!--M_[--><div>Resolved C: C Value</div><button>Before</button><!--M_*7 #button/1--><!--M_]4 #text/0 7--><!--M_!d--><!--M_]1 #text/2 4--><script>M._.r.push(_=>(_.f=[2,{}]),"__tests__/template.marko_9",7);M._.w()</script>
```
# Render End
# Render ASYNC
```html
<!--M_[-->
<!--M_!^b-->
<html>
<head>
<head />
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.d = [0, 1, _.a = {
@ -36,6 +37,24 @@
"__tests__/template.marko_8_content"
](_.e), _.d)]
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
@ -43,6 +62,75 @@
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.d = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.e = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}, _.c = {
"#BranchAccessor": "#text/2"
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.e), _.b["#CatchContent"] = _._[
"__tests__/template.marko_5_content"
](_.e), _.c["#CatchContent"] = _._[
"__tests__/template.marko_8_content"
](_.e), _.d)]
</script>
<script>
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#text
REMOVE html/head/style after html/body/script0
INSERT html/head/style
REMOVE t after html/body/script0
INSERT html/body/script1
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.d = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.e = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}, _.c = {
"#BranchAccessor": "#text/2"
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.e), _.b["#CatchContent"] = _._[
"__tests__/template.marko_5_content"
](_.e), _.c["#CatchContent"] = _._[
"__tests__/template.marko_8_content"
](_.e), _.d)]
</script>
<script>
REORDER_RUNTIME(M._);
M._.w()
@ -81,44 +169,27 @@
# Mutations
```
INSERT #comment0
INSERT #comment1
INSERT html
INSERT html/head
INSERT html/head/script
INSERT html/head/script/#text
INSERT html/head/style
INSERT html/head/style/#text
INSERT html/body
INSERT t
INSERT html/body/#text
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/head/script
INSERT html/head/style
REMOVE t before html/body/script0
INSERT html/body/div0
INSERT html/body/div0/#text
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#comment2
INSERT #comment
INSERT #comment
INSERT html/body/#comment3
INSERT html/body/#comment4
INSERT #comment
INSERT #comment
INSERT html/body/#comment5
INSERT html/body/#comment6
INSERT html/body/#comment7
INSERT html/body/#comment8
INSERT html/body/div1
INSERT html/body/div1/#text
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment7
INSERT html/body/#comment8
INSERT html/body/#comment9
INSERT html/body/#comment10
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE #comment after html/body/#comment2
REMOVE #comment after html/body/#comment2
INSERT html/body/#comment11
INSERT html/body/#comment12
REMOVE #comment after html/body/#comment4
REMOVE #comment after html/body/#comment4
INSERT html/body/#text
INSERT html/body/script2
```

View File

@ -1,8 +1,16 @@
# Render
```html
<!--M_!^b-->
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
@ -16,14 +24,6 @@
"__tests__/template.marko_5_content"
](_.d), _.c)]
</script>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<script>
REORDER_RUNTIME(M._);
M._.w()
@ -42,11 +42,3 @@
</body>
</html>
```
# Mutations
```
REMOVE html/body/#comment0 before #comment
INSERT html/body/#comment0
INSERT html/body/#text0
INSERT html/body/#text2
```

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
# Render ASYNC
# Render ASYNC
```html
<div>
Resolved A: A Value

View File

@ -13,12 +13,13 @@
<div>Resolved A: A Value</div><!--M_!b--><!--M_]1 #text/0 2--><!--M_[--><!--M_!^c--><!--M_!c--><!--M_]1 #text/1 3--><script>M._.w()</script>
```
# Render End
# Render ASYNC
```html
<!--M_[-->
<!--M_!^b-->
<html>
<head>
<head />
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
@ -32,6 +33,24 @@
"__tests__/template.marko_5_content"
](_.d), _.c)]
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
@ -39,6 +58,67 @@
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.d = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.d), _.b["#CatchContent"] = _._[
"__tests__/template.marko_5_content"
](_.d), _.c)]
</script>
<script>
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#text
REMOVE html/head/style after html/body/script0
INSERT html/head/style
REMOVE t after html/body/script0
INSERT html/body/script1
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.d = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.d), _.b["#CatchContent"] = _._[
"__tests__/template.marko_5_content"
](_.d), _.c)]
</script>
<script>
REORDER_RUNTIME(M._);
M._.w()
@ -60,33 +140,16 @@
# Mutations
```
INSERT #comment0
INSERT #comment1
INSERT html
INSERT html/head
INSERT html/head/script
INSERT html/head/script/#text
INSERT html/head/style
INSERT html/head/style/#text
INSERT html/body
INSERT t
INSERT html/body/#text
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/head/script
INSERT html/head/style
REMOVE t before html/body/script0
INSERT html/body/div
INSERT html/body/div/#text
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#comment2
INSERT #comment
INSERT #comment
INSERT html/body/#comment3
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE #comment after html/body/#comment2
REMOVE #comment after html/body/#comment2
INSERT html/body/#comment4
INSERT #comment
INSERT #comment
INSERT html/body/#comment5
REMOVE #comment after html/body/#comment4
REMOVE #comment after html/body/#comment4
INSERT html/body/#text
INSERT html/body/script2
```

View File

@ -73,13 +73,3 @@
</body>
</html>
```
# Mutations
```
REMOVE html/body/#comment0 before html
INSERT html/body/#comment0
INSERT html/body/#text
INSERT html/body/div/div/#text
INSERT html/body/div/#text
INSERT html/body/div/div/div/#text
```

View File

@ -1,4 +1,26 @@
# Render End
# Render ASYNC
```html
LOADING A1
```
# Render ASYNC
```html
<div
class="a"
level="1"
>
<div
class="a"
level="2"
>
LOADING B1
</div>
</div>
```
# Render ASYNC
```html
<div
class="a"

View File

@ -13,9 +13,8 @@
<t M_=e><div class=b level=3><!--M_[--><div class=b level=4></div><!--M_]9 #text/1 10--></div></t><script>M._.r.push(_=>(_.k=[2,_.j={"#BranchAccessor":"#text/1","#PlaceholderContent":_.l={}}],_.j["#PlaceholderContent"]=_._["__tests__/template.marko_11_content"](_.l),_.k));M._.w()</script>
```
# Render End
# Render ASYNC
```html
<!--M_[-->
<html>
<head>
<style
@ -25,6 +24,140 @@
</style>
</head>
<body>
<!--M_[-->
<!--M_!^b-->
LOADING A1
<!--M_!b-->
<!--M_]1 #text/0 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_4_content"
](_.c), _.b)];
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text
INSERT html/body/#comment2
INSERT html/body/#comment3
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#comment
REMOVE html/head/style after html/body/#comment3
INSERT html/head/style
REMOVE t after html/body/#comment3
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<div
class="a"
level="1"
>
<!--M_[-->
<div
class="a"
level="2"
>
<!--M_[-->
<!--M_!^d-->
LOADING B1
<!--M_!d-->
<!--M_]6 #text/1 7-->
</div>
<!--M_]4 #text/1 5-->
</div>
<!--M_]1 #text/0 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_4_content"
](_.c), _.b)];
REORDER_RUNTIME(M._);
M._.w()
</script>
<script>
M._.r.push(_ =&gt; (_.e = [2, _.d = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.f = {}
}], _.d["#PlaceholderContent"] = _._[
"__tests__/template.marko_5_content"
](_.f), _.e), _ =&gt; (_.h = [1, _.g = {
"#BranchAccessor": "#text/1",
"#PlaceholderContent": _.i = {}
}], _.g["#PlaceholderContent"] = _._[
"__tests__/template.marko_10_content"
](_.i), _.h));
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT t
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/div
INSERT html/body/div/div/#comment0
INSERT html/body/div/div/#comment1
INSERT html/body/div/div/#text
INSERT html/body/div/div/#comment2
INSERT html/body/div/div/#comment3
INSERT html/body/div/#comment1
INSERT t
INSERT t/#comment
REMOVE t after html/body/script0
REMOVE #text after #comment
REMOVE #comment after html/body/#comment0
REMOVE #comment after html/body/#comment0
INSERT html/body/div
REMOVE t after html/body/script0
INSERT html/body/script1
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<!--M_[-->
<div
class="a"
level="1"
@ -91,53 +224,15 @@
# Mutations
```
INSERT #comment
INSERT #comment
INSERT html
INSERT html/head
INSERT html/body
INSERT #text
INSERT #comment
INSERT html/body/#comment
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT #comment
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/#comment
INSERT html/head/style
REMOVE t after html/body/#comment
INSERT t
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/div
INSERT html/body/div/div/#comment0
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/div/div/#comment1
INSERT html/body/div/#comment1
INSERT t
INSERT #comment
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/script0
REMOVE #text before #comment
REMOVE #comment after #comment
REMOVE #comment before html/body/#comment
INSERT html/body/div
REMOVE t after html/body/script0
INSERT t
INSERT html/body/div/div/div
INSERT html/body/div/div/div/#comment0
INSERT html/body/div/div/div/div
INSERT html/body/div/div/div/#comment1
INSERT html/body/script2
INSERT html/body/script2/#text
REMOVE t after html/body/script1
REMOVE #text after #comment
REMOVE #comment after html/body/div/div/#comment0
REMOVE #comment after html/body/div/div/#comment0
INSERT html/body/div/div/div
INSERT html/body/script2
```

View File

@ -1,4 +1,16 @@
# Render End
# Render ASYNC
```html
a
```
# Render ASYNC
```html
abc
```
# Render ASYNC
```html
abcde
```

View File

@ -13,7 +13,40 @@
de
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
```
# Render ASYNC
```html
<html>
<head />
<body>
abc
</body>
</html>
```
# Mutations
```
INSERT html/body/#text1
```
# Render ASYNC
```html
<html>
<head />
@ -25,8 +58,5 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
INSERT html/body/#text2
```

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
```html
a
```
# Render ASYNC
```html
abcde
```

View File

@ -8,7 +8,25 @@
bcde
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
```
# Render ASYNC
```html
<html>
<head />
@ -20,8 +38,5 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text
INSERT html/body/#text1
```

View File

@ -46,11 +46,6 @@
</html>
```
# Mutations
```
INSERT html/body/#text2
INSERT html/body/#text1
```
# Render
```js

View File

@ -1,4 +1,13 @@
# Render End
# Render ASYNC
```html
<button>
inc
</button>
LOADING...
```
# Render ASYNC
```html
<button>
inc

View File

@ -8,7 +8,72 @@
<t M_=c><!--M_[-->0<!--M_*4 #text/0--><!--M_]2 #text/0 4--></t><script>M._.r.push(_=>(_.e=[1,{}]));M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<button>
inc
</button>
<!--M_*1 #button/0-->
<!--M_[-->
<!--M_!^b-->
LOADING...
<!--M_!b-->
<!--M_]1 #text/1 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, _.a = {
clickCount: 0,
"ClosureScopes:clickCount": _.d = new Set
}, _.b = {
_: _.a,
"ClosureSignalIndex:clickCount": 0,
"#BranchAccessor": "#text/1"
}], _.b["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.a), (_.d).add(_.b), _.c),
"__tests__/template.marko_0_clickCount",
1
];
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#comment2
INSERT html/body/#text
INSERT html/body/#comment3
INSERT html/body/#comment4
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#comment
REMOVE html/head/style after html/body/#comment4
INSERT html/head/style
REMOVE t after html/body/#comment4
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
@ -58,36 +123,15 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/#comment5
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT #comment
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/#comment5
INSERT html/head/style
REMOVE t after html/body/#comment5
INSERT t
INSERT html/body/#comment2
INSERT html/body/#text
INSERT html/body/#comment3
INSERT html/body/#comment4
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/script0
REMOVE #text after #comment
REMOVE #comment after html/body/#comment1
REMOVE #comment after html/body/#comment1
INSERT html/body/#comment2, html/body/#text, html/body/#comment3, html/body/#comment4
INSERT html/body/script1
```

View File

@ -59,12 +59,6 @@
</html>
```
# Mutations
```
INSERT html/body/div/#text2
INSERT html/body/div/#text5
INSERT html/body/div/#text8
```
# Render
```js

View File

@ -1,4 +1,20 @@
# Render End
# Render ASYNC
```html
<div>
Got: a 0
</div>
```
# Render ASYNC
```html
<div>
Got: a 0
</div>
```
# Render ASYNC
```html
<div>
Got: a 0Got: b 0Got: c 0

View File

@ -13,7 +13,92 @@
<!--M_[-->Got: b <!>0<!--M_*4 #text/1--><!--M_]1 #text/1 4--><!--M_[-->Got: c <!>0<!--M_*3 #text/1--><!--M_]1 #text/2 3--><button>Inc</button><!--M_*1 #button/3--></div><script>M._.r.push(_=>(_.h=[_.i={_:_.b,"ClosureSignalIndex:count":1}],_.d.add(_.i),_.h),"__tests__/template.marko_0_count",1);M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
<div>
<!--M_[-->
Got: a
<!---->
0
<!--M_*2 #text/1-->
<!--M_]1 #text/0 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.a = [0,
{
count: 0,
"ClosureScopes:count": new Set
}]), _ =&gt; (_.c = [_.e = {
_: _.b = _.a[1],
"ClosureSignalIndex:count": 0
}], (_.d = _.b["ClosureScopes:count"]).add(_.e), _.c)];
M._.w()
</script>
</div>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/#text0
INSERT html/body/div/#comment1
INSERT html/body/div/#text1
INSERT html/body/div/#comment2
INSERT html/body/div/#comment3
INSERT html/body/div/script
```
# Render ASYNC
```html
<html>
<head />
<body>
<div>
<!--M_[-->
Got: a
<!---->
0
<!--M_*2 #text/1-->
<!--M_]1 #text/0 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.a = [0,
{
count: 0,
"ClosureScopes:count": new Set
}]), _ =&gt; (_.c = [_.e = {
_: _.b = _.a[1],
"ClosureSignalIndex:count": 0
}], (_.d = _.b["ClosureScopes:count"]).add(_.e), _.c)];
M._.w()
</script>
<script>
M._.r.push(_ =&gt; (_.f = [_.g = {
_: _.b,
"ClosureSignalIndex:count": 2
}], _.d.add(_.g), _.f));
M._.w()
</script>
</div>
</body>
</html>
```
# Mutations
```
INSERT html/body/div/script1
```
# Render ASYNC
```html
<html>
<head />
@ -76,20 +161,6 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/div
INSERT html/body/div/#comment0
INSERT html/body/div/#text0
INSERT html/body/div/#comment1
INSERT html/body/div/#text1
INSERT html/body/div/#comment2
INSERT html/body/div/#comment3
INSERT html/body/div/script0
INSERT html/body/div/script0/#text
INSERT html/body/div/script1
INSERT html/body/div/script1/#text
INSERT html/body/div/#comment4
INSERT html/body/div/#text2
INSERT html/body/div/#comment5
@ -106,5 +177,4 @@ INSERT html/body/div/button
INSERT html/body/div/button/#text
INSERT html/body/div/#comment12
INSERT html/body/script
INSERT html/body/script/#text
```

View File

@ -21,8 +21,3 @@
</body>
</html>
```
# Mutations
```
INSERT html/body/#text2
```

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
```html
ab
```
# Render ASYNC
```html
aERROR!def
```

View File

@ -8,7 +8,41 @@
<!--M_!b--><!--M_]1 #text/0 2-->def<style M_>t{display:none}</style><t M_=b>ERROR!</t><script>REORDER_RUNTIME(M._);M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
<!--M_[-->
<!--M_!^b-->
b
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.c = {}
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.c), _.b)]
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text1
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
@ -34,15 +68,6 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT #comment
INSERT #text
INSERT script
INSERT script/#text
INSERT #comment
INSERT html/body/#comment1
INSERT html/body/#text2
@ -50,8 +75,6 @@ INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT html/body/#text1
INSERT html/body/script
INSERT html/body/script/#text
REMOVE html/head/style after html/body/#text2
INSERT html/head/style
REMOVE t after html/body/#text2
@ -60,4 +83,5 @@ REMOVE #text after #comment
REMOVE #comment after html/body/#comment0
REMOVE #comment after html/body/#comment0
INSERT html/body/#text1
INSERT html/body/script
```

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
```html
ab
```
# Render ASYNC
```html
abcdfgh
```

View File

@ -8,7 +8,41 @@
cd<!--M_!b--><!--M_]1 #text/0 2-->fgh
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
<!--M_[-->
<!--M_!^b-->
b
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#CatchContent": _.c = {}
}], _.a["#CatchContent"] = _._[
"__tests__/template.marko_2_content"
](_.c), _.b)]
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text1
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head />
@ -36,15 +70,6 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text1
INSERT html/body/script
INSERT html/body/script/#text
INSERT html/body/#text2
INSERT html/body/#comment2
INSERT html/body/#comment3

View File

@ -1,17 +0,0 @@
# Render
```html
<button>
$0.00
</button>
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
$1.00
</button>
```

View File

@ -1,26 +0,0 @@
# Render
```html
<button>
$0.00
</button>
```
# Mutations
```
INSERT button
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
$1.00
</button>
```
# Mutations
```
UPDATE button/#text "$0.00" => "$1.00"
```

View File

@ -1,24 +0,0 @@
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 $expr_input_count = /* @__PURE__ */_$.intersection(5, $scope => {
const {
input,
count
} = $scope;
_$.data($scope["#text/1"], input.format(count));
});
const $count_effect = _$.effect("__tests__/tags/counter.marko_0_count", ($scope, {
count
}) => _$.on($scope["#button/0"], "click", function () {
$count($scope, ++count)
}));
const $count = /* @__PURE__ */_$.state("count/4", $scope => {
$expr_input_count($scope);
$count_effect($scope);
});
export function $setup($scope) {
$count($scope, 0);
}
export const $input = /* @__PURE__ */_$.value("input", $expr_input_count);
export default /* @__PURE__ */_$.createTemplate("__tests__/tags/counter.marko", $template, $walks, $setup, $input);

View File

@ -1,15 +0,0 @@
import * as _$ from "@marko/runtime-tags/debug/html";
export default _$.createTemplate("__tests__/tags/counter.marko", input => {
const $scope0_id = _$._scope_id();
let count = 0;
_$._html(`<button>${_$._safe(input.format(count))}${_$.markResumeNode($scope0_id, "#text/1")}</button>${_$.markResumeNode($scope0_id, "#button/0")}`);
_$._script($scope0_id, "__tests__/tags/counter.marko_0_count");
_$._scope($scope0_id, {
input,
count
}, "__tests__/tags/counter.marko", 0, {
input: 0,
count: "1:6"
});
_$._resume_branch($scope0_id);
});

View File

@ -1,8 +0,0 @@
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 _style_ = /* @__PURE__ */_$.value("style", (_scope, style) => _$.styleAttr(_scope["#div/0"], style));
export const _input_ = /* @__PURE__ */_$.value("input", (_scope, input) => _style_(_scope, input.style));
export const _params__ = /* @__PURE__ */_$.value("_params_", (_scope, _params_) => _input_(_scope, _params_[0]));
export default /* @__PURE__ */_$.createTemplate("__tests__/tags/custom-tag.marko", _template_, _walks_, _setup_, void 0, () => _params__);

View File

@ -1,9 +0,0 @@
import * as _$ from "@marko/runtime-tags/debug/html";
const _renderer = /* @__PURE__ */_$.createRenderer((input, _tagVar) => {
const _scope0_id = _$._scope_id();
const {
style
} = input;
_$._html(`<div${_$.styleAttr(style)}></div>${_$.markResumeNode(_scope0_id, "#div/0")}`);
});
export default /* @__PURE__ */_$.createTemplate("__tests__/tags/custom-tag.marko", _renderer);

View File

@ -1,11 +0,0 @@
export const $template = "<div>Hello <!> <!></div>";
export const $walks = /* next(1), over(1), replace, over(2), replace, out(1) */"Db%c%l";
export const $setup = () => {};
import * as _ from "@marko/runtime-tags/debug/dom";
export const $input_name = /* @__PURE__ */_._const("input_name", ($scope, input_name) => _._text($scope["#text/0"], input_name));
export const $input_count = /* @__PURE__ */_._const("input_count", ($scope, input_count) => _._text($scope["#text/1"], input_count));
export const $input = /* @__PURE__ */_._const("input", ($scope, input) => {
$input_name($scope, input.name);
$input_count($scope, input.count);
});
export default /* @__PURE__ */_._template("__tests__/tags/your-tag.marko", $template, $walks, $setup, $input);

View File

@ -1,7 +0,0 @@
import * as _ from "@marko/runtime-tags/debug/html";
export default _._template("__tests__/__snapshots__/tags/your-tag.marko", input => {
const $serialize = _._get_serialize_reason();
const $scope0_id = _._scope_id();
_._html(`<div>Hello ${_._sep(_._serialize_guard($serialize, /* input.name */1))}${_._escape(input.name)}${_._el_resume($scope0_id, "#text/0", _._serialize_guard($serialize, /* input.name */1))} ${_._sep(_._serialize_guard($serialize, /* input.count */2))}${_._escape(input.count)}${_._el_resume($scope0_id, "#text/1", _._serialize_guard($serialize, /* input.count */2))}</div>`);
_._serialize_guard($serialize, /* input.name,input.count */0) && _._scope($scope0_id, {}, "__tests__/__snapshots__/tags/your-tag.marko", 0);
});

View File

@ -1,7 +0,0 @@
import * as _ from "@marko/runtime-tags/debug/html";
export default _._template("__tests__/tags/your-tag.marko", input => {
const $serialize = _._get_serialize_reason();
const $scope0_id = _._scope_id();
_._html(`<div>Hello ${_._sep(_._serialize_guard($serialize, /* input.name */1))}${_._escape(input.name)}${_._el_resume($scope0_id, "#text/0", _._serialize_guard($serialize, /* input.name */1))} ${_._sep(_._serialize_guard($serialize, /* input.count */2))}${_._escape(input.count)}${_._el_resume($scope0_id, "#text/1", _._serialize_guard($serialize, /* input.count */2))}</div>`);
_._serialize_guard($serialize, /* input.name,input.count */0) && _._scope($scope0_id, {}, "__tests__/tags/your-tag.marko", 0);
});

View File

@ -1,6 +0,0 @@
import * as _$ from "@marko/runtime-tags/debug/html";
export default _$.createTemplate("__tests__/tags/skeleton-part.marko", (input, $serialize) => {
const $scope0_id = _$._scope_id();
_$._dynamic_tag($scope0_id, "#text/0", input.as || "div", {}, 0, 0, _$.serializeGuard($serialize, /* input.as */0));
_$.serializeGuard($serialize, /* input.as */0) && _$._scope($scope0_id, {}, "__tests__/tags/skeleton-part.marko", 0);
});

View File

@ -1,3 +1,6 @@
// size: 84 (min) 76 (brotli)
// size: 86 (min) 79 (brotli)
const $output = _._let(2, ($scope) => _._text($scope.a, $scope.c));
(_._script("a0", ($scope) => $output($scope, JSON.stringify(testLog))), init());
(_._script("a0", ($scope) => {
$output($scope, JSON.stringify(testLog));
}),
init());

View File

@ -5,7 +5,10 @@ const staticVar = "static var";
import * as _ from "@marko/runtime-tags/debug/dom";
const $tagVar = /* @__PURE__ */_._const("tagVar", $scope => console.log($scope.tagVar));
const $output = /* @__PURE__ */_._let("output/2", $scope => _._text($scope["#text/0"], $scope.output));
const $setup__script = _._script("__tests__/template.marko_0", $scope => $output($scope, JSON.stringify(testLog)));
const $setup__script = _._script("__tests__/template.marko_0", $scope => {
debugger;
$output($scope, JSON.stringify(testLog));
});
export function $setup($scope) {
console.log("identifier");
console.log(staticVar);

View File

@ -2,3 +2,9 @@
```html
{"identifier":true,"tag var":true,"static var":true}
```
# Render ASYNC
```html
{"identifier":false,"tag var":false,"static var":false}
```

View File

@ -18,3 +18,30 @@
</body>
</html>
```
# Render ASYNC
```html
<!---->
<html>
<head />
<body>
{"identifier":false,"tag var":false,"static var":false}
<!--M_*1 #text/0-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.a = [0,
{}]),
"__tests__/template.marko_0",
1
];
M._.w()
</script>
</body>
</html>
```
# Mutations
```
UPDATE html/body/#text "{\"identifier\":true,\"tag var\":true,\"static var\":true}" => "{\"identifier\":false,\"tag var\":false,\"static var\":false}"
```

View File

@ -1,5 +1,4 @@
import testLog from "./test-log"
<log="identifier"/>
<const/tagVar="tag var"/>
<log=tagVar/>
@ -7,5 +6,5 @@ static const staticVar = "static var";
<log=staticVar/>
<let/output=JSON.stringify(testLog)/>
<script>output = JSON.stringify(testLog)</script>
<script>debugger; output = JSON.stringify(testLog)</script>
-- ${output}

View File

@ -0,0 +1,5 @@
import { wait } from "../../utils/resolve";
export const steps = [{}, wait(1)];
export const skip_equivalent = true;

View File

@ -32,8 +32,3 @@
</body>
</html>
```
# Mutations
```
INSERT html/body/#text4
```

View File

@ -1,4 +1,16 @@
# Render End
# Render ASYNC
```html
a_A_e
```
# Render ASYNC
```html
a_A_efg
```
# Render ASYNC
```html
abcdefg
```

View File

@ -13,7 +13,103 @@
<t M_=c>c</t><script>M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
a
<!--M_[-->
<!--M_!^b-->
_A_
<!--M_!b-->
<!--M_]1 #text/0 2-->
e
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.c), _.b)];
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text1
INSERT html/body/#comment2
INSERT html/body/#comment3
INSERT html/body/#text2
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#text0
INSERT t/#comment
INSERT t/#text1
REMOVE html/head/style after html/body/#text2
INSERT html/head/style
REMOVE t after html/body/#text2
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
a
<!--M_[-->
<!--M_!^b-->
_A_
<!--M_!b-->
<!--M_]1 #text/0 2-->
e
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.c), _.b)];
REORDER_RUNTIME(M._);
M._.w()
</script>
fg
</body>
</html>
```
# Mutations
```
INSERT html/body/#text3
```
# Render ASYNC
```html
<html>
<head>
@ -50,35 +146,12 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/#comment1
INSERT html/body/#text4
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT html/body/#text1
INSERT #comment
INSERT html/body/#text3
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/#text4
INSERT html/head/style
REMOVE t after html/body/#text4
INSERT html/body/#text5
INSERT t
INSERT html/body/#text2
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/#text5
REMOVE #text after #comment
REMOVE #comment after html/body/#comment0
REMOVE #comment after html/body/#comment0
INSERT html/body/#text1, html/body/#text2, html/body/#text3
INSERT html/body/script1
```

View File

@ -1,4 +1,10 @@
# Render End
# Render ASYNC
```html
abc
```
# Render ASYNC
```html
abcde
```

View File

@ -8,7 +8,43 @@
de
```
# Render End
# Render ASYNC
```html
<html>
<head />
<body>
a
<!--M_[-->
b
<!--M_]1 #text/0 2-->
c
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.b = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.c = {}
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.c), _.b)]
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#text1
INSERT html/body/#comment1
INSERT html/body/#text2
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head />
@ -34,15 +70,5 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#text1
INSERT html/body/#comment1
INSERT html/body/#text2
INSERT html/body/script
INSERT html/body/script/#text
INSERT html/body/#text3
```

View File

@ -42,9 +42,3 @@
</body>
</html>
```
# Mutations
```
INSERT html/body/#text8
INSERT html/body/#text7
```

View File

@ -1,4 +1,22 @@
# Render End
# Render ASYNC
```html
a_B_h
```
# Render ASYNC
```html
a_B_hij
```
# Render ASYNC
```html
abcd_A_hij
```
# Render ASYNC
```html
abcdefghij
```

View File

@ -18,7 +18,177 @@
<t M_=e>f</t><script>M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
a
<!--M_[-->
<!--M_!^b-->
_B_
<!--M_!b-->
<!--M_]1 #text/0 2-->
h
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.d = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.d), _.b["#PlaceholderContent"] = _._[
"__tests__/template.marko_5_content"
](_.a), _.c)];
REORDER_RUNTIME(M._);
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT html/body/#comment1
INSERT html/body/#text1
INSERT html/body/#comment2
INSERT html/body/#comment3
INSERT html/body/#text2
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#text0
INSERT t/#comment0
INSERT t/#text1
INSERT t/#comment1
INSERT t/#comment2
INSERT t/#text2
INSERT t/#comment3
INSERT t/#comment4
INSERT t
INSERT t/#text0
INSERT t/#comment
INSERT t/#text1
REMOVE html/head/style after html/body/#text2
INSERT html/head/style
REMOVE t after html/body/#text2
REMOVE t after html/body/#text2
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
a
<!--M_[-->
<!--M_!^b-->
_B_
<!--M_!b-->
<!--M_]1 #text/0 2-->
h
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.d = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.d), _.b["#PlaceholderContent"] = _._[
"__tests__/template.marko_5_content"
](_.a), _.c)];
REORDER_RUNTIME(M._);
M._.w()
</script>
ij
</body>
</html>
```
# Mutations
```
INSERT html/body/#text3
```
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
a
<!--M_[-->
bcd
<!--M_[-->
<!--M_!^d-->
_A_
<!--M_!d-->
<!--M_]2 #text/1 3-->
<!--M_]1 #text/0 2-->
h
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, 1, _.a = {
"#BranchAccessor": "#text/0",
"#PlaceholderContent": _.d = {}
}, _.b = {
"#BranchAccessor": "#text/1"
}], _.a["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.d), _.b["#PlaceholderContent"] = _._[
"__tests__/template.marko_5_content"
](_.a), _.c)];
REORDER_RUNTIME(M._);
M._.w()
</script>
ij
<script>
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT t
INSERT html/body/#text2
REMOVE t after html/body/#text6
REMOVE #text after #comment
REMOVE #comment after html/body/#comment0
REMOVE #comment after html/body/#comment0
INSERT html/body/#text1, html/body/#text2, html/body/#text3, html/body/#comment1, html/body/#comment2, html/body/#text4, html/body/#comment3, html/body/#comment4
INSERT html/body/script1
```
# Render ASYNC
```html
<html>
<head>
@ -65,54 +235,12 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/#text0
INSERT html/body/#comment0
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/#comment3
INSERT html/body/#text7
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT html/body/#text1
INSERT #comment
INSERT html/body/#text3
INSERT html/body/#comment1
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/#comment2
INSERT t
INSERT html/body/#text4
INSERT #comment
INSERT html/body/#text6
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/#text7
INSERT html/head/style
REMOVE t after html/body/#text7
REMOVE t after html/body/#text7
INSERT html/body/#text8
INSERT t
INSERT html/body/#text2
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/#text8
REMOVE #text after #comment
REMOVE #comment after html/body/#comment0
REMOVE #comment after html/body/#comment0
INSERT html/body/#text1, html/body/#text2, html/body/#text3, html/body/#comment1, #comment, #text, #comment, html/body/#comment2
INSERT t
INSERT html/body/#text5
INSERT html/body/script2
INSERT html/body/script2/#text
REMOVE t after html/body/script1
REMOVE #text after #comment
REMOVE #comment after html/body/#comment1
REMOVE #comment after html/body/#comment1
INSERT html/body/#text4, html/body/#text5, html/body/#text6
INSERT html/body/script2
```

View File

@ -1,53 +0,0 @@
# Render
```html
<button>
inc
</button>
<div />
```
# Render ASYNC
```html
<button>
inc
</button>
<div />
LOADING...
```
# Render ASYNC
```html
<button>
inc
</button>
<div />
Error: Element references can only be read in scripts and event handlers.
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
inc
</button>
<div />
Error: Element references can only be read in scripts and event handlers.
```
# Render
```js
container.querySelector("button").click();
```
```html
<button>
inc
</button>
<div />
Error: Element references can only be read in scripts and event handlers.
```

View File

@ -1,4 +1,4 @@
// size: 516 (min) 289 (brotli)
// size: 514 (min) 296 (brotli)
_._enable_catch();
const $await_content__value = _._const(2, ($scope) =>
_._text(
@ -26,9 +26,10 @@ const $try_content__await = _._await(
0,
$await_content__$params,
),
$try_content__clickCount__script = _._script("a2", ($scope) => {
$scope._.b.textContent = $scope._.d;
}),
$try_content__clickCount__script = _._script(
"a2",
($scope) => ($scope._.b.textContent = $scope._.d),
),
$try_content__clickCount = _._closure_get(3, ($scope) => {
($try_content__await($scope, resolveAfter($scope._.d, 1)),
$try_content__clickCount__script($scope));

View File

@ -12,10 +12,7 @@ const $catch_content__$params = /* @__PURE__ */_._const("$params2", $scope => $c
const $catch_content = _._content_resume("__tests__/template.marko_3_content", " ", /* get, over(1) */" b", 0, $catch_content__$params);
const $placeholder_content = _._content_resume("__tests__/template.marko_2_content", "LOADING...", /* over(1) */"b");
const $try_content__await = /* @__PURE__ */_._await("#text/0", "Async: <!>", /* over(1), replace, over(1) */"b%b", 0, $await_content__$params);
const $try_content__clickCount__script = _._script("__tests__/template.marko_1_clickCount", $scope => {
debugger;
_._el_read($scope._["#div/1"]).textContent = $scope._.clickCount;
});
const $try_content__clickCount__script = _._script("__tests__/template.marko_1_clickCount", $scope => (_._el_read($scope._["#div/1"]).textContent = $scope._.clickCount));
const $try_content__clickCount = /* @__PURE__ */_._closure_get("clickCount", $scope => {
$try_content__await($scope, resolveAfter($scope._.clickCount, 1));
$try_content__clickCount__script($scope);

View File

@ -12,7 +12,7 @@ export default _._template("__tests__/template.marko", input => {
_._html(`Async: <!>${_._escape(value > 1 ? (() => {
throw new Error("ERROR!");
})() : value)}${_._el_resume($scope4_id, "#text/0")}`);
_._scope($scope4_id, {}, "__tests__/template.marko", "12:4");
_._scope($scope4_id, {}, "__tests__/template.marko", "11:4");
});
_._script($scope1_id, "__tests__/template.marko_1_clickCount");
_._subscribe($clickCount__closures, _._scope($scope1_id, {
@ -26,7 +26,7 @@ export default _._template("__tests__/template.marko", input => {
const $scope3_reason = _._scope_reason();
const $scope3_id = _._scope_id();
_._html(`${_._escape(err)}${_._el_resume($scope3_id, "#text/0", _._serialize_guard($scope3_reason, /* err */0))}`);
_._serialize_if($scope3_reason, /* err */0) && _._scope($scope3_id, {}, "__tests__/template.marko", "18:4");
_._serialize_if($scope3_reason, /* err */0) && _._scope($scope3_id, {}, "__tests__/template.marko", "17:4");
}, $scope0_id)
}),
placeholder: _.attrTag({

View File

@ -62,12 +62,6 @@
</html>
```
# Mutations
```
INSERT html/body/#text3
INSERT html/body/#text2
INSERT html/body/div/#text
```
# Render
```js

View File

@ -1,4 +1,14 @@
# Render End
# Render ASYNC
```html
<button>
inc
</button>
<div />
LOADING...
```
# Render ASYNC
```html
<button>
inc

View File

@ -8,7 +8,88 @@
<t M_=d><!--M_[-->Async: <!>0<!--M_*4 #text/0--><!--M_]2 #text/0 4--></t><script>M._.r.push(_=>(_.e=[1,{}]));M._.w()</script>
```
# Render End
# Render ASYNC
```html
<html>
<head>
<style
m_=""
>
t{display:none}
</style>
</head>
<body>
<button>
inc
</button>
<!--M_*1 #button/0-->
<div />
<!--M_*1 #div/1-->
<!--M_[-->
<!--M_!^b-->
<!--M_!^c-->
LOADING...
<!--M_!c-->
<!--M_!b-->
<!--M_]1 #text/2 2-->
<script>
WALKER_RUNTIME("M")("_");
M._.r = [_ =&gt; (_.c = [0, _.a = {
clickCount: 0,
"ClosureScopes:clickCount": _.d = new Set
}, _.b = {
_: _.a,
"ClosureSignalIndex:clickCount": 0,
"#BranchAccessor": "#text/2"
}], _.b["#CatchContent"] = _._[
"__tests__/template.marko_3_content"
](_.a), _.b["#PlaceholderContent"] = _._[
"__tests__/template.marko_2_content"
](_.a), (_.d).add(_.b), _.c),
"__tests__/template.marko_0_clickCount",
1
];
REORDER_RUNTIME(M._);
M._.j.c = _ =&gt;
{
_.push(
"__tests__/template.marko_1_clickCount",
2)
};
M._.w()
</script>
</body>
</html>
```
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment0
INSERT html/body/div
INSERT html/body/#comment1
INSERT html/body/#comment2
INSERT html/body/#comment3
INSERT html/body/#comment4
INSERT html/body/#text
INSERT html/body/#comment5
INSERT html/body/#comment6
INSERT html/body/#comment7
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT t/#comment
REMOVE html/head/style after html/body/#comment7
INSERT html/head/style
REMOVE t after html/body/#comment7
INSERT html/body/script
```
# Render ASYNC
```html
<html>
<head>
@ -72,30 +153,6 @@
# Mutations
```
INSERT html
INSERT html/head
INSERT html/body
INSERT html/body/button
INSERT html/body/button/#text
INSERT html/body/#comment0
INSERT html/body/div
INSERT html/body/#comment1
INSERT html/body/#comment2
INSERT html/body/#comment3
INSERT #comment
INSERT #text
INSERT #comment
INSERT html/body/#comment8
INSERT html/body/#comment9
INSERT html/head/style
INSERT html/head/style/#text
INSERT t
INSERT #comment
INSERT html/body/script0
INSERT html/body/script0/#text
REMOVE html/head/style after html/body/#comment9
INSERT html/head/style
REMOVE t after html/body/#comment9
INSERT t
INSERT html/body/#comment4
INSERT html/body/#text0
@ -103,11 +160,10 @@ INSERT html/body/#comment5
INSERT html/body/#text1
INSERT html/body/#comment6
INSERT html/body/#comment7
INSERT html/body/script1
INSERT html/body/script1/#text
REMOVE t after html/body/script0
REMOVE #text after #comment
REMOVE #comment after html/body/#comment3
REMOVE #comment after html/body/#comment3
INSERT html/body/#comment4, html/body/#text0, html/body/#comment5, html/body/#text1, html/body/#comment6, html/body/#comment7
INSERT html/body/script1
```

View File

@ -6,7 +6,6 @@ import { resolveAfter } from "../../utils/resolve";
<div/el/>
<try>
<script>
debugger;
el().textContent = clickCount;
</script>
<await|value|=resolveAfter(clickCount, 1)>

View File

@ -189,24 +189,41 @@ describe("runtime-tags/translator", () => {
);
}
};
let ssr = () => {
let serverRender = () => {
const cached = (async () => {
const hooks: TestHooks = (() => {
try {
return require(resolve("hooks.ts"));
} catch {
return {};
}
})();
hooks.before?.();
const serverTemplate = require(manualSSR ? serverFile : templateFile)
.default as Template;
let buffer = "";
// let flushCount = 0;
const [input = {}, ...steps] = (
typeof config.steps === "function"
? await config.steps()
: config.steps || []
) as [Input, ...unknown[]];
const chunks: string[] = [];
for await (const data of serverTemplate.render(input)) {
chunks.push(data);
}
return { chunks, input, steps };
})();
serverRender = () => cached;
return cached;
};
const getHooks = (
browser?: ReturnType<typeof createBrowser>,
): TestHooks => {
try {
return (browser ? browser.require : require)(resolve("hooks.ts"));
} catch {
return {};
}
};
let ssr = () => {
const cached = (async () => {
const browser = createBrowser({
dir: __dirname,
extensions: register({
@ -215,27 +232,31 @@ describe("runtime-tags/translator", () => {
extensions: {},
}),
});
const document = browser.window.document;
const [input = {}] = (
typeof config.steps === "function"
? await config.steps()
: config.steps || []
) as [Input];
const { window } = browser;
const { document } = window;
const hooks = getHooks();
document.open();
hooks.before?.();
const tracker = createMutationTracker(browser.window, document);
const { chunks } = await serverRender();
for await (const data of serverTemplate.render(input)) {
const browserStream = browser.open();
const tracker = createMutationTracker(window, document);
for (const data of chunks) {
const formattedHtml = indent(stripInlineRuntime(data));
if (formattedHtml) {
tracker.log(`# Write\n\`\`\`html\n${formattedHtml}\n\`\`\``);
}
buffer += data;
browserStream.write(data);
}
document.write(buffer);
document.close();
const flushRemaining = browserStream.close();
if (flushRemaining) {
await flushRemaining();
}
tracker.logUpdate("End", true);
tracker.cleanup();
@ -258,13 +279,7 @@ describe("runtime-tags/translator", () => {
}),
});
const hooks: TestHooks = (() => {
try {
return browser.require(resolve("hooks.ts"));
} catch {
return {};
}
})();
const hooks = getHooks(browser);
hooks.before?.();
@ -325,24 +340,48 @@ describe("runtime-tags/translator", () => {
let resume = () => {
const cached = (async () => {
const { browser } = await ssr();
const browser = createBrowser({
dir: __dirname,
extensions: register({
...domConfig,
modules: "cjs",
extensions: {},
}),
});
const { window } = browser;
const { document } = window;
const tracker = createMutationTracker(window, document);
const [input, ...steps] =
typeof config.steps === "function"
? await config.steps()
: config.steps || [];
const serverHooks = getHooks();
const browserHooks = getHooks(browser);
// TODO: when this is removed, the resume test will fail if run by itself... why?
await new Promise((resolve) => setTimeout(resolve, 10));
serverHooks.before?.();
browserHooks.before?.();
const { chunks, input, steps } = await serverRender();
const { run, init } = browser.require<
typeof import("@marko/runtime-tags/dom")
>("@marko/runtime-tags/dom");
browser.require(manualResume ? resumeFile : templateFile);
init();
const browserStream = browser.open();
let tracker: ReturnType<typeof createMutationTracker>;
for (const data of chunks) {
browserStream.write(data);
}
const flushRemaining = browserStream.close();
if (flushRemaining) {
init();
await flushRemaining();
tracker = createMutationTracker(window, document);
} else {
tracker = createMutationTracker(window, document);
init();
}
tracker.logUpdate(input);
for (const update of steps) {
@ -363,6 +402,9 @@ describe("runtime-tags/translator", () => {
tracker.cleanup();
serverHooks.after?.();
browserHooks.after?.();
return { browser, tracker };
})();
resume = () => cached;

View File

@ -1,8 +1,15 @@
import type { DOMWindow } from "jsdom";
import { createBrowser } from "jsdom-context-require";
import { resolveAfter } from "./resolve";
export default function (options: Parameters<typeof createBrowser>[0]) {
const browser = createBrowser(options);
const browser = createBrowser(options) as ReturnType<typeof createBrowser> & {
open(): {
write(chunk: string): void;
close(): undefined | (() => Promise<void>);
};
};
const window = browser.window as unknown as DOMWindow & {
MessageChannel: any;
};
@ -23,5 +30,69 @@ export default function (options: Parameters<typeof createBrowser>[0]) {
}
};
window.requestAnimationFrame = (fn) => window.setTimeout(fn) as any;
browser.open = () => {
const doc = window.document;
let chunkCount = 0;
let buffer = "";
doc.open();
return {
write(chunk: string) {
if (buffer) {
buffer += "<!--%%FLUSH%%-->";
}
buffer += chunk;
chunkCount++;
},
close() {
if (chunkCount > 1) {
const parsed = doc.implementation.createHTMLDocument();
parsed.write(buffer);
parsed.doctype?.remove();
const walker = parsed.createTreeWalker(parsed);
const targetNodes = new WeakMap<Node, Node>([[parsed, doc]]);
let node: Node | null;
function walkFlush() {
while ((node = walker.nextNode())) {
if (
node.nodeType === 8 /* Node.COMMENT_NODE */ &&
(node as Comment).data === "%%FLUSH%%"
) {
return true;
}
const isScript = (node as Element).tagName === "SCRIPT";
const clone = doc.importNode(node, isScript);
targetNodes.set(node, clone);
(targetNodes.get(node.parentNode!) as ParentNode).appendChild(
clone,
);
if (isScript) {
walker.nextNode();
}
}
doc.close();
}
if (walkFlush()) {
return async () => {
await resolveAfter(0, 1);
while (walkFlush()) {
await resolveAfter(0, 1);
}
};
}
}
doc.write(buffer);
doc.close();
},
};
};
return browser;
}