mirror of
https://github.com/marko-js/marko.git
synced 2026-02-01 16:07:13 +00:00
fix: optimize pass-through spreads to known tags
This commit is contained in:
parent
d694b03c93
commit
897a00dcfe
5
.changeset/good-clocks-knock.md
Normal file
5
.changeset/good-clocks-knock.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@marko/runtime-tags": patch
|
||||
---
|
||||
|
||||
Optimize spreads through a wrapper tag to a known tag into direct calls
|
||||
@ -44,16 +44,16 @@
|
||||
{
|
||||
"name": "comments",
|
||||
"user": {
|
||||
"min": 695,
|
||||
"brotli": 376
|
||||
"min": 745,
|
||||
"brotli": 396
|
||||
},
|
||||
"runtime": {
|
||||
"min": 7059,
|
||||
"brotli": 3086
|
||||
},
|
||||
"total": {
|
||||
"min": 7754,
|
||||
"brotli": 3462
|
||||
"min": 7804,
|
||||
"brotli": 3482
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
// size: 695 (min) 376 (brotli)
|
||||
// size: 745 (min) 396 (brotli)
|
||||
const $if_content__setup = ($scope) => {
|
||||
($scope.a,
|
||||
$if_content__comment_comments._($scope),
|
||||
$if_content__id._($scope));
|
||||
},
|
||||
$if_content__comment_comments = _if_closure(4, 0, ($scope) =>
|
||||
$input_comments($scope.a, $scope._.i),
|
||||
$input_comments$1($scope.a, $scope._.i),
|
||||
),
|
||||
$if_content__id = _if_closure(4, 0, ($scope) =>
|
||||
$input_path($scope.a, $scope._.l),
|
||||
$input_path$1($scope.a, $scope._.l),
|
||||
),
|
||||
$for_content__id = _const(11, ($scope) => {
|
||||
(_attr($scope.a, "id", $scope.l), $if_content__id($scope));
|
||||
@ -49,18 +49,22 @@ const $if_content__setup = ($scope) => {
|
||||
$for_content__setup,
|
||||
$for_content__$params,
|
||||
),
|
||||
$input_comments = _const(3, ($scope) => $for($scope, [$scope.d])),
|
||||
$input_path = _const(4, $for_content__input_path);
|
||||
$input_comments$1 = _const(3, ($scope) => $for($scope, [$scope.d])),
|
||||
$input_path$1 = _const(4, $for_content__input_path);
|
||||
function $setup($scope) {
|
||||
$scope.a;
|
||||
}
|
||||
const $input_comments = _const(3, ($scope) =>
|
||||
$input_comments$1($scope.a, $scope.d),
|
||||
),
|
||||
$input_path = _const(4, ($scope) => $input_path$1($scope.a, $scope.e));
|
||||
_template(
|
||||
"b",
|
||||
"<ul></ul>",
|
||||
"/ b&",
|
||||
$setup,
|
||||
_const(2, ($scope) => {
|
||||
($input_comments($scope.a, $scope.c.comments),
|
||||
$input_path($scope.a, $scope.c.path));
|
||||
($input_comments($scope, $scope.c.comments),
|
||||
$input_path($scope, $scope.c.path));
|
||||
}),
|
||||
).mount();
|
||||
|
||||
@ -1 +1 @@
|
||||
{"vars":{"props":{"$empty":"e","$rest":"t","$attrTag":"n","$attrTags":"r","$attrTagIterator":"i","$_assert_hoist":"o","$forIn":"l","$forOf":"u","$forTo":"f","$forUntil":"a","$_call":"c","$stringifyClassObject":"s","$stringifyStyleObject":"d","$toDelimitedString":"h","$isEventHandler":"p","$getEventHandlerName":"g","$normalizeDynamicRenderer":"v","$decodeAccessor":"b","$toArray":"m","$push":"S","$defaultDelegator":"y","$_on":"A","$createDelegator":"N","$handleDelegated":"k","$stripSpacesAndPunctuation":"C","$nextScopeId":"_","$createScope":"w","$skipScope":"E","$findBranchWithKey":"T","$destroyBranch":"I","$destroyNestedBranches":"F","$removeAndDestroyBranch":"M","$insertBranchBefore":"x","$tempDetachBranch":"L","$walker":"$","$walk":"O","$walkInternal":"D","$branchesEnabled":"K","$isResuming":"V","$registeredValues":"G","$enableBranches":"R","$init":"B","$runResumeEffects":"H","$_resume":"U","$_var_resume":"q","$_el":"P","$_attr_input_checked":"j","$_attr_input_checked_script":"W","$_attr_input_checkedValue":"J","$_attr_input_checkedValue_script":"Q","$_attr_input_value":"X","$_attr_input_value_script":"Z","$_attr_select_value":"z","$_attr_select_value_script":"Y","$setSelectOptions":"ee","$_attr_details_or_dialog_open":"te","$_attr_details_or_dialog_open_script":"ne","$inputType":"re","$setValueAndUpdateSelection":"ie","$setCheckboxValue":"oe","$controllableDelegate":"le","$syncControllable":"ue","$handleChange":"fe","$handleFormReset":"ae","$hasValueChanged":"ce","$hasCheckboxChanged":"se","$hasSelectChanged":"de","$hasFormElementChanged":"he","$normalizeStrProp":"pe","$normalizeBoolProp":"ge","$toValueProp":"ve","$isScheduled":"be","$channel":"me","$parsers":"Se","$parseHTML":"ye","$schedule":"Ae","$flushAndWaitFrame":"Ne","$triggerMacroTask":"ke","$_let":"Ce","$_const":"_e","$_or":"we","$_for_closure":"Ee","$_if_closure":"Te","$subscribeToScopeSet":"Ie","$_closure":"Fe","$_closure_get":"Me","$_child_setup":"xe","$_var":"Le","$_return":"$e","$_return_change":"Oe","$_var_change":"De","$tagIdsByGlobal":"Ke","$_id":"Ve","$_script":"Ge","$_el_read":"Re","$traverseAllHoisted":"Be","$_hoist":"He","$createBranch":"Ue","$createAndSetupBranch":"qe","$setupBranch":"Pe","$_content":"je","$_content_resume":"We","$_content_closures":"Je","$cloneCache":"Qe","$_to_text":"Xe","$_attr":"Ze","$setAttribute":"ze","$_attr_class":"Ye","$_attr_class_items":"et","$_attr_class_item":"tt","$_attr_style":"nt","$_attr_style_items":"rt","$_attr_style_item":"it","$_text":"ot","$_text_content":"lt","$_attrs":"ut","$_attrs_content":"ft","$hasAttrAlias":"at","$_attrs_partial":"ct","$_attrs_partial_content":"st","$attrsInternal":"dt","$_attr_content":"ht","$_attrs_script":"pt","$_html":"gt","$normalizeAttrValue":"vt","$normalizeString":"bt","$_lifecycle":"mt","$removeChildNodes":"St","$insertChildNodes":"yt","$toInsertNode":"At","$_await_promise":"Nt","$_await_content":"kt","$_try":"Ct","$renderCatch":"_t","$_if":"wt","$_dynamic_tag":"Et","$_resume_dynamic_tag":"Tt","$dynamicTagScript":"It","$setConditionalRenderer":"Ft","$_for_of":"Mt","$_for_in":"xt","$_for_to":"Lt","$_for_until":"$t","$loop":"Ot","$createBranchWithTagNameOrRenderer":"Dt","$bySecondArg":"Kt","$byFirstArg":"Vt","$asyncRendersLookup":"Gt","$rendering":"Rt","$pendingRenders":"Bt","$pendingRendersLookup":"Ht","$caughtError":"Ut","$placeholderShown":"qt","$pendingEffects":"Pt","$pendingScopes":"jt","$scopeKeyOffset":"Wt","$queueRender":"Jt","$queuePendingRender":"Qt","$queueEffect":"Xt","$run":"Zt","$prepareEffects":"zt","$runEffects":"Yt","$runRenders":"en","$runRender":"tn","$_enable_catch":"nn","$$signalReset":"rn","$$signal":"on","$abort":"ln","$classIdToBranch":"un","$compat":"fn","$_template":"an","$mount":"cn","$$clickCount__script":"ta","$$clickCount":"aa","$$setup":"na","$forEach":"sn","$$if_content__setup":"sa","$$if_content__comment_comments":"ia","$$if_content__id":"ca","$$for_content__id":"la","$$for_content__input_path__OR__i":"ma","$$for_content__input_path":"oa","$$for_content__i":"ua","$$for_content__open__script":"ba","$$for_content__open":"ea","$$for_content__setup":"_a","$$for_content__comment_text":"da","$$for_content__if":"fa","$$for_content__comment_comments":"ha","$$for_content__$params":"ja","$$for_content__comment":"pa","$$for":"ra","$$input_comments":"ga","$$input_path":"ka","$_attr_nonce":"dn","$setParentBranch":"hn","$$setup$1":"Da","$$if_content__dynamicTag":"$a","$$if_content__comment_comments__OR__id":"va","$$input$1":"xa","$_comments":"Ba","$$dynamicTag":"Ea"}}}
|
||||
{"vars":{"props":{"$empty":"e","$rest":"t","$attrTag":"n","$attrTags":"r","$attrTagIterator":"i","$_assert_hoist":"o","$forIn":"l","$forOf":"u","$forTo":"f","$forUntil":"a","$_call":"c","$stringifyClassObject":"s","$stringifyStyleObject":"d","$toDelimitedString":"h","$isEventHandler":"p","$getEventHandlerName":"g","$normalizeDynamicRenderer":"v","$decodeAccessor":"b","$toArray":"m","$push":"S","$defaultDelegator":"y","$_on":"A","$createDelegator":"N","$handleDelegated":"k","$stripSpacesAndPunctuation":"C","$nextScopeId":"_","$createScope":"w","$skipScope":"E","$findBranchWithKey":"T","$destroyBranch":"I","$destroyNestedBranches":"F","$removeAndDestroyBranch":"M","$insertBranchBefore":"x","$tempDetachBranch":"L","$walker":"$","$walk":"O","$walkInternal":"D","$branchesEnabled":"K","$isResuming":"V","$registeredValues":"G","$enableBranches":"R","$init":"B","$runResumeEffects":"H","$_resume":"U","$_var_resume":"q","$_el":"P","$_attr_input_checked":"j","$_attr_input_checked_script":"W","$_attr_input_checkedValue":"J","$_attr_input_checkedValue_script":"Q","$_attr_input_value":"X","$_attr_input_value_script":"Z","$_attr_select_value":"z","$_attr_select_value_script":"Y","$setSelectOptions":"ee","$_attr_details_or_dialog_open":"te","$_attr_details_or_dialog_open_script":"ne","$inputType":"re","$setValueAndUpdateSelection":"ie","$setCheckboxValue":"oe","$controllableDelegate":"le","$syncControllable":"ue","$handleChange":"fe","$handleFormReset":"ae","$hasValueChanged":"ce","$hasCheckboxChanged":"se","$hasSelectChanged":"de","$hasFormElementChanged":"he","$normalizeStrProp":"pe","$normalizeBoolProp":"ge","$toValueProp":"ve","$isScheduled":"be","$channel":"me","$parsers":"Se","$parseHTML":"ye","$schedule":"Ae","$flushAndWaitFrame":"Ne","$triggerMacroTask":"ke","$_let":"Ce","$_const":"_e","$_or":"we","$_for_closure":"Ee","$_if_closure":"Te","$subscribeToScopeSet":"Ie","$_closure":"Fe","$_closure_get":"Me","$_child_setup":"xe","$_var":"Le","$_return":"$e","$_return_change":"Oe","$_var_change":"De","$tagIdsByGlobal":"Ke","$_id":"Ve","$_script":"Ge","$_el_read":"Re","$traverseAllHoisted":"Be","$_hoist":"He","$createBranch":"Ue","$createAndSetupBranch":"qe","$setupBranch":"Pe","$_content":"je","$_content_resume":"We","$_content_closures":"Je","$cloneCache":"Qe","$_to_text":"Xe","$_attr":"Ze","$setAttribute":"ze","$_attr_class":"Ye","$_attr_class_items":"et","$_attr_class_item":"tt","$_attr_style":"nt","$_attr_style_items":"rt","$_attr_style_item":"it","$_text":"ot","$_text_content":"lt","$_attrs":"ut","$_attrs_content":"ft","$hasAttrAlias":"at","$_attrs_partial":"ct","$_attrs_partial_content":"st","$attrsInternal":"dt","$_attr_content":"ht","$_attrs_script":"pt","$_html":"gt","$normalizeAttrValue":"vt","$normalizeString":"bt","$_lifecycle":"mt","$removeChildNodes":"St","$insertChildNodes":"yt","$toInsertNode":"At","$_await_promise":"Nt","$_await_content":"kt","$_try":"Ct","$renderCatch":"_t","$_if":"wt","$_dynamic_tag":"Et","$_resume_dynamic_tag":"Tt","$dynamicTagScript":"It","$setConditionalRenderer":"Ft","$_for_of":"Mt","$_for_in":"xt","$_for_to":"Lt","$_for_until":"$t","$loop":"Ot","$createBranchWithTagNameOrRenderer":"Dt","$bySecondArg":"Kt","$byFirstArg":"Vt","$asyncRendersLookup":"Gt","$rendering":"Rt","$pendingRenders":"Bt","$pendingRendersLookup":"Ht","$caughtError":"Ut","$placeholderShown":"qt","$pendingEffects":"Pt","$pendingScopes":"jt","$scopeKeyOffset":"Wt","$queueRender":"Jt","$queuePendingRender":"Qt","$queueEffect":"Xt","$run":"Zt","$prepareEffects":"zt","$runEffects":"Yt","$runRenders":"en","$runRender":"tn","$_enable_catch":"nn","$$signalReset":"rn","$$signal":"on","$abort":"ln","$classIdToBranch":"un","$compat":"fn","$_template":"an","$mount":"cn","$$clickCount__script":"ta","$$clickCount":"aa","$$setup":"na","$forEach":"sn","$$if_content__setup":"sa","$$if_content__comment_comments":"ia","$$if_content__id":"ca","$$for_content__id":"la","$$for_content__input_path__OR__i":"ma","$$for_content__input_path":"oa","$$for_content__i":"ua","$$for_content__open__script":"ba","$$for_content__open":"ea","$$for_content__setup":"_a","$$for_content__comment_text":"da","$$for_content__if":"fa","$$for_content__comment_comments":"ha","$$for_content__$params":"ja","$$for_content__comment":"pa","$$for":"ra","$$input_comments":"ga","$$input_path":"ka","$_attr_nonce":"dn","$setParentBranch":"hn","$$setup$1":"Da","$$if_content__dynamicTag":"$a","$$if_content__comment_comments__OR__id":"va","$$input$1":"xa","$_comments":"Ba","$$dynamicTag":"Ea","$$input_comments$1":"Ma","$$input_path$1":"Ua"}}}
|
||||
@ -5,8 +5,10 @@ export function $setup($scope) {
|
||||
_comments($scope["#childScope/0"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_comments = /* @__PURE__ */_._const("input_comments", $scope => _comments_input_comments($scope["#childScope/0"], $scope.input_comments));
|
||||
export const $input_path = /* @__PURE__ */_._const("input_path", $scope => _comments_input_path($scope["#childScope/0"], $scope.input_path));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
_comments_input_comments($scope["#childScope/0"], $scope.input.comments);
|
||||
_comments_input_path($scope["#childScope/0"], $scope.input.path);
|
||||
$input_comments($scope, $scope.input.comments);
|
||||
$input_path($scope, $scope.input.path);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup, $input);
|
||||
@ -5,12 +5,12 @@ export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason({
|
||||
/* input.comments, input.path */0: _._serialize_guard($scope0_reason, /* input */0),
|
||||
/* input.comments */1: _._serialize_guard($scope0_reason, /* input */0),
|
||||
/* input.path */2: _._serialize_guard($scope0_reason, /* input */0)
|
||||
/* input.comments, input.path */0: _._serialize_guard($scope0_reason, /* input.comments, input.path */0),
|
||||
/* input.comments */1: _._serialize_guard($scope0_reason, /* input.comments */1),
|
||||
/* input.path */2: _._serialize_guard($scope0_reason, /* input.path */2)
|
||||
});
|
||||
_comments(input);
|
||||
_._serialize_if($scope0_reason, /* input */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input */0) && _._existing_scope($childScope)
|
||||
_._serialize_if($scope0_reason, /* input.comments, input.path */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input.comments, input.path */0) && _._existing_scope($childScope)
|
||||
}, "__tests__/template.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,40 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT div0, div1, div2
|
||||
```
|
||||
@ -0,0 +1,11 @@
|
||||
export const $template = "<input>";
|
||||
export const $walks = /* get, over(1) */" b";
|
||||
export const $setup = () => {};
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#input/0"], $scope.input_class));
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => _._attr($scope["#input/0"], "value", $scope.input_value));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,20 @@
|
||||
export const $template = `${_child_template}${_child_template}`;
|
||||
export const $walks = /* <child>, <child> */`/${_child_walks}&/${_child_walks}&`;
|
||||
import { $setup as _child, $input_value as _child_input_value, $input_class as _child_input_class, $template as _child_template, $walks as _child_walks } from "./child.marko";
|
||||
export function $setup($scope) {
|
||||
_child($scope["#childScope/0"]);
|
||||
_child_input_value($scope["#childScope/0"], "override");
|
||||
_child($scope["#childScope/1"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
const $input_class = /* @__PURE__ */_._const("input_class", $scope => _child_input_class($scope["#childScope/0"], $scope.input_class));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
const $child_input_spread = {
|
||||
value: "default",
|
||||
...$scope.input
|
||||
};
|
||||
_child_input_class($scope["#childScope/1"], $child_input_spread.class);
|
||||
_child_input_value($scope["#childScope/1"], $child_input_spread.value);
|
||||
$input_class($scope, $scope.input.class);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1 @@
|
||||
// size: 0
|
||||
@ -0,0 +1,22 @@
|
||||
export const $template = `<div id=value-missing>${_wrap_template}</div><div id=value-undefined>${_wrap_template}</div><div id=dynamic-value-set><!></div>`;
|
||||
export const $walks = /* next(1), <wrap>, out(1), next(1), <wrap>, out(1), next(1), replace, out(1) */`D/${_wrap_walks}&lD/${_wrap_walks}&lD%l`;
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import { $setup as _wrap, $input as _wrap_input, $template as _wrap_template, $walks as _wrap_walks } from "./tags/wrap.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/2");
|
||||
export function $setup($scope) {
|
||||
_wrap($scope["#childScope/0"]);
|
||||
_wrap_input($scope["#childScope/0"], {
|
||||
class: "foo"
|
||||
});
|
||||
_wrap($scope["#childScope/1"]);
|
||||
_wrap_input($scope["#childScope/1"], {
|
||||
value: undefined
|
||||
});
|
||||
$dynamicTag($scope, Wrap, () => ({
|
||||
class: "bar",
|
||||
value: "abcd"
|
||||
}));
|
||||
}
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
|
||||
@ -0,0 +1,7 @@
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/child.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html(`<input${_._attr_class(input.class)}${_._attr("value", input.value)}>${_._el_resume($scope0_id, "#input/0", _._serialize_guard($scope0_reason, /* input.class, input.value */0))}`);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value */0) && _._scope($scope0_id, {}, "__tests__/tags/child.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,22 @@
|
||||
import _child from "./child.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input.class */1));
|
||||
_child({
|
||||
...input,
|
||||
value: "override"
|
||||
});
|
||||
const $childScope2 = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input */0));
|
||||
_child({
|
||||
value: "default",
|
||||
...input
|
||||
});
|
||||
_._serialize_if($scope0_reason, /* input */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input.class */1) && _._existing_scope($childScope),
|
||||
"#childScope/1": _._serialize_if($scope0_reason, /* input */0) && _._existing_scope($childScope2)
|
||||
}, "__tests__/tags/wrap.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,21 @@
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
import _wrap from "./tags/wrap.marko";
|
||||
export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html("<div id=value-missing>");
|
||||
_wrap({
|
||||
class: "foo"
|
||||
});
|
||||
_._html("</div><div id=value-undefined>");
|
||||
_wrap({
|
||||
value: undefined
|
||||
});
|
||||
_._html("</div><div id=dynamic-value-set>");
|
||||
_._dynamic_tag($scope0_id, "#text/2", Wrap, {
|
||||
class: "bar",
|
||||
value: "abcd"
|
||||
}, 0, 0, 0);
|
||||
_._html("</div>");
|
||||
});
|
||||
@ -0,0 +1,35 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,40 @@
|
||||
# Render
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@ -0,0 +1,35 @@
|
||||
# Render End
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,61 @@
|
||||
# Write
|
||||
```html
|
||||
<div id=value-missing><input class=foo value=override><input class=foo value=default></div><div id=value-undefined><input value=override><input></div><div id=dynamic-value-set><input class=bar value=override><input class=bar value=abcd></div>
|
||||
```
|
||||
|
||||
# Render End
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
value="default"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
value="override"
|
||||
/>
|
||||
<input />
|
||||
</div>
|
||||
<div
|
||||
id="dynamic-value-set"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
value="override"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT html
|
||||
INSERT html/head
|
||||
INSERT html/body
|
||||
INSERT html/body/div0
|
||||
INSERT html/body/div0/input0
|
||||
INSERT html/body/div0/input1
|
||||
INSERT html/body/div1
|
||||
INSERT html/body/div1/input0
|
||||
INSERT html/body/div1/input1
|
||||
INSERT html/body/div2
|
||||
INSERT html/body/div2/input0
|
||||
INSERT html/body/div2/input1
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
<input class=input.class value=input.value>
|
||||
@ -0,0 +1,3 @@
|
||||
<child ...input value="override" />
|
||||
// <child ...input />
|
||||
<child value="default" ...input />
|
||||
@ -0,0 +1,11 @@
|
||||
import wrapTag from "<wrap>";
|
||||
static const Wrap = wrapTag
|
||||
<div#value-missing>
|
||||
<wrap class="foo" />
|
||||
</div>
|
||||
<div#value-undefined>
|
||||
<wrap value=undefined />
|
||||
</div>
|
||||
<div#dynamic-value-set>
|
||||
<${Wrap} class="bar" value="abcd" />
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
export const steps = [{}];
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,28 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT div0, div1
|
||||
```
|
||||
@ -0,0 +1,11 @@
|
||||
export const $template = "<input>";
|
||||
export const $walks = /* get, over(1) */" b";
|
||||
export const $setup = () => {};
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#input/0"], $scope.input_class));
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => _._attr($scope["#input/0"], "value", $scope.input_value));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,21 @@
|
||||
export const $template = `${_child_template}${_child_template}`;
|
||||
export const $walks = /* <child>, <child> */`/${_child_walks}&/${_child_walks}&`;
|
||||
import { $setup as _child, $input_class as _child_input_class, $input_value as _child_input_value, $template as _child_template, $walks as _child_walks } from "./child.marko";
|
||||
export function $setup($scope) {
|
||||
_child($scope["#childScope/0"]);
|
||||
_child($scope["#childScope/1"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => {
|
||||
_child_input_class($scope["#childScope/0"], $scope.input_class);
|
||||
_child_input_class($scope["#childScope/1"], $scope.input_class);
|
||||
});
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => {
|
||||
_child_input_value($scope["#childScope/0"], $scope.input_value);
|
||||
_child_input_value($scope["#childScope/1"], $scope.input_value);
|
||||
});
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1 @@
|
||||
// size: 0
|
||||
@ -0,0 +1,16 @@
|
||||
export const $template = `<div id=known>${_wrap_template}</div><div id=dynamic><!></div>`;
|
||||
export const $walks = /* next(1), <wrap>, out(1), next(1), replace, out(1) */`D/${_wrap_walks}&lD%l`;
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import { $setup as _wrap, $input_class as _wrap_input_class, $input_value as _wrap_input_value, $template as _wrap_template, $walks as _wrap_walks } from "./tags/wrap.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/1");
|
||||
export function $setup($scope) {
|
||||
_wrap($scope["#childScope/0"]);
|
||||
_wrap_input_class($scope["#childScope/0"], "foo");
|
||||
_wrap_input_value($scope["#childScope/0"]);
|
||||
$dynamicTag($scope, Wrap, () => ({
|
||||
class: "bar"
|
||||
}));
|
||||
}
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
|
||||
@ -0,0 +1,7 @@
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/child.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html(`<input${_._attr_class(input.class)}${_._attr("value", input.value)}>${_._el_resume($scope0_id, "#input/0", _._serialize_guard($scope0_reason, /* input.class, input.value */0))}`);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value */0) && _._scope($scope0_id, {}, "__tests__/tags/child.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,16 @@
|
||||
import _child from "./child.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input.class, input.value */0));
|
||||
_child(input);
|
||||
const $childScope2 = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input.class, input.value */0));
|
||||
_child(input);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input.class, input.value */0) && _._existing_scope($childScope),
|
||||
"#childScope/1": _._serialize_if($scope0_reason, /* input.class, input.value */0) && _._existing_scope($childScope2)
|
||||
}, "__tests__/tags/wrap.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,16 @@
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
import _wrap from "./tags/wrap.marko";
|
||||
export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html("<div id=known>");
|
||||
_wrap({
|
||||
class: "foo"
|
||||
});
|
||||
_._html("</div><div id=dynamic>");
|
||||
_._dynamic_tag($scope0_id, "#text/1", Wrap, {
|
||||
class: "bar"
|
||||
}, 0, 0, 0);
|
||||
_._html("</div>");
|
||||
});
|
||||
@ -0,0 +1,23 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,28 @@
|
||||
# Render
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@ -0,0 +1,23 @@
|
||||
# Render End
|
||||
```html
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,46 @@
|
||||
# Write
|
||||
```html
|
||||
<div id=known><input class=foo><input class=foo></div><div id=dynamic><input class=bar><input class=bar></div>
|
||||
```
|
||||
|
||||
# Render End
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="known"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT html
|
||||
INSERT html/head
|
||||
INSERT html/body
|
||||
INSERT html/body/div0
|
||||
INSERT html/body/div0/input0
|
||||
INSERT html/body/div0/input1
|
||||
INSERT html/body/div1
|
||||
INSERT html/body/div1/input0
|
||||
INSERT html/body/div1/input1
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
<input class=input.class value=input.value>
|
||||
@ -0,0 +1,2 @@
|
||||
<child ...input/>
|
||||
<child ...input/>
|
||||
@ -0,0 +1,11 @@
|
||||
import wrapTag from "<wrap>";
|
||||
static const Wrap = wrapTag
|
||||
|
||||
<div#known>
|
||||
<wrap class="foo" />
|
||||
</div>
|
||||
|
||||
<div#dynamic>
|
||||
<${Wrap} class="bar" />
|
||||
</div>
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export const steps = [{}];
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,12 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT input
|
||||
```
|
||||
@ -0,0 +1,13 @@
|
||||
export const $template = "<input>";
|
||||
export const $walks = /* get, over(1) */" b";
|
||||
export const $setup = () => {};
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#input/0"], $scope.input_class));
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => _._attr($scope["#input/0"], "value", $scope.input_value));
|
||||
export const $input_a = /* @__PURE__ */_._const("input_a", $scope => _._attr($scope["#input/0"], "data-a", $scope.input_a));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
$input_a($scope, $scope.input.a);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,19 @@
|
||||
export const $template = _child_template;
|
||||
export const $walks = /* <child> */`/${_child_walks}&`;
|
||||
import { $setup as _child, $input_class as _child_input_class, $input_value as _child_input_value, $input_a as _child_input_a, $template as _child_template, $walks as _child_walks } from "./child.marko";
|
||||
export function $setup($scope) {
|
||||
_child($scope["#childScope/0"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
const $child_input_spread = {
|
||||
...$scope.input,
|
||||
...{
|
||||
a: 1
|
||||
}
|
||||
};
|
||||
_child_input_class($scope["#childScope/0"], $child_input_spread.class);
|
||||
_child_input_value($scope["#childScope/0"], $child_input_spread.value);
|
||||
_child_input_a($scope["#childScope/0"], $child_input_spread.a);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1 @@
|
||||
// size: 0
|
||||
@ -0,0 +1,11 @@
|
||||
export const $template = _wrap_template;
|
||||
export const $walks = /* <wrap> */`/${_wrap_walks}&`;
|
||||
import { $setup as _wrap, $input as _wrap_input, $template as _wrap_template, $walks as _wrap_walks } from "./tags/wrap.marko";
|
||||
export function $setup($scope) {
|
||||
_wrap($scope["#childScope/0"]);
|
||||
_wrap_input($scope["#childScope/0"], {
|
||||
class: "foo"
|
||||
});
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
|
||||
@ -0,0 +1,7 @@
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/child.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html(`<input${_._attr_class(input.class)}${_._attr("value", input.value)}${_._attr("data-a", input.a)}>${_._el_resume($scope0_id, "#input/0", _._serialize_guard($scope0_reason, /* input.class, input.value, input.a */0))}`);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value, input.a */0) && _._scope($scope0_id, {}, "__tests__/tags/child.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,17 @@
|
||||
import _child from "./child.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input */0));
|
||||
_child({
|
||||
...input,
|
||||
...{
|
||||
a: 1
|
||||
}
|
||||
});
|
||||
_._serialize_if($scope0_reason, /* input */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input */0) && _._existing_scope($childScope)
|
||||
}, "__tests__/tags/wrap.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
import _wrap from "./tags/wrap.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
_wrap({
|
||||
class: "foo"
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,7 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,12 @@
|
||||
# Render
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@ -0,0 +1,7 @@
|
||||
# Render End
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,25 @@
|
||||
# Write
|
||||
```html
|
||||
<input class=foo data-a=1>
|
||||
```
|
||||
|
||||
# Render End
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<input
|
||||
class="foo"
|
||||
data-a="1"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT html
|
||||
INSERT html/head
|
||||
INSERT html/body
|
||||
INSERT html/body/input
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
<input class=input.class value=input.value data-a=input.a>
|
||||
@ -0,0 +1 @@
|
||||
<child ...input ...{ a: 1 } />
|
||||
@ -0,0 +1 @@
|
||||
<wrap class="foo" />
|
||||
@ -0,0 +1 @@
|
||||
export const steps = [{}];
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,12 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT input
|
||||
```
|
||||
@ -0,0 +1,11 @@
|
||||
export const $template = "<input>";
|
||||
export const $walks = /* get, over(1) */" b";
|
||||
export const $setup = () => {};
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#input/0"], $scope.input_class));
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => _._attr($scope["#input/0"], "value", $scope.input_value));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,15 @@
|
||||
export const $template = _wrap_template;
|
||||
export const $walks = /* <wrap> */`/${_wrap_walks}&`;
|
||||
import { $setup as _wrap, $value as _wrap_input_value, $rest_class as _wrap_input_class, $template as _wrap_template, $walks as _wrap_walks } from "./wrap.marko";
|
||||
export function $setup($scope) {
|
||||
_wrap($scope["#childScope/0"]);
|
||||
_wrap_input_value($scope["#childScope/0"], "abcd");
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $rest_class = /* @__PURE__ */_._const("rest_class", $scope => _wrap_input_class($scope["#childScope/0"], $scope.rest_class));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => (({
|
||||
value,
|
||||
...rest
|
||||
}) => $rest($scope, rest))($scope.input));
|
||||
export const $rest = /* @__PURE__ */_._const("rest", $scope => $rest_class($scope, $scope.rest.class));
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap-outer.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,18 @@
|
||||
export const $template = _child_template;
|
||||
export const $walks = /* <child> */`/${_child_walks}&`;
|
||||
import { $setup as _child, $input_value as _child_input_value, $input_class as _child_input_class, $template as _child_template, $walks as _child_walks } from "./child.marko";
|
||||
export function $setup($scope) {
|
||||
_child($scope["#childScope/0"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $value = /* @__PURE__ */_._const("value", $scope => _child_input_value($scope["#childScope/0"], $scope.value));
|
||||
export const $rest_class = /* @__PURE__ */_._const("rest_class", $scope => _child_input_class($scope["#childScope/0"], $scope.rest_class));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
(({
|
||||
value,
|
||||
...rest
|
||||
}) => $rest($scope, rest))($scope.input);
|
||||
$value($scope, $scope.input.value);
|
||||
});
|
||||
export const $rest = /* @__PURE__ */_._const("rest", $scope => $rest_class($scope, $scope.rest.class));
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1 @@
|
||||
// size: 0
|
||||
@ -0,0 +1,9 @@
|
||||
export const $template = _wrapOuter_template;
|
||||
export const $walks = /* <wrap-outer> */`/${_wrapOuter_walks}&`;
|
||||
import { $setup as _wrapOuter, $rest_class as _wrapOuter_input_class, $template as _wrapOuter_template, $walks as _wrapOuter_walks } from "./tags/wrap-outer.marko";
|
||||
export function $setup($scope) {
|
||||
_wrapOuter($scope["#childScope/0"]);
|
||||
_wrapOuter_input_class($scope["#childScope/0"], "foo");
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
|
||||
@ -0,0 +1,7 @@
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/child.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html(`<input${_._attr_class(input.class)}${_._attr("value", input.value)}>${_._el_resume($scope0_id, "#input/0", _._serialize_guard($scope0_reason, /* input.class, input.value */0))}`);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value */0) && _._scope($scope0_id, {}, "__tests__/tags/child.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,18 @@
|
||||
import _wrap from "./wrap.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap-outer.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const {
|
||||
value,
|
||||
...rest
|
||||
} = input;
|
||||
const $childScope = _._peek_scope_id();
|
||||
_wrap({
|
||||
value: "abcd",
|
||||
...rest
|
||||
});
|
||||
_._serialize_if($scope0_reason, /* rest.class */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* rest.class */0) && _._existing_scope($childScope)
|
||||
}, "__tests__/tags/wrap-outer.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
import _child from "./child.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const {
|
||||
value,
|
||||
...rest
|
||||
} = input;
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input.value, rest.class */0));
|
||||
_child({
|
||||
value: value,
|
||||
...rest
|
||||
});
|
||||
_._serialize_if($scope0_reason, /* input.value, rest.class */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input.value, rest.class */0) && _._existing_scope($childScope)
|
||||
}, "__tests__/tags/wrap.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
import _wrapOuter from "./tags/wrap-outer.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
_wrapOuter({
|
||||
class: "foo"
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,7 @@
|
||||
# Render
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,12 @@
|
||||
# Render
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@ -0,0 +1,7 @@
|
||||
# Render End
|
||||
```html
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
```
|
||||
@ -0,0 +1,25 @@
|
||||
# Write
|
||||
```html
|
||||
<input class=foo value=abcd>
|
||||
```
|
||||
|
||||
# Render End
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT html
|
||||
INSERT html/head
|
||||
INSERT html/body
|
||||
INSERT html/body/input
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
<input class=input.class value=input.value>
|
||||
@ -0,0 +1,2 @@
|
||||
<const/{ value, ...rest }=input>
|
||||
<wrap value="abcd" ...rest />
|
||||
@ -0,0 +1,2 @@
|
||||
<const/{ value, ...rest }=input>
|
||||
<child value=value ...rest />
|
||||
@ -0,0 +1,2 @@
|
||||
<wrap-outer class="foo" />
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export const steps = [{}];
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,37 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT div0, div1, div2, div3
|
||||
```
|
||||
@ -0,0 +1,11 @@
|
||||
export const $template = "<input>";
|
||||
export const $walks = /* get, over(1) */" b";
|
||||
export const $setup = () => {};
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $input_class = /* @__PURE__ */_._const("input_class", $scope => _._attr_class($scope["#input/0"], $scope.input_class));
|
||||
export const $input_value = /* @__PURE__ */_._const("input_value", $scope => _._attr($scope["#input/0"], "value", $scope.input_value));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
$input_class($scope, $scope.input.class);
|
||||
$input_value($scope, $scope.input.value);
|
||||
});
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/child.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1,18 @@
|
||||
export const $template = _child_template;
|
||||
export const $walks = /* <child> */`/${_child_walks}&`;
|
||||
import { $setup as _child, $input_value as _child_input_value, $input_class as _child_input_class, $template as _child_template, $walks as _child_walks } from "./child.marko";
|
||||
export function $setup($scope) {
|
||||
_child($scope["#childScope/0"]);
|
||||
}
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
export const $value = /* @__PURE__ */_._const("value", $scope => _child_input_value($scope["#childScope/0"], $scope.value));
|
||||
export const $rest_class = /* @__PURE__ */_._const("rest_class", $scope => _child_input_class($scope["#childScope/0"], $scope.rest_class));
|
||||
export const $input = /* @__PURE__ */_._const("input", $scope => {
|
||||
(({
|
||||
value,
|
||||
...rest
|
||||
}) => $rest($scope, rest))($scope.input);
|
||||
$value($scope, $scope.input.value);
|
||||
});
|
||||
export const $rest = /* @__PURE__ */_._const("rest", $scope => $rest_class($scope, $scope.rest.class));
|
||||
export default /* @__PURE__ */_._template("__tests__/tags/wrap.marko", $template, $walks, $setup, $input);
|
||||
@ -0,0 +1 @@
|
||||
// size: 0
|
||||
@ -0,0 +1,22 @@
|
||||
export const $template = `<div id=value-missing>${_wrap_template}</div><div id=value-undefined>${_wrap_template}</div><div id=value-set>${_wrap_template}</div><div id=dynamic><!></div>`;
|
||||
export const $walks = /* next(1), <wrap>, out(1), next(1), <wrap>, out(1), next(1), <wrap>, out(1), next(1), replace, out(1) */`D/${_wrap_walks}&lD/${_wrap_walks}&lD/${_wrap_walks}&lD%l`;
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import { $setup as _wrap, $rest_class as _wrap_input_class, $value as _wrap_input_value, $template as _wrap_template, $walks as _wrap_walks } from "./tags/wrap.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/dom";
|
||||
const $dynamicTag = /* @__PURE__ */_._dynamic_tag("#text/3");
|
||||
export function $setup($scope) {
|
||||
_wrap($scope["#childScope/0"]);
|
||||
_wrap_input_class($scope["#childScope/0"], "foo");
|
||||
_wrap_input_value($scope["#childScope/0"]);
|
||||
_wrap($scope["#childScope/1"]);
|
||||
_wrap_input_class($scope["#childScope/1"], "foo");
|
||||
_wrap_input_value($scope["#childScope/1"], undefined);
|
||||
_wrap($scope["#childScope/2"]);
|
||||
_wrap_input_class($scope["#childScope/2"], "foo");
|
||||
_wrap_input_value($scope["#childScope/2"], "abcd");
|
||||
$dynamicTag($scope, Wrap, () => ({
|
||||
class: "bar"
|
||||
}));
|
||||
}
|
||||
export default /* @__PURE__ */_._template("__tests__/template.marko", $template, $walks, $setup);
|
||||
@ -0,0 +1,7 @@
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/child.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html(`<input${_._attr_class(input.class)}${_._attr("value", input.value)}>${_._el_resume($scope0_id, "#input/0", _._serialize_guard($scope0_reason, /* input.class, input.value */0))}`);
|
||||
_._serialize_if($scope0_reason, /* input.class, input.value */0) && _._scope($scope0_id, {}, "__tests__/tags/child.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,19 @@
|
||||
import _child from "./child.marko";
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
export default _._template("__tests__/tags/wrap.marko", input => {
|
||||
const $scope0_reason = _._scope_reason();
|
||||
const $scope0_id = _._scope_id();
|
||||
const {
|
||||
value,
|
||||
...rest
|
||||
} = input;
|
||||
const $childScope = _._peek_scope_id();
|
||||
_._set_serialize_reason(_._serialize_guard($scope0_reason, /* input.value, rest.class */0));
|
||||
_child({
|
||||
value: value,
|
||||
...rest
|
||||
});
|
||||
_._serialize_if($scope0_reason, /* input.value, rest.class */0) && _._scope($scope0_id, {
|
||||
"#childScope/0": _._serialize_if($scope0_reason, /* input.value, rest.class */0) && _._existing_scope($childScope)
|
||||
}, "__tests__/tags/wrap.marko", 0);
|
||||
});
|
||||
@ -0,0 +1,26 @@
|
||||
import wrapTag from "./tags/wrap.marko";
|
||||
const Wrap = wrapTag;
|
||||
import * as _ from "@marko/runtime-tags/debug/html";
|
||||
import _wrap from "./tags/wrap.marko";
|
||||
export default _._template("__tests__/template.marko", input => {
|
||||
const $scope0_id = _._scope_id();
|
||||
_._html("<div id=value-missing>");
|
||||
_wrap({
|
||||
class: "foo"
|
||||
});
|
||||
_._html("</div><div id=value-undefined>");
|
||||
_wrap({
|
||||
class: "foo",
|
||||
value: undefined
|
||||
});
|
||||
_._html("</div><div id=value-set>");
|
||||
_wrap({
|
||||
class: "foo",
|
||||
value: "abcd"
|
||||
});
|
||||
_._html("</div><div id=dynamic>");
|
||||
_._dynamic_tag($scope0_id, "#text/3", Wrap, {
|
||||
class: "bar"
|
||||
}, 0, 0, 0);
|
||||
_._html("</div>");
|
||||
});
|
||||
@ -0,0 +1,32 @@
|
||||
# Render
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,37 @@
|
||||
# Render
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
@ -0,0 +1,32 @@
|
||||
# Render End
|
||||
```html
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
```
|
||||
@ -0,0 +1,57 @@
|
||||
# Write
|
||||
```html
|
||||
<div id=value-missing><input class=foo></div><div id=value-undefined><input class=foo></div><div id=value-set><input class=foo value=abcd></div><div id=dynamic><input class=bar></div>
|
||||
```
|
||||
|
||||
# Render End
|
||||
```html
|
||||
<html>
|
||||
<head />
|
||||
<body>
|
||||
<div
|
||||
id="value-missing"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-undefined"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="value-set"
|
||||
>
|
||||
<input
|
||||
class="foo"
|
||||
value="abcd"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
id="dynamic"
|
||||
>
|
||||
<input
|
||||
class="bar"
|
||||
/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
# Mutations
|
||||
```
|
||||
INSERT html
|
||||
INSERT html/head
|
||||
INSERT html/body
|
||||
INSERT html/body/div0
|
||||
INSERT html/body/div0/input
|
||||
INSERT html/body/div1
|
||||
INSERT html/body/div1/input
|
||||
INSERT html/body/div2
|
||||
INSERT html/body/div2/input
|
||||
INSERT html/body/div3
|
||||
INSERT html/body/div3/input
|
||||
```
|
||||
@ -0,0 +1 @@
|
||||
<input class=input.class value=input.value>
|
||||
@ -0,0 +1,3 @@
|
||||
<const/{ value, ...rest }=input>
|
||||
<child value=value ...rest />
|
||||
// <div>${value}</div>
|
||||
@ -0,0 +1,18 @@
|
||||
import wrapTag from "<wrap>";
|
||||
static const Wrap = wrapTag
|
||||
|
||||
<div#value-missing>
|
||||
<wrap class="foo" />
|
||||
</div>
|
||||
|
||||
<div#value-undefined>
|
||||
<wrap class="foo" value=undefined />
|
||||
</div>
|
||||
|
||||
<div#value-set>
|
||||
<wrap class="foo" value="abcd" />
|
||||
</div>
|
||||
|
||||
<div#dynamic>
|
||||
<${Wrap} class="bar" />
|
||||
</div>
|
||||
@ -0,0 +1 @@
|
||||
export const steps = [{}];
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"vars": {
|
||||
"props": {}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user