@jsenv/core 37.0.5 → 37.1.1
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/js/autoreload.js +23 -20
- package/dist/js/import_meta_hot.js +0 -1
- package/dist/jsenv_core.js +691 -591
- package/package.json +2 -2
- package/src/build/build.js +141 -154
- package/src/build/build_versions_manager.js +53 -56
- package/src/dev/file_service.js +68 -77
- package/src/dev/start_dev_server.js +2 -4
- package/src/helpers/event_emitter.js +18 -0
- package/src/kitchen/kitchen.js +4 -6
- package/src/kitchen/url_graph/references.js +29 -8
- package/src/kitchen/url_graph/url_content.js +9 -0
- package/src/kitchen/url_graph/url_graph.js +50 -57
- package/src/kitchen/url_graph/url_graph_report.js +62 -59
- package/src/kitchen/url_graph/url_graph_visitor.js +30 -0
- package/src/kitchen/url_graph/url_info_transformations.js +26 -26
- package/src/plugins/autoreload/client/autoreload.js +7 -7
- package/src/plugins/autoreload/client/reload.js +16 -13
- package/src/plugins/autoreload/jsenv_plugin_autoreload.js +4 -4
- package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +138 -96
- package/src/plugins/autoreload/jsenv_plugin_hot_search_param.js +43 -25
- package/src/plugins/import_meta_hot/client/import_meta_hot.js +0 -1
- package/src/plugins/plugins.js +3 -14
- package/src/plugins/resolution_node_esm/jsenv_plugin_node_esm_resolution.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.1.1",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@jsenv/node-esm-resolution": "1.0.1",
|
|
70
70
|
"@jsenv/js-module-fallback": "1.2.0",
|
|
71
71
|
"@jsenv/runtime-compat": "1.1.0",
|
|
72
|
-
"@jsenv/server": "15.0
|
|
72
|
+
"@jsenv/server": "15.1.0",
|
|
73
73
|
"@jsenv/sourcemap": "1.1.0",
|
|
74
74
|
"@jsenv/plugin-transpilation": "1.2.1",
|
|
75
75
|
"@jsenv/plugin-supervisor": "1.2.0",
|
package/src/build/build.js
CHANGED
|
@@ -347,7 +347,7 @@ build ${entryPointKeys.length} entry points`);
|
|
|
347
347
|
sourcemaps,
|
|
348
348
|
sourcemapsSourcesContent,
|
|
349
349
|
outDirectoryUrl: outDirectoryUrl
|
|
350
|
-
? new URL("
|
|
350
|
+
? new URL("prebuild/", outDirectoryUrl)
|
|
351
351
|
: undefined,
|
|
352
352
|
});
|
|
353
353
|
|
|
@@ -602,13 +602,6 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
602
602
|
rawUrlInfo.url,
|
|
603
603
|
"raw file",
|
|
604
604
|
);
|
|
605
|
-
if (buildUrl.includes("?")) {
|
|
606
|
-
associateBuildUrlAndRawUrl(
|
|
607
|
-
asUrlWithoutSearch(buildUrl),
|
|
608
|
-
rawUrlInfo.url,
|
|
609
|
-
"raw file",
|
|
610
|
-
);
|
|
611
|
-
}
|
|
612
605
|
return buildUrl;
|
|
613
606
|
}
|
|
614
607
|
if (reference.type === "sourcemap_comment") {
|
|
@@ -822,84 +815,86 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
822
815
|
bundler.urlInfoMap.set(rawUrlInfo.url, rawUrlInfo);
|
|
823
816
|
}
|
|
824
817
|
};
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
}
|
|
841
|
-
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
842
|
-
if (referencedUrlInfo.isInline) {
|
|
843
|
-
if (referencedUrlInfo.type === "js_module") {
|
|
844
|
-
// bundle inline script type module deps
|
|
845
|
-
referencedUrlInfo.referenceToOthersSet.forEach(
|
|
846
|
-
(jsModuleReferenceToOther) => {
|
|
847
|
-
if (jsModuleReferenceToOther.type === "js_import") {
|
|
848
|
-
const inlineUrlInfo = jsModuleReferenceToOther.urlInfo;
|
|
849
|
-
addToBundlerIfAny(inlineUrlInfo);
|
|
850
|
-
}
|
|
851
|
-
},
|
|
852
|
-
);
|
|
818
|
+
// ignore unused urls thanks to "forEachUrlInfoStronglyReferenced"
|
|
819
|
+
// it avoid bundling things that are not actually used
|
|
820
|
+
// happens for:
|
|
821
|
+
// - js import assertions
|
|
822
|
+
// - conversion to js classic using ?as_js_classic or ?js_module_fallback
|
|
823
|
+
GRAPH_VISITOR.forEachUrlInfoStronglyReferenced(
|
|
824
|
+
rawKitchen.graph.rootUrlInfo,
|
|
825
|
+
(rawUrlInfo) => {
|
|
826
|
+
if (rawUrlInfo.isEntryPoint) {
|
|
827
|
+
addToBundlerIfAny(rawUrlInfo);
|
|
828
|
+
}
|
|
829
|
+
if (rawUrlInfo.type === "html") {
|
|
830
|
+
rawUrlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
831
|
+
if (referenceToOther.isWeak) {
|
|
832
|
+
return;
|
|
853
833
|
}
|
|
854
|
-
// inline content cannot be bundled
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
addToBundlerIfAny(referencedUrlInfo);
|
|
858
|
-
});
|
|
859
|
-
rawUrlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
860
|
-
if (
|
|
861
|
-
referenceToOther.isResourceHint &&
|
|
862
|
-
referenceToOther.expectedType === "js_module"
|
|
863
|
-
) {
|
|
864
834
|
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
835
|
+
if (referencedUrlInfo.isInline) {
|
|
836
|
+
if (referencedUrlInfo.type === "js_module") {
|
|
837
|
+
// bundle inline script type module deps
|
|
838
|
+
referencedUrlInfo.referenceToOthersSet.forEach(
|
|
839
|
+
(jsModuleReferenceToOther) => {
|
|
840
|
+
if (jsModuleReferenceToOther.type === "js_import") {
|
|
841
|
+
const inlineUrlInfo =
|
|
842
|
+
jsModuleReferenceToOther.urlInfo;
|
|
843
|
+
addToBundlerIfAny(inlineUrlInfo);
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
);
|
|
847
|
+
}
|
|
848
|
+
// inline content cannot be bundled
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
addToBundlerIfAny(referencedUrlInfo);
|
|
852
|
+
});
|
|
853
|
+
rawUrlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
865
854
|
if (
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
referencedUrlInfo.referenceFromOthersSet.size > 0
|
|
855
|
+
referenceToOther.isResourceHint &&
|
|
856
|
+
referenceToOther.expectedType === "js_module"
|
|
869
857
|
) {
|
|
870
|
-
|
|
858
|
+
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
859
|
+
if (
|
|
860
|
+
referencedUrlInfo &&
|
|
861
|
+
// something else than the resource hint is using this url
|
|
862
|
+
referencedUrlInfo.referenceFromOthersSet.size > 0
|
|
863
|
+
) {
|
|
864
|
+
addToBundlerIfAny(referencedUrlInfo);
|
|
865
|
+
}
|
|
871
866
|
}
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
867
|
+
});
|
|
868
|
+
return;
|
|
869
|
+
}
|
|
870
|
+
// File referenced with new URL('./file.js', import.meta.url)
|
|
871
|
+
// are entry points that should be bundled
|
|
872
|
+
// For instance we will bundle service worker/workers detected like this
|
|
873
|
+
if (rawUrlInfo.type === "js_module") {
|
|
874
|
+
rawUrlInfo.referenceToOthersSet.forEach((referenceToOther) => {
|
|
875
|
+
if (referenceToOther.type === "js_url") {
|
|
876
|
+
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
877
|
+
for (const referenceFromOther of referencedUrlInfo.referenceFromOthersSet) {
|
|
878
|
+
if (referenceFromOther.url === referencedUrlInfo.url) {
|
|
879
|
+
if (
|
|
880
|
+
referenceFromOther.subtype === "import_dynamic" ||
|
|
881
|
+
referenceFromOther.type === "script"
|
|
882
|
+
) {
|
|
883
|
+
// will already be bundled
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
891
886
|
}
|
|
892
887
|
}
|
|
888
|
+
addToBundlerIfAny(referencedUrlInfo);
|
|
889
|
+
return;
|
|
893
890
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
}
|
|
902
|
-
});
|
|
891
|
+
if (referenceToOther.type === "js_inline_content") {
|
|
892
|
+
// we should bundle it too right?
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
);
|
|
903
898
|
await Object.keys(bundlers).reduce(async (previous, type) => {
|
|
904
899
|
await previous;
|
|
905
900
|
const bundler = bundlers[type];
|
|
@@ -1209,24 +1204,14 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
1209
1204
|
resyncTask.done();
|
|
1210
1205
|
}
|
|
1211
1206
|
}
|
|
1212
|
-
delete_unused_urls: {
|
|
1213
|
-
const actions = [];
|
|
1214
|
-
GRAPH_VISITOR.forEach(finalKitchen.graph, (urlInfo) => {
|
|
1215
|
-
if (!urlInfo.isUsed()) {
|
|
1216
|
-
actions.push(() => {
|
|
1217
|
-
urlInfo.deleteFromGraph();
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
});
|
|
1221
|
-
actions.forEach((action) => action());
|
|
1222
|
-
}
|
|
1223
1207
|
inject_urls_in_service_workers: {
|
|
1224
1208
|
const serviceWorkerEntryUrlInfos = GRAPH_VISITOR.filter(
|
|
1225
1209
|
finalKitchen.graph,
|
|
1226
1210
|
(finalUrlInfo) => {
|
|
1227
1211
|
return (
|
|
1228
1212
|
finalUrlInfo.subtype === "service_worker" &&
|
|
1229
|
-
finalUrlInfo.isEntryPoint
|
|
1213
|
+
finalUrlInfo.isEntryPoint &&
|
|
1214
|
+
finalUrlInfo.isUsed()
|
|
1230
1215
|
);
|
|
1231
1216
|
},
|
|
1232
1217
|
);
|
|
@@ -1235,34 +1220,34 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
1235
1220
|
"inject urls in service worker",
|
|
1236
1221
|
);
|
|
1237
1222
|
const serviceWorkerResources = {};
|
|
1238
|
-
GRAPH_VISITOR.
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1223
|
+
GRAPH_VISITOR.forEachUrlInfoStronglyReferenced(
|
|
1224
|
+
finalKitchen.graph.rootUrlInfo,
|
|
1225
|
+
(urlInfo) => {
|
|
1226
|
+
if (!urlInfo.url.startsWith("file:")) {
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
if (urlInfo.isInline) {
|
|
1230
|
+
return;
|
|
1231
|
+
}
|
|
1232
|
+
if (!canUseVersionedUrl(urlInfo)) {
|
|
1233
|
+
// when url is not versioned we compute a "version" for that url anyway
|
|
1234
|
+
// so that service worker source still changes and navigator
|
|
1235
|
+
// detect there is a change
|
|
1236
|
+
const buildSpecifier = findKey(buildSpecifierMap, urlInfo.url);
|
|
1237
|
+
serviceWorkerResources[buildSpecifier] = {
|
|
1238
|
+
version: buildVersionsManager.getVersion(urlInfo),
|
|
1239
|
+
};
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1252
1242
|
const buildSpecifier = findKey(buildSpecifierMap, urlInfo.url);
|
|
1243
|
+
const buildSpecifierVersioned =
|
|
1244
|
+
buildVersionsManager.getBuildSpecifierVersioned(buildSpecifier);
|
|
1253
1245
|
serviceWorkerResources[buildSpecifier] = {
|
|
1254
1246
|
version: buildVersionsManager.getVersion(urlInfo),
|
|
1247
|
+
versionedUrl: buildSpecifierVersioned,
|
|
1255
1248
|
};
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
const buildSpecifier = findKey(buildSpecifierMap, urlInfo.url);
|
|
1259
|
-
const buildSpecifierVersioned =
|
|
1260
|
-
buildVersionsManager.getBuildSpecifierVersioned(buildSpecifier);
|
|
1261
|
-
serviceWorkerResources[buildSpecifier] = {
|
|
1262
|
-
version: buildVersionsManager.getVersion(urlInfo),
|
|
1263
|
-
versionedUrl: buildSpecifierVersioned,
|
|
1264
|
-
};
|
|
1265
|
-
});
|
|
1249
|
+
},
|
|
1250
|
+
);
|
|
1266
1251
|
for (const serviceWorkerEntryUrlInfo of serviceWorkerEntryUrlInfos) {
|
|
1267
1252
|
const serviceWorkerResourcesWithoutSwScriptItSelf = {
|
|
1268
1253
|
...serviceWorkerResources,
|
|
@@ -1302,48 +1287,48 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
1302
1287
|
const buildRelativeUrl = urlToRelativeUrl(url, buildDirectoryUrl);
|
|
1303
1288
|
return buildRelativeUrl;
|
|
1304
1289
|
};
|
|
1305
|
-
GRAPH_VISITOR.
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1290
|
+
GRAPH_VISITOR.forEachUrlInfoStronglyReferenced(
|
|
1291
|
+
finalKitchen.graph.rootUrlInfo,
|
|
1292
|
+
(urlInfo) => {
|
|
1293
|
+
if (!urlInfo.url.startsWith("file:")) {
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
if (urlInfo.type === "directory") {
|
|
1297
|
+
return;
|
|
1298
|
+
}
|
|
1299
|
+
if (urlInfo.isInline) {
|
|
1300
|
+
const buildRelativeUrl = getBuildRelativeUrl(urlInfo.url);
|
|
1301
|
+
buildContents[buildRelativeUrl] = urlInfo.content;
|
|
1302
|
+
buildInlineRelativeUrls.push(buildRelativeUrl);
|
|
1303
|
+
} else {
|
|
1304
|
+
const buildRelativeUrl = getBuildRelativeUrl(urlInfo.url);
|
|
1305
|
+
if (
|
|
1306
|
+
buildVersionsManager.getVersion(urlInfo) &&
|
|
1307
|
+
canUseVersionedUrl(urlInfo)
|
|
1308
|
+
) {
|
|
1309
|
+
const buildSpecifier = findKey(buildSpecifierMap, urlInfo.url);
|
|
1310
|
+
const buildSpecifierVersioned =
|
|
1311
|
+
buildVersionsManager.getBuildSpecifierVersioned(buildSpecifier);
|
|
1312
|
+
const buildUrlVersioned = asBuildUrlVersioned({
|
|
1313
|
+
buildSpecifierVersioned,
|
|
1314
|
+
buildDirectoryUrl,
|
|
1315
|
+
});
|
|
1316
|
+
const buildRelativeUrlVersioned = urlToRelativeUrl(
|
|
1317
|
+
buildUrlVersioned,
|
|
1318
|
+
buildDirectoryUrl,
|
|
1319
|
+
);
|
|
1320
|
+
if (versioningMethod === "search_param") {
|
|
1321
|
+
buildContents[buildRelativeUrl] = urlInfo.content;
|
|
1322
|
+
} else {
|
|
1323
|
+
buildContents[buildRelativeUrlVersioned] = urlInfo.content;
|
|
1324
|
+
}
|
|
1325
|
+
buildManifest[buildRelativeUrl] = buildRelativeUrlVersioned;
|
|
1338
1326
|
} else {
|
|
1339
|
-
buildContents[
|
|
1327
|
+
buildContents[buildRelativeUrl] = urlInfo.content;
|
|
1340
1328
|
}
|
|
1341
|
-
buildManifest[buildRelativeUrl] = buildRelativeUrlVersioned;
|
|
1342
|
-
} else {
|
|
1343
|
-
buildContents[buildRelativeUrl] = urlInfo.content;
|
|
1344
1329
|
}
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1330
|
+
},
|
|
1331
|
+
);
|
|
1347
1332
|
const buildFileContents = {};
|
|
1348
1333
|
const buildInlineContents = {};
|
|
1349
1334
|
Object.keys(buildContents)
|
|
@@ -1378,7 +1363,9 @@ ${ANSI.color(buildUrl, ANSI.MAGENTA)}
|
|
|
1378
1363
|
writingFiles.done();
|
|
1379
1364
|
}
|
|
1380
1365
|
logger.info(
|
|
1381
|
-
createUrlGraphSummary(finalKitchen.graph, {
|
|
1366
|
+
createUrlGraphSummary(finalKitchen.graph, {
|
|
1367
|
+
title: "build files",
|
|
1368
|
+
}),
|
|
1382
1369
|
);
|
|
1383
1370
|
return {
|
|
1384
1371
|
buildFileContents,
|
|
@@ -213,63 +213,60 @@ export const createBuildVersionsManager = ({
|
|
|
213
213
|
|
|
214
214
|
const contentOnlyVersionMap = new Map();
|
|
215
215
|
generate_content_only_versions: {
|
|
216
|
-
GRAPH_VISITOR.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
{
|
|
253
|
-
cleanupJsenvAttributes: true,
|
|
254
|
-
cleanupPositionAttributes: true,
|
|
255
|
-
},
|
|
256
|
-
);
|
|
257
|
-
}
|
|
258
|
-
if (
|
|
259
|
-
CONTENT_TYPE.isTextual(urlInfo.contentType) &&
|
|
260
|
-
urlInfo.referenceToOthersSet.size > 0
|
|
261
|
-
) {
|
|
262
|
-
const containedPlaceholders = new Set();
|
|
263
|
-
const contentWithPredictibleVersionPlaceholders =
|
|
264
|
-
replaceWithDefaultAndPopulateContainedPlaceholders(
|
|
265
|
-
content,
|
|
266
|
-
containedPlaceholders,
|
|
216
|
+
GRAPH_VISITOR.forEachUrlInfoStronglyReferenced(
|
|
217
|
+
finalKitchen.graph.rootUrlInfo,
|
|
218
|
+
(urlInfo) => {
|
|
219
|
+
// ignore:
|
|
220
|
+
// - inline files and data files:
|
|
221
|
+
// they are already taken into account in the file where they appear
|
|
222
|
+
// - ignored files:
|
|
223
|
+
// we don't know their content
|
|
224
|
+
// - unused files without reference
|
|
225
|
+
// File updated such as style.css -> style.css.js or file.js->file.nomodule.js
|
|
226
|
+
// Are used at some point just to be discarded later because they need to be converted
|
|
227
|
+
// There is no need to version them and we could not because the file have been ignored
|
|
228
|
+
// so their content is unknown
|
|
229
|
+
if (urlInfo.type === "sourcemap") {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (urlInfo.isInline) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (urlInfo.url.startsWith("data:")) {
|
|
236
|
+
// urlInfo became inline and is not referenced by something else
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (urlInfo.url.startsWith("ignore:")) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
let content = urlInfo.content;
|
|
243
|
+
if (urlInfo.type === "html") {
|
|
244
|
+
content = stringifyHtmlAst(
|
|
245
|
+
parseHtmlString(urlInfo.content, {
|
|
246
|
+
storeOriginalPositions: false,
|
|
247
|
+
}),
|
|
248
|
+
{
|
|
249
|
+
cleanupJsenvAttributes: true,
|
|
250
|
+
cleanupPositionAttributes: true,
|
|
251
|
+
},
|
|
267
252
|
);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
253
|
+
}
|
|
254
|
+
if (
|
|
255
|
+
CONTENT_TYPE.isTextual(urlInfo.contentType) &&
|
|
256
|
+
urlInfo.referenceToOthersSet.size > 0
|
|
257
|
+
) {
|
|
258
|
+
const containedPlaceholders = new Set();
|
|
259
|
+
const contentWithPredictibleVersionPlaceholders =
|
|
260
|
+
replaceWithDefaultAndPopulateContainedPlaceholders(
|
|
261
|
+
content,
|
|
262
|
+
containedPlaceholders,
|
|
263
|
+
);
|
|
264
|
+
content = contentWithPredictibleVersionPlaceholders;
|
|
265
|
+
}
|
|
266
|
+
const contentVersion = generateVersion([content], versionLength);
|
|
267
|
+
contentOnlyVersionMap.set(urlInfo, contentVersion);
|
|
268
|
+
},
|
|
269
|
+
);
|
|
273
270
|
}
|
|
274
271
|
|
|
275
272
|
generate_versions: {
|