@marko/runtime-tags 6.0.169 → 6.0.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/debug/dom.js +6 -6
- package/dist/debug/dom.mjs +6 -6
- package/dist/debug/html.js +3 -4
- package/dist/debug/html.mjs +3 -4
- package/dist/dom.js +3 -2
- package/dist/dom.mjs +3 -2
- package/dist/translator/index.js +12 -20
- package/dist/translator/util/entry-builder.d.ts +0 -1
- package/package.json +1 -1
package/dist/debug/dom.js
CHANGED
|
@@ -550,8 +550,9 @@ function enableBranches() {
|
|
|
550
550
|
branchesEnabled = 1;
|
|
551
551
|
}
|
|
552
552
|
const ready = /* @__PURE__ */ ((_) => (id) => {
|
|
553
|
-
readyLookup[id]
|
|
553
|
+
const cb = readyLookup[id];
|
|
554
554
|
readyLookup[id] = 1;
|
|
555
|
+
cb?.();
|
|
555
556
|
})(readyLookup = {});
|
|
556
557
|
function initEmbedded(readyId, runtimeId) {
|
|
557
558
|
embedEnabled = 1;
|
|
@@ -647,7 +648,7 @@ function init(runtimeId = "M") {
|
|
|
647
648
|
if (readyLookup) {
|
|
648
649
|
for (const readyId in render.b) if (readyLookup[readyId] !== 1) {
|
|
649
650
|
readyLookup[readyId] = ((prev) => () => {
|
|
650
|
-
render
|
|
651
|
+
runResumeEffects(render);
|
|
651
652
|
prev?.();
|
|
652
653
|
})(readyLookup[readyId]);
|
|
653
654
|
return effects;
|
|
@@ -1652,10 +1653,9 @@ function abort(ctrl) {
|
|
|
1652
1653
|
}
|
|
1653
1654
|
//#endregion
|
|
1654
1655
|
//#region src/common/compat-meta.ts
|
|
1655
|
-
const
|
|
1656
|
-
const
|
|
1657
|
-
const
|
|
1658
|
-
const RENDER_BODY_ID = prefix + "renderBody";
|
|
1656
|
+
const RENDERER_REGISTER_ID = "$compat_renderer";
|
|
1657
|
+
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
1658
|
+
const RENDER_BODY_ID = "$compat_renderBody";
|
|
1659
1659
|
//#endregion
|
|
1660
1660
|
//#region src/dom/compat.ts
|
|
1661
1661
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -548,8 +548,9 @@ function enableBranches() {
|
|
|
548
548
|
branchesEnabled = 1;
|
|
549
549
|
}
|
|
550
550
|
const ready = /* @__PURE__ */ ((_) => (id) => {
|
|
551
|
-
readyLookup[id]
|
|
551
|
+
const cb = readyLookup[id];
|
|
552
552
|
readyLookup[id] = 1;
|
|
553
|
+
cb?.();
|
|
553
554
|
})(readyLookup = {});
|
|
554
555
|
function initEmbedded(readyId, runtimeId) {
|
|
555
556
|
embedEnabled = 1;
|
|
@@ -645,7 +646,7 @@ function init(runtimeId = "M") {
|
|
|
645
646
|
if (readyLookup) {
|
|
646
647
|
for (const readyId in render.b) if (readyLookup[readyId] !== 1) {
|
|
647
648
|
readyLookup[readyId] = ((prev) => () => {
|
|
648
|
-
render
|
|
649
|
+
runResumeEffects(render);
|
|
649
650
|
prev?.();
|
|
650
651
|
})(readyLookup[readyId]);
|
|
651
652
|
return effects;
|
|
@@ -1650,10 +1651,9 @@ function abort(ctrl) {
|
|
|
1650
1651
|
}
|
|
1651
1652
|
//#endregion
|
|
1652
1653
|
//#region src/common/compat-meta.ts
|
|
1653
|
-
const
|
|
1654
|
-
const
|
|
1655
|
-
const
|
|
1656
|
-
const RENDER_BODY_ID = prefix + "renderBody";
|
|
1654
|
+
const RENDERER_REGISTER_ID = "$compat_renderer";
|
|
1655
|
+
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
1656
|
+
const RENDER_BODY_ID = "$compat_renderBody";
|
|
1657
1657
|
//#endregion
|
|
1658
1658
|
//#region src/dom/compat.ts
|
|
1659
1659
|
const classIdToBranch = /* @__PURE__ */ new Map();
|
package/dist/debug/html.js
CHANGED
|
@@ -2409,10 +2409,9 @@ function normalizeBoolAttrValue(value) {
|
|
|
2409
2409
|
}
|
|
2410
2410
|
//#endregion
|
|
2411
2411
|
//#region src/common/compat-meta.ts
|
|
2412
|
-
const
|
|
2413
|
-
const
|
|
2414
|
-
const
|
|
2415
|
-
const RENDER_BODY_ID = prefix + "renderBody";
|
|
2412
|
+
const RENDERER_REGISTER_ID = "$compat_renderer";
|
|
2413
|
+
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
2414
|
+
const RENDER_BODY_ID = "$compat_renderBody";
|
|
2416
2415
|
//#endregion
|
|
2417
2416
|
//#region src/common/meta.ts
|
|
2418
2417
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
package/dist/debug/html.mjs
CHANGED
|
@@ -2407,10 +2407,9 @@ function normalizeBoolAttrValue(value) {
|
|
|
2407
2407
|
}
|
|
2408
2408
|
//#endregion
|
|
2409
2409
|
//#region src/common/compat-meta.ts
|
|
2410
|
-
const
|
|
2411
|
-
const
|
|
2412
|
-
const
|
|
2413
|
-
const RENDER_BODY_ID = prefix + "renderBody";
|
|
2410
|
+
const RENDERER_REGISTER_ID = "$compat_renderer";
|
|
2411
|
+
const SET_SCOPE_REGISTER_ID = "$compat_setScope";
|
|
2412
|
+
const RENDER_BODY_ID = "$compat_renderBody";
|
|
2414
2413
|
//#endregion
|
|
2415
2414
|
//#region src/common/meta.ts
|
|
2416
2415
|
const DYNAMIC_TAG_SCRIPT_REGISTER_ID = "_dynamicTagScript";
|
package/dist/dom.js
CHANGED
|
@@ -21,7 +21,8 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
21
21
|
walker.nextSibling();
|
|
22
22
|
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
23
23
|
}, cloneCache = {}, registeredValues = {}, curRuntimeId, readyLookup, branchesEnabled, embedEnabled, ready = /* @__PURE__ */ ((_) => (id) => {
|
|
24
|
-
|
|
24
|
+
let cb = readyLookup[id];
|
|
25
|
+
readyLookup[id] = 1, cb?.();
|
|
25
26
|
})(readyLookup = {}), isResuming, inputType = "", controllableDelegate = /* @__PURE__ */ createDelegator(), _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
26
27
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
27
28
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
@@ -441,7 +442,7 @@ function init(runtimeId = "M") {
|
|
|
441
442
|
return render.m = (effects = []) => {
|
|
442
443
|
if (readyLookup) {
|
|
443
444
|
for (let readyId in render.b) if (readyLookup[readyId] !== 1) return readyLookup[readyId] = ((prev) => () => {
|
|
444
|
-
render
|
|
445
|
+
runResumeEffects(render), prev?.();
|
|
445
446
|
})(readyLookup[readyId]), effects;
|
|
446
447
|
render.b = 0;
|
|
447
448
|
}
|
package/dist/dom.mjs
CHANGED
|
@@ -21,7 +21,8 @@ let empty = [], rest = Symbol(), toDelimitedString = function toDelimitedString(
|
|
|
21
21
|
walker.nextSibling();
|
|
22
22
|
} else storedMultiplier = currentMultiplier * 10 + value - 117;
|
|
23
23
|
}, cloneCache = {}, registeredValues = {}, curRuntimeId, readyLookup, branchesEnabled, embedEnabled, ready = /* @__PURE__ */ ((_) => (id) => {
|
|
24
|
-
|
|
24
|
+
let cb = readyLookup[id];
|
|
25
|
+
readyLookup[id] = 1, cb?.();
|
|
25
26
|
})(readyLookup = {}), isResuming, inputType = "", controllableDelegate = /* @__PURE__ */ createDelegator(), _dynamic_tag = function(nodeAccessor, getContent, getTagVar, inputIsArgs) {
|
|
26
27
|
nodeAccessor = decodeAccessor(nodeAccessor);
|
|
27
28
|
let childScopeAccessor = "A" + nodeAccessor, rendererAccessor = "D" + nodeAccessor;
|
|
@@ -440,7 +441,7 @@ function init(runtimeId = "M") {
|
|
|
440
441
|
return render.m = (effects = []) => {
|
|
441
442
|
if (readyLookup) {
|
|
442
443
|
for (let readyId in render.b) if (readyLookup[readyId] !== 1) return readyLookup[readyId] = ((prev) => () => {
|
|
443
|
-
render
|
|
444
|
+
runResumeEffects(render), prev?.();
|
|
444
445
|
})(readyLookup[readyId]), effects;
|
|
445
446
|
render.b = 0;
|
|
446
447
|
}
|
package/dist/translator/index.js
CHANGED
|
@@ -26,6 +26,8 @@ let package_json = require("../../package.json");
|
|
|
26
26
|
let _marko_compiler = require("@marko/compiler");
|
|
27
27
|
let _marko_compiler_babel_utils = require("@marko/compiler/babel-utils");
|
|
28
28
|
let _marko_compiler_config = require("@marko/compiler/config");
|
|
29
|
+
let node_path = require("node:path");
|
|
30
|
+
node_path = __toESM(node_path);
|
|
29
31
|
let path = require("path");
|
|
30
32
|
path = __toESM(path);
|
|
31
33
|
let magic_string = require("magic-string");
|
|
@@ -1091,7 +1093,7 @@ function isOutputHTML() {
|
|
|
1091
1093
|
return getMarkoOpts().output === "html";
|
|
1092
1094
|
}
|
|
1093
1095
|
function isOutputDOM() {
|
|
1094
|
-
return
|
|
1096
|
+
return getMarkoOpts().output === "dom";
|
|
1095
1097
|
}
|
|
1096
1098
|
function getMarkoOpts() {
|
|
1097
1099
|
return (0, _marko_compiler_babel_utils.getFile)().markoOpts;
|
|
@@ -1760,11 +1762,11 @@ var entry_builder_default = {
|
|
|
1760
1762
|
build(entryFile, exportInit) {
|
|
1761
1763
|
const state = entryFile[kState];
|
|
1762
1764
|
if (!state) throw entryFile.path.buildCodeFrameError("Unable to build hydrate code, no files were visited before finalizing the build");
|
|
1763
|
-
const body =
|
|
1765
|
+
const body = [];
|
|
1764
1766
|
if (state.init) {
|
|
1765
1767
|
const isPage = entryFile.path.node.extra.page;
|
|
1766
1768
|
const initHelper = isPage ? "init" : "initEmbedded";
|
|
1767
|
-
body.
|
|
1769
|
+
body.push(_marko_compiler.types.importDeclaration([_marko_compiler.types.importSpecifier(_marko_compiler.types.identifier(initHelper), _marko_compiler.types.identifier(initHelper))], _marko_compiler.types.stringLiteral(`${runtime_info_default.name}/${entryFile.markoOpts.optimize ? "" : "debug/"}dom`)), _marko_compiler.types.importDeclaration([], _marko_compiler.types.stringLiteral(`./${node_path.default.basename(entryFile.opts.filename)}`)));
|
|
1768
1770
|
const { runtimeId } = entryFile.markoOpts;
|
|
1769
1771
|
const readyId = !isPage && (0, _marko_compiler_babel_utils.getTemplateId)(entryFile.markoOpts, entryFile.opts.filename);
|
|
1770
1772
|
const initExpression = _marko_compiler.types.callExpression(_marko_compiler.types.identifier(initHelper), readyId ? runtimeId ? [_marko_compiler.types.stringLiteral(readyId), _marko_compiler.types.stringLiteral(runtimeId)] : [_marko_compiler.types.stringLiteral(readyId)] : runtimeId ? [_marko_compiler.types.stringLiteral(runtimeId)] : []);
|
|
@@ -1773,13 +1775,9 @@ var entry_builder_default = {
|
|
|
1773
1775
|
return body;
|
|
1774
1776
|
},
|
|
1775
1777
|
visit(file, entryFile, visitChild) {
|
|
1776
|
-
const state = entryFile[kState] ||= {
|
|
1777
|
-
imports: [],
|
|
1778
|
-
init: false
|
|
1779
|
-
};
|
|
1778
|
+
const state = entryFile[kState] ||= { init: false };
|
|
1780
1779
|
const programExtra = file.path.node.extra;
|
|
1781
1780
|
const { analyzedTags } = file.metadata.marko;
|
|
1782
|
-
state.imports.push((0, _marko_compiler_babel_utils.resolveRelativePath)(entryFile, file.opts.filename));
|
|
1783
1781
|
if (programExtra.isInteractive || programExtra.needsCompat) state.init = true;
|
|
1784
1782
|
for (const tag of analyzedTags || []) visitChild(tag);
|
|
1785
1783
|
}
|
|
@@ -2071,12 +2069,6 @@ function normalizeBoolAttrValue(value) {
|
|
|
2071
2069
|
if (value != null && value !== false) return true;
|
|
2072
2070
|
}
|
|
2073
2071
|
//#endregion
|
|
2074
|
-
//#region src/common/compat-meta.ts
|
|
2075
|
-
const prefix = "$C_";
|
|
2076
|
-
prefix + "";
|
|
2077
|
-
prefix + "";
|
|
2078
|
-
prefix + "";
|
|
2079
|
-
//#endregion
|
|
2080
2072
|
//#region src/html/dynamic-tag.ts
|
|
2081
2073
|
const voidElementsReg = /^(?:area|b(?:ase|r)|col|embed|hr|i(?:mg|nput)|link|meta|param|source|track|wbr)$/;
|
|
2082
2074
|
let _dynamic_tag = (scopeId, accessor, tag, inputOrArgs, content, inputIsArgs, serializeReason) => {
|
|
@@ -2374,7 +2366,7 @@ function appendLiteral(arr, str) {
|
|
|
2374
2366
|
arr[arr.length - 1] += str;
|
|
2375
2367
|
}
|
|
2376
2368
|
function escapeTemplateRaw(raw) {
|
|
2377
|
-
return raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`");
|
|
2369
|
+
return raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$(?=\{)/g, "\\$");
|
|
2378
2370
|
}
|
|
2379
2371
|
function shiftItems(list, start, offset) {
|
|
2380
2372
|
for (let i = list.length - 1; i >= start; i--) list[i + offset] = list[i];
|
|
@@ -8407,7 +8399,7 @@ var text_default = { translate: { exit(text) {
|
|
|
8407
8399
|
function buildAggregateError(file, rootMsg, ...paths) {
|
|
8408
8400
|
const err = /* @__PURE__ */ new SyntaxError();
|
|
8409
8401
|
const fileName = path.default.relative(_marko_compiler_modules.cwd, file.opts.filename);
|
|
8410
|
-
const finalMsg = `${rootMsg}:\n\n${paths.map(([msg, path$
|
|
8402
|
+
const finalMsg = `${rootMsg}:\n\n${paths.map(([msg, path$10]) => `\x1b[90m${msg} at ${getFileNameWithLoc(fileName, path$10)}:\x1b[0m\n${getFrame(file, path$10)}`).join("\n\n")}`;
|
|
8411
8403
|
if (!("MARKO_DEBUG" in process.env)) err.stack = finalMsg;
|
|
8412
8404
|
Object.defineProperty(err, "message", {
|
|
8413
8405
|
get() {
|
|
@@ -8628,13 +8620,13 @@ function mergeVisitors(visitor5, visitor6) {
|
|
|
8628
8620
|
function mergeVisit(visit5, visit6) {
|
|
8629
8621
|
const enter5 = getVisitorEnter(visit5);
|
|
8630
8622
|
const enter6 = getVisitorEnter(visit6);
|
|
8631
|
-
const enter = (enter5 || enter6) && function enter(path$
|
|
8632
|
-
return (isTagsAPI() ? enter6 : enter5)?.call(this, path$
|
|
8623
|
+
const enter = (enter5 || enter6) && function enter(path$8, state) {
|
|
8624
|
+
return (isTagsAPI() ? enter6 : enter5)?.call(this, path$8, state);
|
|
8633
8625
|
};
|
|
8634
8626
|
const exit5 = getVisitorExit(visit5);
|
|
8635
8627
|
const exit6 = getVisitorExit(visit6);
|
|
8636
|
-
const exit = (exit5 || exit6) && function exit(path$
|
|
8637
|
-
return (isTagsAPI() ? exit6 : exit5)?.call(this, path$
|
|
8628
|
+
const exit = (exit5 || exit6) && function exit(path$9, state) {
|
|
8629
|
+
return (isTagsAPI() ? exit6 : exit5)?.call(this, path$9, state);
|
|
8638
8630
|
};
|
|
8639
8631
|
return exit ? enter ? {
|
|
8640
8632
|
enter,
|