marko 6.3.49 → 6.3.50
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/translator/index.js +89 -81
- package/dist/translator/util/asset-imports.d.ts +1 -1
- package/dist/translator/util/body-to-text-literal.d.ts +1 -1
- package/dist/translator/util/optional.d.ts +1 -0
- package/dist/translator/util/references.d.ts +4 -1
- package/dist/translator/util/sections.d.ts +21 -6
- package/dist/translator/util/serialize-reasons.d.ts +3 -0
- package/dist/translator/visitors/program/pre-analyze.d.ts +6 -0
- package/package.json +4 -4
package/dist/translator/index.js
CHANGED
|
@@ -995,12 +995,6 @@ function getAccessorProp() {
|
|
|
995
995
|
//#endregion
|
|
996
996
|
//#region src/translator/util/serialize-reasons.ts
|
|
997
997
|
const sourcesUtil = new Sorted(compareSources);
|
|
998
|
-
const scopeExprsBySection = /* @__PURE__ */ new WeakMap();
|
|
999
|
-
const propExprsBySection = /* @__PURE__ */ new WeakMap();
|
|
1000
|
-
const scopeProvenanceBySection = /* @__PURE__ */ new WeakMap();
|
|
1001
|
-
const propProvenanceBySection = /* @__PURE__ */ new WeakMap();
|
|
1002
|
-
const serializePropsByBinding = /* @__PURE__ */ new WeakMap();
|
|
1003
|
-
const serializePropByModifier = {};
|
|
1004
998
|
function isSameReason(a, b) {
|
|
1005
999
|
return a === b || (a && b ? a !== true && b !== true && compareSources(a, b) === 0 : false);
|
|
1006
1000
|
}
|
|
@@ -1034,20 +1028,15 @@ function addSerializeExpr(section, expr, prop, prefix) {
|
|
|
1034
1028
|
if (expr === true) {
|
|
1035
1029
|
if (section.serializeReasons.get(key) !== true) forcePropSerialize(section, key);
|
|
1036
1030
|
} else {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
if (curExprs) curExpr = curExprs.get(key);
|
|
1040
|
-
else {
|
|
1041
|
-
curExprs = /* @__PURE__ */ new Map();
|
|
1042
|
-
propExprsBySection.set(section, curExprs);
|
|
1043
|
-
}
|
|
1031
|
+
const curExprs = section.propSerializeExprs ??= /* @__PURE__ */ new Map();
|
|
1032
|
+
const curExpr = curExprs.get(key);
|
|
1044
1033
|
curExprs.set(key, curExpr ? concat(curExpr, expr) : expr);
|
|
1045
1034
|
}
|
|
1046
1035
|
} else if (expr === true) {
|
|
1047
1036
|
if (section.serializeReason !== true) forceSerialize(section);
|
|
1048
1037
|
} else {
|
|
1049
|
-
const curExpr =
|
|
1050
|
-
|
|
1038
|
+
const curExpr = section.serializeExprs;
|
|
1039
|
+
section.serializeExprs = curExpr ? concat(curExpr, expr) : expr;
|
|
1051
1040
|
}
|
|
1052
1041
|
}
|
|
1053
1042
|
function addOwnerSerializeReason(from, to, reason) {
|
|
@@ -1073,7 +1062,7 @@ function getSerializeReason(section, prop, prefix) {
|
|
|
1073
1062
|
else return section.serializeReason;
|
|
1074
1063
|
}
|
|
1075
1064
|
function getSerializeSourcesForExpr(expr) {
|
|
1076
|
-
|
|
1065
|
+
return isReferencedExtra(expr) ? getSerializeSourcesForRef(expr.referencedBindings) : void 0;
|
|
1077
1066
|
}
|
|
1078
1067
|
function getSerializeSourcesForExprs(exprs) {
|
|
1079
1068
|
if (exprs) if (exprs === true) return exprs;
|
|
@@ -1128,9 +1117,9 @@ function mergeSerializeReasons(a, b) {
|
|
|
1128
1117
|
return mergeSources(a, b);
|
|
1129
1118
|
}
|
|
1130
1119
|
function applySerializeExprs(section) {
|
|
1131
|
-
const propExprs =
|
|
1120
|
+
const propExprs = section.propSerializeExprs;
|
|
1132
1121
|
if (propExprs) {
|
|
1133
|
-
|
|
1122
|
+
section.propSerializeExprs = void 0;
|
|
1134
1123
|
for (const [key, exprs] of propExprs) {
|
|
1135
1124
|
addProvenance(section, getProvenanceForExprs(exprs), key);
|
|
1136
1125
|
const exprReason = getSerializeSourcesForExprs(exprs);
|
|
@@ -1141,9 +1130,9 @@ function applySerializeExprs(section) {
|
|
|
1141
1130
|
}
|
|
1142
1131
|
}
|
|
1143
1132
|
}
|
|
1144
|
-
const scopeExprs =
|
|
1133
|
+
const scopeExprs = section.serializeExprs;
|
|
1145
1134
|
if (scopeExprs) {
|
|
1146
|
-
|
|
1135
|
+
section.serializeExprs = void 0;
|
|
1147
1136
|
addProvenance(section, getProvenanceForExprs(scopeExprs));
|
|
1148
1137
|
const exprReason = getSerializeSourcesForExprs(scopeExprs);
|
|
1149
1138
|
if (exprReason) {
|
|
@@ -1171,16 +1160,15 @@ function finalizeSerializeReason(section) {
|
|
|
1171
1160
|
}
|
|
1172
1161
|
if (newReason && curReason !== newReason) setSerializeReason(section, newReason);
|
|
1173
1162
|
}
|
|
1174
|
-
const propProvenance =
|
|
1163
|
+
const propProvenance = section.propSerializeProvenance;
|
|
1175
1164
|
if (propProvenance) for (const provenance of propProvenance.values()) addProvenance(section, provenance);
|
|
1176
1165
|
}
|
|
1177
1166
|
function addProvenance(section, sources, key) {
|
|
1178
1167
|
if (!sources) return;
|
|
1179
1168
|
if (key) {
|
|
1180
|
-
|
|
1181
|
-
if (!provenance) propProvenanceBySection.set(section, provenance = /* @__PURE__ */ new Map());
|
|
1169
|
+
const provenance = section.propSerializeProvenance ??= /* @__PURE__ */ new Map();
|
|
1182
1170
|
provenance.set(key, mergeSources(provenance.get(key), sources));
|
|
1183
|
-
} else
|
|
1171
|
+
} else section.serializeProvenance = mergeSources(section.serializeProvenance, sources);
|
|
1184
1172
|
}
|
|
1185
1173
|
function getProvenanceForExprs(exprs) {
|
|
1186
1174
|
let sources;
|
|
@@ -1194,16 +1182,16 @@ function getProvenanceForExprs(exprs) {
|
|
|
1194
1182
|
}
|
|
1195
1183
|
function getPropKey(section, prop, prefix) {
|
|
1196
1184
|
if (isStrOrSym(prop)) {
|
|
1197
|
-
const keys =
|
|
1198
|
-
let key = keys.get(
|
|
1199
|
-
if (!key) keys.set(
|
|
1185
|
+
const keys = section.serializePropKeys ??= /* @__PURE__ */ new Map();
|
|
1186
|
+
let key = keys.get(prop);
|
|
1187
|
+
if (!key) keys.set(prop, key = Symbol(typeof prop === "symbol" ? `Symbol(${prop.description})` : prop));
|
|
1200
1188
|
if (prefix) throw new Error("Cannot have a scope property reason with a prefix.");
|
|
1201
1189
|
return key;
|
|
1202
1190
|
} else {
|
|
1203
|
-
const keys = prefix ? serializePropByModifier[prefix] ||= /* @__PURE__ */ new WeakMap() : serializePropsByBinding;
|
|
1204
1191
|
const binding = getCanonicalBinding(prop);
|
|
1205
|
-
|
|
1206
|
-
|
|
1192
|
+
const keys = binding.serializePropKeys ??= /* @__PURE__ */ new Map();
|
|
1193
|
+
let key = keys.get(prefix);
|
|
1194
|
+
if (!key) keys.set(prefix, key = Symbol((prefix ? typeof prefix === "symbol" ? `Symbol(${prefix.description})` : prefix : "") + binding.name));
|
|
1207
1195
|
return key;
|
|
1208
1196
|
}
|
|
1209
1197
|
}
|
|
@@ -1391,12 +1379,17 @@ function startSection(path) {
|
|
|
1391
1379
|
serializeReason: void 0,
|
|
1392
1380
|
serializeReasons: /* @__PURE__ */ new Map(),
|
|
1393
1381
|
domSerializeReasons: void 0,
|
|
1382
|
+
serializeExprs: void 0,
|
|
1383
|
+
propSerializeExprs: void 0,
|
|
1384
|
+
serializeProvenance: void 0,
|
|
1385
|
+
propSerializeProvenance: void 0,
|
|
1386
|
+
serializePropKeys: void 0,
|
|
1394
1387
|
paramReasonGroups: void 0,
|
|
1395
1388
|
returnValueExpr: void 0,
|
|
1396
1389
|
returnSerializeReason: void 0,
|
|
1397
1390
|
content: getContentInfo(path),
|
|
1398
1391
|
upstreamExpression: void 0,
|
|
1399
|
-
|
|
1392
|
+
downstream: void 0,
|
|
1400
1393
|
hasAbortSignal: false,
|
|
1401
1394
|
abortSignalExprs: 0,
|
|
1402
1395
|
readsOwner: false,
|
|
@@ -1505,14 +1498,14 @@ function getNodeContentType(path, extraMember, contentInfo) {
|
|
|
1505
1498
|
}
|
|
1506
1499
|
function getSectionRegisterReasons(section) {
|
|
1507
1500
|
if (section.isBranch) return false;
|
|
1508
|
-
const {
|
|
1509
|
-
if (
|
|
1510
|
-
let downstreamReasons = getAllSerializeReasonsForBinding(
|
|
1511
|
-
if (downstreamReasons && downstreamReasons !== true) downstreamReasons = mapCrossProgramReason(section.program, downstreamReasons,
|
|
1501
|
+
const { downstream } = section;
|
|
1502
|
+
if (downstream?.binding) {
|
|
1503
|
+
let downstreamReasons = getAllSerializeReasonsForBinding(downstream.binding, downstream.properties);
|
|
1504
|
+
if (downstreamReasons && downstreamReasons !== true) downstreamReasons = mapCrossProgramReason(section.program, downstreamReasons, downstream.exprs);
|
|
1512
1505
|
if (!downstreamReasons) return false;
|
|
1513
1506
|
if (isReasonDynamic(downstreamReasons) && !section.serializeReason && !section.serializeReasons.size && !section.parent?.serializeReason && !section.parent?.serializeReasons.size) return false;
|
|
1514
1507
|
return downstreamReasons;
|
|
1515
|
-
} else if (
|
|
1508
|
+
} else if (downstream) return false;
|
|
1516
1509
|
return true;
|
|
1517
1510
|
}
|
|
1518
1511
|
function isImmediateOwner(section, binding) {
|
|
@@ -1834,8 +1827,8 @@ function hasAnalyzeErrors() {
|
|
|
1834
1827
|
}
|
|
1835
1828
|
//#endregion
|
|
1836
1829
|
//#region src/translator/util/asset-imports.ts
|
|
1837
|
-
function addAssetImport(
|
|
1838
|
-
(
|
|
1830
|
+
function addAssetImport(request) {
|
|
1831
|
+
((0, _marko_compiler_babel_utils.getFile)().metadata.marko.assetImports ??= /* @__PURE__ */ new Set()).add(request);
|
|
1839
1832
|
}
|
|
1840
1833
|
function isClientAssetImport(file, request) {
|
|
1841
1834
|
const { hydrateIncludeImports } = file.markoOpts;
|
|
@@ -1844,7 +1837,7 @@ function isClientAssetImport(file, request) {
|
|
|
1844
1837
|
//#endregion
|
|
1845
1838
|
//#region src/translator/util/binding-has-prop.ts
|
|
1846
1839
|
function isSectionRendererElided(section) {
|
|
1847
|
-
return !!section.
|
|
1840
|
+
return !!section.downstream?.binding && !bindingHasProperty(section.downstream.binding, section.downstream.properties);
|
|
1848
1841
|
}
|
|
1849
1842
|
function bindingHasProperty(binding, properties) {
|
|
1850
1843
|
if (binding.pruned) return false;
|
|
@@ -2248,7 +2241,7 @@ function sectionHasSetupStatements(section) {
|
|
|
2248
2241
|
* reserved a register id without registering it.
|
|
2249
2242
|
*/
|
|
2250
2243
|
function writeModuleRegistrations(program) {
|
|
2251
|
-
const
|
|
2244
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
2252
2245
|
const statements = [];
|
|
2253
2246
|
const seen = /* @__PURE__ */ new Set();
|
|
2254
2247
|
for (const child of program.node.body) {
|
|
@@ -3998,8 +3991,8 @@ function getRegisteredFnExpression(node) {
|
|
|
3998
3991
|
//#endregion
|
|
3999
3992
|
//#region src/translator/util/body-to-text-literal.ts
|
|
4000
3993
|
const kRawText = Symbol("raw text placeholder");
|
|
4001
|
-
function bodyToTextLiteral(body) {
|
|
4002
|
-
return buildTextLiteral(body, toText, true);
|
|
3994
|
+
function bodyToTextLiteral(body, decodeEntities = false) {
|
|
3995
|
+
return buildTextLiteral(body, toText, true, decodeEntities);
|
|
4003
3996
|
}
|
|
4004
3997
|
function bodyToRawTextLiteral(body) {
|
|
4005
3998
|
return buildTextLiteral(body, (value) => value, true);
|
|
@@ -4018,13 +4011,13 @@ function injectTextCoercion(expr) {
|
|
|
4018
4011
|
function toText(value) {
|
|
4019
4012
|
return callRuntime("_to_text", value);
|
|
4020
4013
|
}
|
|
4021
|
-
function buildTextLiteral(body, coerce, bareSingle) {
|
|
4014
|
+
function buildTextLiteral(body, coerce, bareSingle, decodeEntities = false) {
|
|
4022
4015
|
const templateQuasis = [];
|
|
4023
4016
|
const templateExpressions = [];
|
|
4024
4017
|
let currentQuasi = "";
|
|
4025
4018
|
let placeholderExtra;
|
|
4026
4019
|
let singleValue;
|
|
4027
|
-
for (const child of body.body) if (_marko_compiler.types.isMarkoText(child)) currentQuasi += child.value;
|
|
4020
|
+
for (const child of body.body) if (_marko_compiler.types.isMarkoText(child)) currentQuasi += decodeEntities ? (0, _marko_compiler_babel_utils.decodeHTML)(child.value) : child.value;
|
|
4028
4021
|
else if (_marko_compiler.types.isMarkoPlaceholder(child)) {
|
|
4029
4022
|
placeholderExtra ||= child.value.extra;
|
|
4030
4023
|
templateQuasis.push(templateElement(currentQuasi, false));
|
|
@@ -4084,6 +4077,7 @@ function isNonHTMLText(placeholder) {
|
|
|
4084
4077
|
return false;
|
|
4085
4078
|
}
|
|
4086
4079
|
function isTextOnlyNativeTag(tag) {
|
|
4080
|
+
if (analyzeTagNameType(tag) !== 0) return false;
|
|
4087
4081
|
const def = (0, _marko_compiler_babel_utils.getTagDef)(tag);
|
|
4088
4082
|
return !!(def && def.html && (def.name === "title" || def.parseOptions?.text));
|
|
4089
4083
|
}
|
|
@@ -5062,7 +5056,7 @@ var native_tag_default = {
|
|
|
5062
5056
|
const openTagOnly = (0, _marko_compiler_babel_utils.getTagDef)(tag)?.parseOptions?.openTagOnly;
|
|
5063
5057
|
const tagName = getCanonicalTagName(tag);
|
|
5064
5058
|
if (!openTagOnly) if (tagName !== "textarea" && isTextOnlyNativeTag(tag)) {
|
|
5065
|
-
const textLiteral = bodyToTextLiteral(tag.node.body);
|
|
5059
|
+
const textLiteral = bodyToTextLiteral(tag.node.body, tagName === "title");
|
|
5066
5060
|
if (!_marko_compiler.types.isStringLiteral(textLiteral)) addStatement("render", getSection(tag), textLiteral.extra?.referencedBindings, _marko_compiler.types.expressionStatement(callRuntime("_text_content", createScopeReadExpression(nodeBinding), textLiteral)), true);
|
|
5067
5061
|
} else tag.insertBefore(tag.node.body.body).forEach((child) => child.skip());
|
|
5068
5062
|
tag.remove();
|
|
@@ -5857,6 +5851,10 @@ function normalizeTag(tag) {
|
|
|
5857
5851
|
const { node } = tag;
|
|
5858
5852
|
const { name, attributes } = node;
|
|
5859
5853
|
let attrNameReg = userAttrNameReg;
|
|
5854
|
+
if (name.type === "StringLiteral") {
|
|
5855
|
+
const tagName = name.value;
|
|
5856
|
+
if (tag.scope.getBinding(tagName) && TAG_NAME_IDENTIFIER_REG.test(tagName)) node.name = withPreviousLocation(_marko_compiler.types.identifier(tagName), name);
|
|
5857
|
+
}
|
|
5860
5858
|
normalizeBody(tag.get("body").get("body"));
|
|
5861
5859
|
normalizeBody(tag.get("attributeTags"));
|
|
5862
5860
|
if (node.var) {
|
|
@@ -5868,17 +5866,15 @@ function normalizeTag(tag) {
|
|
|
5868
5866
|
for (const param of node.body.params) insertions = getAssignmentInsertions(param, insertions);
|
|
5869
5867
|
if (insertions) node.body.body = [...insertions, ...node.body.body];
|
|
5870
5868
|
}
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
if (
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
switch (tagName) {
|
|
5877
|
-
case "textarea":
|
|
5878
|
-
preAnalyze$1(tag);
|
|
5879
|
-
break;
|
|
5880
|
-
}
|
|
5869
|
+
const nativeTagDef = getStaticNativeTagDef(tag);
|
|
5870
|
+
if (nativeTagDef) {
|
|
5871
|
+
if (!_marko_compiler.types.isStringLiteral(node.name)) {
|
|
5872
|
+
node.name = withPreviousLocation(_marko_compiler.types.stringLiteral(nativeTagDef.name), node.name);
|
|
5873
|
+
node.tagDef = nativeTagDef;
|
|
5881
5874
|
}
|
|
5875
|
+
attrNameReg = htmlAttrNameReg;
|
|
5876
|
+
if (nativeTagDef.parseOptions?.openTagOnly && node.body.body.length) throw tag.hub.buildError(node.body.body[0], `The \`<${nativeTagDef.name}>\` tag cannot have content, so it does not support a body.`);
|
|
5877
|
+
if (nativeTagDef.name === "textarea") preAnalyze$1(tag);
|
|
5882
5878
|
}
|
|
5883
5879
|
for (let i = 0; i < attributes.length; i++) {
|
|
5884
5880
|
const attr = attributes[i];
|
|
@@ -5898,6 +5894,14 @@ function normalizeTag(tag) {
|
|
|
5898
5894
|
}
|
|
5899
5895
|
}
|
|
5900
5896
|
}
|
|
5897
|
+
function getStaticNativeTagDef(tag) {
|
|
5898
|
+
const { name } = tag.node;
|
|
5899
|
+
if (_marko_compiler.types.isStringLiteral(name)) return (0, _marko_compiler_babel_utils.isNativeTag)(tag) ? (0, _marko_compiler_babel_utils.getTagDef)(tag) : void 0;
|
|
5900
|
+
if (_marko_compiler.types.isTemplateLiteral(name) && name.quasis.length === 1) {
|
|
5901
|
+
const tagDef = (0, _marko_compiler_babel_utils.getTagDefForTagName)((0, _marko_compiler_babel_utils.getFile)(), name.quasis[0].value.cooked);
|
|
5902
|
+
if (tagDef?.taglibId === "marko-html" && tagDef.html && !tagDef.template && !tagDef.renderer) return tagDef;
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5901
5905
|
function getChangeHandler(tag, attr) {
|
|
5902
5906
|
const changeAttrName = attr.name + "Change";
|
|
5903
5907
|
let modifier;
|
|
@@ -6053,7 +6057,7 @@ var program_default = {
|
|
|
6053
6057
|
const styleFile = getStyleFile((0, _marko_compiler_babel_utils.getFile)());
|
|
6054
6058
|
if (styleFile) {
|
|
6055
6059
|
programExtra.styleFile = styleFile;
|
|
6056
|
-
addAssetImport(
|
|
6060
|
+
addAssetImport(styleFile);
|
|
6057
6061
|
}
|
|
6058
6062
|
},
|
|
6059
6063
|
exit(program) {
|
|
@@ -6147,9 +6151,9 @@ function setTagDownstream(tag, binding, exprs) {
|
|
|
6147
6151
|
});
|
|
6148
6152
|
}
|
|
6149
6153
|
function finalizeTagDownstreams(section) {
|
|
6150
|
-
for (const [tag, { binding, exprs }] of getTagDownstreams(section)) crawlSectionsAndSetBinding(tag, binding, exprs);
|
|
6154
|
+
for (const [tag, { binding, exprs }] of getTagDownstreams(section)) crawlSectionsAndSetBinding(tag, tag.node.extra, binding, exprs);
|
|
6151
6155
|
}
|
|
6152
|
-
function crawlSectionsAndSetBinding(tag, binding, exprs, properties, skip) {
|
|
6156
|
+
function crawlSectionsAndSetBinding(tag, downstreamTag, binding, exprs, properties, skip) {
|
|
6153
6157
|
if (!skip) {
|
|
6154
6158
|
const contentSection = getSectionForBody(tag.get("body"));
|
|
6155
6159
|
if (contentSection) {
|
|
@@ -6157,10 +6161,12 @@ function crawlSectionsAndSetBinding(tag, binding, exprs, properties, skip) {
|
|
|
6157
6161
|
forEach(properties, (property) => {
|
|
6158
6162
|
target = target?.propertyAliases.get(property);
|
|
6159
6163
|
});
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
+
const serialized = !(target && (target.noSerialize || includes(target.noSerializeProperties, "content")));
|
|
6165
|
+
contentSection.downstream = {
|
|
6166
|
+
tag: downstreamTag,
|
|
6167
|
+
binding: serialized ? binding : void 0,
|
|
6168
|
+
properties: serialized ? concat(properties, "content") : void 0,
|
|
6169
|
+
exprs: serialized ? exprs : void 0
|
|
6164
6170
|
};
|
|
6165
6171
|
}
|
|
6166
6172
|
}
|
|
@@ -6169,8 +6175,8 @@ function crawlSectionsAndSetBinding(tag, binding, exprs, properties, skip) {
|
|
|
6169
6175
|
const attrTags = getAttrTagPaths(tag);
|
|
6170
6176
|
for (const child of attrTags) if (child.isMarkoTag()) if ((0, _marko_compiler_babel_utils.isAttributeTag)(child)) {
|
|
6171
6177
|
const attrTagMeta = attrTagLookup[getTagName(child)];
|
|
6172
|
-
crawlSectionsAndSetBinding(child, binding, exprs, concat(properties, attrTagMeta.name));
|
|
6173
|
-
} else crawlSectionsAndSetBinding(child, binding, exprs, properties, true);
|
|
6178
|
+
crawlSectionsAndSetBinding(child, downstreamTag, binding, exprs, concat(properties, attrTagMeta.name));
|
|
6179
|
+
} else crawlSectionsAndSetBinding(child, downstreamTag, binding, exprs, properties, true);
|
|
6174
6180
|
}
|
|
6175
6181
|
//#endregion
|
|
6176
6182
|
//#region src/translator/util/translate-var.ts
|
|
@@ -6820,6 +6826,7 @@ function createBinding(name, type, refSection, upstreamAlias, property, excludeP
|
|
|
6820
6826
|
pruned: void 0,
|
|
6821
6827
|
exposed: false,
|
|
6822
6828
|
forcePersist: false,
|
|
6829
|
+
serializePropKeys: void 0,
|
|
6823
6830
|
reserveSize: 0
|
|
6824
6831
|
};
|
|
6825
6832
|
if (property) {
|
|
@@ -7267,7 +7274,7 @@ function finalizeReferences() {
|
|
|
7267
7274
|
let branchesForced = false;
|
|
7268
7275
|
let branchesSources;
|
|
7269
7276
|
while (currentSection !== sourceSection) {
|
|
7270
|
-
const upstreamReason = currentSection.
|
|
7277
|
+
const upstreamReason = currentSection.downstream?.binding ? getSectionRegisterReasons(currentSection) || void 0 : !currentSection.upstreamExpression || getSerializeSourcesForExpr(currentSection.upstreamExpression);
|
|
7271
7278
|
if (upstreamReason === true) branchesForced = true;
|
|
7272
7279
|
else if (upstreamReason) branchesSources = mergeSources(branchesSources, upstreamReason);
|
|
7273
7280
|
currentSection = currentSection.parent;
|
|
@@ -8210,7 +8217,8 @@ function createStatementTag(keyword) {
|
|
|
8210
8217
|
const keywordReg = new RegExp(`^${keyword}\\s*`);
|
|
8211
8218
|
return {
|
|
8212
8219
|
parse(tag) {
|
|
8213
|
-
const { node
|
|
8220
|
+
const { node } = tag;
|
|
8221
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
8214
8222
|
const rawValue = node.rawValue;
|
|
8215
8223
|
const code = rawValue.replace(keywordReg, "");
|
|
8216
8224
|
const start = node.start + (rawValue.length - code.length);
|
|
@@ -9145,16 +9153,16 @@ var style_default = {
|
|
|
9145
9153
|
(0, _marko_compiler_babel_utils.assertNoArgs)(tag);
|
|
9146
9154
|
(0, _marko_compiler_babel_utils.assertNoParams)(tag);
|
|
9147
9155
|
(0, _marko_compiler_babel_utils.assertNoAttributeTags)(tag);
|
|
9148
|
-
const { node
|
|
9156
|
+
const { node } = tag;
|
|
9149
9157
|
assertNoStyleAttributes(tag);
|
|
9150
9158
|
const names = collectDynamicStyleNames(tag);
|
|
9151
9159
|
if (names) {
|
|
9152
9160
|
checkStyleInterpolations(tag);
|
|
9153
9161
|
checkDynamicStylePlacement(tag);
|
|
9154
9162
|
}
|
|
9155
|
-
const importPath = getStyleImportPath(
|
|
9163
|
+
const importPath = getStyleImportPath((0, _marko_compiler_babel_utils.getFile)(), node, names);
|
|
9156
9164
|
(node.extra ??= {}).styleImportPath = importPath;
|
|
9157
|
-
if (importPath) addAssetImport(
|
|
9165
|
+
if (importPath) addAssetImport(importPath);
|
|
9158
9166
|
if (names) {
|
|
9159
9167
|
analyzeDynamicStyle(tag, names);
|
|
9160
9168
|
addSetupStatement(getOrCreateSection(tag));
|
|
@@ -9192,14 +9200,14 @@ function collectDynamicStyleNames(tag) {
|
|
|
9192
9200
|
const program = (0, _marko_compiler_babel_utils.getProgram)().node;
|
|
9193
9201
|
const index = programDynamicStyleNameCounts.get(program) ?? 0;
|
|
9194
9202
|
programDynamicStyleNameCounts.set(program, index + 1);
|
|
9195
|
-
(names ??= []).push(dynamicStyleName(
|
|
9203
|
+
(names ??= []).push(dynamicStyleName(index));
|
|
9196
9204
|
} else if (!_marko_compiler.types.isMarkoText(child)) throw tag.hub.buildError(child, "The [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) only supports text and `${...}` interpolations. For a native html [`<style>` tag](https://markojs.com/docs/reference/core-tag#style) use the `html-style` core tag instead.");
|
|
9197
9205
|
return names;
|
|
9198
9206
|
}
|
|
9199
9207
|
const styleNameUnsafeReg = /[^a-zA-Z0-9_]/g;
|
|
9200
9208
|
const encodeStyleNameChar = (c) => "-" + c.charCodeAt(0).toString(36);
|
|
9201
|
-
function dynamicStyleName(
|
|
9202
|
-
const
|
|
9209
|
+
function dynamicStyleName(index) {
|
|
9210
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
9203
9211
|
const id = (0, _marko_compiler_babel_utils.getTemplateId)(file.markoOpts, file.opts.filename, index.toString(36));
|
|
9204
9212
|
return "--" + ((file.markoOpts.runtimeId || "M_") + id).replace(styleNameUnsafeReg, encodeStyleNameChar);
|
|
9205
9213
|
}
|
|
@@ -9254,13 +9262,13 @@ function dynamicStyleValues(node) {
|
|
|
9254
9262
|
return values;
|
|
9255
9263
|
}
|
|
9256
9264
|
function emitStyleImport(tag) {
|
|
9257
|
-
const { node
|
|
9265
|
+
const { node } = tag;
|
|
9258
9266
|
const importPath = node.extra?.styleImportPath;
|
|
9259
9267
|
if (!importPath) return;
|
|
9260
9268
|
if (!node.var) (0, _marko_compiler_babel_utils.getProgram)().node.body.push(_marko_compiler.types.importDeclaration([], _marko_compiler.types.stringLiteral(importPath)));
|
|
9261
9269
|
else if (_marko_compiler.types.isIdentifier(node.var)) (0, _marko_compiler_babel_utils.getProgram)().node.body.push(_marko_compiler.types.importDeclaration([_marko_compiler.types.importNamespaceSpecifier(node.var)], _marko_compiler.types.stringLiteral(importPath)));
|
|
9262
9270
|
else {
|
|
9263
|
-
const varDecl = _marko_compiler.types.variableDeclaration("const", [_marko_compiler.types.variableDeclarator(node.var, (0, _marko_compiler_babel_utils.importStar)(
|
|
9271
|
+
const varDecl = _marko_compiler.types.variableDeclaration("const", [_marko_compiler.types.variableDeclarator(node.var, (0, _marko_compiler_babel_utils.importStar)((0, _marko_compiler_babel_utils.getFile)(), importPath, "style"))]);
|
|
9264
9272
|
(0, _marko_compiler_babel_utils.getProgram)().node.body.push(isOutputDOM() ? varDecl : _marko_compiler.types.markoScriptlet([varDecl], true));
|
|
9265
9273
|
}
|
|
9266
9274
|
}
|
|
@@ -9514,7 +9522,7 @@ var import_declaration_default = {
|
|
|
9514
9522
|
const { node } = importDecl;
|
|
9515
9523
|
const { source } = node;
|
|
9516
9524
|
const { value } = source;
|
|
9517
|
-
if (_marko_compiler.types.isProgram(importDecl.parent) && isClientAssetImport((0, _marko_compiler_babel_utils.getFile)(), value)) addAssetImport(
|
|
9525
|
+
if (_marko_compiler.types.isProgram(importDecl.parent) && isClientAssetImport((0, _marko_compiler_babel_utils.getFile)(), value)) addAssetImport(value);
|
|
9518
9526
|
const tagImport = (0, _marko_compiler_babel_utils.resolveTagImport)(importDecl, value);
|
|
9519
9527
|
if (tagImport) {
|
|
9520
9528
|
(node.extra ??= {}).tagImport = tagImport;
|
|
@@ -9533,7 +9541,7 @@ var import_declaration_default = {
|
|
|
9533
9541
|
return;
|
|
9534
9542
|
}
|
|
9535
9543
|
(node.extra ??= {}).loadImport = loadImport;
|
|
9536
|
-
const
|
|
9544
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
9537
9545
|
const loadFile = tagImport && (0, _marko_compiler_babel_utils.loadFileForImport)(file, value);
|
|
9538
9546
|
if (!loadFile) throw importDecl.buildCodeFrameError("Unable to resolve marko file for load import.");
|
|
9539
9547
|
(file.path.node.extra.loadImports ??= /* @__PURE__ */ new Set()).add(loadFile.opts.filename);
|
|
@@ -9550,8 +9558,7 @@ var import_declaration_default = {
|
|
|
9550
9558
|
const { local } = node.specifiers.find(_marko_compiler.types.isImportDefaultSpecifier);
|
|
9551
9559
|
const binding = importDecl.scope.getBinding(local.name);
|
|
9552
9560
|
if (isOutputHTML()) {
|
|
9553
|
-
const
|
|
9554
|
-
const loadFile = (0, _marko_compiler_babel_utils.loadFileForImport)(file, node.source.value);
|
|
9561
|
+
const loadFile = (0, _marko_compiler_babel_utils.loadFileForImport)((0, _marko_compiler_babel_utils.getFile)(), node.source.value);
|
|
9555
9562
|
const wrappedName = getOrCreateHtmlLoadWrapped(getReadyId(loadFile), _marko_compiler.types.identifier(local.name), loadFile.opts.filename, loadImport.render ? void 0 : loadImport.triggers);
|
|
9556
9563
|
for (const ref of binding.referencePaths) ref.replaceWith(_marko_compiler.types.identifier(wrappedName));
|
|
9557
9564
|
node.source.value = tagImport;
|
|
@@ -9559,7 +9566,7 @@ var import_declaration_default = {
|
|
|
9559
9566
|
return;
|
|
9560
9567
|
} else if (binding.referencePaths.every((ref) => _marko_compiler.types.isMarkoTag(ref.parent) && ref.parent.extra?.tagNameLoad)) importDecl.remove();
|
|
9561
9568
|
else {
|
|
9562
|
-
const
|
|
9569
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
9563
9570
|
const loadFile = (0, _marko_compiler_babel_utils.loadFileForImport)(file, node.source.value);
|
|
9564
9571
|
const resolvedPath = (0, _marko_compiler_babel_utils.resolveRelativePath)(file, loadFile.opts.filename);
|
|
9565
9572
|
importRuntimeFeature("catch");
|
|
@@ -9988,7 +9995,7 @@ function translateHTML(tag) {
|
|
|
9988
9995
|
}
|
|
9989
9996
|
function translateDOM(tag) {
|
|
9990
9997
|
const { node } = tag;
|
|
9991
|
-
const
|
|
9998
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
9992
9999
|
const relativePath = getTagRelativePath(tag);
|
|
9993
10000
|
const programSection = (0, _marko_compiler_babel_utils.getProgram)().node.extra.section;
|
|
9994
10001
|
const childFile = (0, _marko_compiler_babel_utils.loadFileForTag)(tag);
|
|
@@ -10040,7 +10047,8 @@ function translateDOM(tag) {
|
|
|
10040
10047
|
tag.remove();
|
|
10041
10048
|
}
|
|
10042
10049
|
function getTagRelativePath(tag) {
|
|
10043
|
-
const { node
|
|
10050
|
+
const { node } = tag;
|
|
10051
|
+
const file = (0, _marko_compiler_babel_utils.getFile)();
|
|
10044
10052
|
let relativePath;
|
|
10045
10053
|
if (_marko_compiler.types.isStringLiteral(node.name)) {
|
|
10046
10054
|
const tagDef = (0, _marko_compiler_babel_utils.getTagDef)(tag);
|
|
@@ -9,5 +9,5 @@ declare module "@marko/compiler" {
|
|
|
9
9
|
assetImports?: Set<string>;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
export declare function addAssetImport(
|
|
12
|
+
export declare function addAssetImport(request: string): void;
|
|
13
13
|
export declare function isClientAssetImport(file: t.BabelFile, request: string): boolean;
|
|
@@ -5,6 +5,6 @@ declare module "@marko/compiler/dist/types" {
|
|
|
5
5
|
[kRawText]?: true;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare function bodyToTextLiteral(body: t.MarkoTagBody): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
|
|
8
|
+
export declare function bodyToTextLiteral(body: t.MarkoTagBody, decodeEntities?: boolean): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
|
|
9
9
|
export declare function bodyToRawTextLiteral(body: t.MarkoTagBody): t.ArrayExpression | t.ArrowFunctionExpression | t.AssignmentExpression | t.AwaitExpression | t.BigIntLiteral | t.BinaryExpression | t.BindExpression | t.BooleanLiteral | t.CallExpression | t.ClassExpression | t.ConditionalExpression | t.DecimalLiteral | t.DoExpression | t.FunctionExpression | t.Identifier | t.Import | t.ImportExpression | t.JSXElement | t.JSXFragment | t.LogicalExpression | t.MarkoParseError | t.MemberExpression | t.MetaProperty | t.ModuleExpression | t.NewExpression | t.NullLiteral | t.NumericLiteral | t.ObjectExpression | t.OptionalCallExpression | t.OptionalMemberExpression | t.ParenthesizedExpression | t.PipelineBareFunction | t.PipelinePrimaryTopicReference | t.PipelineTopicExpression | t.RecordExpression | t.RegExpLiteral | t.SequenceExpression | t.StringLiteral | t.Super | t.TSAsExpression | t.TSInstantiationExpression | t.TSNonNullExpression | t.TSSatisfiesExpression | t.TSTypeAssertion | t.TaggedTemplateExpression | t.TemplateLiteral | t.ThisExpression | t.TopicReference | t.TupleExpression | t.TypeCastExpression | t.UnaryExpression | t.UpdateExpression | t.YieldExpression;
|
|
10
10
|
export declare function injectTextCoercion(expr: t.Expression): void;
|
|
@@ -23,6 +23,7 @@ export declare function toIter<T>(data: Opt<T>): Iterable<T>;
|
|
|
23
23
|
export declare function includes<T>(data: Opt<T>, item: T): boolean;
|
|
24
24
|
export declare function find<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): Opt<T>;
|
|
25
25
|
export declare function some<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): boolean;
|
|
26
|
+
export declare function every<T>(data: Opt<T>, cb: (item: T, index: number) => boolean): boolean;
|
|
26
27
|
export declare function toArray<T, R>(data: Opt<T>, cb: (item: T, index: number) => R): R[];
|
|
27
28
|
export declare function mapToString<T>(data: Opt<T>, sep: string, cb: (item: T, index: number) => string): string;
|
|
28
29
|
export declare function findSorted<T>(compare: Compare<T>, data: T[], item: T): T | undefined;
|
|
@@ -3,7 +3,7 @@ import type { AccessorPrefix } from "../../common/accessor.debug";
|
|
|
3
3
|
import * as BindingType from "./constants/binding-type";
|
|
4
4
|
import { type Many, type Opt, Sorted } from "./optional";
|
|
5
5
|
import { type Section } from "./sections";
|
|
6
|
-
import { type SerializeReason } from "./serialize-reasons";
|
|
6
|
+
import { type SerializeKey, type SerializeReason } from "./serialize-reasons";
|
|
7
7
|
import { type Signal } from "./signals";
|
|
8
8
|
export declare const kBranchSerializeReason: unique symbol;
|
|
9
9
|
export type Aliases = undefined | Binding | {
|
|
@@ -48,6 +48,9 @@ export interface Binding {
|
|
|
48
48
|
pruned: boolean | undefined;
|
|
49
49
|
exposed: boolean;
|
|
50
50
|
forcePersist: boolean;
|
|
51
|
+
/** Binding-side counterpart of `Section.serializePropKeys`, keyed by
|
|
52
|
+
* accessor prefix (`undefined` is the plain binding key). */
|
|
53
|
+
serializePropKeys: Map<AccessorPrefix | symbol | undefined, SerializeKey> | undefined;
|
|
51
54
|
reserveSize: number;
|
|
52
55
|
}
|
|
53
56
|
export interface InputBinding extends Binding {
|
|
@@ -4,9 +4,9 @@ import type { WalkCode } from "../../common/types";
|
|
|
4
4
|
import * as ContentType from "./constants/content-type";
|
|
5
5
|
import type * as Step from "./constants/step";
|
|
6
6
|
import * as StructureKind from "./constants/structure-kind";
|
|
7
|
-
import { type Opt, Sorted } from "./optional";
|
|
7
|
+
import { type OneMany, type Opt, Sorted } from "./optional";
|
|
8
8
|
import { type Binding, type InputBinding, type KnownExprs, type ParamBinding, type ReferencedBindings, type Sources } from "./references";
|
|
9
|
-
import { type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
9
|
+
import { type SerializeKey, type SerializeReason, type SerializeReasons } from "./serialize-reasons";
|
|
10
10
|
export interface ParamSerializeReasonGroup {
|
|
11
11
|
id: symbol;
|
|
12
12
|
reason: NonNullable<Sources["param"]>;
|
|
@@ -67,16 +67,29 @@ export interface Section {
|
|
|
67
67
|
/** Reasons any of the section's dom nodes resumes, as the analyzed reasons
|
|
68
68
|
* (not merged) so each one's guard stays buildable. */
|
|
69
69
|
domSerializeReasons: undefined | SerializeReasons;
|
|
70
|
+
/** Pending serialize exprs, resolved into the reasons (and provenance)
|
|
71
|
+
* once references finalize. */
|
|
72
|
+
serializeExprs: Opt<t.NodeExtra>;
|
|
73
|
+
propSerializeExprs: Map<SerializeKey, OneMany<t.NodeExtra>> | undefined;
|
|
74
|
+
/** Whose values feed each serialization decision — survives force-`true`
|
|
75
|
+
* and counts function-body reads; complete after reference finalize. */
|
|
76
|
+
serializeProvenance: Sources | undefined;
|
|
77
|
+
propSerializeProvenance: Map<SerializeKey, Sources> | undefined;
|
|
78
|
+
/** Interned per-prop reason keys for string/symbol props. */
|
|
79
|
+
serializePropKeys: Map<string | symbol, SerializeKey> | undefined;
|
|
70
80
|
paramReasonGroups: ParamSerializeReasonGroups | undefined;
|
|
71
81
|
returnValueExpr: t.NodeExtra | undefined;
|
|
72
82
|
returnSerializeReason: SerializeReason | undefined;
|
|
73
83
|
isHoistThrough: true | undefined;
|
|
74
84
|
upstreamExpression: t.NodeExtra | undefined;
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
/** The content's rendering tag (its extra), and the child binding the
|
|
86
|
+
* content feeds when the child can serialize it. */
|
|
87
|
+
downstream: {
|
|
88
|
+
tag: t.MarkoTagExtra;
|
|
89
|
+
binding: Binding | undefined;
|
|
77
90
|
properties: Opt<string>;
|
|
78
91
|
exprs: KnownExprs | undefined;
|
|
79
|
-
} |
|
|
92
|
+
} | undefined;
|
|
80
93
|
hasAbortSignal: boolean;
|
|
81
94
|
/** Count of distinct `$signal` expression roots; analyze allocates each
|
|
82
95
|
* root's `abortId` from this so translates read, never re-derive. */
|
|
@@ -108,6 +121,7 @@ export declare const getScopeIdIdentifier: (section: Section) => t.Identifier;
|
|
|
108
121
|
export declare const getSectionParentIsOwner: (section: Section) => boolean, setSectionParentIsOwner: (section: Section, value: boolean) => void;
|
|
109
122
|
export declare const getBranchRendererArgs: (section: Section) => [template?: t.Expression | undefined, walks?: t.Expression | undefined, setup?: t.Expression | undefined, params?: t.Expression | undefined], setBranchRendererArgs: (section: Section, value: [template?: t.Expression | undefined, walks?: t.Expression | undefined, setup?: t.Expression | undefined, params?: t.Expression | undefined]) => void;
|
|
110
123
|
export declare function forEachSection(fn: (section: Section) => void): void;
|
|
124
|
+
export declare function getChildSections(section: Section): Section[];
|
|
111
125
|
export declare function forEachSectionReverse(fn: (section: Section) => void): void;
|
|
112
126
|
export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType.Value | null;
|
|
113
127
|
export declare function getSectionRegisterReasons(section: Section): false | SerializeReason;
|
|
@@ -119,5 +133,6 @@ export declare function getDirectClosures(section: Section): Opt<Binding>;
|
|
|
119
133
|
export declare function isSameOrChildSection(section: Section, other: Section): boolean;
|
|
120
134
|
export declare function getCommonSection(section: Section, other: Section): Section;
|
|
121
135
|
export declare function finalizeParamSerializeReasonGroups(section: Section): void;
|
|
136
|
+
export declare function ensureReasonGroups(reason: Section["serializeReason"]): void;
|
|
122
137
|
export declare function getParamReasonGroupIndex(section: Section, reason: ParamSerializeReasonGroup["reason"]): number;
|
|
123
|
-
export declare function groupParamsBySection(params: Sources["param"]): Map<Section,
|
|
138
|
+
export declare function groupParamsBySection(params: Sources["param"]): Map<Section, OneMany<InputBinding | ParamBinding>>;
|
|
@@ -6,6 +6,9 @@ import type { Section } from "./sections";
|
|
|
6
6
|
export type SerializeReasons = true | OneMany<Sources>;
|
|
7
7
|
export declare const sourcesUtil: Sorted<Sources>;
|
|
8
8
|
export type SerializeReason = true | Sources;
|
|
9
|
+
export type SerializeKey = symbol & {
|
|
10
|
+
__serialize_key__: 1;
|
|
11
|
+
};
|
|
9
12
|
export declare function isSameReason(a: SerializeReason | undefined, b: SerializeReason | undefined): boolean;
|
|
10
13
|
export declare function isForceSerialized(section: Section, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): boolean;
|
|
11
14
|
export declare function addSerializeReason(section: Section, reason: undefined | false | SerializeReason, prop?: Binding | AccessorProp | symbol, prefix?: AccessorPrefix | symbol): void;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { types as t } from "@marko/compiler";
|
|
2
|
+
import { type TagDefinition } from "@marko/compiler/babel-utils";
|
|
3
|
+
declare module "@marko/compiler/dist/types" {
|
|
4
|
+
interface MarkoTag {
|
|
5
|
+
tagDef?: TagDefinition | null;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
2
8
|
export declare function preAnalyze(program: t.NodePath<t.Program>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "marko",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.50",
|
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -51,14 +51,14 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@marko/compiler": "^5.42.
|
|
54
|
+
"@marko/compiler": "^5.42.5",
|
|
55
55
|
"csstype": "^3.2.3",
|
|
56
56
|
"fastest-levenshtein": "^1.0.16",
|
|
57
57
|
"magic-string": "^0.30.21"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@marko/runtime-tags": "npm:marko@6.3.
|
|
61
|
-
"marko": "5.39.
|
|
60
|
+
"@marko/runtime-tags": "npm:marko@6.3.50",
|
|
61
|
+
"marko": "5.39.40"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=22"
|