diff --git a/.sizes.json b/.sizes.json index ab015c4ea..f43113531 100644 --- a/.sizes.json +++ b/.sizes.json @@ -51,9 +51,9 @@ { "name": "comments", "user": { - "min": 1133, - "gzip": 687, - "brotli": 612 + "min": 1142, + "gzip": 695, + "brotli": 625 }, "runtime": { "min": 7250, @@ -61,17 +61,17 @@ "brotli": 2965 }, "total": { - "min": 8383, - "gzip": 3955, - "brotli": 3577 + "min": 8392, + "gzip": 3963, + "brotli": 3590 } }, { "name": "comments 💧", "user": { - "min": 930, - "gzip": 579, - "brotli": 533 + "min": 944, + "gzip": 591, + "brotli": 540 }, "runtime": { "min": 8244, @@ -79,9 +79,9 @@ "brotli": 3361 }, "total": { - "min": 9174, - "gzip": 4292, - "brotli": 3894 + "min": 9188, + "gzip": 4304, + "brotli": 3901 } } ] diff --git a/packages/runtime/src/dom/hydrate.ts b/packages/runtime/src/dom/hydrate.ts index 56ef7a90c..01aed0515 100644 --- a/packages/runtime/src/dom/hydrate.ts +++ b/packages/runtime/src/dom/hydrate.ts @@ -135,9 +135,10 @@ export function init(runtimeId = "M" /* [a-zA-Z0-9]+ */) { } for (let i = 0; i < calls.length; i += 2) { - (registeredObjects.get(calls[i + 1] as string) as HydrateFn)!( - scopeLookup[calls[i] as number]! - ); + const hydrateFn = (registeredObjects.get( + calls[i + 1] as string + ) as HydrateFn)!; + hydrateFn(scopeLookup[calls[i] as number]!); } } } diff --git a/packages/runtime/src/html/writer.ts b/packages/runtime/src/html/writer.ts index 62c94bc33..e698cde07 100644 --- a/packages/runtime/src/html/writer.ts +++ b/packages/runtime/src/html/writer.ts @@ -329,9 +329,11 @@ export function markHydrateControlEnd(scopeId: number, index: Accessor) { export function markHydrateControlSingleNodeEnd( scopeId: number, index: Accessor, - childScopeIds: number | number[] + childScopeIds?: number | number[] ) { - return ``; + return ``; } function writeHydrateScript() { diff --git a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/dom.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/dom.expected/template.js index df21badde..054ca3eb1 100644 --- a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/dom.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/dom.expected/template.js @@ -1,7 +1,7 @@ let _thing; -import { write as _write, bindRenderer as _bindRenderer, createRenderer as _createRenderer, conditional as _conditional, dynamicSubscribers as _dynamicSubscribers, dynamicClosure as _dynamicClosure, source as _source, setSource as _setSource, destructureSources as _destructureSources, createRenderFn as _createRenderFn } from "@marko/runtime-fluurt/src/dom"; +import { write as _write, bindRenderer as _bindRenderer, createRenderer as _createRenderer, register as _register, conditional as _conditional, dynamicSubscribers as _dynamicSubscribers, dynamicClosure as _dynamicClosure, source as _source, setSource as _setSource, destructureSources as _destructureSources, createRenderFn as _createRenderFn } from "@marko/runtime-fluurt/src/dom"; import { setup as _customTag, template as _customTag_template, walks as _customTag_walks } from "./components/custom-tag/index.marko"; -const _ifBody = /* @__PURE__ */_createRenderer("", ""); +const _ifBody = _register("packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/template.marko_2_renderer", /* @__PURE__ */_createRenderer("", "")); const _if$customTagBody = /* @__PURE__ */_conditional("#text/0", 1, (_scope, x = _scope._["x"]) => x ? _ifBody : null); const _x$customTagBody = _dynamicClosure(1, "x", [_if$customTagBody]); const _customTagBody = /* @__PURE__ */_createRenderer("", /* replace */"%", null, [_x$customTagBody]); diff --git a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/components/custom-tag/index.js b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/components/custom-tag/index.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/components/custom-tag/index.js +++ b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/components/custom-tag/index.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write("
"); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/template.js index a31828941..fed7b3b8f 100644 --- a/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/__snapshots__/html.expected/template.js @@ -1,20 +1,33 @@ -import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; +import { write as _write, SYMBOL_OWNER as _SYMBOL_OWNER, nextScopeId as _nextScopeId, writeHydrateScope as _writeHydrateScope, register as _register, markHydrateControlSingleNodeEnd as _markHydrateControlSingleNodeEnd, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _customTag from "./components/custom-tag/index.marko"; const _renderer = ({ x }, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); let _thing; - const _scope = _nextScopeId(); + const _scope1_ = _nextScopeId(); + let _ifScopeId; + const _ifScope = {}, + _ifRenderer = () => {}; if (x) { - const _scope = _nextScopeId(); + const _scope2_ = _nextScopeId(); _thing = { x: 1, renderBody() { _write("Hello"); } }; + _writeHydrateScope(_scope2_, Object.assign(_ifScope, { + [_SYMBOL_OWNER]: _scope1_ + })); + _register(_ifRenderer, "packages/translator/src/__tests__/fixtures/at-tag-inside-if-tag/template.marko_2_renderer"); + _ifScopeId = _scope2_; } + _write(`${_markHydrateControlSingleNodeEnd(_scope1_, "#text/0", _ifScopeId)}`); + _writeHydrateScope(_scope1_, { + "#text/0!": _ifScope, + "#text/0(": _ifRenderer + }); _customTag({ thing: _thing }); diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/components/hello/index.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/components/hello/index.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/components/hello/index.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/components/hello/index.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/template.js index a723d390f..f893f0567 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-and-static/__snapshots__/html.expected/template.js @@ -1,14 +1,14 @@ import { nextScopeId as _nextScopeId, maybeFlush as _maybeFlush, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _hello from "./components/hello/index.marko"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); const _item = []; - const _scope = _nextScopeId(); + const _scope1_ = _nextScopeId(); for (const a in { a: 1, b: 2 }) { - const _scope = _nextScopeId(); + const _scope2_ = _nextScopeId(); _item.push({}); _maybeFlush(); } diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-tag-parent/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-tag-parent/__snapshots__/html.expected/template.js index 84b8a6946..c3e3794e5 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-tag-parent/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-tag-parent/__snapshots__/html.expected/template.js @@ -2,7 +2,7 @@ import { write as _write, dynamicTag as _dynamicTag, nextScopeId as _nextScopeId const _renderer = ({ x }, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _dynamicTag(x, { header: { class: "my-header", diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/dom.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/dom.expected/template.js index 32695a91d..eda8d5ac8 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/dom.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/dom.expected/template.js @@ -1,11 +1,11 @@ let _item; -import { data as _data, write as _write, bindRenderer as _bindRenderer, createRenderer as _createRenderer, conditional as _conditional, dynamicSubscribers as _dynamicSubscribers, dynamicClosure as _dynamicClosure, source as _source, setSource as _setSource, destructureSources as _destructureSources, createRenderFn as _createRenderFn } from "@marko/runtime-fluurt/src/dom"; +import { data as _data, write as _write, bindRenderer as _bindRenderer, createRenderer as _createRenderer, register as _register, conditional as _conditional, dynamicSubscribers as _dynamicSubscribers, dynamicClosure as _dynamicClosure, source as _source, setSource as _setSource, destructureSources as _destructureSources, createRenderFn as _createRenderFn } from "@marko/runtime-fluurt/src/dom"; import { setup as _hello, template as _hello_template, walks as _hello_walks } from "./components/hello/index.marko"; const _setup$itemBody = _scope => { _data(_scope["#text/0"], y); }; const _itemBody = /* @__PURE__ */_createRenderer("", /* get */" ", _setup$itemBody); -const _ifBody = /* @__PURE__ */_createRenderer("", ""); +const _ifBody = _register("packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/template.marko_2_renderer", /* @__PURE__ */_createRenderer("", "")); const _if$helloBody = /* @__PURE__ */_conditional("#text/0", 1, (_scope, x = _scope._["x"]) => x ? _ifBody : null); const _x$helloBody = _dynamicClosure(1, "x", [_if$helloBody]); const _helloBody = /* @__PURE__ */_createRenderer("", /* replace */"%", null, [_x$helloBody]); diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/components/hello/index.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/components/hello/index.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/components/hello/index.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/components/hello/index.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/template.js index b7a4835c1..1bb20df64 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/__snapshots__/html.expected/template.js @@ -1,19 +1,32 @@ -import { escapeXML as _escapeXML, markHydrateNode as _markHydrateNode, write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; +import { escapeXML as _escapeXML, markHydrateNode as _markHydrateNode, write as _write, SYMBOL_OWNER as _SYMBOL_OWNER, nextScopeId as _nextScopeId, writeHydrateScope as _writeHydrateScope, register as _register, markHydrateControlSingleNodeEnd as _markHydrateControlSingleNodeEnd, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _hello from "./components/hello/index.marko"; const _renderer = ({ x }, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); let _item; - const _scope = _nextScopeId(); + const _scope1_ = _nextScopeId(); + let _ifScopeId; + const _ifScope = {}, + _ifRenderer = () => {}; if (x) { - const _scope = _nextScopeId(); + const _scope2_ = _nextScopeId(); _item = { renderBody(y) { - _write(`${_escapeXML(y)}${_markHydrateNode(_scope, "#text/0")}`); + _write(`${_escapeXML(y)}${_markHydrateNode(_scope3_, "#text/0")}`); } }; + _writeHydrateScope(_scope2_, Object.assign(_ifScope, { + [_SYMBOL_OWNER]: _scope1_ + })); + _register(_ifRenderer, "packages/translator/src/__tests__/fixtures/at-tags-dynamic-with-params/template.marko_2_renderer"); + _ifScopeId = _scope2_; } + _write(`${_markHydrateControlSingleNodeEnd(_scope1_, "#text/0", _ifScopeId)}`); + _writeHydrateScope(_scope1_, { + "#text/0!": _ifScope, + "#text/0(": _ifRenderer + }); _hello({ item: _item }); diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/components/hello/index.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/components/hello/index.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/components/hello/index.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/components/hello/index.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/template.js index 0cf91cd78..d79055a9e 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags-dynamic/__snapshots__/html.expected/template.js @@ -1,14 +1,17 @@ -import { write as _write, nextScopeId as _nextScopeId, maybeFlush as _maybeFlush, escapeXML as _escapeXML, markHydrateNode as _markHydrateNode, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; +import { write as _write, SYMBOL_OWNER as _SYMBOL_OWNER, nextScopeId as _nextScopeId, writeHydrateScope as _writeHydrateScope, register as _register, markHydrateControlSingleNodeEnd as _markHydrateControlSingleNodeEnd, maybeFlush as _maybeFlush, escapeXML as _escapeXML, markHydrateNode as _markHydrateNode, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _hello from "./components/hello/index.marko"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); const _col = []; - const _scope = _nextScopeId(); + const _scope1_ = _nextScopeId(); const _item = []; for (const color of ["red", "blue", "green"]) { - const _scope = _nextScopeId(); + const _scope3_ = _nextScopeId(); + let _ifScopeId; + const _ifScope = {}, + _ifRenderer = () => {}; if (color === "red") { - const _scope = _nextScopeId(); + const _scope4_ = _nextScopeId(); _item.push({ style: { color @@ -17,8 +20,13 @@ const _renderer = (input, _tagVar) => { _write("foo"); } }); + _writeHydrateScope(_scope4_, Object.assign(_ifScope, { + [_SYMBOL_OWNER]: _scope3_ + })); + _register(_ifRenderer, "packages/translator/src/__tests__/fixtures/at-tags-dynamic/template.marko_4_renderer"); + _ifScopeId = _scope4_; } else { - const _scope = _nextScopeId(); + const _scope5_ = _nextScopeId(); _item.push({ style: { color @@ -27,20 +35,30 @@ const _renderer = (input, _tagVar) => { _write("bar"); } }); + _writeHydrateScope(_scope5_, Object.assign(_ifScope, { + [_SYMBOL_OWNER]: _scope3_ + })); + _register(_ifRenderer, "packages/translator/src/__tests__/fixtures/at-tags-dynamic/template.marko_5_renderer"); + _ifScopeId = _scope5_; } + _write(`${_markHydrateControlSingleNodeEnd(_scope3_, "#text/0", _ifScopeId)}`); + _writeHydrateScope(_scope3_, { + "#text/0!": _ifScope, + "#text/0(": _ifRenderer + }); _maybeFlush(); } let _i = 0; for (const col of [["a", "b"], ["c", "d"]]) { let i = _i++; - const _scope = _nextScopeId(); + const _scope6_ = _nextScopeId(); const _row = []; for (const row of col) { - const _scope = _nextScopeId(); + const _scope8_ = _nextScopeId(); _row.push({ row: row, renderBody() { - _write(`${_escapeXML(row)}${_markHydrateNode(_scope, "#text/0")}`); + _write(`${_escapeXML(row)}${_markHydrateNode(_scope9_, "#text/0")}`); } }); _maybeFlush(); diff --git a/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/components/hello/index.js b/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/components/hello/index.js index 860f890ac..9ee49872b 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/components/hello/index.js +++ b/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/components/hello/index.js @@ -1,6 +1,6 @@ import { nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); }; export default _renderer; export const render = /* @__PURE__ */_createRenderer(_renderer); \ No newline at end of file diff --git a/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/template.js index ee84dbb1d..b9bc9c30c 100644 --- a/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/at-tags/__snapshots__/html.expected/template.js @@ -1,7 +1,7 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _hello from "./components/hello/index.marko"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _hello({ foo: { renderBody() { @@ -9,7 +9,7 @@ const _renderer = (input, _tagVar) => { } }, renderBody() { - const _scope = _nextScopeId(); + const _scope1_ = _nextScopeId(); } }); }; diff --git a/packages/translator/src/__tests__/fixtures/attr-boolean/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-boolean/__snapshots__/html.expected/template.js index b1bb5c789..4cd660941 100644 --- a/packages/translator/src/__tests__/fixtures/attr-boolean/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-boolean/__snapshots__/html.expected/template.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/components/custom-tag.js b/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/components/custom-tag.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/components/custom-tag.js +++ b/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/components/custom-tag.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/template.js index a6c94b69c..13189b033 100644 --- a/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-class/__snapshots__/html.expected/template.js @@ -1,7 +1,7 @@ import { classAttr as _classAttr, markHydrateNode as _markHydrateNode, write as _write, nextScopeId as _nextScopeId, dynamicTag as _dynamicTag, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; import _customTag from "./components/custom-tag.marko"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); const { c, d @@ -9,20 +9,20 @@ const _renderer = (input, _tagVar) => { _write(`${_markHydrateNode(_scope, "#div/0")}`); + }])}>${_markHydrateNode(_scope0_, "#div/0")}`); _customTag({ class: ["a", { b: c, d }], renderBody() { - const _scope = _nextScopeId(); + const _scope2_ = _nextScopeId(); } }); _customTag({ class: ["a", false, "b"], renderBody() { - const _scope = _nextScopeId(); + const _scope3_ = _nextScopeId(); } }); _dynamicTag(input.test, { diff --git a/packages/translator/src/__tests__/fixtures/attr-escape/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-escape/__snapshots__/html.expected/template.js index 6fce67f30..cff618052 100644 --- a/packages/translator/src/__tests__/fixtures/attr-escape/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-escape/__snapshots__/html.expected/template.js @@ -1,7 +1,7 @@ import { classAttr as _classAttr, attr as _attr, markHydrateNode as _markHydrateNode, write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); - _write(`${_markHydrateNode(_scope, "#div/0")}`); + const _scope0_ = _nextScopeId(); + _write(`${_markHydrateNode(_scope0_, "#div/0")}`); }; export default _renderer; export const render = /* @__PURE__ */_createRenderer(_renderer); \ No newline at end of file diff --git a/packages/translator/src/__tests__/fixtures/attr-falsey/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-falsey/__snapshots__/html.expected/template.js index af76849a0..b70a1893d 100644 --- a/packages/translator/src/__tests__/fixtures/attr-falsey/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-falsey/__snapshots__/html.expected/template.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/attr-scoped/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-scoped/__snapshots__/html.expected/template.js index be425f07a..7aef9aca4 100644 --- a/packages/translator/src/__tests__/fixtures/attr-scoped/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-scoped/__snapshots__/html.expected/template.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/components/custom-tag.js b/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/components/custom-tag.js index fda3a01e2..f31d1bda1 100644 --- a/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/components/custom-tag.js +++ b/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/components/custom-tag.js @@ -1,6 +1,6 @@ import { write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(""); }; export default _renderer; diff --git a/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/template.js index 06aca296d..c4f7ada02 100644 --- a/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-style/__snapshots__/html.expected/template.js @@ -4,16 +4,16 @@ const _renderer = ({ color, test }, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); _write(`${_markHydrateNode(_scope, "#div/0")}`); + })}>${_markHydrateNode(_scope0_, "#div/0")}`); _customTag({ style: { color: color }, renderBody() { - const _scope = _nextScopeId(); + const _scope2_ = _nextScopeId(); } }); _customTag({ @@ -21,13 +21,13 @@ const _renderer = ({ width: 100 }, renderBody() { - const _scope = _nextScopeId(); + const _scope3_ = _nextScopeId(); } }); _customTag({ style: "color: green", renderBody() { - const _scope = _nextScopeId(); + const _scope4_ = _nextScopeId(); } }); _dynamicTag(test, { diff --git a/packages/translator/src/__tests__/fixtures/attr-template-literal-escape/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/attr-template-literal-escape/__snapshots__/html.expected/template.js index e3628ed97..d648d931c 100644 --- a/packages/translator/src/__tests__/fixtures/attr-template-literal-escape/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/attr-template-literal-escape/__snapshots__/html.expected/template.js @@ -2,8 +2,8 @@ import { attr as _attr, markHydrateNode as _markHydrateNode, write as _write, ne const _renderer = ({ name }, _tagVar) => { - const _scope = _nextScopeId(); - _write(`${_markHydrateNode(_scope, "#div/0")}`); + const _scope0_ = _nextScopeId(); + _write(`${_markHydrateNode(_scope0_, "#div/0")}`); }; export default _renderer; export const render = /* @__PURE__ */_createRenderer(_renderer); \ No newline at end of file diff --git a/packages/translator/src/__tests__/fixtures/basic-chain/__snapshots__/html.expected/template.js b/packages/translator/src/__tests__/fixtures/basic-chain/__snapshots__/html.expected/template.js index 3775a9bda..0619c9e20 100644 --- a/packages/translator/src/__tests__/fixtures/basic-chain/__snapshots__/html.expected/template.js +++ b/packages/translator/src/__tests__/fixtures/basic-chain/__snapshots__/html.expected/template.js @@ -1,10 +1,10 @@ import { escapeXML as _escapeXML, markHydrateNode as _markHydrateNode, write as _write, nextScopeId as _nextScopeId, createRenderer as _createRenderer } from "@marko/runtime-fluurt/src/html"; const _renderer = (input, _tagVar) => { - const _scope = _nextScopeId(); + const _scope0_ = _nextScopeId(); const x = 1; const y = x * 2; const z = y * 3; - _write(`