From af9da0f1c8dac7709b4828e0110236ce6df4b27b Mon Sep 17 00:00:00 2001 From: Dylan Piercey Date: Mon, 22 Jun 2026 02:44:44 +0000 Subject: [PATCH] fix(runtime-tags): correctly link control-flow branches on resume Link the owning scope's closest branch from the control-flow runtimes so a client-created ``/``/dynamic-tag branch is not orphaned from the branch tree, which previously leaked effect and `onDestroy` cleanup when an ancestor branch was removed. Also avoid a `HierarchyRequestError` thrown when a bare `` (with no enclosing ``) re-resolves its promise after resume. The closest-branch link is now omitted when a branch's contents provably register no cleanup (no `$signal`/``, dynamic closure, ``/ ``, or custom/dynamic tag), trimming resume data for purely presentational control flow. --- .changeset/resume-branch-fixes.md | 7 ++ .sizes.json | 4 +- .sizes/dom.js | 19 +++-- .../sizes.json | 2 +- .../fixtures-interop/class/sizes.json | 2 +- .../sizes.json | 4 +- .../interop-basic-class-to-tags/sizes.json | 4 +- .../interop-basic-tags-to-class/sizes.json | 4 +- .../sizes.json | 4 +- .../interop-class-to-tags-import/sizes.json | 4 +- .../sizes.json | 4 +- .../interop-events-tags-to-class/sizes.json | 4 +- .../sizes.json | 4 +- .../interop-nested-class-to-tags/sizes.json | 4 +- .../interop-nested-tags-to-class/sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../lazy-class-child-event/sizes.json | 2 +- .../lazy-class-child-idle/sizes.json | 2 +- .../lazy-class-child-ssr-toggle/sizes.json | 2 +- .../lazy-class-child-ssr/sizes.json | 2 +- .../sizes.json | 2 +- .../lazy-class-child-visible/sizes.json | 2 +- .../__tests__/fixtures-interop/let/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../assign-to-owner-closure/sizes.json | 4 +- .../sizes.json | 4 +- .../__tests__/fixtures/async-state/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../at-tags-dynamic-with-params/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 6 +- .../__snapshots__/html.bundle.js | 6 +- .../fixtures/at-tags-dynamic/sizes.json | 6 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../attr-class/__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../attr-style/__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/await-cleanup/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../await-closure-in-order/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/await-closure-within/sizes.json | 4 +- .../__snapshots__/dom.bundle.debug.js | 21 +++++ .../__snapshots__/dom.bundle.js | 12 +++ .../__snapshots__/html.bundle.debug.js | 20 +++++ .../__snapshots__/html.bundle.js | 20 +++++ .../__snapshots__/render-csr.debug.md | 50 +++++++++++ .../__snapshots__/render-csr.md | 50 +++++++++++ .../__snapshots__/render-ssr.debug.md | 34 ++++++++ .../__snapshots__/render-ssr.md | 34 ++++++++ .../__snapshots__/writes.debug.html | 14 +++ .../__snapshots__/writes.html | 12 +++ .../await-no-try-resume-rerender/sizes.json | 12 +++ .../template.marko | 6 ++ .../await-no-try-resume-rerender/test.ts | 9 ++ .../fixtures/await-remove-parent/sizes.json | 4 +- .../await-update-after-resume/sizes.json | 4 +- .../await-update-before-resume/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../basic-conditional-counter/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/basic-execution-order/sizes.json | 4 +- .../fixtures/basic-nested-for/sizes.json | 2 +- .../fixtures/basic-nested-params/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/basic-nested-scope-if/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/basic-push-pop-list/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/basic-shared-node-ref/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/basic-toggle-show/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../batched-updates-cleanup/sizes.json | 4 +- .../fixtures/body-content/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../cleanup-n-child-for-shallow/sizes.json | 2 +- .../cleanup-n-child-if-deep/sizes.json | 4 +- .../cleanup-n-child-if-same-scope/sizes.json | 4 +- .../cleanup-n-child-if-shallow/sizes.json | 4 +- .../cleanup-single-child-for-deep/sizes.json | 2 +- .../sizes.json | 2 +- .../cleanup-single-child-if-deep/sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../closure-serialize-reason/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/conditional-table-row/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../controllable-checked-many/sizes.json | 2 +- .../controllable-checked-spread/sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../controllable-merged-spread/sizes.json | 4 +- .../controllable-partial-spread/sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../controllable-select-spread/sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../define-tag-for-attribute-tag/sizes.json | 4 +- .../define-tag-render-closure/sizes.json | 4 +- .../define-tag-render-conditional/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../fixtures/dollar-global-client/sizes.json | 4 +- .../dynamic-native-dynamic-tag/sizes.json | 4 +- .../dynamic-native-tag-events/sizes.json | 4 +- .../dynamic-tag-args-tag-var/sizes.json | 4 +- .../fixtures/dynamic-tag-args/sizes.json | 4 +- .../dynamic-tag-custom-native/sizes.json | 4 +- .../dynamic-tag-custom-tags/sizes.json | 4 +- .../dynamic-tag-input-intersection/sizes.json | 4 +- .../__snapshots__/dom.bundle.debug.js | 42 +++++++++ .../__snapshots__/dom.bundle.js | 29 +++++++ .../__snapshots__/html.bundle.debug.js | 45 ++++++++++ .../__snapshots__/html.bundle.js | 42 +++++++++ .../__snapshots__/render.debug.md | 75 ++++++++++++++++ .../__snapshots__/render.md | 75 ++++++++++++++++ .../__snapshots__/writes.debug.html | 17 ++++ .../__snapshots__/writes.html | 15 ++++ .../sizes.json | 18 ++++ .../tags/child.marko | 4 + .../template.marko | 8 ++ .../test.ts | 8 ++ .../dynamic-tag-single-arg/sizes.json | 4 +- .../dynamic-tag-sometimes-null/sizes.json | 4 +- .../dynamic-tag-with-updating-body/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../embed-control-flow-boundary/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../fixtures/for-by-use-index/sizes.json | 4 +- .../for-by/__snapshots__/html.bundle.debug.js | 10 +-- .../for-by/__snapshots__/html.bundle.js | 10 +-- .../src/__tests__/fixtures/for-by/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/for-destructure/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/for-event-handler/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/dom.bundle.debug.js | 48 +++++++++++ .../__snapshots__/dom.bundle.js | 38 +++++++++ .../__snapshots__/html.bundle.debug.js | 45 ++++++++++ .../__snapshots__/html.bundle.js | 42 +++++++++ .../__snapshots__/render.debug.md | 85 +++++++++++++++++++ .../__snapshots__/render.md | 85 +++++++++++++++++++ .../__snapshots__/writes.debug.html | 18 ++++ .../__snapshots__/writes.html | 16 ++++ .../for-resume-owns-branch-cleanup/sizes.json | 18 ++++ .../tags/child.marko | 5 ++ .../template.marko | 8 ++ .../for-resume-owns-branch-cleanup/test.ts | 12 +++ .../__snapshots__/dom.bundle.debug.js | 42 +++++++++ .../__snapshots__/dom.bundle.js | 32 +++++++ .../__snapshots__/html.bundle.debug.js | 44 ++++++++++ .../__snapshots__/html.bundle.js | 41 +++++++++ .../__snapshots__/render.debug.md | 85 +++++++++++++++++++ .../__snapshots__/render.md | 85 +++++++++++++++++++ .../__snapshots__/writes.debug.html | 18 ++++ .../__snapshots__/writes.html | 16 ++++ .../sizes.json | 18 ++++ .../tags/list.marko | 4 + .../template.marko | 7 ++ .../test.ts | 8 ++ .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/for-tag-with-state/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../for-to-range-resume-key/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 8 +- .../__snapshots__/html.bundle.js | 8 +- .../__snapshots__/html.bundle.debug.js | 8 +- .../__snapshots__/html.bundle.js | 8 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 8 +- .../__snapshots__/html.bundle.js | 8 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/html-script-nonce/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/html-style-nonce/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/if-default-false/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/if-no-content-script/sizes.json | 4 +- .../__snapshots__/dom.bundle.debug.js | 49 +++++++++++ .../__snapshots__/dom.bundle.js | 37 ++++++++ .../__snapshots__/html.bundle.debug.js | 56 ++++++++++++ .../__snapshots__/html.bundle.js | 53 ++++++++++++ .../__snapshots__/render.debug.md | 75 ++++++++++++++++ .../__snapshots__/render.md | 75 ++++++++++++++++ .../__snapshots__/writes.debug.html | 17 ++++ .../__snapshots__/writes.html | 15 ++++ .../sizes.json | 19 +++++ .../tags/leaf.marko | 2 + .../tags/wrapper.marko | 4 + .../template.marko | 8 ++ .../test.ts | 8 ++ .../__snapshots__/dom.bundle.debug.js | 41 +++++++++ .../__snapshots__/dom.bundle.js | 29 +++++++ .../__snapshots__/html.bundle.debug.js | 48 +++++++++++ .../__snapshots__/html.bundle.js | 45 ++++++++++ .../__snapshots__/render.debug.md | 75 ++++++++++++++++ .../__snapshots__/render.md | 75 ++++++++++++++++ .../__snapshots__/writes.debug.html | 17 ++++ .../__snapshots__/writes.html | 15 ++++ .../if-resume-owns-branch-cleanup/sizes.json | 18 ++++ .../tags/child.marko | 5 ++ .../template.marko | 8 ++ .../if-resume-owns-branch-cleanup/test.ts | 12 +++ .../__snapshots__/dom.bundle.debug.js | 42 +++++++++ .../__snapshots__/dom.bundle.js | 31 +++++++ .../__snapshots__/html.bundle.debug.js | 47 ++++++++++ .../__snapshots__/html.bundle.js | 44 ++++++++++ .../__snapshots__/render.debug.md | 64 ++++++++++++++ .../__snapshots__/render.md | 64 ++++++++++++++ .../__snapshots__/writes.debug.html | 17 ++++ .../__snapshots__/writes.html | 15 ++++ .../sizes.json | 18 ++++ .../tags/leaf.marko | 4 + .../template.marko | 7 ++ .../test.ts | 8 ++ .../if-tag/__snapshots__/html.bundle.debug.js | 6 +- .../if-tag/__snapshots__/html.bundle.js | 6 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../input-missing-property/sizes.json | 4 +- .../input-spread-value-also-read/sizes.json | 4 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../known-tag-attr-tags-rest/sizes.json | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 2 +- .../sizes.json | 4 +- .../lifecycle-tag-conditional/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../my-for-to/__snapshots__/html.bundle.js | 2 +- .../fixtures/namespaced-tags/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../native-tag-local-closures/sizes.json | 4 +- .../sizes.json | 4 +- .../native-tag-spread-void/sizes.json | 4 +- .../nested-for-if-stateful/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../placeholder-static-multiple/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 4 +- .../__snapshots__/html.bundle.js | 4 +- .../fixtures/resume-single-node/sizes.json | 4 +- .../spread-removed-event-handler/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../sizes.json | 4 +- .../fixtures/tag-name-type-unions/sizes.json | 4 +- .../fixtures/tag-param-if-closure/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../tag-var-with-serialize-reason/sizes.json | 4 +- .../__snapshots__/writes.debug.html | 2 + .../__snapshots__/writes.html | 2 + .../fixtures/tags-dir-recursive/sizes.json | 8 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/toggle-nested-2/sizes.json | 4 +- .../fixtures/toggle-nested-3/sizes.json | 4 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../__snapshots__/html.bundle.debug.js | 2 +- .../__snapshots__/html.bundle.js | 2 +- .../fixtures/toggle-only-child/sizes.json | 4 +- .../toggle-stateful-component/sizes.json | 4 +- .../fixtures/try-effects-async/sizes.json | 4 +- .../sizes.json | 4 +- packages/runtime-tags/src/dom/control-flow.ts | 20 +++-- packages/runtime-tags/src/html/dynamic-tag.ts | 13 +++ packages/runtime-tags/src/html/writer.ts | 29 +++++++ .../runtime-tags/src/translator/core/await.ts | 3 + .../runtime-tags/src/translator/core/for.ts | 17 +++- .../runtime-tags/src/translator/core/if.ts | 9 ++ .../runtime-tags/src/translator/core/try.ts | 3 + .../src/translator/util/known-tag.ts | 3 + .../src/translator/util/sections.ts | 48 +++++++++++ 413 files changed, 3294 insertions(+), 492 deletions(-) create mode 100644 .changeset/resume-branch-fixes.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/tags/child.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/tags/child.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/tags/list.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/leaf.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/wrapper.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/tags/child.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/test.ts create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.md create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.html create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/sizes.json create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/tags/leaf.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/template.marko create mode 100644 packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/test.ts diff --git a/.changeset/resume-branch-fixes.md b/.changeset/resume-branch-fixes.md new file mode 100644 index 0000000000..dc6c1e6c21 --- /dev/null +++ b/.changeset/resume-branch-fixes.md @@ -0,0 +1,7 @@ +--- +"@marko/runtime-tags": patch +--- + +Fix two resume bugs in control-flow branches: a client-created ``/``/dynamic-tag branch could be orphaned from the branch tree (leaking effect/`onDestroy` cleanup) when its owner was driven only by input, and a bare `` (no enclosing ``) could throw a `HierarchyRequestError` when its promise re-resolved after resume. + +The closest-branch link is now omitted when a branch's contents provably register no cleanup (no `$signal`/``, dynamic closure, ``/``, or custom/dynamic tag), trimming resume data for purely presentational control flow. diff --git a/.sizes.json b/.sizes.json index e3ebd5b49c..2d11c5cfd0 100644 --- a/.sizes.json +++ b/.sizes.json @@ -7,8 +7,8 @@ { "name": "*", "total": { - "min": 23837, - "brotli": 8807 + "min": 23891, + "brotli": 8858 } }, { diff --git a/.sizes/dom.js b/.sizes/dom.js index 37d34b5eff..e0e97b9c23 100644 --- a/.sizes/dom.js +++ b/.sizes/dom.js @@ -1,4 +1,4 @@ -// size: 23837 (min) 8807 (brotli) +// size: 23891 (min) 8858 (brotli) //#region packages/runtime-tags/dist/dom.mjs let empty = [], rest = Symbol(), @@ -1616,13 +1616,16 @@ function _await_promise(nodeAccessor, params) { i: 0, c() { if (--awaitCounter.i) return 1; - (tryBranch === scope[branchAccessor] - ? scope[nodeAccessor].parentNode && - scope[nodeAccessor].replaceWith( - scope[branchAccessor].S.parentNode, - ) - : dismissPlaceholder(tryBranch), - queueEffect(tryBranch, runPendingEffects)); + if (tryBranch === scope[branchAccessor]) { + let anchor = scope[nodeAccessor]; + if (anchor.parentNode) { + let detachedParent = scope[branchAccessor].S.parentNode; + detachedParent === anchor.parentNode + ? anchor.remove() + : anchor.replaceWith(detachedParent); + } + } else dismissPlaceholder(tryBranch); + queueEffect(tryBranch, runPendingEffects); }, }), scope[promiseAccessor] || diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/ambiguous-tags-and-components-dir/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/ambiguous-tags-and-components-dir/sizes.json index ccffa3aa94..99d59f8ea4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/ambiguous-tags-and-components-dir/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/ambiguous-tags-and-components-dir/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 921, - "brotli": 452 + "brotli": 453 }, "files": { "v:template.marko.hydrate-6.js": 104, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/class/sizes.json index 38def9a9b0..43e2b77aa2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/class/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 49563, - "brotli": 14671 + "brotli": 14672 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/custom-tag-parameters-from-args/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/custom-tag-parameters-from-args/sizes.json index e8e2fe9780..8eff7a05fa 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/custom-tag-parameters-from-args/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/custom-tag-parameters-from-args/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 68022, - "brotli": 21118 + "min": 68068, + "brotli": 21137 }, "files": { "components/custom-tag.marko": 1121, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-class-to-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-class-to-tags/sizes.json index 066c229bd7..e56b1ba24b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-class-to-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-class-to-tags/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 65782, - "brotli": 20201 + "min": 65808, + "brotli": 20243 }, "files": { "components/tags-counter.marko": 691, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-tags-to-class/sizes.json index 9b8d818333..eab7fd4399 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-basic-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 67231, - "brotli": 20838 + "min": 67268, + "brotli": 20832 }, "files": { "components/class-counter.marko": 1028, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-in-components-in-tags-dir/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-in-components-in-tags-dir/sizes.json index 48ad8a42cf..4a2a00bee9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-in-components-in-tags-dir/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-in-components-in-tags-dir/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 66817, - "brotli": 20584 + "min": 66851, + "brotli": 20594 }, "files": { "tags/components/hello-internal.marko": 941, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-to-tags-import/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-to-tags-import/sizes.json index 066c229bd7..e56b1ba24b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-to-tags-import/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-class-to-tags-import/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 65782, - "brotli": 20201 + "min": 65808, + "brotli": 20243 }, "files": { "components/tags-counter.marko": 691, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-handler-render-body-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-handler-render-body-tags-to-class/sizes.json index 1c8e350267..d343b61722 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-handler-render-body-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-event-handler-render-body-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 67549, - "brotli": 20983 + "min": 67589, + "brotli": 20964 }, "files": { "components/my-button.marko": 1048, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-events-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-events-tags-to-class/sizes.json index 2b766c77d3..d400a1e3f2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-events-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-events-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 67184, - "brotli": 20787 + "min": 67219, + "brotli": 20835 }, "files": { "components/class-counter.marko": 1043, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-attr-tags-class-to-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-attr-tags-class-to-tags/sizes.json index fb988757b6..ae8bc769c1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-attr-tags-class-to-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-attr-tags-class-to-tags/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 66107, - "brotli": 20382 + "min": 66131, + "brotli": 20394 }, "files": { "components/tags-layout.marko": 912, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-class-to-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-class-to-tags/sizes.json index 6de5f30707..2618e3f125 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-class-to-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-class-to-tags/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 65777, - "brotli": 20245 + "min": 65803, + "brotli": 20248 }, "files": { "components/tags-layout.marko": 758, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-tags-to-class/sizes.json index d222fa0194..015246c57f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-nested-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 67655, - "brotli": 21011 + "min": 67697, + "brotli": 20991 }, "files": { "components/class-layout.marko": 1227, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-stateless-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-stateless-tags-to-class/sizes.json index 040626d8c7..29889842f3 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-stateless-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-stateless-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 66972, - "brotli": 20691 + "min": 67003, + "brotli": 20703 }, "files": { "components/my-button/component-browser.js": 457, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-class-to-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-class-to-tags/sizes.json index f5280c00f6..05910306e4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-class-to-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-class-to-tags/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 66135, - "brotli": 20397 + "min": 66162, + "brotli": 20426 }, "files": { "components/tags-layout.marko": 922, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-tags-to-class/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-tags-to-class/sizes.json index 024cfd19db..67a9367988 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-tags-to-class/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/interop-tag-params-tags-to-class/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 68010, - "brotli": 21162 + "min": 68052, + "brotli": 21140 }, "files": { "components/class-layout.marko": 1245, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-event/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-event/sizes.json index 95af7be43c..125e79facd 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-event/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-event/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 1983, - "brotli": 942 + "brotli": 945 }, "child.mjs": { "min": 366, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-idle/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-idle/sizes.json index 36ba46a114..ef672e0892 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-idle/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-idle/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 1937, - "brotli": 928 + "brotli": 929 }, "child.mjs": { "min": 366, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr-toggle/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr-toggle/sizes.json index 82761587e2..0072c3ddd4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr-toggle/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr-toggle/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 50468, - "brotli": 14924 + "brotli": 14941 }, "child.mjs": { "min": 321, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr/sizes.json index 3189148f65..80c8fe5e7f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-ssr/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 50451, - "brotli": 14925 + "brotli": 14964 }, "child.mjs": { "min": 321, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-unmount-before-load/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-unmount-before-load/sizes.json index d5efe2ec27..dbb588de4d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-unmount-before-load/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-unmount-before-load/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 50468, - "brotli": 14924 + "brotli": 14930 }, "child.mjs": { "min": 321, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-visible/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-visible/sizes.json index dd4ae6cb46..daa63c4c55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-visible/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/lazy-class-child-visible/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 50797, - "brotli": 15038 + "brotli": 15055 }, "child.mjs": { "min": 321, diff --git a/packages/runtime-tags/src/__tests__/fixtures-interop/let/sizes.json b/packages/runtime-tags/src/__tests__/fixtures-interop/let/sizes.json index 4f8ebc4e04..3d813d0678 100644 --- a/packages/runtime-tags/src/__tests__/fixtures-interop/let/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures-interop/let/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 3259, - "brotli": 1579 + "min": 3239, + "brotli": 1571 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.debug.js index d5e23d7dd0..87600c42f7 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "2:2"); return 0; } - }, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, {}, "__tests__/template.marko", 0); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.js index bdc7ab2b44..6c70cab961 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", 1, 1, 1, 0, 1); + }, $scope0_id, "a", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, {}); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/sizes.json index 1475fe93d7..dc759a245c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/assign-to-owner-closure/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 5888, - "brotli": 2681 + "min": 5877, + "brotli": 2679 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/async-multi-resolve-in-order-and-update/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/async-multi-resolve-in-order-and-update/sizes.json index a15fac61e2..1ee07607f2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/async-multi-resolve-in-order-and-update/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/async-multi-resolve-in-order-and-update/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 7752, - "brotli": 3307 + "min": 7806, + "brotli": 3318 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/async-state/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/async-state/sizes.json index 68e9a5de20..9162d7b0f5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/async-state/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/async-state/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9233, - "brotli": 3912 + "min": 9287, + "brotli": 3933 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.debug.js index e400c64904..82c630ef85 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var hello_default = _template("__tests__/tags/hello/index.marko", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "#text/0", item.content, {}, 0, 0, $sg__input_item); _serialize_if($scope0_reason, 1) && writeScope($scope1_id, {}, "__tests__/tags/hello/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); _dynamic_tag($scope0_id, "#text/1", input.other, {}, 0, 0, _serialize_guard($scope0_reason, 2)); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/hello/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.js index cd3127e6d3..0eaf562c26 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var hello_default = _template("b", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "a", item.content, {}, 0, 0, $sg__input_item); _serialize_if($scope0_reason, 1) && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); _dynamic_tag($scope0_id, "b", input.other, {}, 0, 0, _serialize_guard($scope0_reason, 2)); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-with-params/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-with-params/sizes.json index bbe40e9edb..b4f3a3da2e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-with-params/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic-with-params/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13317, - "brotli": 5112 + "min": 13370, + "brotli": 5132 }, "files": { "tags/hello/index.marko": 196, diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.debug.js index 222e0f7842..00653c7e27 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var hello_default = _template("__tests__/tags/hello/index.marko", (input) => { _html(`${_el_resume($scope1_id, "#div/0")}`); _script($scope1_id, "__tests__/tags/hello/index.marko_1_attrs"); writeScope($scope1_id, {}, "__tests__/tags/hello/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_list_item, $sg__input_list_item, $sg__input_list_item__OR__input_col, 0, 1); + }, 0, $scope0_id, "#text/0", $sg__input_list_item, $sg__input_list_item, $sg__input_list_item__OR__input_col, 0, 1, 1); _for_of(input.col, ({ content, row, ...attrs }) => { const $scope2_id = _scope_id(); _html("
{ _html(`
${_el_resume($scope3_id, "#div/0")}`); _script($scope3_id, "__tests__/tags/hello/index.marko_3_attrs"); writeScope($scope3_id, {}, "__tests__/tags/hello/index.marko", "7:3"); - }, 0, $scope2_id, "#text/1", $sg__input_col, $sg__input_col, $sg__input_col, 0, 1); + }, 0, $scope2_id, "#text/1", $sg__input_col, $sg__input_col, $sg__input_col, 0, 1, 1); _script($scope2_id, "__tests__/tags/hello/index.marko_2_attrs"); writeScope($scope2_id, {}, "__tests__/tags/hello/index.marko", "5:1"); - }, 0, $scope0_id, "#text/1", $sg__input_col, $sg__input_col, $sg__input_list_item__OR__input_col); + }, 0, $scope0_id, "#text/1", $sg__input_col, $sg__input_col, $sg__input_list_item__OR__input_col, 0, 0, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/hello/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.js index 75e2055123..da2525d753 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var hello_default = _template("b", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "b0"); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_list_item, $sg__input_list_item, $sg__input_list_item__OR__input_col, 0, 1); + }, 0, $scope0_id, "a", $sg__input_list_item, $sg__input_list_item, $sg__input_list_item__OR__input_col, 0, 1, 1); _for_of(input.col, ({ content, row, ...attrs }) => { const $scope2_id = _scope_id(); _html("
{ _html(`
${_el_resume($scope3_id, "a")}`); _script($scope3_id, "b1"); writeScope($scope3_id, {}); - }, 0, $scope2_id, "b", $sg__input_col, $sg__input_col, $sg__input_col, 0, 1); + }, 0, $scope2_id, "b", $sg__input_col, $sg__input_col, $sg__input_col, 0, 1, 1); _script($scope2_id, "b2"); writeScope($scope2_id, {}); - }, 0, $scope0_id, "b", $sg__input_col, $sg__input_col, $sg__input_list_item__OR__input_col); + }, 0, $scope0_id, "b", $sg__input_col, $sg__input_col, $sg__input_list_item__OR__input_col, 0, 0, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/sizes.json index c00a6cb58a..05a2ebf28b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-dynamic/sizes.json @@ -6,13 +6,13 @@ "brotli": 2606 }, "files": { - "tags/hello/index.marko": 316, + "tags/hello/index.marko": 321, "template.marko": 351 } } }, "html": { - "min": 1662, - "brotli": 579 + "min": 898, + "brotli": 371 } } diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.debug.js index e1498dfba7..982c7cf657 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var list_default = _template("__tests__/tags/list/index.marko", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "#text/0", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}, "__tests__/tags/list/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}, "__tests__/tags/list/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.js index 5b5c0a4861..666b6a73c4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-closure/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var list_default = _template("b", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "a", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.debug.js index 9ccf520fe2..e9225813d4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var list_default = _template("__tests__/tags/list/index.marko", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "#text/0", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}, "__tests__/tags/list/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}, "__tests__/tags/list/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.js index 1fbafd88d5..ff423d83ce 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-for-loop-param-intersection-closure/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var list_default = _template("b", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "a", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.debug.js index c3d2e24207..b36598ccf2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var list_default = _template("__tests__/tags/list/index.marko", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "#text/0", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}, "__tests__/tags/list/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}, "__tests__/tags/list/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.js index d6d43234df..6f89b39e7d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/at-tags-static-repeated/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var list_default = _template("b", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "a", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.debug.js index 90a208f364..76db3a342b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var custom_tag_default = _template("__tests__/tags/custom-tag.marko", (input) => $si__input_test && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 1) && _scope_with_id($scope0_id) }, "__tests__/tags/custom-tag.marko", "3:2"); return 0; } - }, $scope0_id, "#text/1", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1); + }, $scope0_id, "#text/1", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { input_test_class: $si__input_test && input.test?.class, input_test_content: $si__input_test && input.test?.content diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.js index e9b2dab48f..8dbd0807f2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-class/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var custom_tag_default = _template("b", (input) => { $si__input_test && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 1) && _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1); + }, $scope0_id, "b", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { g: $si__input_test && input.test?.class, h: $si__input_test && input.test?.content diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.debug.js index 369be9aca1..3bd1dbe51e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var custom_tag_default = _template("__tests__/tags/custom-tag.marko", (input) => $si__input_test && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 1) && _scope_with_id($scope0_id) }, "__tests__/tags/custom-tag.marko", "3:2"); return 0; } - }, $scope0_id, "#text/1", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1); + }, $scope0_id, "#text/1", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { input_test_style: $si__input_test && input.test?.style, input_test_content: $si__input_test && input.test?.content diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.js index 773ce14cf2..59a8b38f6e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-style/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var custom_tag_default = _template("b", (input) => { $si__input_test && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 1) && _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1); + }, $scope0_id, "b", $sg__input_test, $sg__input_test, $sg__input_test, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, { g: $si__input_test && input.test?.style, h: $si__input_test && input.test?.content diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.debug.js index 1895ba5975..ea259e1218 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope3_id = _scope_id(); _dynamic_tag($scope3_id, "#text/0", item, {}, 0, 0, $sg__items); $si__items && writeScope($scope3_id, {}, "__tests__/template.marko", "2:4"); - }, 0, $scope1_id, "#text/0", $sg__items, $sg__items, $sg__items); + }, 0, $scope1_id, "#text/0", $sg__items, $sg__items, $sg__items, 0, 0, 1); $si__items && writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); }) }; forOf([[{ text: "hello" }, { text: "world" }]], (texts) => { diff --git a/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.js index 89933ef936..6c5395cfeb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/attr-tag-local-member-expression-closure/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var template_default = _template("a", (input) => { const $scope3_id = _scope_id(); _dynamic_tag($scope3_id, "a", item, {}, 0, 0, $sg__items); $si__items && writeScope($scope3_id, {}); - }, 0, $scope1_id, "a", $sg__items, $sg__items, $sg__items); + }, 0, $scope1_id, "a", $sg__items, $sg__items, $sg__items, 0, 0, 1); $si__items && writeScope($scope1_id, {}); }) }; forOf([[{ text: "hello" }, { text: "world" }]], (texts) => { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-cleanup/sizes.json index 698f925bb4..3db6f82c50 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-cleanup/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-cleanup/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 10340, - "brotli": 4317 + "min": 10411, + "brotli": 4340 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.debug.js index 9227980dee..33471505c9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.debug.js @@ -15,7 +15,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "6:1"); return 0; } - }, $scope0_id, "#text/3", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/3", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0_value"); writeScope($scope0_id, { value }, "__tests__/template.marko", 0, { value: "2:5" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.js index 1c6da64b1f..b07508a8e1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/__snapshots__/html.bundle.js @@ -15,7 +15,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "d", 1, 1, 1, 0, 1); + }, $scope0_id, "d", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { e: value }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/sizes.json index ec2d24ffda..5b725e44a1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-in-order/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6775, - "brotli": 3008 + "min": 6792, + "brotli": 3014 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.debug.js index 90e4e6fe6f..8b159dede1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.debug.js @@ -16,7 +16,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope4_id, { _: _scope_with_id($scope3_id) }, "__tests__/template.marko", "7:5"); return 0; } - }, $scope3_id, "#text/2", 1, 1, 1, 0, 1); + }, $scope3_id, "#text/2", 1, 1, 1, 0, 1, 1); _script($scope3_id, "__tests__/template.marko_3_value"); writeScope($scope3_id, { value }, "__tests__/template.marko", "4:3", { value: "5:9" }); _resume_branch($scope3_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.js index c1a2bc588a..0d0e6ec78d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/__snapshots__/html.bundle.js @@ -16,7 +16,7 @@ var template_default = _template("a", (input) => { writeScope($scope4_id, { _: _scope_with_id($scope3_id) }); return 0; } - }, $scope3_id, "c", 1, 1, 1, 0, 1); + }, $scope3_id, "c", 1, 1, 1, 0, 1, 1); _script($scope3_id, "a0"); writeScope($scope3_id, { d: value }); _resume_branch($scope3_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/sizes.json index c3dd5b739f..615960cc52 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-closure-within/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 7472, - "brotli": 3299 + "min": 7489, + "brotli": 3303 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..4bafd6a124 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,21 @@ +// template.marko +const $template = ""; +const $walks = " b%c"; +const $await_content__n = /* @__PURE__ */ _closure_get("n", ($scope) => _text($scope["#text/0"], $scope._.n)); +const $await_content__setup = $await_content__n; +const $await_content = /* @__PURE__ */ _await_content("#text/1", "
done
", "Db%l", $await_content__setup); +const $await_promise = /* @__PURE__ */ _await_promise("#text/1"); +const $n__closure = /* @__PURE__ */ _closure($await_content__n); +const $n__script = _script("__tests__/template.marko_0_n", ($scope) => _on($scope["#button/0"], "click", function() { + $n($scope, $scope.n + 1); +})); +const $n = /* @__PURE__ */ _let("n/2", ($scope) => { + $await_promise($scope, resolveAfter($scope.n, 0)); + $n__closure($scope); + $n__script($scope); +}); +function $setup($scope) { + $await_content($scope); + $n($scope, 0); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..69bed572be --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/dom.bundle.js @@ -0,0 +1,12 @@ +// template.marko +const $await_content__n = /* @__PURE__ */ _closure_get(2, ($scope) => _text($scope.a, $scope._.c)); +const $await_promise = /* @__PURE__ */ _await_promise(1); +const $n__closure = /* @__PURE__ */ _closure($await_content__n); +const $n__script = _script("a0", ($scope) => _on($scope.a, "click", function() { + $n($scope, $scope.c + 1); +})); +const $n = /* @__PURE__ */ _let(2, ($scope) => { + $await_promise($scope, resolveAfter($scope.c, 0)); + $n__closure($scope); + $n__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..451b1e494c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.debug.js @@ -0,0 +1,20 @@ +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + const $n__closures = new Set(); + let n = 0; + _html(`${_el_resume($scope0_id, "#button/0")}`); + _await($scope0_id, "#text/1", resolveAfter(n, 0), (v) => { + const $scope1_id = _scope_id(); + _html(`
done ${_escape(n)}${_el_resume($scope1_id, "#text/0")}
`); + _subscribe($n__closures, writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:2")); + _resume_branch($scope1_id); + }); + _script($scope0_id, "__tests__/template.marko_0_n"); + writeScope($scope0_id, { + n, + "ClosureScopes:n": $n__closures + }, "__tests__/template.marko", 0, { n: "2:6" }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..024624fa2f --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/html.bundle.js @@ -0,0 +1,20 @@ +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + const $n__closures = /* @__PURE__ */ new Set(); + let n = 0; + _html(`${_el_resume($scope0_id, "a")}`); + _await($scope0_id, "b", resolveAfter(n, 0), (v) => { + const $scope1_id = _scope_id(); + _html(`
done ${_escape(n)}${_el_resume($scope1_id, "a")}
`); + _subscribe($n__closures, writeScope($scope1_id, { _: _scope_with_id($scope0_id) })); + _resume_branch($scope1_id); + }); + _script($scope0_id, "a0"); + writeScope($scope0_id, { + c: n, + Bc: $n__closures + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.debug.md b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.debug.md new file mode 100644 index 0000000000..6b7b4e4fe7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.debug.md @@ -0,0 +1,50 @@ +# Render +```html + +``` + +# Update +```html + +
+ done 0 +
+``` +## Change +``` +INSERT: #a + #out +UPDATE: #out::text@5 "" => "0" +``` + +# Update +```js +c.querySelector("#a").click(); +``` + +# Update +```html + +
+ done 1 +
+``` +## Change +``` +UPDATE: #out::text@5 "0" => "1" +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.md b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.md new file mode 100644 index 0000000000..6b7b4e4fe7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-csr.md @@ -0,0 +1,50 @@ +# Render +```html + +``` + +# Update +```html + +
+ done 0 +
+``` +## Change +``` +INSERT: #a + #out +UPDATE: #out::text@5 "" => "0" +``` + +# Update +```js +c.querySelector("#a").click(); +``` + +# Update +```html + +
+ done 1 +
+``` +## Change +``` +UPDATE: #out::text@5 "0" => "1" +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.debug.md b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.debug.md new file mode 100644 index 0000000000..aa52bd1e55 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.debug.md @@ -0,0 +1,34 @@ +# Render +```html + +
+ done 0 +
+``` + +# Update +```js +c.querySelector("#a").click(); +``` +```html + +
+ done 1 +
+``` +## Change +``` +UPDATE: #out::text@5 "0" => "1" +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.md b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.md new file mode 100644 index 0000000000..aa52bd1e55 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/render-ssr.md @@ -0,0 +1,34 @@ +# Render +```html + +
+ done 0 +
+``` + +# Update +```js +c.querySelector("#a").click(); +``` +```html + +
+ done 1 +
+``` +## Change +``` +UPDATE: #out::text@5 "0" => "1" +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..5fa81317ea --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.debug.html @@ -0,0 +1,14 @@ + +
done 0
+ diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.html new file mode 100644 index 0000000000..6f3fe56b47 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/__snapshots__/writes.html @@ -0,0 +1,12 @@ + +
done 0
+ diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/sizes.json new file mode 100644 index 0000000000..cbedd9390b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/sizes.json @@ -0,0 +1,12 @@ +{ + "dom": { + "template.marko.page.mjs": { + "min": 7943, + "brotli": 3423 + } + }, + "html": { + "min": 467, + "brotli": 319 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/template.marko b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/template.marko new file mode 100644 index 0000000000..ac89cae2a8 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/template.marko @@ -0,0 +1,6 @@ +import { resolveAfter } from "../../utils/resolve"; + +A + + done ${n} +
diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/test.ts b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/test.ts new file mode 100644 index 0000000000..12fc4a5e42 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/await-no-try-resume-rerender/test.ts @@ -0,0 +1,9 @@ +import type { TestConfig } from "../../main.test"; +import { wait } from "../../utils/resolve"; +function clickA(c: Element) { + c.querySelector("#a")!.click(); +} +export const config: TestConfig = { + equivalent: false, + steps: [{}, wait, clickA, wait], +}; diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-remove-parent/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-remove-parent/sizes.json index 564002ff11..0b510008a1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-remove-parent/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-remove-parent/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9176, - "brotli": 3856 + "min": 9247, + "brotli": 3884 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-update-after-resume/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-update-after-resume/sizes.json index d8b5069f85..9fd25a2355 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-update-after-resume/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-update-after-resume/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9124, - "brotli": 3847 + "min": 9178, + "brotli": 3867 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/await-update-before-resume/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/await-update-before-resume/sizes.json index 119bdb027c..dc2eb243de 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/await-update-before-resume/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/await-update-before-resume/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9126, - "brotli": 3844 + "min": 9180, + "brotli": 3870 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.debug.js index 457d38d135..bab59c8554 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "5:2"); return 0; } - }, $scope0_id, "#text/2"); + }, $scope0_id, "#text/2", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "__tests__/template.marko_0_show"); _script($scope0_id, "__tests__/template.marko_0_count"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.js index 4b67cb20c3..388148909b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "c"); + }, $scope0_id, "c", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/sizes.json index 383945e4f8..a107641417 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter-multiple-nodes/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6190, - "brotli": 2811 + "min": 6207, + "brotli": 2819 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.debug.js index e89b3af26b..b48b9a0a82 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "5:2"); return 0; } - }, $scope0_id, "#text/2", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/2", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0_show"); _script($scope0_id, "__tests__/template.marko_0_count"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.js index 4114eadc12..68bbac23a8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "c", 1, 1, 1, 0, 1); + }, $scope0_id, "c", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/sizes.json index e0fdb99b3b..91e7f9e4b1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-conditional-counter/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6188, - "brotli": 2800 + "min": 6205, + "brotli": 2809 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.debug.js index d0ae2a3d77..1694a7902b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "8:2"); return 0; } - }, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, { message_text: message?.text }, "__tests__/template.marko", 0, { message_text: ["message.text", "1:6"] }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.js index f554b0a067..77bdf03704 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", 1, 1, 1, 0, 1); + }, $scope0_id, "b", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { d: message?.text }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/sizes.json index 9d6fce3c42..d9f24926fe 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-execution-order/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6220, - "brotli": 2818 + "min": 6237, + "brotli": 2828 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-for/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-for/sizes.json index a7a12681a3..7b603a9438 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-for/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-for/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7530, - "brotli": 3442 + "brotli": 3445 }, "files": { "tags/child.marko": 154, diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/sizes.json index 795284297a..72db053e8b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-params/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13901, - "brotli": 5377 + "min": 13954, + "brotli": 5389 }, "files": { "tags/child.marko": 440, diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.debug.js index 14aaf53231..24afad5d4f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.debug.js @@ -24,6 +24,6 @@ var template_default = _template("__tests__/template.marko", (input) => { num, _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:2", { num: "3:6" }); - }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 1, 1); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.js index 4ef53898ac..a4ec386064 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-for/__snapshots__/html.bundle.js @@ -24,6 +24,6 @@ var template_default = _template("a", (input) => { d: num, _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "a", 1, 0, 0, 0, 1, 1); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.debug.js index fd19b259d3..352d83cdca 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.debug.js @@ -17,7 +17,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope2_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "8:4"); return 1; } - }, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _html(""); writeScope($scope0_id, { clickCount }, "__tests__/template.marko", 0, { clickCount: "2:8" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.js index 7065de4a49..8275b7fbb2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/__snapshots__/html.bundle.js @@ -17,7 +17,7 @@ var template_default = _template("a", (input) => { writeScope($scope2_id, { _: _scope_with_id($scope0_id) }); return 1; } - }, $scope0_id, "a", 1, 1, 1, 0, 1); + }, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _html(""); writeScope($scope0_id, { b: clickCount }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/sizes.json index bd24bcd2ec..044387e999 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-nested-scope-if/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6228, - "brotli": 2842 + "min": 6245, + "brotli": 2847 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.debug.js index 9c87a97166..990cfd4518 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(item)}${_el_resume($scope1_id, "#text/0")}`); writeScope($scope1_id, {}, "__tests__/template.marko", "5:4"); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}${_el_resume($scope0_id, "#button/2")}`); _script($scope0_id, "__tests__/template.marko_0_items"); _script($scope0_id, "__tests__/template.marko_0_id_items"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.js index 2e15c52242..d2736f8616 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(item)}${_el_resume($scope1_id, "a")}`); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "b")}${_el_resume($scope0_id, "c")}`); _script($scope0_id, "a0"); _script($scope0_id, "a1"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/sizes.json index 61a52182d0..4e04685c3b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-push-pop-list/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7200, - "brotli": 3277 + "brotli": 3280 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.debug.js index 867e799070..33daf93b07 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.debug.js @@ -15,7 +15,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "4:4"); }, function(x) { return x; - }, $scope0_id, "#ul/0", 1, 1, 1, "", 1); + }, $scope0_id, "#ul/0", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}${_el_resume($scope0_id, "#button/2")}`); _script($scope0_id, "__tests__/template.marko_0_list"); _script($scope0_id, "__tests__/template.marko_0_open"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.js index 60dbbbf056..03b7dd68a7 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/__snapshots__/html.bundle.js @@ -15,7 +15,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, {}); }, function(x) { return x; - }, $scope0_id, "a", 1, 1, 1, "", 1); + }, $scope0_id, "a", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "b")}${_el_resume($scope0_id, "c")}`); _script($scope0_id, "a0"); _script($scope0_id, "a1"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/sizes.json index 8dd0add26e..051c56acee 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-shared-node-ref/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7341, - "brotli": 3319 + "brotli": 3316 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.debug.js index 8c5aee6c4e..163f30947e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "3:4"); return 0; } - }, $scope0_id, "#text/0"); + }, $scope0_id, "#text/0", void 0, void 0, void 0, void 0, void 0, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_show"); writeScope($scope0_id, { show }, "__tests__/template.marko", 0, { show: "2:8" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.js index 2ccf9a3f9a..dd71b4d0ae 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, {}); return 0; } - }, $scope0_id, "a"); + }, $scope0_id, "a", void 0, void 0, void 0, void 0, void 0, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { c: show }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/sizes.json index 2c7eecfae3..c8f25e0c83 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/basic-toggle-show/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 5858, - "brotli": 2677 + "min": 5875, + "brotli": 2686 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.debug.js index ba7ae4751f..2731518088 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:2"); return 0; } - }, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0_show"); writeScope($scope0_id, { show, diff --git a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.js index 033d45f4e4..eb92be6546 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", 1, 1, 1, 0, 1); + }, $scope0_id, "b", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { c: show, diff --git a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/sizes.json index 0b1f7fce98..05a21047e2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/batched-updates-cleanup/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6133, - "brotli": 2785 + "min": 6150, + "brotli": 2792 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/body-content/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/body-content/sizes.json index b2c26fe370..7edde08d6a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/body-content/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/body-content/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 9274, - "brotli": 3545 + "min": 9327, + "brotli": 3561 }, "files": { "tags/FancyButton.marko": 240, diff --git a/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.debug.js index 4591fa777a..bd8c5462e6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "7:4"); return 0; } - }, $scope0_id, "#div/2", 1, 1, 0, "", 1); + }, $scope0_id, "#div/2", 1, 1, 0, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _script($scope0_id, "__tests__/template.marko_0_count"); writeScope($scope0_id, { count }, "__tests__/template.marko", 0, { count: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.js index d6dbcf72e3..eb9f956f8a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/branch-closure-if-only-child/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "c", 1, 1, 0, "", 1); + }, $scope0_id, "c", 1, 1, 0, "", 1, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, { d: count }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-for-shallow/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-for-shallow/sizes.json index fdd3959d69..81e96e73bd 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-for-shallow/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-for-shallow/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7778, - "brotli": 3533 + "brotli": 3528 }, "files": { "tags/child.marko": 745, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-deep/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-deep/sizes.json index 111a53f8c3..1698d7fb99 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-deep/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-deep/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 7614, - "brotli": 3347 + "min": 7631, + "brotli": 3354 }, "files": { "tags/child.marko": 757, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-same-scope/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-same-scope/sizes.json index b65b565af5..9b5d3a2705 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-same-scope/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-same-scope/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6097, - "brotli": 2778 + "min": 6114, + "brotli": 2785 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-shallow/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-shallow/sizes.json index 28cc078ba4..1f244c0f57 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-shallow/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-n-child-if-shallow/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6284, - "brotli": 2849 + "min": 6301, + "brotli": 2860 }, "files": { "tags/child.marko": 387, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-deep/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-deep/sizes.json index 27bee7918d..bb3891fcdf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-deep/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-deep/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 8227, - "brotli": 3696 + "brotli": 3695 }, "files": { "tags/child.marko": 597, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-shallow/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-shallow/sizes.json index 005bf8ae2d..7ae1c843f1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-shallow/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-for-shallow/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7728, - "brotli": 3513 + "brotli": 3510 }, "files": { "tags/child.marko": 639, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-deep/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-deep/sizes.json index b220382ae0..4e0dc23068 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-deep/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-deep/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 7548, - "brotli": 3331 + "min": 7565, + "brotli": 3338 }, "files": { "tags/child.marko": 635, diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-same-scope/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-same-scope/sizes.json index 85f360d810..3ddcbf14b2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-same-scope/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-same-scope/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6079, - "brotli": 2766 + "min": 6096, + "brotli": 2777 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-shallow/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-shallow/sizes.json index 293723f46c..2257305dd2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-shallow/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/cleanup-single-child-if-shallow/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6266, - "brotli": 2839 + "min": 6283, + "brotli": 2847 }, "files": { "tags/child.marko": 369, diff --git a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.debug.js index d809b7655f..ada06266cc 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _serialize_if($scope0_reason, 0) && _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:4"); return 0; } - }, $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_x"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.js index 22e6411a26..c5c0d2b53c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/__snapshots__/html.bundle.js @@ -5,7 +5,7 @@ var template_default = _template("a", (input) => { let x = 0; const getMessage = _resume(() => input.message, "a0", $scope0_id); _html("
"); - _if(() => {}, $scope0_id, "a", 1, 1, 1, "
", 1); + _if(() => {}, $scope0_id, "a", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a1"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/sizes.json index e91bc004ca..bfb064ce0c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/closure-serialize-reason/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6159, - "brotli": 2803 + "min": 6176, + "brotli": 2805 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.debug.js index 97a80b5078..df6838dd0d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.debug.js @@ -11,9 +11,9 @@ var sections_default = _template("__tests__/tags/sections.marko", (input) => { $si__input_section && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }, "__tests__/tags/sections.marko", "2:4"); return 0; } - }, $scope1_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section); + }, $scope1_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section, void 0, void 0, 1); $si__input_section && writeScope($scope1_id, { content }, "__tests__/tags/sections.marko", "1:2", { content: "1:8" }); - }, 0, $scope0_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section); + }, 0, $scope0_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section, 0, 0, 1); $si__input_section && writeScope($scope0_id, {}, "__tests__/tags/sections.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.js index 743d9d45ed..ee0ebf8fe7 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/__snapshots__/html.bundle.js @@ -11,9 +11,9 @@ var sections_default = _template("b", (input) => { $si__input_section && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }); return 0; } - }, $scope1_id, "a", $sg__input_section, $sg__input_section, $sg__input_section); + }, $scope1_id, "a", $sg__input_section, $sg__input_section, $sg__input_section, void 0, void 0, 1); $si__input_section && writeScope($scope1_id, { d: content }); - }, 0, $scope0_id, "a", $sg__input_section, $sg__input_section, $sg__input_section); + }, 0, $scope0_id, "a", $sg__input_section, $sg__input_section, $sg__input_section, 0, 0, 1); $si__input_section && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/sizes.json index 491f0c9b70..3acea4dfd2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop-closure/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 15480, - "brotli": 6049 + "min": 15550, + "brotli": 6057 }, "files": { "tags/sections.marko": 827, diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.debug.js index 8e4bb447ea..5269636163 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.debug.js @@ -11,9 +11,9 @@ var sections_default = _template("__tests__/tags/sections.marko", (input) => { $si__input_section && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }, "__tests__/tags/sections.marko", "2:4"); return 0; } - }, $scope1_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section); + }, $scope1_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section, void 0, void 0, 1); $si__input_section && writeScope($scope1_id, { content }, "__tests__/tags/sections.marko", "1:2", { content: "1:8" }); - }, 0, $scope0_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section); + }, 0, $scope0_id, "#text/0", $sg__input_section, $sg__input_section, $sg__input_section, 0, 0, 1); $si__input_section && writeScope($scope0_id, {}, "__tests__/tags/sections.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.js index 49961dbc6d..2650bb62e9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-dynamic-tag-in-loop/__snapshots__/html.bundle.js @@ -11,9 +11,9 @@ var sections_default = _template("b", (input) => { $si__input_section && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }); return 0; } - }, $scope1_id, "a", $sg__input_section, $sg__input_section, $sg__input_section); + }, $scope1_id, "a", $sg__input_section, $sg__input_section, $sg__input_section, void 0, void 0, 1); $si__input_section && writeScope($scope1_id, { d: content }); - }, 0, $scope0_id, "a", $sg__input_section, $sg__input_section, $sg__input_section); + }, 0, $scope0_id, "a", $sg__input_section, $sg__input_section, $sg__input_section, 0, 0, 1); $si__input_section && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.debug.js index ce3551757b..796e71cdb8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "4:6"); return 0; } - }, $scope0_id, "#tbody/0", 1, 1, 1, "", 1); + }, $scope0_id, "#tbody/0", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_show"); writeScope($scope0_id, { show }, "__tests__/template.marko", 0, { show: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.js index 65e4f4c649..728369325d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/__snapshots__/html.bundle.js @@ -4,7 +4,7 @@ var template_default = _template("a", (input) => { const $scope0_id = _scope_id(); let show = false; _html(""); - _if(() => {}, $scope0_id, "a", 1, 1, 1, "", 1); + _if(() => {}, $scope0_id, "a", 1, 1, 1, "", 1, 1); _html(`
${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { c: show }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/sizes.json index ab6e0ccc26..69763c7f6a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/conditional-table-row/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 5872, - "brotli": 2681 + "min": 5889, + "brotli": 2691 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.debug.js index 5358f1402b..a8c1e21ce5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.debug.js @@ -26,7 +26,7 @@ var template_default = _template("__tests__/template.marko", (input) => { states = newStates; }, "__tests__/template.marko_1/valueChange", $scope1_id) || void 0 }, "__tests__/template.marko", "2:2", { "#LoopKey": "2:13" }); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _html(`
${_escape(states.join(","))}${_el_resume($scope0_id, "#text/1")}
`); writeScope($scope0_id, { states }, "__tests__/template.marko", 0, { states: "1:6" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.js index 9e351e7050..fb64fc3925 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/__snapshots__/html.bundle.js @@ -24,7 +24,7 @@ var template_default = _template("a", (input) => { states = newStates; }, "a0", $scope1_id) || void 0 }); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _html(`
${_escape(states.join(","))}${_el_resume($scope0_id, "b")}
`); writeScope($scope0_id, { c: states }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/sizes.json index 8598ade27d..5a97d4ac43 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-many/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 8441, - "brotli": 3736 + "brotli": 3739 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-spread/sizes.json index ae324698a3..32281c5ffa 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8812, - "brotli": 3338 + "min": 8865, + "brotli": 3353 }, "files": { "tags/checkbox.marko": 267, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-empty-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-empty-spread/sizes.json index 10934af2ec..7304aba6bd 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-empty-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-empty-spread/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8879, - "brotli": 3382 + "min": 8932, + "brotli": 3399 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-spread/sizes.json index 03449ad308..d8b999e773 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-value-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 9066, - "brotli": 3409 + "min": 9119, + "brotli": 3420 }, "files": { "tags/radio.marko": 261, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-values-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-values-spread/sizes.json index ee2045a970..8d5a1e6e62 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-values-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-checked-values-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 9069, - "brotli": 3409 + "min": 9122, + "brotli": 3423 }, "files": { "tags/checkbox.marko": 267, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-details-open-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-details-open-spread/sizes.json index 3abd7966c8..f3e2a58613 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-details-open-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-details-open-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8785, - "brotli": 3323 + "min": 8838, + "brotli": 3338 }, "files": { "tags/my-details.marko": 239, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-dialog-open-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-dialog-open-spread/sizes.json index 349cee16a8..7924144728 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-dialog-open-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-dialog-open-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 10451, - "brotli": 3922 + "min": 10504, + "brotli": 3936 }, "files": { "tags/my-dialog.marko": 246, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.debug.js index 0a03501e3a..f6a97d66d6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.debug.js @@ -16,7 +16,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "5:2"); return 0; } - }, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "#input/2")}${_escape(checkedValue)}${_el_resume($scope0_id, "#text/3")}${_el_resume($scope0_id, "#button/4")}`); _script($scope0_id, "__tests__/template.marko_0_show"); _script($scope0_id, "__tests__/template.marko_0"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.js index 2cfd44dd21..fbaf9074f0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/__snapshots__/html.bundle.js @@ -16,7 +16,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", 1, 1, 1, 0, 1); + }, $scope0_id, "b", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "c")}${_escape(checkedValue)}${_el_resume($scope0_id, "d")}${_el_resume($scope0_id, "e")}`); _script($scope0_id, "a2"); _script($scope0_id, "a3"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/sizes.json index 9724ec7dad..ca8e2af327 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-dynamic-checkbox-checked-value/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8241, - "brotli": 3558 + "min": 8258, + "brotli": 3567 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-input-value-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-input-value-spread/sizes.json index b0fb948ea4..0584d6935b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-input-value-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-input-value-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8791, - "brotli": 3328 + "min": 8844, + "brotli": 3346 }, "files": { "tags/my-input.marko": 237, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-merged-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-merged-spread/sizes.json index e0389c5860..f1afaa31c0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-merged-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-merged-spread/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8835, - "brotli": 3365 + "min": 8888, + "brotli": 3381 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-partial-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-partial-spread/sizes.json index 5d8432bc35..adeaf6b34e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-partial-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-partial-spread/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8858, - "brotli": 3374 + "min": 8911, + "brotli": 3385 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-dynamic-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-dynamic-spread/sizes.json index 8788f143a0..1c7e0a2477 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-dynamic-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-dynamic-spread/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13526, - "brotli": 5165 + "min": 13579, + "brotli": 5181 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.debug.js index bf5a2b2ff6..fb9b264c95 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.debug.js @@ -16,7 +16,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(opt)}${_el_resume($scope1_id, "#text/1")}${_el_resume($scope1_id, "#option/0")}`); writeScope($scope1_id, {}, "__tests__/template.marko", "5:6"); - }, (v) => v, $scope0_id, "#select/0", 1, 1, 1, "", 1); + }, (v) => v, $scope0_id, "#select/0", 1, 1, 1, "", 1, 1); }); _html(`
${_escape(value)}${_el_resume($scope0_id, "#text/1")}
${_el_resume($scope0_id, "#button/2")}${_el_resume($scope0_id, "#button/3")}`); _script($scope0_id, "__tests__/template.marko_0_options"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.js index 3970f54afd..57fe07d31e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/__snapshots__/html.bundle.js @@ -16,7 +16,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(opt)}${_el_resume($scope1_id, "b")}${_el_resume($scope1_id, "a")}`); writeScope($scope1_id, {}); - }, (v) => v, $scope0_id, "a", 1, 1, 1, "", 1); + }, (v) => v, $scope0_id, "a", 1, 1, 1, "", 1, 1); }); _html(`
${_escape(value)}${_el_resume($scope0_id, "b")}
${_el_resume($scope0_id, "c")}${_el_resume($scope0_id, "d")}`); _script($scope0_id, "a1"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/sizes.json index cf2859ddf9..cb9d3559d1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-mutated-option/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 9244, - "brotli": 3963 + "brotli": 3977 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-spread/sizes.json index 842ef5a33e..74fca3850e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-select-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-select-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 11795, - "brotli": 4416 + "min": 11848, + "brotli": 4429 }, "files": { "tags/my-select.marko": 246, diff --git a/packages/runtime-tags/src/__tests__/fixtures/controllable-textarea-value-spread/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/controllable-textarea-value-spread/sizes.json index 40a3460753..41a19b91bf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/controllable-textarea-value-spread/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/controllable-textarea-value-spread/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8779, - "brotli": 3318 + "min": 8832, + "brotli": 3333 }, "files": { "tags/my-textarea.marko": 240, diff --git a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.debug.js index e307c0e104..93ba8f8938 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.debug.js @@ -7,7 +7,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(n)}, `); $si__input_from__OR__input_to__OR__input_step && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, 0, $scope0_id, "#div/0", $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, ""); + }, 0, $scope0_id, "#div/0", $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, "", 0, 1); $si__input_from__OR__input_to__OR__input_step && writeScope($scope0_id, { input_from: _serialize_if($scope0_reason, 2) && input.from, input_to: _serialize_if($scope0_reason, 1) && input.to, diff --git a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.js index 9f4aad3b69..ca8de91f01 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-from/__snapshots__/html.bundle.js @@ -7,7 +7,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(n)}, `); $si__input_from__OR__input_to__OR__input_step && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, ""); + }, 0, $scope0_id, "a", $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, $sg__input_from__OR__input_to__OR__input_step, "", 0, 1); $si__input_from__OR__input_to__OR__input_step && writeScope($scope0_id, { d: _serialize_if($scope0_reason, 2) && input.from, e: _serialize_if($scope0_reason, 1) && input.to, diff --git a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.debug.js index b6063de64c..e0a414db5a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.debug.js @@ -7,12 +7,12 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`

${_escape(key)}: ${_sep($sg__input_children)}${_escape(text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}

`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, 0, $scope0_id, "#text/0", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, 0, $scope0_id, "#text/0", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); _for_in(input.children, (key) => { const $scope2_id = _scope_id(); _html(`

${_escape(key)}

`); $si__input_children && writeScope($scope2_id, {}, "__tests__/template.marko", "5:4"); - }, 0, $scope0_id, "#text/1", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, 0, $scope0_id, "#text/1", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); _html(""); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.js index 03a79096fb..03da8a5c5c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/create-and-clear-rows-loop-in/__snapshots__/html.bundle.js @@ -7,12 +7,12 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`

${_escape(key)}: ${_sep($sg__input_children)}${_escape(text)}${_el_resume($scope1_id, "b", $sg__input_children)}

`); $si__input_children && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, 0, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); _for_in(input.children, (key) => { const $scope2_id = _scope_id(); _html(`

${_escape(key)}

`); $si__input_children && writeScope($scope2_id, {}); - }, 0, $scope0_id, "b", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, 0, $scope0_id, "b", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); _html(""); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/sizes.json index f13f039d85..e5605da4b8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-args/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13456, - "brotli": 5173 + "min": 13509, + "brotli": 5185 }, "files": { "tags/custom-tag.marko": 686, diff --git a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/sizes.json index 54161c0adc..d40ce18a1d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-attributes/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13442, - "brotli": 5172 + "min": 13495, + "brotli": 5189 }, "files": { "tags/custom-tag.marko": 524, diff --git a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/sizes.json index 2dbe51ec2f..cf931f87fa 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/custom-tag-parameters-from-single-arg/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13355, - "brotli": 5138 + "min": 13408, + "brotli": 5151 }, "files": { "tags/custom-tag.marko": 469, diff --git a/packages/runtime-tags/src/__tests__/fixtures/define-tag-for-attribute-tag/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/define-tag-for-attribute-tag/sizes.json index a6e01d5385..a9c4978853 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/define-tag-for-attribute-tag/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/define-tag-for-attribute-tag/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13286, - "brotli": 5102 + "min": 13339, + "brotli": 5115 }, "files": { "tags/child.marko": 475, diff --git a/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-closure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-closure/sizes.json index 1af0ae7f5a..ce910ccebc 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-closure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-closure/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6610, - "brotli": 3007 + "min": 6627, + "brotli": 3018 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-conditional/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-conditional/sizes.json index 85f5831150..defcfbfddf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-conditional/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/define-tag-render-conditional/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6211, - "brotli": 2844 + "min": 6228, + "brotli": 2851 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.debug.js index f921cfe300..be72a7b29b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.debug.js @@ -29,7 +29,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "#text/0")}
  • `); writeScope($scope1_id, {}, "__tests__/template.marko", "10:4"); - }, 0, $scope0_id, "#ul/3", 1, 1, 1, "", 1); + }, 0, $scope0_id, "#ul/3", 1, 1, 1, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0_clear"); writeScope($scope0_id, { clear, diff --git a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.js index 6823e5bf74..6c40c60494 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/__snapshots__/html.bundle.js @@ -29,7 +29,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "a")}
  • `); writeScope($scope1_id, {}); - }, 0, $scope0_id, "d", 1, 1, 1, "", 1); + }, 0, $scope0_id, "d", 1, 1, 1, "", 1, 1); _script($scope0_id, "a1"); writeScope($scope0_id, { g: clear, diff --git a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/sizes.json index 2166b717fc..c041ae0705 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/destructure-stateful-upstream-alias/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7339, - "brotli": 3360 + "brotli": 3334 }, "files": { "tags/store.marko": 397, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.debug.js index 5cfc393762..e6713dc105 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "3:4"); return 0; } - }, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _if(() => { if (!show) { const $scope2_id = _scope_id(); @@ -19,7 +19,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope2_id, {}, "__tests__/template.marko", "7:4"); return 0; } - }, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "#button/2")}`); _script($scope0_id, "__tests__/template.marko_0_show"); writeScope($scope0_id, { show }, "__tests__/template.marko", 0, { show: "2:8" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.js index 30868b4a43..6fdfe7aa3b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/__snapshots__/html.bundle.js @@ -4,7 +4,7 @@ var template_default = _template("a", (input) => { const $scope0_id = _scope_id(); let show = false; _html("
    "); - _if(() => {}, $scope0_id, "a", 1, 1, 1, 0, 1); + _if(() => {}, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _if(() => { { const $scope2_id = _scope_id(); @@ -12,7 +12,7 @@ var template_default = _template("a", (input) => { writeScope($scope2_id, {}); return 0; } - }, $scope0_id, "b", 1, 1, 1, 0, 1); + }, $scope0_id, "b", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "c")}
    `); _script($scope0_id, "a0"); writeScope($scope0_id, { d: show }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/sizes.json index 355c3c1c01..4db5a9b751 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dollar-global-client/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6055, - "brotli": 2742 + "min": 6072, + "brotli": 2750 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/sizes.json index 2e233dbaed..a26f4404b9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-dynamic-tag/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13222, - "brotli": 5078 + "min": 13275, + "brotli": 5094 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/sizes.json index 40155fc67e..979342cb01 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-native-tag-events/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13091, - "brotli": 5022 + "min": 13144, + "brotli": 5038 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args-tag-var/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args-tag-var/sizes.json index 29ff583591..49b951b06e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args-tag-var/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args-tag-var/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 14044, - "brotli": 5384 + "min": 14097, + "brotli": 5402 }, "files": { "tags/custom-tag.marko": 343, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args/sizes.json index 3092937d28..9bc2645f61 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-args/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13861, - "brotli": 5324 + "min": 13914, + "brotli": 5338 }, "files": { "tags/custom-tag.marko": 291, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-native/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-native/sizes.json index f2cbab6913..4420a523c1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-native/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-native/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13886, - "brotli": 5338 + "min": 13939, + "brotli": 5354 }, "files": { "tags/child.marko": 323, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-tags/sizes.json index 32e0a4283a..b02d9106cd 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-custom-tags/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 14127, - "brotli": 5405 + "min": 14180, + "brotli": 5423 }, "files": { "tags/child1.marko": 366, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-input-intersection/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-input-intersection/sizes.json index 05f8152a89..a1c40dcff0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-input-intersection/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-input-intersection/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13226, - "brotli": 5079 + "min": 13279, + "brotli": 5094 }, "files": { "tags/my-tag.marko": 515, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..384d39fe5b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,42 @@ +// tags/child.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $showdivnull_content__setup__script = _script("__tests__/tags/child.marko_1", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "dyn destroyed"; +} })); +const $showdivnull_content__setup = $showdivnull_content__setup__script; +const $showdivnull_content = _content_resume("__tests__/tags/child.marko_1_content", 0, 0, $showdivnull_content__setup); +const $dynamicTag = /* @__PURE__ */ _dynamic_tag("#text/0", $showdivnull_content); +const $show$1 = ($scope, show) => $dynamicTag($scope, show ? "div" : null); +const $input = ($scope, input) => $show$1($scope, input.show); +var child_default = /* @__PURE__ */ _template("__tests__/tags/child.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = "
    init
    "; +const $walks = "b b b%c"; +const $if_content__show = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $show$1($scope["#childScope/0"], $scope._.show)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("__tests__/template.marko_0_show", ($scope) => _on($scope["#button/1"], "click", function() { + $show($scope, !$scope.show); +})); +const $show = /* @__PURE__ */ _let("show/4", ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $show($scope, false); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..90e0db23a1 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js @@ -0,0 +1,29 @@ +// tags/child.marko +const $template = ""; +const $setup = () => {}; +const $dynamicTag = /* @__PURE__ */ _dynamic_tag(0, _content_resume("b0", 0, 0, _script("b1", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "dyn destroyed"; +} })))); +const $show$1 = ($scope, show) => $dynamicTag($scope, show ? "div" : null); + +// template.marko +const $if_content__show = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $show$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $show($scope, !$scope.e); +})); +const $show = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..21868dcc6f --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js @@ -0,0 +1,45 @@ +// tags/child.marko +var child_default = _template("__tests__/tags/child.marko", (input) => { + const $scope0_reason = _scope_reason(); + const $scope0_id = _scope_id(); + const { show } = input; + _dynamic_tag($scope0_id, "#text/0", show ? "div" : null, {}, _content_resume("__tests__/tags/child.marko_1_content", () => { + const $scope1_id = _scope_id(); + _scope_reason(); + _script($scope1_id, "__tests__/tags/child.marko_1"); + _resume_branch($scope1_id); + }, $scope0_id), 0, _serialize_guard($scope0_reason, 0)); + _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "6:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_show"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + show + }, "__tests__/template.marko", 0, { + outer: "1:6", + show: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..d1645c0af3 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/html.bundle.js @@ -0,0 +1,42 @@ +// tags/child.marko +var child_default = _template("b", (input) => { + const $scope0_reason = _scope_reason(); + const $scope0_id = _scope_id(); + const { show } = input; + _dynamic_tag($scope0_id, "a", show ? "div" : null, {}, _content_resume("b0", () => { + const $scope1_id = _scope_id(); + _scope_reason(); + _script($scope1_id, "b1"); + _resume_branch($scope1_id); + }, $scope0_id), 0, _serialize_guard($scope0_reason, 0)); + _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: show + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.debug.md new file mode 100644 index 0000000000..19e700cee7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.debug.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +c.querySelector("#s").click(); +``` +```html +
    + dyn destroyed +
    + + +
    +``` +## Change +``` +INSERT: #s + div +REMOVE: #ref::text("init") +INSERT: #ref::text("dyn destroyed") +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html +
    + dyn destroyed +
    + + +``` +## Change +``` +REMOVE: #s + div +REMOVE: #ref::text("dyn destroyed") +INSERT: #ref::text("dyn destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.md new file mode 100644 index 0000000000..19e700cee7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/render.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +c.querySelector("#s").click(); +``` +```html +
    + dyn destroyed +
    + + +
    +``` +## Change +``` +INSERT: #s + div +REMOVE: #ref::text("init") +INSERT: #ref::text("dyn destroyed") +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html +
    + dyn destroyed +
    + + +``` +## Change +``` +REMOVE: #s + div +REMOVE: #ref::text("dyn destroyed") +INSERT: #ref::text("dyn destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..5338e1186a --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.debug.html @@ -0,0 +1,17 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.html new file mode 100644 index 0000000000..02d8895133 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/__snapshots__/writes.html @@ -0,0 +1,15 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/sizes.json new file mode 100644 index 0000000000..e58124ace1 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/sizes.json @@ -0,0 +1,18 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 13842, + "brotli": 5317 + }, + "files": { + "tags/child.marko": 395, + "template.marko": 865 + } + } + }, + "html": { + "min": 490, + "brotli": 316 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/tags/child.marko b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/tags/child.marko new file mode 100644 index 0000000000..a1e9c483b7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/tags/child.marko @@ -0,0 +1,4 @@ + +<${show ? "div" : null}> + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/template.marko b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/template.marko new file mode 100644 index 0000000000..99c1e86eb7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/template.marko @@ -0,0 +1,8 @@ + + +init
    +O +S + + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/test.ts b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/test.ts new file mode 100644 index 0000000000..e0b84c33bd --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-resume-owns-branch-cleanup/test.ts @@ -0,0 +1,8 @@ +import type { TestConfig } from "../../main.test"; +function clickS(c: Element) { + c.querySelector("#s")!.click(); +} +function clickO(c: Element) { + c.querySelector("#o")!.click(); +} +export const config: TestConfig = { steps: [{}, clickS, clickO] }; diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-single-arg/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-single-arg/sizes.json index 44061f521d..22edaf0685 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-single-arg/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-single-arg/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13906, - "brotli": 5325 + "min": 13959, + "brotli": 5342 }, "files": { "tags/custom-tag.marko": 316, diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-sometimes-null/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-sometimes-null/sizes.json index 144d537818..f6af863349 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-sometimes-null/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-sometimes-null/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13067, - "brotli": 5001 + "min": 13120, + "brotli": 5017 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/sizes.json index 5aa290eb2b..f81fea5164 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/dynamic-tag-with-updating-body/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13330, - "brotli": 5098 + "min": 13383, + "brotli": 5115 }, "files": { "tags/counter.marko": 393, diff --git a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.debug.js index 6f7111c638..3f1f0c4c0e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "20:2"); return 0; } - }, $scope0_id, "#text/2", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/2", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0_hide"); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, { hide }, "__tests__/template.marko", 0, { hide: "7:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.js index 230d666a42..bc505bc323 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, {}); return 0; } - }, $scope0_id, "c", 1, 1, 1, 0, 1); + }, $scope0_id, "c", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, { d: hide }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/sizes.json index 49501129a9..06ccc30d23 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/embed-control-flow-boundary/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6627, - "brotli": 2991 + "min": 6644, + "brotli": 2998 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-duplicate/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-duplicate/__snapshots__/html.bundle.debug.js index 0dc6f923c9..7223be2d03 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-duplicate/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-duplicate/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope1_id, "#button/0")}`); _script($scope1_id, "__tests__/template.marko_1"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "2:2"); - }, () => "dup", $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, () => "dup", $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, {}, "__tests__/template.marko", 0); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-object/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-object/__snapshots__/html.bundle.debug.js index 188b8407a1..7d106d4ed8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-object/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-object/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope1_id, "#button/0")}`); _script($scope1_id, "__tests__/template.marko_1"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "2:2"); - }, (item) => item, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, (item) => item, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, {}, "__tests__/template.marko", 0); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-static/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-static/__snapshots__/html.bundle.debug.js index 2a21f3ac51..7d7065b911 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/error-for-by-static/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/error-for-by-static/__snapshots__/html.bundle.debug.js @@ -6,6 +6,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(item.id)}${_el_resume($scope1_id, "#text/0", $sg__input_items)}`); $si__input_items && writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); - }, (item) => item, $scope0_id, "#text/0", $sg__input_items, $sg__input_items, $sg__input_items, 0, 1); + }, (item) => item, $scope0_id, "#text/0", $sg__input_items, $sg__input_items, $sg__input_items, 0, 1, 1); $si__input_items && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.debug.js index 58dfd52584..68076d4e07 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.debug.js @@ -31,9 +31,9 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope3_id, { _: _scope_with_id($scope1_id) }, "__tests__/template.marko", "9:6"); return 1; } - }, $scope1_id, "#text/0", 1, 1, 1, 0, 1); + }, $scope1_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope1_id, { item_id: item?.id }, "__tests__/template.marko", "5:4", { item_id: ["item.id", "5:8"] }); - }, "id", $scope0_id, "#div/0", 1, 1, 1, "
    "); + }, "id", $scope0_id, "#div/0", 1, 1, 1, "", 0, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_list_2_list_0_list_1"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.js index 219c4a343d..dd37385eae 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by-nested-branch-divergence/__snapshots__/html.bundle.js @@ -31,9 +31,9 @@ var template_default = _template("a", (input) => { writeScope($scope3_id, { _: _scope_with_id($scope1_id) }); return 1; } - }, $scope1_id, "a", 1, 1, 1, 0, 1); + }, $scope1_id, "a", 1, 1, 1, 0, 1, 1); writeScope($scope1_id, { e: item?.id }); - }, "id", $scope0_id, "a", 1, 1, 1, ""); + }, "id", $scope0_id, "a", 1, 1, 1, "", 0, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.debug.js index 687b9a782d..40bd2acf04 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.debug.js @@ -13,7 +13,7 @@ var template_default = _template("__tests__/template.marko", (input) => { index, _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:4", { index: "4:17" }); - }, (f) => f, $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, (f) => f, $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _if(() => { if (last !== undefined) { const $scope2_id = _scope_id(); @@ -21,7 +21,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope2_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "15:2"); return 0; } - }, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { messages, last diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.js index 6b87e77a26..8af353ada9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/__snapshots__/html.bundle.js @@ -13,7 +13,7 @@ var template_default = _template("a", (input) => { e: index, _: _scope_with_id($scope0_id) }); - }, (f) => f, $scope0_id, "a", 1, 1, 1, "", 1); + }, (f) => f, $scope0_id, "a", 1, 1, 1, "", 1, 1); _if(() => { if (last !== void 0) { const $scope2_id = _scope_id(); @@ -21,7 +21,7 @@ var template_default = _template("a", (input) => { writeScope($scope2_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "b", 1, 1, 1, 0, 1); + }, $scope0_id, "b", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { c: messages, d: last diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/sizes.json index 29eaa4118a..2fb2cb81bb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by-use-index/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8184, - "brotli": 3667 + "min": 8201, + "brotli": 3676 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.debug.js index 24535e70e3..290977dee3 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.debug.js @@ -30,31 +30,31 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope1_id, "#text/0")}`); writeScope($scope1_id, {}, "__tests__/template.marko", "17:6"); - }, "id", $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, "id", $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope2_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope2_id, "#text/0")}`); writeScope($scope2_id, {}, "__tests__/template.marko", "21:6"); - }, (item) => item.id, $scope0_id, "#div/1", 1, 1, 1, "
    ", 1); + }, (item) => item.id, $scope0_id, "#div/1", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope3_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope3_id, "#text/0")}`); writeScope($scope3_id, {}, "__tests__/template.marko", "25:6"); - }, getStringBy(), $scope0_id, "#div/2", 1, 1, 1, "
    ", 1); + }, getStringBy(), $scope0_id, "#div/2", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope4_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope4_id, "#text/0")}`); writeScope($scope4_id, {}, "__tests__/template.marko", "29:6"); - }, getFunctionBy(), $scope0_id, "#div/3", 1, 1, 1, "
    ", 1); + }, getFunctionBy(), $scope0_id, "#div/3", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope5_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope5_id, "#text/0")}`); writeScope($scope5_id, {}, "__tests__/template.marko", "33:6"); - }, getMissingBy(), $scope0_id, "#div/4", 1, 1, 1, "
    ", 1); + }, getMissingBy(), $scope0_id, "#div/4", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "#button/5")}`); _script($scope0_id, "__tests__/template.marko_0_items"); writeScope($scope0_id, { items }, "__tests__/template.marko", 0, { items: "14:8" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.js index 92ff7a85b4..c11edafee7 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by/__snapshots__/html.bundle.js @@ -27,31 +27,31 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope1_id, "a")}`); writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", 1, 1, 1, "", 1); + }, "id", $scope0_id, "a", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope2_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope2_id, "a")}`); writeScope($scope2_id, {}); - }, (item) => item.id, $scope0_id, "b", 1, 1, 1, "
    ", 1); + }, (item) => item.id, $scope0_id, "b", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope3_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope3_id, "a")}`); writeScope($scope3_id, {}); - }, getStringBy(), $scope0_id, "c", 1, 1, 1, "
    ", 1); + }, getStringBy(), $scope0_id, "c", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope4_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope4_id, "a")}`); writeScope($scope4_id, {}); - }, getFunctionBy(), $scope0_id, "d", 1, 1, 1, "
    ", 1); + }, getFunctionBy(), $scope0_id, "d", 1, 1, 1, "", 1, 1); _html("
    "); _for_of(items, ({ text }) => { const $scope5_id = _scope_id(); _html(`${_escape(text)}${_el_resume($scope5_id, "a")}`); writeScope($scope5_id, {}); - }, void 0, $scope0_id, "e", 1, 1, 1, "
    ", 1); + }, void 0, $scope0_id, "e", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "f")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { g: items }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-by/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-by/sizes.json index bd94351f0a..830a888a7c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-by/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-by/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7511, - "brotli": 3316 + "brotli": 3321 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.debug.js index e7b813ecb4..4d50ff1ee5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.debug.js @@ -12,7 +12,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
    ${_escape(name)}${_el_resume($scope1_id, "#text/0")}: ${_escape(description)}${_el_resume($scope1_id, "#text/1")}
    `); writeScope($scope1_id, {}, "__tests__/template.marko", "5:4"); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}${_el_resume($scope0_id, "#button/2")}`); _script($scope0_id, "__tests__/template.marko_0_items"); writeScope($scope0_id, { items }, "__tests__/template.marko", 0, { items: "3:8" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.js index 13ff68a10f..1dc91918a2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`
    ${_escape(name)}${_el_resume($scope1_id, "a")}: ${_escape(description)}${_el_resume($scope1_id, "b")}
    `); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _html(`${_el_resume($scope0_id, "b")}${_el_resume($scope0_id, "c")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { d: items }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/sizes.json index ea405884f9..abc17972ed 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-destructure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-destructure/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7179, - "brotli": 3260 + "brotli": 3262 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.debug.js index df60bc1150..08cd1950ee 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope1_id, "#button/0")}`); _script($scope1_id, "__tests__/template.marko_1_num"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:2"); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { num }, "__tests__/template.marko", 0, { num: "1:6" }); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.js index 4fc845ba81..f1c8c901eb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/__snapshots__/html.bundle.js @@ -8,7 +8,7 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "a0"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { b: num }); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/sizes.json index b9a1e9cb0c..112ffa8c67 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-event-handler/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7109, - "brotli": 3266 + "brotli": 3260 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.debug.js index 301345a989..2811417fac 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope1_id, "#button/0")}`); _script($scope1_id, "__tests__/template.marko_1_items"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:4"); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); _html(`
    ${_el_resume($scope0_id, "#div/1")}`); writeScope($scope0_id, { items }, "__tests__/template.marko", 0, { items: "1:6" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.js index 1fa0a83440..da471800a1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-loop-closure-remove-all-items/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "a0"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); _html(`
    ${_el_resume($scope0_id, "b")}`); writeScope($scope0_id, { c: items }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-of-by-nullish-key/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-of-by-nullish-key/__snapshots__/html.bundle.debug.js index 3f58c7ee28..8c9691af85 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-of-by-nullish-key/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-of-by-nullish-key/__snapshots__/html.bundle.debug.js @@ -14,7 +14,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item.text)}${_el_resume($scope1_id, "#text/0")}
  • `); writeScope($scope1_id, {}, "__tests__/template.marko", "6:4"); - }, "id", $scope0_id, "#ul/0", 1, 1, 1, "", 1); + }, "id", $scope0_id, "#ul/0", 1, 1, 1, "", 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_items"); writeScope($scope0_id, { items }, "__tests__/template.marko", 0, { items: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-grow-shrink/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-insert-middle/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-mixed/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-replace/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-reverse/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.debug.js index 58ead4d172..8f39d14e55 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/1", $sg__input_children)}${_el_resume($scope1_id, "#span/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.js index 7d62ce4ada..9d2f81311c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-rotate/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "b", $sg__input_children)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.debug.js index 03d2551d8e..345f49dbc6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.debug.js @@ -7,6 +7,6 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "#text/0", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); - }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.js index 3feba4001e..2fb7db1f0b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-reorder-swap/__snapshots__/html.bundle.js @@ -7,6 +7,6 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(child.text)}${_el_resume($scope1_id, "a", $sg__input_children)}`); $si__input_children && writeScope($scope1_id, {}); - }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, "id", $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..817354e0ff --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,48 @@ +// tags/child.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $for_content__setup__script = _script("__tests__/tags/child.marko_1", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "item destroyed"; +} })); +const $for_content__setup = ($scope) => { + _text($scope["#text/0"], $scope["#LoopKey"]); + $for_content__setup__script($scope); +}; +const $for = /* @__PURE__ */ _for_to("#text/0", "

    item

    ", "Db%l", $for_content__setup); +const $count$1 = ($scope, count) => $for($scope, [ + count, + 0, + 1 +]); +const $input = ($scope, input) => $count$1($scope, input.count); +var child_default = /* @__PURE__ */ _template("__tests__/tags/child.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = "
    init
    "; +const $walks = "b b b%c"; +const $if_content__count = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $count$1($scope["#childScope/0"], $scope._.count)); +const $if_content__setup = ($scope) => { + $if_content__count._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $count__script = _script("__tests__/template.marko_0_count", ($scope) => _on($scope["#button/1"], "click", function() { + $count($scope, $scope.count + 1); +})); +const $count = /* @__PURE__ */ _let("count/4", ($scope) => { + $if_content__count($scope); + $count__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $count($scope, 0); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..bd80a98ac7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js @@ -0,0 +1,38 @@ +// tags/child.marko +const $template = ""; +const $setup = () => {}; +const $for_content__setup__script = _script("b0", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "item destroyed"; +} })); +const $for_content__setup = ($scope) => { + _text($scope.a, $scope.M); + $for_content__setup__script($scope); +}; +const $for = /* @__PURE__ */ _for_to(0, "

    item

    ", "Db%l", $for_content__setup); +const $count$1 = ($scope, count) => $for($scope, [ + count, + 0, + 1 +]); + +// template.marko +const $if_content__count = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $count$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__count._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $count__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $count($scope, $scope.e + 1); +})); +const $count = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__count($scope); + $count__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..8d244358fc --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js @@ -0,0 +1,45 @@ +// tags/child.marko +var child_default = _template("__tests__/tags/child.marko", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_count = _serialize_guard($scope0_reason, 0), $si__input_count = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { count } = input; + _for_to(count, 0, 1, (i) => { + const $scope1_id = _scope_id(); + _html(`

    item ${_escape(i)}

    `); + _script($scope1_id, "__tests__/tags/child.marko_1"); + $si__input_count && writeScope($scope1_id, {}, "__tests__/tags/child.marko", "2:2"); + }, 0, $scope0_id, "#text/0", $sg__input_count, $sg__input_count, $sg__input_count, 0, 1); + $si__input_count && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let count = 0; + _html(`
    init
    ${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ count }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "6:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_count"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + count + }, "__tests__/template.marko", 0, { + outer: "1:6", + count: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..0a6c2df9c6 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/html.bundle.js @@ -0,0 +1,42 @@ +// tags/child.marko +var child_default = _template("b", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_count = _serialize_guard($scope0_reason, 0), $si__input_count = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { count } = input; + _for_to(count, 0, 1, (i) => { + const $scope1_id = _scope_id(); + _html(`

    item ${_escape(i)}

    `); + _script($scope1_id, "b0"); + $si__input_count && writeScope($scope1_id, {}); + }, 0, $scope0_id, "a", $sg__input_count, $sg__input_count, $sg__input_count, 0, 1); + $si__input_count && writeScope($scope0_id, {}); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let count = 0; + _html(`
    init
    ${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ count }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: count + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.debug.md new file mode 100644 index 0000000000..86ad08fdfb --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.debug.md @@ -0,0 +1,85 @@ +# Render +```html +
    + init +
    + + +

    + item 0 +

    +``` + +# Update +```js +container.querySelector("#a").click(); +``` +```html +
    + init +
    + + +

    + item 0 +

    +

    + item 1 +

    +``` +## Change +``` +INSERT: p:nth-of-type(1) + p +UPDATE: p:nth-of-type(2)::text@5 "" => "1" +``` + +# Update +```js +container.querySelector("#o").click(); +``` +```html +
    + item destroyed +
    + + +``` +## Change +``` +REMOVE: #a + p +REMOVE: #a + p +REMOVE: #ref::text("init") +INSERT: #ref::text("item destroyed") +REMOVE: #ref::text("item destroyed") +INSERT: #ref::text("item destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.md new file mode 100644 index 0000000000..86ad08fdfb --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/render.md @@ -0,0 +1,85 @@ +# Render +```html +
    + init +
    + + +

    + item 0 +

    +``` + +# Update +```js +container.querySelector("#a").click(); +``` +```html +
    + init +
    + + +

    + item 0 +

    +

    + item 1 +

    +``` +## Change +``` +INSERT: p:nth-of-type(1) + p +UPDATE: p:nth-of-type(2)::text@5 "" => "1" +``` + +# Update +```js +container.querySelector("#o").click(); +``` +```html +
    + item destroyed +
    + + +``` +## Change +``` +REMOVE: #a + p +REMOVE: #a + p +REMOVE: #ref::text("init") +INSERT: #ref::text("item destroyed") +REMOVE: #ref::text("item destroyed") +INSERT: #ref::text("item destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..df92dc619d --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.debug.html @@ -0,0 +1,18 @@ +
    init
    +

    item 0

    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.html new file mode 100644 index 0000000000..45e3392f03 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/__snapshots__/writes.html @@ -0,0 +1,16 @@ +
    init
    +

    item 0

    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/sizes.json new file mode 100644 index 0000000000..e3adcafdeb --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/sizes.json @@ -0,0 +1,18 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 8017, + "brotli": 3631 + }, + "files": { + "tags/child.marko": 544, + "template.marko": 876 + } + } + }, + "html": { + "min": 492, + "brotli": 324 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/tags/child.marko b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/tags/child.marko new file mode 100644 index 0000000000..85c8c0a8b6 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/tags/child.marko @@ -0,0 +1,5 @@ + + +

    item ${i}

    + +
    diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/template.marko b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/template.marko new file mode 100644 index 0000000000..b343897ae5 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/template.marko @@ -0,0 +1,8 @@ + + +init +O +A + + +
    diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/test.ts b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/test.ts new file mode 100644 index 0000000000..1ec990289c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-owns-branch-cleanup/test.ts @@ -0,0 +1,12 @@ +import type { TestConfig } from "../../main.test"; + +function add(container: Element) { + container.querySelector("#a")!.click(); +} +function toggleOuter(container: Element) { + container.querySelector("#o")!.click(); +} + +export const config: TestConfig = { + steps: [{}, add, toggleOuter], +}; diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..40d418cc86 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,42 @@ +// tags/list.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $for_content__setup = ($scope) => _text($scope["#text/0"], $scope["#LoopKey"]); +const $for = /* @__PURE__ */ _for_to("#text/0", "
  • item
  • ", "Db%l", $for_content__setup); +const $count$1 = ($scope, count) => $for($scope, [ + count, + 0, + 1 +]); +const $input = ($scope, input) => $count$1($scope, input.count); +var list_default = /* @__PURE__ */ _template("__tests__/tags/list.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = ""; +const $walks = " b b%c"; +const $if_content__count = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $count$1($scope["#childScope/0"], $scope._.count)); +const $if_content__setup = ($scope) => { + $if_content__count._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $count__script = _script("__tests__/template.marko_0_count", ($scope) => _on($scope["#button/1"], "click", function() { + $count($scope, $scope.count + 1); +})); +const $count = /* @__PURE__ */ _let("count/4", ($scope) => { + $if_content__count($scope); + $count__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $count($scope, 2); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..d6360b5887 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js @@ -0,0 +1,32 @@ +// tags/list.marko +const $template = ""; +const $setup = () => {}; +const $for_content__setup = ($scope) => _text($scope.a, $scope.M); +const $for = /* @__PURE__ */ _for_to(0, "
  • item
  • ", "Db%l", $for_content__setup); +const $count$1 = ($scope, count) => $for($scope, [ + count, + 0, + 1 +]); + +// template.marko +const $if_content__count = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $count$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__count._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $count__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $count($scope, $scope.e + 1); +})); +const $count = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__count($scope); + $count__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..148648b928 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js @@ -0,0 +1,44 @@ +// tags/list.marko +var list_default = _template("__tests__/tags/list.marko", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_count = _serialize_guard($scope0_reason, 0), $si__input_count = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { count } = input; + _for_to(count, 0, 1, (i) => { + const $scope1_id = _scope_id(); + _html(`
  • item ${_escape(i)}
  • `); + $si__input_count && writeScope($scope1_id, {}, "__tests__/tags/list.marko", "2:2"); + }, 0, $scope0_id, "#text/0", $sg__input_count, $sg__input_count, $sg__input_count, 0, 1, 1); + $si__input_count && writeScope($scope0_id, {}, "__tests__/tags/list.marko", 0); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let count = 2; + _html(`${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + list_default({ count }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "5:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_count"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + count + }, "__tests__/template.marko", 0, { + outer: "1:6", + count: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..1cbb0f8c81 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js @@ -0,0 +1,41 @@ +// tags/list.marko +var list_default = _template("b", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_count = _serialize_guard($scope0_reason, 0), $si__input_count = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { count } = input; + _for_to(count, 0, 1, (i) => { + const $scope1_id = _scope_id(); + _html(`
  • item ${_escape(i)}
  • `); + $si__input_count && writeScope($scope1_id, {}); + }, 0, $scope0_id, "a", $sg__input_count, $sg__input_count, $sg__input_count, 0, 1, 1); + $si__input_count && writeScope($scope0_id, {}); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let count = 2; + _html(`${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + list_default({ count }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: count + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md new file mode 100644 index 0000000000..c6ae4b4019 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md @@ -0,0 +1,85 @@ +# Render +```html + + +
  • + item 0 +
  • +
  • + item 1 +
  • +
  • + item 2 +
  • +``` + +# Update +```js +el.querySelector("#c").click(); +``` +```html + + +
  • + item 0 +
  • +
  • + item 1 +
  • +
  • + item 2 +
  • +
  • + item 3 +
  • +``` +## Change +``` +INSERT: li:nth-of-type(3) + li +UPDATE: li:nth-of-type(4)::text@5 "" => "3" +``` + +# Update +```js +el.querySelector("#o").click(); +``` +```html + + +``` +## Change +``` +REMOVE: #c + li +REMOVE: #c + li +REMOVE: #c + li +REMOVE: #c + li +``` + +# Update +```js +el.querySelector("#c").click(); +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.md new file mode 100644 index 0000000000..c6ae4b4019 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/render.md @@ -0,0 +1,85 @@ +# Render +```html + + +
  • + item 0 +
  • +
  • + item 1 +
  • +
  • + item 2 +
  • +``` + +# Update +```js +el.querySelector("#c").click(); +``` +```html + + +
  • + item 0 +
  • +
  • + item 1 +
  • +
  • + item 2 +
  • +
  • + item 3 +
  • +``` +## Change +``` +INSERT: li:nth-of-type(3) + li +UPDATE: li:nth-of-type(4)::text@5 "" => "3" +``` + +# Update +```js +el.querySelector("#o").click(); +``` +```html + + +``` +## Change +``` +REMOVE: #c + li +REMOVE: #c + li +REMOVE: #c + li +REMOVE: #c + li +``` + +# Update +```js +el.querySelector("#c").click(); +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..c9ddf62033 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html @@ -0,0 +1,18 @@ + +
  • item 0
  • +
  • item 1
  • +
  • item 2
  • + diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.html new file mode 100644 index 0000000000..4eb300b44e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/__snapshots__/writes.html @@ -0,0 +1,16 @@ + +
  • item 0
  • +
  • item 1
  • +
  • item 2
  • + diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/sizes.json new file mode 100644 index 0000000000..9776c71d72 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/sizes.json @@ -0,0 +1,18 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 7671, + "brotli": 3499 + }, + "files": { + "tags/list.marko": 323, + "template.marko": 876 + } + } + }, + "html": { + "min": 495, + "brotli": 320 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/tags/list.marko b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/tags/list.marko new file mode 100644 index 0000000000..6f2db2613d --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/tags/list.marko @@ -0,0 +1,4 @@ + + +
  • item ${i}
  • +
    diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/template.marko b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/template.marko new file mode 100644 index 0000000000..5ea14f644b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/template.marko @@ -0,0 +1,7 @@ + + +O +C + + +
    diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/test.ts b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/test.ts new file mode 100644 index 0000000000..35b19f74da --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/for-resume-skip-link-when-cleanup-free/test.ts @@ -0,0 +1,8 @@ +import type { TestConfig } from "../../main.test"; +function c(el: Element) { + el.querySelector("#c")!.click(); +} +function o(el: Element) { + el.querySelector("#o")!.click(); +} +export const config: TestConfig = { steps: [{}, c, o, c] }; diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.debug.js index 62d38bb74e..0343c89757 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html("
    "); writeScope($scope1_id, {}, "__tests__/template.marko", "3:4"); - }, 0, $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, 0, $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0_children"); writeScope($scope0_id, { children }, "__tests__/template.marko", 0, { children: "1:6" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.js index db6f343c44..54763e3611 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/__snapshots__/html.bundle.js @@ -8,7 +8,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html("
    "); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", 1, 1, 1, "", 1); + }, 0, $scope0_id, "a", 1, 1, 1, "", 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { b: children }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/sizes.json index 67612f0cd3..e4953d4b2e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-node-only-child-in-parent/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 6899, - "brotli": 3130 + "brotli": 3134 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.debug.js index 2399a3db78..c11f49c599 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html("Child"); writeScope($scope1_id, {}, "__tests__/template.marko", "4:4"); - }, 0, $scope0_id, "#text/1"); + }, 0, $scope0_id, "#text/1", void 0, void 0, void 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "#div/0")}`); _script($scope0_id, "__tests__/template.marko_0_children"); writeScope($scope0_id, { children }, "__tests__/template.marko", 0, { children: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.js index df2d20af8c..bfe25dabcb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/__snapshots__/html.bundle.js @@ -8,7 +8,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html("Child"); writeScope($scope1_id, {}); - }, 0, $scope0_id, "b"); + }, 0, $scope0_id, "b", void 0, void 0, void 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "a")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { c: children }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/sizes.json index fed4d3e036..ed77272de9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-single-text-node-with-text-before/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 6893, - "brotli": 3129 + "brotli": 3130 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.debug.js index fa2469e03b..6ea5894bdc 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.debug.js @@ -7,7 +7,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(index)}-${_escape(count)}${_el_resume($scope1_id, "#text/1")}`); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:2"); - }, 0, $scope0_id, "#text/0", 1, 0, 0); + }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_count"); writeScope($scope0_id, { count }, "__tests__/template.marko", 0, { count: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.js index eb1f1ab5c3..47400fb544 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-static-value-with-closure/__snapshots__/html.bundle.js @@ -7,7 +7,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`${_escape(index)}-${_escape(count)}${_el_resume($scope1_id, "b")}`); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 0, 0); + }, 0, $scope0_id, "a", 1, 0, 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { d: count }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.debug.js index 91861f9601..895d191a95 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.debug.js @@ -20,7 +20,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope2_id = _scope_id(); _html(`
    ${_escape(i)}: ${_escape(val)}${_el_resume($scope2_id, "#text/1")}
    `); writeScope($scope2_id, {}, "__tests__/template.marko", "9:2"); - }, 0, $scope0_id, "#text/1", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/1", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.js index 62343d7fee..8fb2f049f4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/__snapshots__/html.bundle.js @@ -18,7 +18,7 @@ var template_default = _template("a", (input) => { const $scope2_id = _scope_id(); _html(`
    ${_escape(i)}: ${_escape(val)}${_el_resume($scope2_id, "b")}
    `); writeScope($scope2_id, {}); - }, 0, $scope0_id, "b", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "b", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, {}); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/sizes.json index 802940a635..f172a1f895 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-tag-with-state/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 6674, - "brotli": 3069 + "brotli": 3070 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.debug.js index f3f4ffd090..4d62e772ba 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.debug.js @@ -8,7 +8,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope1_id, "#button/0")}`); _script($scope1_id, "__tests__/template.marko_1_end"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:2"); - }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { end }, "__tests__/template.marko", 0, { end: "3:6" }); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.js index 89c212a512..af4af86e5a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/__snapshots__/html.bundle.js @@ -8,7 +8,7 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "a0"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 1, 1, 0, 1); + }, 0, $scope0_id, "a", 1, 1, 1, 0, 1, 1); writeScope($scope0_id, { b: end }); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/sizes.json index 814709fba1..0ff94988f5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/for-to-range-resume-key/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7114, - "brotli": 3288 + "brotli": 3265 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.debug.js index 0b92d9058b..2fef4106b4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "#text/0")}
  • `); writeScope($scope1_id, {}, "__tests__/template.marko", "7:4"); - }, 0, $scope0_id, "#ul/1", 1, 1, 1, "", 1); + }, 0, $scope0_id, "#ul/1", 1, 1, 1, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _script($scope0_id, "__tests__/template.marko_0_items"); writeScope($scope0_id, { items }, "__tests__/template.marko", 0, { items: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.js index 87b30bce4a..d4822eb5d0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "a")}
  • `); writeScope($scope1_id, {}); - }, 0, $scope0_id, "b", 1, 1, 1, "", 1); + }, 0, $scope0_id, "b", 1, 1, 1, "", 1, 1); _script($scope0_id, "a1"); _script($scope0_id, "a2"); writeScope($scope0_id, { c: items }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/sizes.json index f219b50b53..79eefab57a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/getter-on-single-node-only-child/sizes.json @@ -2,7 +2,7 @@ "dom": { "template.marko.page.mjs": { "min": 7119, - "brotli": 3252 + "brotli": 3262 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-custom-tag-var-from-dynamic/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/hoist-custom-tag-var-from-dynamic/sizes.json index 87a5daed83..25f2a0dd2b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-custom-tag-var-from-dynamic/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-custom-tag-var-from-dynamic/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13776, - "brotli": 5278 + "min": 13829, + "brotli": 5290 }, "files": { "tags/thing.marko": 364, diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-from-dynamic/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-from-dynamic/sizes.json index 80b21569bb..10e4cc2795 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-from-dynamic/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-from-dynamic/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 14431, - "brotli": 5531 + "min": 14484, + "brotli": 5548 }, "files": { "tags/child.marko": 351, diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.debug.js index addca2050d..5a068ab8ad 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.debug.js @@ -20,7 +20,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _var($scope1_id, "#scopeOffset/1", $Child_scope, "__tests__/template.marko_1_setHtml/var"); writeScope($scope1_id, { setHtml }, "__tests__/template.marko", "3:2", { setHtml: "4:18" }); _assert_hoist(setHtml); - }, 0, $scope0_id, "#text/0", 1, 0, 0); + }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 0, 1); let to = 3; _html("
    "); _for_to(to, 0, 1, () => { @@ -30,7 +30,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _var($scope2_id, "#scopeOffset/1", $Child_scope2, "__tests__/template.marko_2_setHtml2/var"); writeScope($scope2_id, { setHtml2 }, "__tests__/template.marko", "14:2", { setHtml2: "15:18" }); _assert_hoist(setHtml2); - }, 0, $scope0_id, "#text/1", 1, 0, 0); + }, 0, $scope0_id, "#text/1", 1, 0, 0, 0, 0, 1); _html("
    "); _for_to(3, 0, 1, (i) => { const $scope3_id = _scope_id(); @@ -42,10 +42,10 @@ var template_default = _template("__tests__/template.marko", (input) => { _var($scope4_id, "#scopeOffset/1", $Child_scope3, "__tests__/template.marko_4_setHtml3/var"); writeScope($scope4_id, { setHtml3 }, "__tests__/template.marko", "26:4", { setHtml3: "27:20" }); _assert_hoist(setHtml3); - }, 0, $scope3_id, "#ul/0", 1, 0, 0); + }, 0, $scope3_id, "#ul/0", 1, 0, 0, 0, 0, 1); _html(""); writeScope($scope3_id, {}, "__tests__/template.marko", "24:2"); - }, 0, $scope0_id, "#text/2", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "#text/2", 1, 0, 0, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.js index db2c5bf0d6..792767b6b0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var-many/__snapshots__/html.bundle.js @@ -19,7 +19,7 @@ var template_default = _template("a", (input) => { let setHtml = _dynamic_tag($scope1_id, "a", child_default, {}); _var($scope1_id, "b", $Child_scope, "a1"); writeScope($scope1_id, { c: setHtml }); - }, 0, $scope0_id, "a", 1, 0, 0); + }, 0, $scope0_id, "a", 1, 0, 0, 0, 0, 1); let to = 3; _html("
    "); _for_to(to, 0, 1, () => { @@ -28,7 +28,7 @@ var template_default = _template("a", (input) => { let setHtml2 = _dynamic_tag($scope2_id, "a", child_default, {}); _var($scope2_id, "b", $Child_scope2, "a2"); writeScope($scope2_id, { c: setHtml2 }); - }, 0, $scope0_id, "b", 1, 0, 0); + }, 0, $scope0_id, "b", 1, 0, 0, 0, 0, 1); _html("
    "); _for_to(3, 0, 1, (i) => { const $scope3_id = _scope_id(); @@ -39,10 +39,10 @@ var template_default = _template("a", (input) => { let setHtml3 = _dynamic_tag($scope4_id, "a", child_default, {}); _var($scope4_id, "b", $Child_scope3, "a3"); writeScope($scope4_id, { c: setHtml3 }); - }, 0, $scope3_id, "a", 1, 0, 0); + }, 0, $scope3_id, "a", 1, 0, 0, 0, 0, 1); _html(""); writeScope($scope3_id, {}); - }, 0, $scope0_id, "c", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "c", 1, 0, 0, 0, 1, 1); _script($scope0_id, "a4"); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.debug.js index 4e8e4a3614..e0717cd51b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.debug.js @@ -34,11 +34,11 @@ var template_default = _template("__tests__/template.marko", (input) => { _assert_hoist(setHtml); return 0; } - }, $scope1_id, "#text/0", 1, $sg__input_show, $sg__input_show); + }, $scope1_id, "#text/0", 1, $sg__input_show, $sg__input_show, void 0, void 0, 1); writeScope($scope1_id, { _: $si__input_show && _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:2"); return 0; } - }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show); + }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show, void 0, void 0, 1); thing_default({ value: $setHtml_getter }); _if(() => { if (true) { @@ -50,7 +50,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _assert_hoist(setHtml2); return 0; } - }, $scope0_id, "#text/2", 1, 0, $sg__input_show); + }, $scope0_id, "#text/2", 1, 0, $sg__input_show, void 0, void 0, 1); _if(() => { if (true) { const $scope4_id = _scope_id(); @@ -61,7 +61,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _assert_hoist(setHtml3); return 0; } - }, $scope0_id, "#text/3", 1, 0, $sg__input_show); + }, $scope0_id, "#text/3", 1, 0, $sg__input_show, void 0, void 0, 1); if (true) { const $scope5_id = _scope_id(); _script($scope5_id, "__tests__/template.marko_5"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.js index 9add0456ee..90461c50d9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-dynamic-tag-var/__snapshots__/html.bundle.js @@ -33,11 +33,11 @@ var template_default = _template("a", (input) => { writeScope($scope2_id, { c: setHtml }); return 0; } - }, $scope1_id, "a", 1, $sg__input_show, $sg__input_show); + }, $scope1_id, "a", 1, $sg__input_show, $sg__input_show, void 0, void 0, 1); writeScope($scope1_id, { _: $si__input_show && _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show); + }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show, void 0, void 0, 1); thing_default({ value: $setHtml_getter }); _if(() => { { @@ -48,7 +48,7 @@ var template_default = _template("a", (input) => { writeScope($scope3_id, { c: setHtml2 }); return 0; } - }, $scope0_id, "c", 1, 0, $sg__input_show); + }, $scope0_id, "c", 1, 0, $sg__input_show, void 0, void 0, 1); _if(() => { { const $scope4_id = _scope_id(); @@ -58,7 +58,7 @@ var template_default = _template("a", (input) => { writeScope($scope4_id, { c: setHtml3 }); return 0; } - }, $scope0_id, "d", 1, 0, $sg__input_show); + }, $scope0_id, "d", 1, 0, $sg__input_show, void 0, void 0, 1); { const $scope5_id = _scope_id(); _script($scope5_id, "a4"); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-from-dynamic/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-from-dynamic/sizes.json index 8725122c58..9aa736db21 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-from-dynamic/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-from-dynamic/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13510, - "brotli": 5168 + "min": 13563, + "brotli": 5181 }, "files": { "tags/child.marko": 360, diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.debug.js index 2e38a1f3d9..01f5d1a857 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.debug.js @@ -7,14 +7,14 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
    ${_el_resume($scope1_id, "#div/0")}`); writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); - }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "#text/0", 1, 0, 0, 0, 1, 1); let to = 3; _html("
    "); _for_to(to, 0, 1, () => { const $scope2_id = _scope_id(); _html(`
    ${_el_resume($scope2_id, "#div/0")}`); writeScope($scope2_id, {}, "__tests__/template.marko", "15:2"); - }, 0, $scope0_id, "#text/1", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "#text/1", 1, 0, 0, 0, 1, 1); _html("
    "); _for_to(3, 0, 1, (i) => { const $scope3_id = _scope_id(); @@ -23,10 +23,10 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope4_id = _scope_id(); _html(`${_el_resume($scope4_id, "#li/0")}`); writeScope($scope4_id, {}, "__tests__/template.marko", "30:4"); - }, 0, $scope3_id, "#ul/0", 1, 0, 0, 0, 1); + }, 0, $scope3_id, "#ul/0", 1, 0, 0, 0, 1, 1); _html(""); writeScope($scope3_id, {}, "__tests__/template.marko", "28:2"); - }, 0, $scope0_id, "#text/2", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "#text/2", 1, 0, 0, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.js index d9ac930263..fe44a82dc7 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-many/__snapshots__/html.bundle.js @@ -7,14 +7,14 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`
    ${_el_resume($scope1_id, "a")}`); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "a", 1, 0, 0, 0, 1, 1); let to = 3; _html("
    "); _for_to(to, 0, 1, () => { const $scope2_id = _scope_id(); _html(`
    ${_el_resume($scope2_id, "a")}`); writeScope($scope2_id, {}); - }, 0, $scope0_id, "b", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "b", 1, 0, 0, 0, 1, 1); _html("
    "); _for_to(3, 0, 1, (i) => { const $scope3_id = _scope_id(); @@ -23,10 +23,10 @@ var template_default = _template("a", (input) => { const $scope4_id = _scope_id(); _html(`${_el_resume($scope4_id, "a")}`); writeScope($scope4_id, {}); - }, 0, $scope3_id, "a", 1, 0, 0, 0, 1); + }, 0, $scope3_id, "a", 1, 0, 0, 0, 1, 1); _html(""); writeScope($scope3_id, {}); - }, 0, $scope0_id, "c", 1, 0, 0, 0, 1); + }, 0, $scope0_id, "c", 1, 0, 0, 0, 1, 1); _script($scope0_id, "a1"); _resume_branch($scope0_id); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.debug.js index 8315fc9bce..cbe2d0a763 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.debug.js @@ -13,10 +13,10 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope2_id, "#div/0")}`); _script($scope2_id, "__tests__/template.marko_2"); writeScope($scope2_id, { _: _scope_with_id($scope1_id) }, "__tests__/template.marko", "7:4"); - }, 0, $scope1_id, "#text/0", 1, 0, 0, 0, 1); + }, 0, $scope1_id, "#text/0", 1, 0, 0, 0, 1, 1); _script($scope1_id, "__tests__/template.marko_1"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "5:2"); - }, 0, $scope0_id, "#text/3", 1, 0, 0); + }, 0, $scope0_id, "#text/3", 1, 0, 0, 0, 0, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.js index aa133e20ca..5762d7c822 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var-minimum-scope/__snapshots__/html.bundle.js @@ -13,10 +13,10 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope2_id, "a")}`); _script($scope2_id, "a3"); writeScope($scope2_id, { _: _scope_with_id($scope1_id) }); - }, 0, $scope1_id, "a", 1, 0, 0, 0, 1); + }, 0, $scope1_id, "a", 1, 0, 0, 0, 1, 1); _script($scope1_id, "a4"); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "d", 1, 0, 0); + }, 0, $scope0_id, "d", 1, 0, 0, 0, 0, 1); _script($scope0_id, "a5"); writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.debug.js index 0d6e2b6590..f3b63e9d28 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.debug.js @@ -38,7 +38,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope3_id, {}, "__tests__/template.marko", "19:2"); return 0; } - }, $scope0_id, "#text/2", 1, 0, $sg__input_show, 0, 1); + }, $scope0_id, "#text/2", 1, 0, $sg__input_show, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); $si__input_show && writeScope($scope0_id, { input_show: input.show }, "__tests__/template.marko", 0, { input_show: ["input.show"] }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.js index 7693261305..2fae000147 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-native-tag-var/__snapshots__/html.bundle.js @@ -37,7 +37,7 @@ var template_default = _template("a", (input) => { writeScope($scope3_id, {}); return 0; } - }, $scope0_id, "c", 1, 0, $sg__input_show, 0, 1); + }, $scope0_id, "c", 1, 0, $sg__input_show, 0, 1, 1); _script($scope0_id, "a2"); $si__input_show && writeScope($scope0_id, { f: input.show }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/hoist-throws-in-render/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/hoist-throws-in-render/__snapshots__/html.bundle.debug.js index 080b032f14..662c14415f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/hoist-throws-in-render/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/hoist-throws-in-render/__snapshots__/html.bundle.debug.js @@ -10,6 +10,6 @@ var template_default = _template("__tests__/template.marko", (input) => { _assert_hoist(x); return 0; } - }, $scope0_id, "#text/0", 1, 0, 0); + }, $scope0_id, "#text/0", 1, 0, 0, void 0, void 0, 1); _html(`
    ${_escape(((x) => x())(_hoist_read_error))}
    `); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.debug.js index f1f1ec64d5..7b43f8153e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.debug.js @@ -24,7 +24,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "17:2"); return 0; } - }, $scope0_id, "#text/2", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/2", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _script($scope0_id, "__tests__/template.marko_0_spreadAttrs"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.js index 835298fa9d..74a622017c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/__snapshots__/html.bundle.js @@ -13,7 +13,7 @@ var template_default = _template("a", (input) => { }, "b", $scope0_id, "script")}> C <\/script>${_el_resume($scope0_id, "b")}`); - _if(() => {}, $scope0_id, "c", 1, 1, 1, 0, 1); + _if(() => {}, $scope0_id, "c", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, {}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/sizes.json index b145b1912b..036eec845f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/html-script-nonce/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8977, - "brotli": 3722 + "min": 8994, + "brotli": 3737 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.debug.js index e7781f798f..5a4030455b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.debug.js @@ -23,7 +23,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "17:2"); return 0; } - }, $scope0_id, "#text/2", 1, 1, 1, 0, 1); + }, $scope0_id, "#text/2", 1, 1, 1, 0, 1, 1); _script($scope0_id, "__tests__/template.marko_0"); _script($scope0_id, "__tests__/template.marko_0_spreadAttrs"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.js index 0b97456331..be474d9d3f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/__snapshots__/html.bundle.js @@ -12,7 +12,7 @@ var template_default = _template("a", (input) => { }, "b", $scope0_id, "style")}> C {} ${_el_resume($scope0_id, "b")}`); - _if(() => {}, $scope0_id, "c", 1, 1, 1, 0, 1); + _if(() => {}, $scope0_id, "c", 1, 1, 1, 0, 1, 1); _script($scope0_id, "a0"); _script($scope0_id, "a1"); writeScope($scope0_id, {}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/sizes.json index a5ee84e8b0..392286923b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/html-style-nonce/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8966, - "brotli": 3714 + "min": 8983, + "brotli": 3728 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.debug.js index ec2b2b6e9a..0b5ff234ea 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, {}, "__tests__/template.marko", "3:2"); return 0; } - }, $scope0_id, "#text/1"); + }, $scope0_id, "#text/1", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "__tests__/template.marko_0_show"); writeScope($scope0_id, { show }, "__tests__/template.marko", 0, { show: "1:6" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.js index 14e4232a9a..164918f59a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/__snapshots__/html.bundle.js @@ -4,7 +4,7 @@ var template_default = _template("a", (input) => { const $scope0_id = _scope_id(); let show = false; _html(`${_el_resume($scope0_id, "a")}`); - _if(() => {}, $scope0_id, "b"); + _if(() => {}, $scope0_id, "b", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { c: show }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/sizes.json index 4f68bda2e5..7bb03de1b8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-default-false/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/if-default-false/sizes.json @@ -1,7 +1,7 @@ { "dom": { "template.marko.page.mjs": { - "min": 5854, + "min": 5871, "brotli": 2684 } }, diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.debug.js index 1397561bc0..961fc54b1f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.debug.js @@ -13,7 +13,7 @@ var child_default = _template("__tests__/tags/child.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/tags/child.marko", "6:4"); return 0; } - }, $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _script($scope0_id, "__tests__/tags/child.marko_0_id"); writeScope($scope0_id, { hide, diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.js index cecedcad14..14972e8a38 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var child_default = _template("b", (input) => { let text = ""; const id = _id(); _html(``); - _if(() => {}, $scope0_id, "a", 1, 1, 1, "", 1); + _if(() => {}, $scope0_id, "a", 1, 1, 1, "", 1, 1); _script($scope0_id, "b0"); writeScope($scope0_id, { b: hide, diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/sizes.json index 6247508b8a..7e5c42ea49 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/if-member-expression-intersection/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6037, - "brotli": 2745 + "min": 6054, + "brotli": 2754 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.debug.js index 43d23effcd..928707e492 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "5:1"); return 0; } - }, $scope0_id, "#text/3"); + }, $scope0_id, "#text/3", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "__tests__/template.marko_0_count"); writeScope($scope0_id, { count }, "__tests__/template.marko", 0, { count: "1:5" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.js index 3adaeaba4a..f41a06a880 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "d"); + }, $scope0_id, "d", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "a1"); writeScope($scope0_id, { e: count }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/sizes.json index e617c20f77..89fe4f13cf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/if-no-content-script/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 5989, - "brotli": 2723 + "min": 6006, + "brotli": 2734 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..e539207f7e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,49 @@ +// tags/leaf.marko +const $template$2 = "

    leaf

    "; +const $walks$2 = "b"; +const $setup__script = _script("__tests__/tags/leaf.marko_0", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "leaf destroyed"; +} })); +const $setup$2 = $setup__script; +var leaf_default = /* @__PURE__ */ _template("__tests__/tags/leaf.marko", $template$2, "b", $setup$2); + +// tags/wrapper.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $if_content__setup$1 = ($scope) => { + $setup$2($scope["#childScope/0"]); +}; +const $if$1 = /* @__PURE__ */ _if("#text/0", $template$2, /* @__PURE__ */ ((_w0) => `/${_w0}&`)("b"), $if_content__setup$1); +const $show$1 = ($scope, show) => $if$1($scope, show ? 0 : 1); +const $input = ($scope, input) => $show$1($scope, input.show); +var wrapper_default = /* @__PURE__ */ _template("__tests__/tags/wrapper.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = "
    init
    "; +const $walks = "b b b%c"; +const $if_content__show = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $show$1($scope["#childScope/0"], $scope._.show)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("__tests__/template.marko_0_show", ($scope) => _on($scope["#button/1"], "click", function() { + $show($scope, !$scope.show); +})); +const $show = /* @__PURE__ */ _let("show/4", ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $show($scope, false); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..ff72fe607b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/dom.bundle.js @@ -0,0 +1,37 @@ +// tags/leaf.marko +const $template$1 = "

    leaf

    "; +const $setup__script = _script("b0", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "leaf destroyed"; +} })); +const $setup$1 = $setup__script; + +// tags/wrapper.marko +const $template = ""; +const $setup = () => {}; +const $if_content__setup$1 = ($scope) => { + $setup$1($scope.a); +}; +const $if$1 = /* @__PURE__ */ _if(0, $template$1, /* @__PURE__ */ ((_w0) => `/${_w0}&`)("b"), $if_content__setup$1); +const $show$1 = ($scope, show) => $if$1($scope, show ? 0 : 1); + +// template.marko +const $if_content__show = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $show$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $show($scope, !$scope.e); +})); +const $show = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..40dea23a53 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.debug.js @@ -0,0 +1,56 @@ +// tags/leaf.marko +var leaf_default = _template("__tests__/tags/leaf.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + _html("

    leaf

    "); + _script($scope0_id, "__tests__/tags/leaf.marko_0"); + _resume_branch($scope0_id); +}); + +// tags/wrapper.marko +var wrapper_default = _template("__tests__/tags/wrapper.marko", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_show = _serialize_guard($scope0_reason, 0), $si__input_show = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { show } = input; + _if(() => { + if (show) { + const $scope1_id = _scope_id(); + leaf_default({}); + $si__input_show && writeScope($scope1_id, {}, "__tests__/tags/wrapper.marko", "2:2"); + return 0; + } + }, $scope0_id, "#text/0", $sg__input_show, $sg__input_show, $sg__input_show, 0, 1); + $si__input_show && writeScope($scope0_id, {}, "__tests__/tags/wrapper.marko", 0); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + wrapper_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "6:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_show"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + show + }, "__tests__/template.marko", 0, { + outer: "1:6", + show: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..446789b56e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/html.bundle.js @@ -0,0 +1,53 @@ +// tags/leaf.marko +var leaf_default = _template("b", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + _html("

    leaf

    "); + _script($scope0_id, "b0"); + _resume_branch($scope0_id); +}); + +// tags/wrapper.marko +var wrapper_default = _template("c", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_show = _serialize_guard($scope0_reason, 0), $si__input_show = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { show } = input; + _if(() => { + if (show) { + const $scope1_id = _scope_id(); + leaf_default({}); + $si__input_show && writeScope($scope1_id, {}); + return 0; + } + }, $scope0_id, "a", $sg__input_show, $sg__input_show, $sg__input_show, 0, 1); + $si__input_show && writeScope($scope0_id, {}); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + wrapper_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: show + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.debug.md new file mode 100644 index 0000000000..c759f5f18e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.debug.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +c.querySelector("#s").click(); +``` +```html +
    + init +
    + + +

    + leaf +

    +``` +## Change +``` +INSERT: #s + p +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html +
    + leaf destroyed +
    + + +``` +## Change +``` +REMOVE: #s + p +REMOVE: #ref::text("init") +INSERT: #ref::text("leaf destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.md new file mode 100644 index 0000000000..c759f5f18e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/render.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +c.querySelector("#s").click(); +``` +```html +
    + init +
    + + +

    + leaf +

    +``` +## Change +``` +INSERT: #s + p +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html +
    + leaf destroyed +
    + + +``` +## Change +``` +REMOVE: #s + p +REMOVE: #ref::text("init") +INSERT: #ref::text("leaf destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..8441c7808c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.debug.html @@ -0,0 +1,17 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.html new file mode 100644 index 0000000000..9daa7882f4 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/__snapshots__/writes.html @@ -0,0 +1,15 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/sizes.json new file mode 100644 index 0000000000..ec80177ce4 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/sizes.json @@ -0,0 +1,19 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 6572, + "brotli": 2957 + }, + "files": { + "tags/leaf.marko": 272, + "tags/wrapper.marko": 345, + "template.marko": 865 + } + } + }, + "html": { + "min": 473, + "brotli": 307 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/leaf.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/leaf.marko new file mode 100644 index 0000000000..384dedf4a1 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/leaf.marko @@ -0,0 +1,2 @@ +

    leaf

    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/wrapper.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/wrapper.marko new file mode 100644 index 0000000000..5afab5f643 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/tags/wrapper.marko @@ -0,0 +1,4 @@ + + + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/template.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/template.marko new file mode 100644 index 0000000000..56bd997ef8 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/template.marko @@ -0,0 +1,8 @@ + + +init +O +S + + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/test.ts b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/test.ts new file mode 100644 index 0000000000..dfdb16c81b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-link-via-nested-component-cleanup/test.ts @@ -0,0 +1,8 @@ +import type { TestConfig } from "../../main.test"; +function s(c: Element) { + c.querySelector("#s")!.click(); +} +function o(c: Element) { + c.querySelector("#o")!.click(); +} +export const config: TestConfig = { steps: [{}, s, o] }; diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..287205fd0f --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,41 @@ +// tags/child.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $if_content__setup__script = _script("__tests__/tags/child.marko_1", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "inner destroyed"; +} })); +const $if_content__setup$1 = $if_content__setup__script; +const $if$1 = /* @__PURE__ */ _if("#text/0", "

    inner

    ", "b", $if_content__setup$1); +const $show$1 = ($scope, show) => $if$1($scope, show ? 0 : 1); +const $input = ($scope, input) => $show$1($scope, input.show); +var child_default = /* @__PURE__ */ _template("__tests__/tags/child.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = "
    init
    "; +const $walks = "b b b%c"; +const $if_content__show = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $show$1($scope["#childScope/0"], $scope._.show)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("__tests__/template.marko_0_show", ($scope) => _on($scope["#button/1"], "click", function() { + $show($scope, !$scope.show); +})); +const $show = /* @__PURE__ */ _let("show/4", ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $show($scope, false); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..b1d6644270 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/dom.bundle.js @@ -0,0 +1,29 @@ +// tags/child.marko +const $template = ""; +const $setup = () => {}; +const $if$1 = /* @__PURE__ */ _if(0, "

    inner

    ", "b", _script("b0", ($scope) => _lifecycle($scope, { onDestroy: function() { + document.getElementById("ref").textContent = "inner destroyed"; +} }))); +const $show$1 = ($scope, show) => $if$1($scope, show ? 0 : 1); + +// template.marko +const $if_content__show = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $show$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__show._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $show__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $show($scope, !$scope.e); +})); +const $show = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__show($scope); + $show__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..af344fcab6 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.debug.js @@ -0,0 +1,48 @@ +// tags/child.marko +var child_default = _template("__tests__/tags/child.marko", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_show = _serialize_guard($scope0_reason, 0), $si__input_show = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { show } = input; + _if(() => { + if (show) { + const $scope1_id = _scope_id(); + _html("

    inner

    "); + _script($scope1_id, "__tests__/tags/child.marko_1"); + $si__input_show && writeScope($scope1_id, {}, "__tests__/tags/child.marko", "2:2"); + return 0; + } + }, $scope0_id, "#text/0", $sg__input_show, $sg__input_show, $sg__input_show, 0, 1); + $si__input_show && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "6:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_show"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + show + }, "__tests__/template.marko", 0, { + outer: "1:6", + show: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..be1e5a39a5 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/html.bundle.js @@ -0,0 +1,45 @@ +// tags/child.marko +var child_default = _template("b", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_show = _serialize_guard($scope0_reason, 0), $si__input_show = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { show } = input; + _if(() => { + if (show) { + const $scope1_id = _scope_id(); + _html("

    inner

    "); + _script($scope1_id, "b0"); + $si__input_show && writeScope($scope1_id, {}); + return 0; + } + }, $scope0_id, "a", $sg__input_show, $sg__input_show, $sg__input_show, 0, 1); + $si__input_show && writeScope($scope0_id, {}); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let show = false; + _html(`
    init
    ${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + child_default({ show }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: show + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.debug.md new file mode 100644 index 0000000000..8da745c7c9 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.debug.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +container.querySelector("#s").click(); +``` +```html +
    + init +
    + + +

    + inner +

    +``` +## Change +``` +INSERT: #s + p +``` + +# Update +```js +container.querySelector("#o").click(); +``` +```html +
    + inner destroyed +
    + + +``` +## Change +``` +REMOVE: #s + p +REMOVE: #ref::text("init") +INSERT: #ref::text("inner destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.md new file mode 100644 index 0000000000..8da745c7c9 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/render.md @@ -0,0 +1,75 @@ +# Render +```html +
    + init +
    + + +``` + +# Update +```js +container.querySelector("#s").click(); +``` +```html +
    + init +
    + + +

    + inner +

    +``` +## Change +``` +INSERT: #s + p +``` + +# Update +```js +container.querySelector("#o").click(); +``` +```html +
    + inner destroyed +
    + + +``` +## Change +``` +REMOVE: #s + p +REMOVE: #ref::text("init") +INSERT: #ref::text("inner destroyed") +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..3814d8bc81 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.debug.html @@ -0,0 +1,17 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.html new file mode 100644 index 0000000000..9daa7882f4 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/__snapshots__/writes.html @@ -0,0 +1,15 @@ +
    init
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/sizes.json new file mode 100644 index 0000000000..1dca2a459c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/sizes.json @@ -0,0 +1,18 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 6541, + "brotli": 2947 + }, + "files": { + "tags/child.marko": 361, + "template.marko": 865 + } + } + }, + "html": { + "min": 473, + "brotli": 307 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/tags/child.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/tags/child.marko new file mode 100644 index 0000000000..afcc9d63c7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/tags/child.marko @@ -0,0 +1,5 @@ + + +

    inner

    + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/template.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/template.marko new file mode 100644 index 0000000000..99c1e86eb7 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/template.marko @@ -0,0 +1,8 @@ + + +init +O +S + + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/test.ts b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/test.ts new file mode 100644 index 0000000000..18a981e5e3 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-owns-branch-cleanup/test.ts @@ -0,0 +1,12 @@ +import type { TestConfig } from "../../main.test"; + +function clickS(container: Element) { + container.querySelector("#s")!.click(); +} +function clickO(container: Element) { + container.querySelector("#o")!.click(); +} + +export const config: TestConfig = { + steps: [{}, clickS, clickO], +}; diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js new file mode 100644 index 0000000000..420690224f --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.debug.js @@ -0,0 +1,42 @@ +// tags/leaf.marko +const $template$1 = ""; +const $walks$1 = "b%c"; +const $setup$1 = () => {}; +const $if_content__input_n = /* @__PURE__ */ _if_closure("#text/0", 0, ($scope) => _text($scope["#text/0"], $scope._.n)); +const $if_content__setup$1 = $if_content__input_n; +const $if$1 = /* @__PURE__ */ _if("#text/0", "
    n is
    ", "Db%l", $if_content__setup$1); +const $n$1 = /* @__PURE__ */ _const("n", ($scope) => { + $if$1($scope, $scope.n ? 0 : 1); + $if_content__input_n($scope); +}); +const $input = ($scope, input) => $n$1($scope, input.n); +var leaf_default = /* @__PURE__ */ _template("__tests__/tags/leaf.marko", $template$1, "b%c", $setup$1, $input); + +// template.marko +const $template = ""; +const $walks = " b b%c"; +const $if_content__n = /* @__PURE__ */ _if_closure("#text/2", 0, ($scope) => $n$1($scope["#childScope/0"], $scope._.n)); +const $if_content__setup = ($scope) => { + $if_content__n._($scope); + /* @__PURE__ */ $setup$1($scope["#childScope/0"]); +}; +const $if = /* @__PURE__ */ _if("#text/2", /* @__PURE__ */ ((_w0) => `${_w0}`)($template$1), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("__tests__/template.marko_0_outer", ($scope) => _on($scope["#button/0"], "click", function() { + $outer($scope, !$scope.outer); +})); +const $outer = /* @__PURE__ */ _let("outer/3", ($scope) => { + $if($scope, $scope.outer ? 0 : 1); + $outer__script($scope); +}); +const $n__script = _script("__tests__/template.marko_0_n", ($scope) => _on($scope["#button/1"], "click", function() { + $n($scope, $scope.n + 1); +})); +const $n = /* @__PURE__ */ _let("n/4", ($scope) => { + $if_content__n($scope); + $n__script($scope); +}); +function $setup($scope) { + $outer($scope, true); + $n($scope, 0); +} +var template_default = /* @__PURE__ */ _template("__tests__/template.marko", $template, $walks, $setup); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js new file mode 100644 index 0000000000..48d54db273 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/dom.bundle.js @@ -0,0 +1,31 @@ +// tags/leaf.marko +const $template = ""; +const $setup = () => {}; +const $if_content__input_n = /* @__PURE__ */ _if_closure(0, 0, ($scope) => _text($scope.a, $scope._.d)); +const $if$1 = /* @__PURE__ */ _if(0, "
    n is
    ", "Db%l", $if_content__input_n); +const $n$1 = /* @__PURE__ */ _const(3, ($scope) => { + $if$1($scope, $scope.d ? 0 : 1); + $if_content__input_n($scope); +}); + +// template.marko +const $if_content__n = /* @__PURE__ */ _if_closure(2, 0, ($scope) => $n$1($scope.a, $scope._.e)); +const $if_content__setup = ($scope) => { + $if_content__n._($scope); + /* @__PURE__ */ $setup($scope.a); +}; +const $if = /* @__PURE__ */ _if(2, /* @__PURE__ */ ((_w0) => `${_w0}`)($template), /* @__PURE__ */ ((_w0) => `b/${_w0}&b`)("b%c"), $if_content__setup); +const $outer__script = _script("a1", ($scope) => _on($scope.a, "click", function() { + $outer($scope, !$scope.d); +})); +const $outer = /* @__PURE__ */ _let(3, ($scope) => { + $if($scope, $scope.d ? 0 : 1); + $outer__script($scope); +}); +const $n__script = _script("a0", ($scope) => _on($scope.b, "click", function() { + $n($scope, $scope.e + 1); +})); +const $n = /* @__PURE__ */ _let(4, ($scope) => { + $if_content__n($scope); + $n__script($scope); +}); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js new file mode 100644 index 0000000000..1a453facc1 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.debug.js @@ -0,0 +1,47 @@ +// tags/leaf.marko +var leaf_default = _template("__tests__/tags/leaf.marko", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_n = _serialize_guard($scope0_reason, 0), $si__input_n = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { n } = input; + _if(() => { + if (n) { + const $scope1_id = _scope_id(); + _html(`
    n is ${_sep($sg__input_n)}${_escape(n)}${_el_resume($scope1_id, "#text/0", $sg__input_n)}
    `); + $si__input_n && writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/tags/leaf.marko", "2:2"); + return 0; + } + }, $scope0_id, "#text/0", $sg__input_n, $sg__input_n, $sg__input_n, 0, 1, 1); + $si__input_n && writeScope($scope0_id, { n }, "__tests__/tags/leaf.marko", 0, { n: "1:10" }); +}); + +// template.marko +var template_default = _template("__tests__/template.marko", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let n = 0; + _html(`${_el_resume($scope0_id, "#button/0")}${_el_resume($scope0_id, "#button/1")}`); + _if(() => { + if (outer) { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + leaf_default({ n }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + "#childScope/0": _existing_scope($childScope) + }, "__tests__/template.marko", "5:2"); + return 0; + } + }, $scope0_id, "#text/2"); + _script($scope0_id, "__tests__/template.marko_0_n"); + _script($scope0_id, "__tests__/template.marko_0_outer"); + writeScope($scope0_id, { + outer, + n + }, "__tests__/template.marko", 0, { + outer: "1:6", + n: "2:6" + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js new file mode 100644 index 0000000000..501a9d467e --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/html.bundle.js @@ -0,0 +1,44 @@ +// tags/leaf.marko +var leaf_default = _template("b", (input) => { + const $scope0_reason = _scope_reason(), $sg__input_n = _serialize_guard($scope0_reason, 0), $si__input_n = _serialize_if($scope0_reason, 0); + const $scope0_id = _scope_id(); + const { n } = input; + _if(() => { + if (n) { + const $scope1_id = _scope_id(); + _html(`
    n is ${_sep($sg__input_n)}${_escape(n)}${_el_resume($scope1_id, "a", $sg__input_n)}
    `); + $si__input_n && writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); + return 0; + } + }, $scope0_id, "a", $sg__input_n, $sg__input_n, $sg__input_n, 0, 1, 1); + $si__input_n && writeScope($scope0_id, { d: n }); +}); + +// template.marko +var template_default = _template("a", (input) => { + _scope_reason(); + const $scope0_id = _scope_id(); + let outer = true; + let n = 0; + _html(`${_el_resume($scope0_id, "a")}${_el_resume($scope0_id, "b")}`); + _if(() => { + { + const $scope1_id = _scope_id(); + const $childScope = _peek_scope_id(); + _set_serialize_reason(1); + leaf_default({ n }); + writeScope($scope1_id, { + _: _scope_with_id($scope0_id), + a: _existing_scope($childScope) + }); + return 0; + } + }, $scope0_id, "c"); + _script($scope0_id, "a0"); + _script($scope0_id, "a1"); + writeScope($scope0_id, { + d: outer, + e: n + }); + _resume_branch($scope0_id); +}, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md new file mode 100644 index 0000000000..2f82a1a07c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.debug.md @@ -0,0 +1,64 @@ +# Render +```html + + +``` + +# Update +```js +c.querySelector("#n").click(); +``` +```html + + +
    + n is 1 +
    +``` +## Change +``` +INSERT: #n + div +UPDATE: div::text@5 "" => "1" +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html + + +``` +## Change +``` +REMOVE: #n + div +``` + +# Update +```js +c.querySelector("#n").click(); +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.md b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.md new file mode 100644 index 0000000000..2f82a1a07c --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/render.md @@ -0,0 +1,64 @@ +# Render +```html + + +``` + +# Update +```js +c.querySelector("#n").click(); +``` +```html + + +
    + n is 1 +
    +``` +## Change +``` +INSERT: #n + div +UPDATE: div::text@5 "" => "1" +``` + +# Update +```js +c.querySelector("#o").click(); +``` +```html + + +``` +## Change +``` +REMOVE: #n + div +``` + +# Update +```js +c.querySelector("#n").click(); +``` diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html new file mode 100644 index 0000000000..f89dbc428b --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.debug.html @@ -0,0 +1,17 @@ + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.html new file mode 100644 index 0000000000..44d7e9c366 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/__snapshots__/writes.html @@ -0,0 +1,15 @@ + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/sizes.json new file mode 100644 index 0000000000..48341b38bc --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/sizes.json @@ -0,0 +1,18 @@ +{ + "dom": { + "template.marko.page.mjs": { + "total": { + "min": 6427, + "brotli": 2907 + }, + "files": { + "tags/leaf.marko": 413, + "template.marko": 844 + } + } + }, + "html": { + "min": 450, + "brotli": 293 + } +} diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/tags/leaf.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/tags/leaf.marko new file mode 100644 index 0000000000..65a62309f3 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/tags/leaf.marko @@ -0,0 +1,4 @@ + + +
    n is ${n}
    + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/template.marko b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/template.marko new file mode 100644 index 0000000000..6ccf02bb27 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/template.marko @@ -0,0 +1,7 @@ + + +O +N + + + diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/test.ts b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/test.ts new file mode 100644 index 0000000000..7b79303e98 --- /dev/null +++ b/packages/runtime-tags/src/__tests__/fixtures/if-resume-skip-link-when-cleanup-free/test.ts @@ -0,0 +1,8 @@ +import type { TestConfig } from "../../main.test"; +function n(c: Element) { + c.querySelector("#n")!.click(); +} +function o(c: Element) { + c.querySelector("#o")!.click(); +} +export const config: TestConfig = { steps: [{}, n, o, n] }; diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.debug.js index 684e540a43..38f86b21f4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_a__OR__input_b && writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); return 0; } - }, $scope0_id, "#text/0", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y); + }, $scope0_id, "#text/0", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, void 0, void 0, 1); _if(() => { if (input.a, input.b) { const $scope2_id = _scope_id(); @@ -17,7 +17,7 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_a__OR__input_b && writeScope($scope2_id, {}, "__tests__/template.marko", "5:2"); return 0; } - }, $scope0_id, "#text/1", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y); + }, $scope0_id, "#text/1", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, void 0, void 0, 1); _html("
    "); _if(() => { if (input.x) { @@ -36,7 +36,7 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_x__OR__input_y && writeScope($scope5_id, {}, "__tests__/template.marko", "16:4"); return 2; } - }, $scope0_id, "#div/2", $sg__input_x__OR__input_y, $sg__input_x__OR__input_y, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, "
    "); + }, $scope0_id, "#div/2", $sg__input_x__OR__input_y, $sg__input_x__OR__input_y, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, "", void 0, 1); _serialize_if($scope0_reason, 2) && writeScope($scope0_id, { input_a: _serialize_if($scope0_reason, 4) && input.a, input_b: _serialize_if($scope0_reason, 3) && input.b, diff --git a/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.js index 6607c416c0..a31e59568b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/if-tag/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var template_default = _template("a", (input) => { $si__input_a__OR__input_b && writeScope($scope1_id, {}); return 0; } - }, $scope0_id, "a", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y); + }, $scope0_id, "a", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, void 0, void 0, 1); _if(() => { if (input.a, input.b) { const $scope2_id = _scope_id(); @@ -17,7 +17,7 @@ var template_default = _template("a", (input) => { $si__input_a__OR__input_b && writeScope($scope2_id, {}); return 0; } - }, $scope0_id, "b", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y); + }, $scope0_id, "b", $sg__input_a__OR__input_b, $sg__input_a__OR__input_b, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, void 0, void 0, 1); _html("
    "); _if(() => { if (input.x) { @@ -36,7 +36,7 @@ var template_default = _template("a", (input) => { $si__input_x__OR__input_y && writeScope($scope5_id, {}); return 2; } - }, $scope0_id, "c", $sg__input_x__OR__input_y, $sg__input_x__OR__input_y, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, "
    "); + }, $scope0_id, "c", $sg__input_x__OR__input_y, $sg__input_x__OR__input_y, $sg__input_a__OR__input_b__OR__input_x__OR__input_y, "", void 0, 1); _serialize_if($scope0_reason, 2) && writeScope($scope0_id, { f: _serialize_if($scope0_reason, 4) && input.a, g: _serialize_if($scope0_reason, 3) && input.b, diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.debug.js index 6cf5b8d5d8..f5ffbadbc5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { "#LoopKey": i, _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:3", { "#LoopKey": "3:7" }); - }, 0, $scope0_id, "#div/0", 1, 1, 0, "", 1); + }, 0, $scope0_id, "#div/0", 1, 1, 0, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0_selected"); writeScope($scope0_id, { selected }, "__tests__/template.marko", 0, { selected: "1:5" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.js index f478e89c71..39a79f908a 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-event/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { M: i, _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 1, 0, "", 1); + }, 0, $scope0_id, "a", 1, 1, 0, "", 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { b: selected }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.debug.js index 235fff2a73..b5c1be0251 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { "#LoopKey": i, _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:3", { "#LoopKey": "3:7" }); - }, 0, $scope0_id, "#select/0", 1, 1, 0, "", 1); + }, 0, $scope0_id, "#select/0", 1, 1, 0, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.js index 0ff078abcd..2be0b359e9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-control-flow-only-child-select-event/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { M: i, _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", 1, 1, 0, "", 1); + }, 0, $scope0_id, "a", 1, 1, 0, "", 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, {}); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.debug.js index 41d480f673..5fa52ff418 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.debug.js @@ -10,7 +10,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "2:2"); return 0; } - }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show, 0, 1); + }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show, 0, 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, { value: _serialize_if($scope0_reason, 0) && value }, "__tests__/template.marko", 0, { value: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.js index fbb84a9c1f..ccee97b36d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-active/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show, 0, 1); + }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show, 0, 1, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { f: _serialize_if($scope0_reason, 0) && value }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.debug.js index 41d480f673..5fa52ff418 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.debug.js @@ -10,7 +10,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "2:2"); return 0; } - }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show, 0, 1); + }, $scope0_id, "#text/0", 1, $sg__input_show, $sg__input_show, 0, 1, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, { value: _serialize_if($scope0_reason, 0) && value }, "__tests__/template.marko", 0, { value: "1:6" }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.js index fbb84a9c1f..ccee97b36d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/inert-if-closure-update-inactive/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show, 0, 1); + }, $scope0_id, "a", 1, $sg__input_show, $sg__input_show, 0, 1, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { f: _serialize_if($scope0_reason, 0) && value }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/input-missing-property/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/input-missing-property/sizes.json index 1dff25a941..4a939a3ff2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/input-missing-property/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/input-missing-property/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6403, - "brotli": 2910 + "min": 6420, + "brotli": 2918 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/input-spread-value-also-read/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/input-spread-value-also-read/sizes.json index d2e1ffb4ce..834871f2aa 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/input-spread-value-also-read/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/input-spread-value-also-read/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8801, - "brotli": 3327 + "min": 8854, + "brotli": 3341 }, "files": { "tags/my-input.marko": 352, diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-define-tag-empty-section-closure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/known-define-tag-empty-section-closure/sizes.json index 86dc8eb899..4d03968db4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-define-tag-empty-section-closure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/known-define-tag-empty-section-closure/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6257, - "brotli": 2828 + "min": 6274, + "brotli": 2836 }, "files": { "tags/test.marko": 691, diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.debug.js index 8e2e1bdf10..1b35098e62 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.debug.js @@ -13,9 +13,9 @@ var child_default = _template("__tests__/tags/child.marko", (input) => { $si__input_button && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }, "__tests__/tags/child.marko", "4:8"); return 0; } - }, $scope1_id, "#text/0", $sg__input_button, $sg__input_button, $sg__input_button); + }, $scope1_id, "#text/0", $sg__input_button, $sg__input_button, $sg__input_button, void 0, void 0, 1); $si__input_button && writeScope($scope1_id, { button }, "__tests__/tags/child.marko", "3:4", { button: "3:8" }); - }, 0, $scope0_id, "#div/0", $sg__input_button, 1, $sg__input_button, ""); + }, 0, $scope0_id, "#div/0", $sg__input_button, 1, $sg__input_button, "", 0, 1); _script($scope0_id, "__tests__/tags/child.marko_0_htmlInput"); writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.js index 18b5310a68..e8df93c903 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/known-rest-attr-tag/__snapshots__/html.bundle.js @@ -13,9 +13,9 @@ var child_default = _template("b", (input) => { $si__input_button && writeScope($scope2_id, { _: _scope_with_id($scope1_id) }); return 0; } - }, $scope1_id, "a", $sg__input_button, $sg__input_button, $sg__input_button); + }, $scope1_id, "a", $sg__input_button, $sg__input_button, $sg__input_button, void 0, void 0, 1); $si__input_button && writeScope($scope1_id, { c: button }); - }, 0, $scope0_id, "a", $sg__input_button, 1, $sg__input_button, ""); + }, 0, $scope0_id, "a", $sg__input_button, 1, $sg__input_button, "", 0, 1); _script($scope0_id, "b0"); writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.debug.js index 30aef923d5..92a63e1197 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var inner_default = _template("__tests__/tags/inner/index.marko", (input) => { const $scope1_id = _scope_id(); _html(`
    row ${_sep($sg__input_stuff_row)}${_escape(row.x)}${_el_resume($scope1_id, "#text/0", $sg__input_stuff_row)}
    `); _serialize_if($scope0_reason, 1) && writeScope($scope1_id, {}, "__tests__/tags/inner/index.marko", "1:2"); - }, 0, $scope0_id, "#text/0", $sg__input_stuff_row, $sg__input_stuff_row, $sg__input_stuff_row, 0, 1); + }, 0, $scope0_id, "#text/0", $sg__input_stuff_row, $sg__input_stuff_row, $sg__input_stuff_row, 0, 1, 1); _html(`
    other ${_sep($sg__input_stuff_other_y)}${_escape(input.stuff.other.y)}${_el_resume($scope0_id, "#text/1", $sg__input_stuff_other_y)}
    cond ${_sep($sg__input_stuff_cond_a)}${_escape(input.stuff.cond.a)}${_el_resume($scope0_id, "#text/2", $sg__input_stuff_cond_a)}
    `); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/inner/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.js index f2662edd8f..e075837db6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var inner_default = _template("c", (input) => { const $scope1_id = _scope_id(); _html(`
    row ${_sep($sg__input_stuff_row)}${_escape(row.x)}${_el_resume($scope1_id, "a", $sg__input_stuff_row)}
    `); _serialize_if($scope0_reason, 1) && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_stuff_row, $sg__input_stuff_row, $sg__input_stuff_row, 0, 1); + }, 0, $scope0_id, "a", $sg__input_stuff_row, $sg__input_stuff_row, $sg__input_stuff_row, 0, 1, 1); _html(`
    other ${_sep($sg__input_stuff_other_y)}${_escape(input.stuff.other.y)}${_el_resume($scope0_id, "b", $sg__input_stuff_other_y)}
    cond ${_sep($sg__input_stuff_cond_a)}${_escape(input.stuff.cond.a)}${_el_resume($scope0_id, "c", $sg__input_stuff_cond_a)}
    `); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/sizes.json index dee83cd151..15c36b8e6b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/known-tag-attr-tags-rest/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7456, - "brotli": 3383 + "brotli": 3381 }, "files": { "tags/inner/index.marko": 1078, diff --git a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.debug.js index 527fb54026..10c786fa9e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.debug.js @@ -29,7 +29,7 @@ var template_default = _template("__tests__/template.marko", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "#text/0")}
  • `); writeScope($scope1_id, {}, "__tests__/template.marko", "10:4"); - }, 0, $scope0_id, "#ul/3", 1, 1, 1, "", 1); + }, 0, $scope0_id, "#ul/3", 1, 1, 1, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0_store_clear"); writeScope($scope0_id, { store_clear: store?.clear, diff --git a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.js index 2ebbf3c46c..f963ae7901 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/__snapshots__/html.bundle.js @@ -29,7 +29,7 @@ var template_default = _template("a", (input) => { const $scope1_id = _scope_id(); _html(`
  • ${_escape(item)}${_el_resume($scope1_id, "a")}
  • `); writeScope($scope1_id, {}); - }, 0, $scope0_id, "d", 1, 1, 1, "", 1); + }, 0, $scope0_id, "d", 1, 1, 1, "", 1, 1); _script($scope0_id, "a1"); writeScope($scope0_id, { i: store?.clear, diff --git a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/sizes.json index 2fdb6663ed..bf6c2767a0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/let-bind-stateful-upstream-alias/sizes.json @@ -3,7 +3,7 @@ "template.marko.page.mjs": { "total": { "min": 7665, - "brotli": 3494 + "brotli": 3469 }, "files": { "tags/store.marko": 397, diff --git a/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional-child-cleanup/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional-child-cleanup/sizes.json index 05161be655..84fa62e9ba 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional-child-cleanup/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional-child-cleanup/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6254, - "brotli": 2798 + "min": 6317, + "brotli": 2831 }, "files": { "tags/child.marko": 353, diff --git a/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional/sizes.json index 594aa2987f..63141a16b6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/lifecycle-tag-conditional/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6555, - "brotli": 2898 + "min": 6572, + "brotli": 2907 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.debug.js index c4f4140094..4aeebeca88 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.debug.js @@ -6,7 +6,7 @@ var list_default = _template("__tests__/tags/list/index.marko", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "#text/0", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}, "__tests__/tags/list/index.marko", "1:1"); - }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}, "__tests__/tags/list/index.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.js index f281dd2076..eb79a022e6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/local-closure-script/__snapshots__/html.bundle.js @@ -6,7 +6,7 @@ var list_default = _template("b", (input) => { const $scope1_id = _scope_id(); _dynamic_tag($scope1_id, "a", item.content, {}, 0, 0, $sg__input_item); $si__input_item && writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item); + }, 0, $scope0_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 0, 1); $si__input_item && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.debug.js index d75fb35ddf..2acfeb6018 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.debug.js @@ -10,6 +10,6 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "3:4"); }, function(c) { return c.id; - }, $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.js index 05b7419fbf..0daec38b3e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-children/__snapshots__/html.bundle.js @@ -10,6 +10,6 @@ var template_default = _template("a", (input) => { $si__input_children && writeScope($scope1_id, {}); }, function(c) { return c.id; - }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.debug.js index bfafe93804..05729494f5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.debug.js @@ -8,6 +8,6 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); }, function(c) { return c.id; - }, $scope0_id, "#text/0", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, $scope0_id, "#text/0", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.js index a02a7a882a..dad24e59cd 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/move-and-clear-top-level/__snapshots__/html.bundle.js @@ -8,6 +8,6 @@ var template_default = _template("a", (input) => { $si__input_children && writeScope($scope1_id, {}); }, function(c) { return c.id; - }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1); + }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, 0, 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.debug.js index d815c4fe24..0378e78e75 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var my_for_default = _template("__tests__/tags/my-for.marko", (input) => { $params2: _serialize_if($scope0_reason, 2) && $params2, _: _scope_with_id($scope0_id) }, "__tests__/tags/my-for.marko", "1:2", { $params2: "1:6" }); - }, 0, $scope0_id, "#text/0", $sg__input_to__OR__input_content, $sg__input_to, $sg__input_to); + }, 0, $scope0_id, "#text/0", $sg__input_to__OR__input_content, $sg__input_to, $sg__input_to, 0, 0, 1); _serialize_if($scope0_reason, 1) && writeScope($scope0_id, { input_content: input.content }, "__tests__/tags/my-for.marko", 0, { input_content: ["input.content"] }); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.js index eccf737bbc..ab2fd2e1b6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/my-for-to/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var my_for_default = _template("b", (input) => { b: _serialize_if($scope0_reason, 2) && $params2, _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a", $sg__input_to__OR__input_content, $sg__input_to, $sg__input_to); + }, 0, $scope0_id, "a", $sg__input_to__OR__input_content, $sg__input_to, $sg__input_to, 0, 0, 1); _serialize_if($scope0_reason, 1) && writeScope($scope0_id, { e: input.content }); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/sizes.json index af1475d881..6909c48cd4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/namespaced-tags/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13893, - "brotli": 5312 + "min": 13946, + "brotli": 5325 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.debug.js index 31d961fd88..4a69b8dd0b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.debug.js @@ -13,7 +13,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope2_id, "#div/0")}`); _script($scope2_id, "__tests__/template.marko_2_item"); writeScope($scope2_id, {}, "__tests__/template.marko", "4:4"); - }, 0, $scope1_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 1); + }, 0, $scope1_id, "#text/0", $sg__input_item, $sg__input_item, $sg__input_item, 0, 1, 1); _serialize_if($scope1_reason, 0) && writeScope($scope1_id, {}, "__tests__/template.marko", "3:2"); }) }; const $childScope = _peek_scope_id(); diff --git a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.js index faffa713d3..e046f82c84 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/__snapshots__/html.bundle.js @@ -13,7 +13,7 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope2_id, "a")}`); _script($scope2_id, "a0"); writeScope($scope2_id, {}); - }, 0, $scope1_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 1); + }, 0, $scope1_id, "a", $sg__input_item, $sg__input_item, $sg__input_item, 0, 1, 1); _serialize_if($scope1_reason, 0) && writeScope($scope1_id, {}); }) }; const $childScope = _peek_scope_id(); diff --git a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/sizes.json index 250f872d03..5220c6cabe 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/native-tag-local-closures/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 14410, - "brotli": 5581 + "min": 14463, + "brotli": 5588 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/sizes.json index d5aff7d32d..c5bd0c40f6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-content-opaque/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13508, - "brotli": 5189 + "min": 13578, + "brotli": 5216 }, "files": { "tags/render-input.marko": 351, diff --git a/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-void/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-void/sizes.json index 5ef03c6cd0..3d2a41339f 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-void/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/native-tag-spread-void/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 8706, - "brotli": 3312 + "min": 8759, + "brotli": 3326 }, "files": { "tags/my-img.marko": 235, diff --git a/packages/runtime-tags/src/__tests__/fixtures/nested-for-if-stateful/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/nested-for-if-stateful/sizes.json index c28d90147c..a35d57b40b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/nested-for-if-stateful/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/nested-for-if-stateful/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 8564, - "brotli": 3851 + "min": 8581, + "brotli": 3846 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.debug.js index 774c013fba..1e0a8eb52c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:3"); return 0; } - }, $scope0_id, "#div/0", 1, 1, 1, ""); + }, $scope0_id, "#div/0", 1, 1, 1, "", void 0, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, { mounted }, "__tests__/template.marko", 0, { mounted: "1:5" }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.js index 509a5d4936..be20e894f8 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/__snapshots__/html.bundle.js @@ -4,7 +4,7 @@ var template_default = _template("a", (input) => { const $scope0_id = _scope_id(); let mounted = void 0; _html("
    "); - _if(() => {}, $scope0_id, "a", 1, 1, 1, "
    "); + _if(() => {}, $scope0_id, "a", 1, 1, 1, "", void 0, 1); _script($scope0_id, "a0"); writeScope($scope0_id, { b: mounted }); _resume_branch($scope0_id); diff --git a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/sizes.json index f590f5cf08..04af0eaa9c 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/placeholder-static-multiple/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 5769, - "brotli": 2651 + "min": 5786, + "brotli": 2648 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.debug.js index d75fb35ddf..2acfeb6018 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.debug.js @@ -10,6 +10,6 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_children && writeScope($scope1_id, {}, "__tests__/template.marko", "3:4"); }, function(c) { return c.id; - }, $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, $scope0_id, "#div/0", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.js index 05b7419fbf..0daec38b3e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/remove-and-add-rows/__snapshots__/html.bundle.js @@ -10,6 +10,6 @@ var template_default = _template("a", (input) => { $si__input_children && writeScope($scope1_id, {}); }, function(c) { return c.id; - }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1); + }, $scope0_id, "a", $sg__input_children, $sg__input_children, $sg__input_children, "", 1, 1); $si__input_children && writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.debug.js index 5c1fb71880..3ce338acb2 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.debug.js @@ -15,6 +15,6 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:2"); return 0; } - }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value); + }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value, void 0, void 0, 1); writeScope($scope0_id, { foo: _serialize_if($scope0_reason, 0) && value?.foo }, "__tests__/template.marko", 0, { foo: "4:12" }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.js index 29bf90cf1f..81e1be53aa 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/rest-alias-nested-scope/__snapshots__/html.bundle.js @@ -15,6 +15,6 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value); + }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value, void 0, void 0, 1); writeScope($scope0_id, { e: _serialize_if($scope0_reason, 0) && value?.foo }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.debug.js index 9566f4b23a..7209dc4cff 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.debug.js @@ -14,9 +14,9 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope2_id, {}, "__tests__/template.marko", "6:4"); return 0; } - }, $scope1_id, "#text/0", 1, 1, 1, 0, 1); + }, $scope1_id, "#text/0", 1, 1, 1, 0, 1, 1); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:2"); - }, 0, $scope0_id, "#text/0"); + }, 0, $scope0_id, "#text/0", void 0, void 0, void 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "#button/1")}`); _script($scope0_id, "__tests__/template.marko_0_itemId_items"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.js index c2596a7602..cf3ed5b2a4 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/__snapshots__/html.bundle.js @@ -14,9 +14,9 @@ var template_default = _template("a", (input) => { writeScope($scope2_id, {}); return 0; } - }, $scope1_id, "a", 1, 1, 1, 0, 1); + }, $scope1_id, "a", 1, 1, 1, 0, 1, 1); writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); - }, 0, $scope0_id, "a"); + }, 0, $scope0_id, "a", void 0, void 0, void 0, 0, 0, 1); _html(`${_el_resume($scope0_id, "b")}`); _script($scope0_id, "a0"); writeScope($scope0_id, { diff --git a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/sizes.json index bc2db39f37..cfa3ac89f9 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/resume-single-node/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 7700, - "brotli": 3492 + "min": 7717, + "brotli": 3524 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-removed-event-handler/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/spread-removed-event-handler/sizes.json index 68e193173f..7d062a6435 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-removed-event-handler/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-removed-event-handler/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9110, - "brotli": 3440 + "min": 9132, + "brotli": 3449 } } } diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.debug.js index 237a387496..5918d339eb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.debug.js @@ -10,7 +10,7 @@ var child_default = _template("__tests__/tags/child.marko", (input) => { _html(`${_el_resume($scope1_id, "#option/0")}`); _script($scope1_id, "__tests__/tags/child.marko_1_option"); writeScope($scope1_id, {}, "__tests__/tags/child.marko", "2:4"); - }, 0, $scope0_id, "#select/0", $sg__input_option, _serialize_guard($scope0_reason, 0), $sg__input_option, "", 1); + }, 0, $scope0_id, "#select/0", $sg__input_option, _serialize_guard($scope0_reason, 0), $sg__input_option, "", 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.js index ecc19990ec..b6acfff61e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-custom-tag/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var child_default = _template("b", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "b0"); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_option, _serialize_guard($scope0_reason, 0), $sg__input_option, "", 1); + }, 0, $scope0_id, "a", $sg__input_option, _serialize_guard($scope0_reason, 0), $sg__input_option, "", 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.debug.js index bcfd91dff7..559144a873 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.debug.js @@ -13,7 +13,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _html(`${_el_resume($scope3_id, "#option/0")}`); _script($scope3_id, "__tests__/template.marko_3_option"); writeScope($scope3_id, {}, "__tests__/template.marko", "3:6"); - }, 0, $scope1_id, "#select/0", $sg__input_option, _serialize_guard($scope1_reason, 0), $sg__input_option, "", 1); + }, 0, $scope1_id, "#select/0", $sg__input_option, _serialize_guard($scope1_reason, 0), $sg__input_option, "", 1, 1); _serialize_if($scope1_reason, 0) && writeScope($scope1_id, {}, "__tests__/template.marko", "1:2"); }) }; const Wrap = { content: _content("__tests__/template.marko_2_content", ({ class: _class, ...rest }) => { diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.js index 52f48ccb60..0250c646da 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-attr-tag-define-tag/__snapshots__/html.bundle.js @@ -13,7 +13,7 @@ var template_default = _template("a", (input) => { _html(`${_el_resume($scope3_id, "a")}`); _script($scope3_id, "a0"); writeScope($scope3_id, {}); - }, 0, $scope1_id, "a", $sg__input_option, _serialize_guard($scope1_reason, 0), $sg__input_option, "", 1); + }, 0, $scope1_id, "a", $sg__input_option, _serialize_guard($scope1_reason, 0), $sg__input_option, "", 1, 1); _serialize_if($scope1_reason, 0) && writeScope($scope1_id, {}); }) }; ({ content: _content("a2", ({ class: _class, ...rest }) => { diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.debug.js index d7732f4bb5..3207f2fe0d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.debug.js @@ -10,7 +10,7 @@ var child_default = _template("__tests__/tags/child.marko", (input) => { _html(`${_el_resume($scope1_id, "#span/0")}`); _script($scope1_id, "__tests__/tags/child.marko_1_item"); writeScope($scope1_id, {}, "__tests__/tags/child.marko", "2:2"); - }, 0, $scope0_id, "#text/0", $sg__input_foo, $sg__input_foo, $sg__input_foo, 0, 1); + }, 0, $scope0_id, "#text/0", $sg__input_foo, $sg__input_foo, $sg__input_foo, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.js index d1b2161914..d4493b3ddb 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var child_default = _template("b", (input) => { _html(`${_el_resume($scope1_id, "a")}`); _script($scope1_id, "b0"); writeScope($scope1_id, {}); - }, 0, $scope0_id, "a", $sg__input_foo, $sg__input_foo, $sg__input_foo, 0, 1); + }, 0, $scope0_id, "a", $sg__input_foo, $sg__input_foo, $sg__input_foo, 0, 1, 1); _serialize_if($scope0_reason, 0) && writeScope($scope0_id, {}); }); diff --git a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/sizes.json index f12bbc027e..21ed5c6fe5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/spread-to-known-rest-input-with-attr-tags-deopt/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 14598, - "brotli": 5728 + "min": 14651, + "brotli": 5742 }, "files": { "tags/child.marko": 879, diff --git a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.debug.js index 15f8512921..cae545a7cf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var consumer_default = _template("__tests__/tags/consumer.marko", (input) => { writeScope($scope1_id, { _: _serialize_if($scope0_reason, 0) && _scope_with_id($scope0_id) }, "__tests__/tags/consumer.marko", "3:2"); return 0; } - }, $scope0_id, "#text/1"); + }, $scope0_id, "#text/1", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "__tests__/tags/consumer.marko_0_show"); writeScope($scope0_id, { input_content: input.content, diff --git a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.js index 9702495967..3a051cd0e3 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/__snapshots__/html.bundle.js @@ -4,7 +4,7 @@ var consumer_default = _template("b", (input) => { const $scope0_id = _scope_id(); let show = false; _html(`${_el_resume($scope0_id, "a")}`); - _if(() => {}, $scope0_id, "b"); + _if(() => {}, $scope0_id, "b", void 0, void 0, void 0, void 0, void 0, 1); _script($scope0_id, "b0"); writeScope($scope0_id, { e: input.content, diff --git a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/sizes.json index 52b29c2c67..eab54f9030 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/static-content-conditional-consumer/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 13396, - "brotli": 5141 + "min": 13466, + "brotli": 5171 }, "files": { "tags/consumer.marko": 547, diff --git a/packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/sizes.json index b4298c48a1..14f444d63e 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/tag-name-type-unions/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 14290, - "brotli": 5476 + "min": 14343, + "brotli": 5489 }, "files": { "tags/a/index.marko": 376, diff --git a/packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/sizes.json index 2e6aae18ca..264297cdef 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/tag-param-if-closure/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13751, - "brotli": 5295 + "min": 13821, + "brotli": 5315 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.debug.js index 22105cd881..d89ff997a0 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.debug.js @@ -9,7 +9,7 @@ var child_default = _template("__tests__/tags/child.marko", (input) => { $si__input_value && writeScope($scope1_id, {}, "__tests__/tags/child.marko", "1:2"); return 0; } - }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1); + }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1, 1); const $return = 1; $si__input_value && writeScope($scope0_id, {}, "__tests__/tags/child.marko", 0); return $return; diff --git a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.js index 6f3ff61fd7..1757672d43 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/__snapshots__/html.bundle.js @@ -9,7 +9,7 @@ var child_default = _template("b", (input) => { $si__input_value && writeScope($scope1_id, {}); return 0; } - }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1); + }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1, 1); const $return = 1; $si__input_value && writeScope($scope0_id, {}); return $return; diff --git a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/sizes.json index f46496a334..850675e8d6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/tag-var-with-serialize-reason/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6052, - "brotli": 2748 + "min": 6069, + "brotli": 2758 }, "files": { "tags/child.marko": 178, diff --git a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.debug.html b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.debug.html index 4962b18441..d15d552c82 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.debug.html +++ b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.debug.html @@ -14,11 +14,13 @@ _: _(2), "#childScope/0": _(4) }, { + "#ClosestBranchId": 3, input_depth: 1 }, { _: _(4), "#childScope/0": _(6) }, { + "#ClosestBranchId": 5, input_depth: 0 }], "packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/template.marko_0_n 1" diff --git a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.html b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.html index a12526a0de..c913fc8489 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.html +++ b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/__snapshots__/writes.html @@ -14,11 +14,13 @@ _: _(2), a: _(4) }, { + G: 3, e: 1 }, { _: _(4), a: _(6) }, { + G: 5, e: 0 }], "a0 1"]; M._.w() diff --git a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/sizes.json index 7407f2ee79..76816dcc08 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/tags-dir-recursive/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6284, - "brotli": 2851 + "min": 6301, + "brotli": 2856 }, "files": { "tags/tree/index.marko": 645, @@ -12,7 +12,7 @@ } }, "html": { - "min": 546, - "brotli": 316 + "min": 554, + "brotli": 324 } } diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.debug.js index ff947820c8..efac813cf5 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { $si__input_value && writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "3:4"); return 0; } - }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1); + }, $scope0_id, "#text/0", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1, 1); _html(""); $si__input_value && writeScope($scope0_id, { value }, "__tests__/template.marko", 0, { value: "1:10" }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.js index 2c3725ceca..7a686383f1 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-first-child/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { $si__input_value && writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1); + }, $scope0_id, "a", $sg__input_value, $sg__input_value, $sg__input_value, 0, 1, 1); _html(""); $si__input_value && writeScope($scope0_id, { d: value }); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-2/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-2/sizes.json index c3d3a25587..eb438ec5c6 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-2/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-2/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6844, - "brotli": 3062 + "min": 6861, + "brotli": 3066 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-3/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-3/sizes.json index f74ded6ba2..08d6c36476 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-3/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-nested-3/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 6844, - "brotli": 3062 + "min": 6861, + "brotli": 3066 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.debug.js index 2046d73059..a0f580519d 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.debug.js @@ -10,7 +10,7 @@ var template_default = _template("__tests__/template.marko", (input) => { _serialize_if($scope0_reason, 0) && writeScope($scope1_id, {}, "__tests__/template.marko", "2:4"); return 0; } - }, $scope0_id, "#button/0", $sg__input_show, 1, $sg__input_show, "", 1); + }, $scope0_id, "#button/0", $sg__input_show, 1, $sg__input_show, "", 1, 1); _script($scope0_id, "__tests__/template.marko_0"); writeScope($scope0_id, {}, "__tests__/template.marko", 0); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.js index 06bd7a3c54..93f5513bd3 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child-with-marker/__snapshots__/html.bundle.js @@ -10,7 +10,7 @@ var template_default = _template("a", (input) => { _serialize_if($scope0_reason, 0) && writeScope($scope1_id, {}); return 0; } - }, $scope0_id, "a", $sg__input_show, 1, $sg__input_show, "", 1); + }, $scope0_id, "a", $sg__input_show, 1, $sg__input_show, "", 1, 1); _script($scope0_id, "a0"); writeScope($scope0_id, {}); }, 1); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.debug.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.debug.js index 67922c39d4..baab92682b 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.debug.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.debug.js @@ -11,7 +11,7 @@ var template_default = _template("__tests__/template.marko", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }, "__tests__/template.marko", "4:4"); return 0; } - }, $scope0_id, "#div/0", 1, 1, 1, "", 1); + }, $scope0_id, "#div/0", 1, 1, 1, "", 1, 1); _html(` { value = _new_value; }, "__tests__/template.marko_0/valueChange", $scope0_id))}>${_el_resume($scope0_id, "#input/1")}`); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.js b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.js index 65c9620912..dda4f61cbf 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.js +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/__snapshots__/html.bundle.js @@ -11,7 +11,7 @@ var template_default = _template("a", (input) => { writeScope($scope1_id, { _: _scope_with_id($scope0_id) }); return 0; } - }, $scope0_id, "a", 1, 1, 1, "", 1); + }, $scope0_id, "a", 1, 1, 1, "", 1, 1); _html(` { value = _new_value; }, "a0", $scope0_id))}>${_el_resume($scope0_id, "b")}`); diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/sizes.json index 77a5f056f6..b39f1fe969 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-only-child/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 7378, - "brotli": 3239 + "min": 7395, + "brotli": 3249 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/toggle-stateful-component/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/toggle-stateful-component/sizes.json index 412a29966a..4b0a5532ad 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/toggle-stateful-component/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/toggle-stateful-component/sizes.json @@ -2,8 +2,8 @@ "dom": { "template.marko.page.mjs": { "total": { - "min": 6631, - "brotli": 2994 + "min": 6648, + "brotli": 2999 }, "files": { "tags/counter.marko": 708, diff --git a/packages/runtime-tags/src/__tests__/fixtures/try-effects-async/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/try-effects-async/sizes.json index 0e70b6da76..bf6b533064 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/try-effects-async/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/try-effects-async/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 9374, - "brotli": 3962 + "min": 9428, + "brotli": 3979 } }, "html": { diff --git a/packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/sizes.json b/packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/sizes.json index 7899058709..307dd22e69 100644 --- a/packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/sizes.json +++ b/packages/runtime-tags/src/__tests__/fixtures/unused-dynamic-tag-body-serialize-reason/sizes.json @@ -1,8 +1,8 @@ { "dom": { "template.marko.page.mjs": { - "min": 13514, - "brotli": 5203 + "min": 13567, + "brotli": 5218 } }, "html": { diff --git a/packages/runtime-tags/src/dom/control-flow.ts b/packages/runtime-tags/src/dom/control-flow.ts index 71454ad611..3b4e2a59c6 100644 --- a/packages/runtime-tags/src/dom/control-flow.ts +++ b/packages/runtime-tags/src/dom/control-flow.ts @@ -82,11 +82,21 @@ export function _await_promise( c() { if (--awaitCounter!.i) return 1; if (tryBranch === scope[branchAccessor]) { - if ((scope[nodeAccessor] as ChildNode).parentNode) { - (scope[nodeAccessor] as ChildNode).replaceWith( - (scope[branchAccessor] as BranchScope)[AccessorProp.StartNode] - .parentNode!, - ); + const anchor = scope[nodeAccessor] as ChildNode; + if (anchor.parentNode) { + const detachedParent = (scope[branchAccessor] as BranchScope)[ + AccessorProp.StartNode + ].parentNode!; + if (detachedParent === anchor.parentNode) { + // The re-await detach (scheduled in a rAF) raced with the + // promise resolving, so the branch was never moved to a + // detached fragment and is still in place beside the anchor. + // Swapping the anchor for its own parent would cycle; just + // drop the leftover anchor. + anchor.remove(); + } else { + anchor.replaceWith(detachedParent); + } } } else { dismissPlaceholder(tryBranch); diff --git a/packages/runtime-tags/src/html/dynamic-tag.ts b/packages/runtime-tags/src/html/dynamic-tag.ts index 6fbb387982..688985842e 100644 --- a/packages/runtime-tags/src/html/dynamic-tag.ts +++ b/packages/runtime-tags/src/html/dynamic-tag.ts @@ -14,6 +14,7 @@ import { _html, _peek_scope_id, _resume, + _resume_branch, _scope, _scope_id, _script, @@ -41,8 +42,18 @@ export let _dynamic_tag = ( content?: (() => void) | 0, inputIsArgs?: 1, serializeReason?: 1 | 0, + branchCleanupFree?: 1, ) => { const shouldResume = serializeReason !== 0; + // The owning scope creates this branch at runtime (passing itself as the + // parent scope), so when it is itself inside a branch it must resume with its + // closest branch linked, or a client-created branch would be orphaned from + // the branch tree. `_resume_branch` is a no-op outside a branch, and is + // skipped entirely when the rendered content provably has no cleanup to + // cascade (`branchCleanupFree`). + if (shouldResume && !branchCleanupFree) { + _resume_branch(scopeId); + } const renderer = normalizeDynamicRenderer(tag); const state = getState()!; const branchId = _peek_scope_id(); @@ -220,6 +231,7 @@ export const patchDynamicTag = ( content, inputIsArgs, resume, + branchCleanupFree, ) => { const patched = patch(tag, scopeId, accessor); if (patched !== tag) @@ -232,6 +244,7 @@ export const patchDynamicTag = ( content, inputIsArgs, resume, + branchCleanupFree, ); }; } diff --git a/packages/runtime-tags/src/html/writer.ts b/packages/runtime-tags/src/html/writer.ts index 82a7ffabe3..4236d5c9be 100644 --- a/packages/runtime-tags/src/html/writer.ts +++ b/packages/runtime-tags/src/html/writer.ts @@ -343,6 +343,7 @@ export function _for_of( serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1, + branchCleanupFree?: 1, ): void { forBranches( by, @@ -360,6 +361,7 @@ export function _for_of( serializeStateful, parentEndTag, singleNode, + branchCleanupFree, ); } @@ -374,6 +376,7 @@ export function _for_in( serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1, + branchCleanupFree?: 1, ): void { forBranches( by, @@ -392,6 +395,7 @@ export function _for_in( serializeStateful, parentEndTag, singleNode, + branchCleanupFree, ); } @@ -408,6 +412,7 @@ export function _for_to( serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1, + branchCleanupFree?: 1, ): void { forBranches( by, @@ -427,6 +432,7 @@ export function _for_to( serializeStateful, parentEndTag, singleNode, + branchCleanupFree, ); } @@ -443,6 +449,7 @@ export function _for_until( serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1, + branchCleanupFree?: 1, ): void { forBranches( by, @@ -462,6 +469,7 @@ export function _for_until( serializeStateful, parentEndTag, singleNode, + branchCleanupFree, ); } @@ -484,6 +492,7 @@ function forBranches( serializeStateful: undefined | 0 | 1, parentEndTag: string | undefined | 0, singleNode?: 1, + branchCleanupFree?: 1, ) { if (MARKO_DEBUG) { // eslint-disable-next-line no-var @@ -518,6 +527,15 @@ function forBranches( let flushBranchIds = ""; let loopScopes: Opt; + // The owning scope creates these branches at runtime (passing itself as the + // parent scope), so when it is itself inside a branch it must resume with its + // closest branch linked, or a client-created branch would be orphaned from + // the branch tree. `_resume_branch` is a no-op outside a branch, and is + // skipped entirely when the loop body provably has no cleanup to cascade. + if (!branchCleanupFree) { + _resume_branch(scopeId); + } + iterate((itemKey, sameAsIndex, render) => { const branchId = _peek_scope_id(); if (MARKO_DEBUG && by) { @@ -570,6 +588,7 @@ export function _if( serializeStateful?: 0 | 1, parentEndTag?: string | 0, singleNode?: 1, + branchCleanupFree?: 1, ) { const { state } = $chunk.boundary; const resumeBranch = serializeBranch !== 0; @@ -580,6 +599,16 @@ export function _if( $chunk.writeHTML(state.mark(ResumeSymbol.BranchStart, "")); } + // The owning scope creates this branch at runtime (passing itself as the + // parent scope), so when it is itself inside a branch it must resume with its + // closest branch linked, or a client-created branch would be orphaned from + // the branch tree. `_resume_branch` is a no-op outside a branch, and is + // skipped entirely when the branch subtree provably has no cleanup to cascade + // (`branchCleanupFree`). + if (resumeBranch && !branchCleanupFree) { + _resume_branch(scopeId); + } + const branchIndex = resumeBranch ? withBranchId(branchId, cb) : cb(); const shouldWriteBranch = resumeBranch && branchIndex !== undefined; diff --git a/packages/runtime-tags/src/translator/core/await.ts b/packages/runtime-tags/src/translator/core/await.ts index 0cb112244f..b264d09bef 100644 --- a/packages/runtime-tags/src/translator/core/await.ts +++ b/packages/runtime-tags/src/translator/core/await.ts @@ -59,6 +59,9 @@ export default { const { node } = tag; const tagBody = tag.get("body"); const section = getOrCreateSection(tag); + // `` registers async cleanup, so its enclosing branch must resume + // linked. + section.hasOpaqueChild = true; const [valueAttr] = node.attributes; const tagExtra = (tag.node.extra ??= {}); tagExtra[kDOMBinding] = createBinding("#text", BindingType.dom, section); diff --git a/packages/runtime-tags/src/translator/core/for.ts b/packages/runtime-tags/src/translator/core/for.ts index cf81242b91..64b69497db 100644 --- a/packages/runtime-tags/src/translator/core/for.ts +++ b/packages/runtime-tags/src/translator/core/for.ts @@ -33,6 +33,7 @@ import { getScopeIdIdentifier, getSection, getSectionForBody, + sectionSubtreeMayCleanup, setSectionParentIsOwner, startSection, } from "../util/sections"; @@ -224,16 +225,26 @@ export default { statefulSerializeArg, ); + // The loop body cannot register cleanup ⇒ a client-created branch + // need not join the branch tree, so skip linking its closest branch + // on resume. Trailing arg, so `parentEndTag`/`singleNode` are filled + // with placeholders when absent. + const branchCleanupFree = !sectionSubtreeMayCleanup(bodySection); + if (skipParentEnd) { getParentTag(tag)!.node.extra![kSkipEndTag] = true; forTagArgs.push(t.stringLiteral(``)); + } else if (singleChild || branchCleanupFree) { + forTagArgs.push(t.numericLiteral(0)); } if (singleChild) { - if (!skipParentEnd) { - forTagArgs.push(t.numericLiteral(0)); - } + forTagArgs.push(t.numericLiteral(1)); + } else if (branchCleanupFree) { + forTagArgs.push(t.numericLiteral(0)); + } + if (branchCleanupFree) { forTagArgs.push(t.numericLiteral(1)); } } diff --git a/packages/runtime-tags/src/translator/core/if.ts b/packages/runtime-tags/src/translator/core/if.ts index 64d790f55a..518bb68cef 100644 --- a/packages/runtime-tags/src/translator/core/if.ts +++ b/packages/runtime-tags/src/translator/core/if.ts @@ -32,6 +32,7 @@ import { getSection, getSectionForBody, type Section, + sectionSubtreeMayCleanup, setSectionParentIsOwner, startSection, } from "../util/sections"; @@ -228,6 +229,13 @@ export const IfTag = { [], t.blockStatement([statement!]), ); + // No branch body can register cleanup ⇒ a client-created branch + // need not join the branch tree, so skip linking its closest + // branch on resume. + const branchCleanupFree = !branches.some( + ([, branchBody]) => + branchBody && sectionSubtreeMayCleanup(branchBody), + ); statement = t.expressionStatement( callRuntime( @@ -248,6 +256,7 @@ export const IfTag = { ? t.numericLiteral(0) : undefined, singleChild ? t.numericLiteral(1) : undefined, + branchCleanupFree ? t.numericLiteral(1) : undefined, ), ); } diff --git a/packages/runtime-tags/src/translator/core/try.ts b/packages/runtime-tags/src/translator/core/try.ts index 607c462306..cea2cdaaa7 100644 --- a/packages/runtime-tags/src/translator/core/try.ts +++ b/packages/runtime-tags/src/translator/core/try.ts @@ -63,6 +63,9 @@ export default { assertNoAttributes(tag); analyzeAttributeTags(tag); const section = getOrCreateSection(tag); + // `` registers async/catch cleanup, so its enclosing branch must + // resume linked. + section.hasOpaqueChild = true; const tagExtra = mergeReferences( section, tag.node, diff --git a/packages/runtime-tags/src/translator/util/known-tag.ts b/packages/runtime-tags/src/translator/util/known-tag.ts index 843b8071af..d455e9488c 100644 --- a/packages/runtime-tags/src/translator/util/known-tag.ts +++ b/packages/runtime-tags/src/translator/util/known-tag.ts @@ -118,6 +118,9 @@ export function knownTagAnalyze( analyzeAttributeTags(tag); const section = getOrCreateSection(tag); + // A custom/dynamic tag renders a separately-compiled child whose cleanup we + // can't see, so its enclosing branch must always resume linked. + section.hasOpaqueChild = true; const tagBody = tag.get("body"); const tagExtra = (tag.node.extra ??= {}); const childScopeBinding = (tagExtra[kChildScopeBinding] = createBinding( diff --git a/packages/runtime-tags/src/translator/util/sections.ts b/packages/runtime-tags/src/translator/util/sections.ts index 0e2d7e4cd5..18d9aea0ec 100644 --- a/packages/runtime-tags/src/translator/util/sections.ts +++ b/packages/runtime-tags/src/translator/util/sections.ts @@ -76,6 +76,7 @@ export interface Section { | false | undefined; hasAbortSignal: boolean; + hasOpaqueChild: boolean; readsOwner: boolean; isBranch: boolean; content: null | { @@ -150,6 +151,7 @@ export function startSection( upstreamExpression: undefined, downstreamBinding: undefined, hasAbortSignal: false, + hasOpaqueChild: false, readsOwner: false, isBranch: false, }; @@ -222,6 +224,52 @@ export function forEachSectionReverse(fn: (section: Section) => void) { } } +// Whether a section's subtree could register cleanup that must run when an +// ancestor branch is destroyed. This is the only reason a (non-branch) owning +// scope needs its closest branch linked on resume: a branch it creates on the +// client must join the branch tree so the cleanup cascades. Cleanup is always +// registered through `$signal` — directly (`hasAbortSignal`, which also covers +// ``), through dynamic closures (`referencedClosures`), or inside an +// opaque/async child (`hasOpaqueChild`: a custom/dynamic tag, ``, or +// ``, whose internals we can't see and so must assume). Only *dynamic* +// closures register cleanup (via `subscribeToScopeSet`); a direct/static +// closure (e.g. an `` reading a value from its immediate parent) does not. +// Defaults to `true` for anything not provably free, so a missed case links +// rather than leaks. +let branchCleanupChildren: Map | undefined; +let branchCleanupChildrenFor: unknown; +const branchCleanupCache = new WeakMap(); +export function sectionSubtreeMayCleanup(section: Section): boolean { + const { sections } = getProgram().node.extra; + if (branchCleanupChildrenFor !== sections) { + branchCleanupChildrenFor = sections; + branchCleanupChildren = new Map(); + for (const s of sections!) { + if (s.parent) { + const siblings = branchCleanupChildren.get(s.parent); + if (siblings) siblings.push(s); + else branchCleanupChildren.set(s.parent, [s]); + } + } + } + return subtreeMayCleanup(section); +} +function subtreeMayCleanup(section: Section): boolean { + let result = branchCleanupCache.get(section); + if (result === undefined) { + branchCleanupCache.set(section, true); // guard re-entrancy safely + result = + section.hasAbortSignal || + section.hasOpaqueChild || + !!find(section.referencedClosures, (closure) => + isDynamicClosure(section, closure), + ) || + !!branchCleanupChildren!.get(section)?.some(subtreeMayCleanup); + branchCleanupCache.set(section, result); + } + return result; +} + function getContentInfo(path: t.NodePath) { const body = path.get("body"); const contentInfo: Section["content"] = {