@jsenv/core 25.2.0 → 25.4.0
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/browser_runtime/asset-manifest.json +2 -2
- package/dist/browser_runtime/{browser_runtime_91c5a3b8.js → browser_runtime_0e3396a1.js} +15 -16
- package/dist/browser_runtime/{browser_runtime_91c5a3b8.js.map → browser_runtime_0e3396a1.js.map} +13 -13
- package/dist/build_manifest.js +5 -5
- package/dist/compile_proxy/asset-manifest.json +2 -2
- package/dist/compile_proxy/compile_proxy.html__inline__20_2334a374.js.map +342 -0
- package/dist/compile_proxy/{compile_proxy_8dfaee51.html → compile_proxy_9f737eaf.html} +357 -398
- package/dist/redirector/asset-manifest.json +2 -2
- package/dist/redirector/redirector.html__inline__12_009c47c7.js.map +348 -0
- package/dist/redirector/{redirector_3e9a97b9.html → redirector_96f74871.html} +378 -421
- package/dist/toolbar/asset-manifest.json +2 -2
- package/dist/toolbar/{toolbar.main_6c1b3d82.js.map → toolbar.main_86335f90.js.map} +82 -115
- package/dist/toolbar/{toolbar_361afb84.html → toolbar_d3a918a4.html} +487 -508
- package/dist/toolbar_injector/asset-manifest.json +2 -2
- package/dist/toolbar_injector/toolbar_injector_978bbd14.js +267 -0
- package/dist/toolbar_injector/toolbar_injector_978bbd14.js.map +119 -0
- package/package.json +19 -14
- package/readme.md +54 -54
- package/src/buildProject.js +31 -26
- package/src/dev_server.js +78 -87
- package/src/execute.js +3 -8
- package/src/internal/browser_launcher/{browser_runtime_report.js → browser_runtime_profile.js} +21 -15
- package/src/internal/browser_launcher/executeHtmlFile.js +22 -14
- package/src/internal/browser_launcher/from_playwright.js +6 -4
- package/src/internal/browser_runtime/browser_runtime.js +12 -14
- package/src/internal/browser_runtime/createBrowserRuntime.js +7 -6
- package/src/internal/browser_utils/fetchAndEvalUsingFetch.js +1 -1
- package/src/internal/browser_utils/fetchJson.js +1 -1
- package/src/internal/browser_utils/{fetch-browser.js → fetch_browser.js} +0 -2
- package/src/internal/building/buildUsingRollup.js +41 -57
- package/src/internal/building/html/parseHtmlRessource.js +2 -1
- package/src/internal/building/rollup_plugin_jsenv.js +28 -8
- package/src/internal/compiling/babel_parse_error.js +9 -0
- package/src/internal/{babel_plugin_transform_import_meta.js → compiling/babel_plugin_transform_import_meta.js} +58 -9
- package/src/internal/compiling/compileFile.js +2 -2
- package/src/internal/compiling/compileHtml.js +1 -1
- package/src/internal/compiling/createCompiledFileService.js +25 -74
- package/src/internal/compiling/js-compilation-service/babelHelper.js +10 -13
- package/src/internal/compiling/js-compilation-service/babel_plugin_babel_helpers_as_jsenv_imports.js +4 -2
- package/src/internal/compiling/js-compilation-service/transformJs.js +153 -23
- package/src/internal/compiling/jsenvCompilerForHtml.js +34 -34
- package/src/internal/compiling/jsenvCompilerForImportmap.js +2 -2
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +2 -4
- package/src/internal/compiling/jsenv_directory/comparison_utils.js +24 -0
- package/src/internal/compiling/{compile-directory/compile-asset.js → jsenv_directory/compile_asset.js} +0 -0
- package/src/internal/compiling/jsenv_directory/compile_context.js +68 -0
- package/src/internal/compiling/jsenv_directory/compile_profile.js +218 -0
- package/src/internal/compiling/{compile-directory/createLockRegistry.js → jsenv_directory/file_lock_registry.js} +0 -0
- package/src/internal/compiling/{compile-directory/createLockRegistry.test.js → jsenv_directory/file_lock_registry.test.js} +2 -1
- package/src/internal/compiling/{compile-directory → jsenv_directory}/fs-optimized-for-cache.js +0 -0
- package/src/internal/compiling/{compile-directory → jsenv_directory}/getOrGenerateCompiledFile.js +2 -2
- package/src/internal/compiling/jsenv_directory/jsenv_directory.js +174 -0
- package/src/internal/compiling/{compile-directory → jsenv_directory}/updateMeta.js +4 -2
- package/src/internal/compiling/{compile-directory → jsenv_directory}/validateCache.js +0 -0
- package/src/internal/compiling/sse_service/sse_service.js +369 -0
- package/src/internal/compiling/startCompileServer.js +156 -804
- package/src/internal/compiling/transformResultToCompilationResult.js +2 -2
- package/src/internal/dev_server/exploring/exploring.js +10 -8
- package/src/internal/dev_server/toolbar/compilation/toolbar.compilation.js +85 -78
- package/src/internal/dev_server/toolbar/settings/toolbar.settings.js +13 -0
- package/src/internal/dev_server/toolbar/toolbar.html +40 -16
- package/src/internal/dev_server/toolbar/toolbar.injector.js +11 -17
- package/src/internal/dev_server/toolbar/toolbar.main.js +6 -6
- package/src/internal/executing/executeConcurrently.js +1 -1
- package/src/internal/executing/executePlan.js +2 -3
- package/src/internal/{generateGroupMap → features}/babel_plugins_compatibility.js +8 -8
- package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +20 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +23 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +25 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +37 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +9 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +14 -0
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +85 -0
- package/src/internal/{browser_feature_detection → features/browser_feature_detection}/compile_proxy.html +1 -1
- package/src/internal/features/browser_feature_detection/execute_with_script_module.js +24 -0
- package/src/internal/features/features_compat_from_runtime.js +38 -0
- package/src/internal/features/features_compat_from_runtime_support.js +31 -0
- package/src/internal/{generateGroupMap → features}/features_compatibility.js +3 -3
- package/src/internal/{node_feature_detection → features/node_feature_detection}/feature_detect_dynamic_import.mjs +0 -0
- package/src/internal/{node_feature_detection → features/node_feature_detection}/feature_detect_top_level_await.mjs +0 -0
- package/src/internal/{node_feature_detection/nodeSupportsDynamicImport.js → features/node_feature_detection/node_feature_detect_dynamic_import.js} +0 -0
- package/src/internal/{node_feature_detection/nodeSupportsTopLevelAwait.js → features/node_feature_detection/node_feature_detect_top_level_await.js} +0 -0
- package/src/internal/features/node_feature_detection/node_feature_detection.js +66 -0
- package/src/internal/jsenv_remote_directory.js +1 -1
- package/src/internal/node_launcher/createControllableNodeProcess.js +4 -3
- package/src/internal/node_launcher/node_runtime_report.js +15 -9
- package/src/internal/node_runtime/fetchSource.js +2 -4
- package/src/internal/node_runtime/node_execution_systemjs.js +2 -5
- package/src/internal/{dev_server/redirector → redirector}/redirector.html +8 -18
- package/src/internal/{generateGroupMap/jsenvRuntimeSupport.js → runtime_support/jsenv_runtime_support.js} +0 -0
- package/src/internal/{generateGroupMap → runtime_support}/runtime_support.js +0 -0
- package/src/internal/url_conversion.js +12 -17
- package/src/launchNode.js +29 -41
- package/dist/compile_proxy/compile_proxy.html__inline__20_809f35f7.js.map +0 -392
- package/dist/redirector/redirector.html__inline__15_e391410e.js.map +0 -397
- package/dist/toolbar_injector/toolbar_injector_fac1e995.js +0 -973
- package/dist/toolbar_injector/toolbar_injector_fac1e995.js.map +0 -294
- package/src/internal/CONSTANTS.js +0 -11
- package/src/internal/browser_feature_detection/browser_feature_detection.js +0 -274
- package/src/internal/compiling/js-compilation-service/jsenvTransform.js +0 -243
- package/src/internal/generateGroupMap/generateGroupMap.js +0 -65
- package/src/internal/generateGroupMap/one_runtime_compat.js +0 -38
- package/src/internal/generateGroupMap/runtime_compat.js +0 -34
- package/src/internal/generateGroupMap/runtime_compat_composition.js +0 -76
- package/src/internal/generateGroupMap/shake_babel_plugin_map.js +0 -21
- package/src/internal/integrity/integrity_algorithms.js +0 -26
- package/src/internal/integrity/integrity_parsing.js +0 -50
- package/src/internal/integrity/integrity_update.js +0 -23
- package/src/internal/integrity/integrity_validation.js +0 -49
- package/src/internal/node_feature_detection/node_feature_detection.js +0 -117
- package/src/internal/node_runtime/detectNode.js +0 -3
- package/src/internal/runtime/computeCompileIdFromGroupId.js +0 -30
- package/src/internal/runtime/resolveGroup.js +0 -13
- package/src/internal/runtime/resolveRuntimeGroup.js +0 -11
|
@@ -902,172 +902,6 @@
|
|
|
902
902
|
return obj;
|
|
903
903
|
};
|
|
904
904
|
|
|
905
|
-
var createDetailedMessage = function createDetailedMessage(message) {
|
|
906
|
-
var details = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
907
|
-
var string = "".concat(message);
|
|
908
|
-
Object.keys(details).forEach(function (key) {
|
|
909
|
-
var value = details[key];
|
|
910
|
-
string += "\n--- ".concat(key, " ---\n").concat(Array.isArray(value) ? value.join("\n") : value);
|
|
911
|
-
});
|
|
912
|
-
return string;
|
|
913
|
-
};
|
|
914
|
-
|
|
915
|
-
var COMPILE_ID_OTHERWISE = "otherwise";
|
|
916
|
-
|
|
917
|
-
var computeCompileIdFromGroupId = function computeCompileIdFromGroupId(_ref) {
|
|
918
|
-
var groupId = _ref.groupId,
|
|
919
|
-
groupMap = _ref.groupMap;
|
|
920
|
-
|
|
921
|
-
if (typeof groupId === "undefined") {
|
|
922
|
-
if (COMPILE_ID_OTHERWISE in groupMap) {
|
|
923
|
-
return COMPILE_ID_OTHERWISE;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
var keys = Object.keys(groupMap);
|
|
927
|
-
|
|
928
|
-
if (keys.length === 1) {
|
|
929
|
-
return keys[0];
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
throw new Error(createUnexpectedGroupIdMessage({
|
|
933
|
-
groupMap: groupMap
|
|
934
|
-
}));
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
if (groupId in groupMap === false) {
|
|
938
|
-
throw new Error(createUnexpectedGroupIdMessage({
|
|
939
|
-
groupId: groupId,
|
|
940
|
-
groupMap: groupMap
|
|
941
|
-
}));
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
return groupId;
|
|
945
|
-
};
|
|
946
|
-
|
|
947
|
-
var createUnexpectedGroupIdMessage = function createUnexpectedGroupIdMessage(_ref2) {
|
|
948
|
-
var _createDetailedMessag;
|
|
949
|
-
|
|
950
|
-
var compileId = _ref2.compileId,
|
|
951
|
-
groupMap = _ref2.groupMap;
|
|
952
|
-
return createDetailedMessage("unexpected groupId.", (_createDetailedMessag = {}, _defineProperty(_createDetailedMessag, "expected compiled id", Object.keys(groupMap)), _defineProperty(_createDetailedMessag, "received compile id", compileId), _createDetailedMessag));
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
var valueToVersion = function valueToVersion(value) {
|
|
956
|
-
if (typeof value === "number") {
|
|
957
|
-
return numberToVersion(value);
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
if (typeof value === "string") {
|
|
961
|
-
return stringToVersion(value);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
throw new TypeError("version must be a number or a string, got ".concat(value));
|
|
965
|
-
};
|
|
966
|
-
|
|
967
|
-
var numberToVersion = function numberToVersion(number) {
|
|
968
|
-
return {
|
|
969
|
-
major: number,
|
|
970
|
-
minor: 0,
|
|
971
|
-
patch: 0
|
|
972
|
-
};
|
|
973
|
-
};
|
|
974
|
-
|
|
975
|
-
var stringToVersion = function stringToVersion(string) {
|
|
976
|
-
if (string.indexOf(".") > -1) {
|
|
977
|
-
var parts = string.split(".");
|
|
978
|
-
return {
|
|
979
|
-
major: Number(parts[0]),
|
|
980
|
-
minor: parts[1] ? Number(parts[1]) : 0,
|
|
981
|
-
patch: parts[2] ? Number(parts[2]) : 0
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
if (isNaN(string)) {
|
|
986
|
-
return {
|
|
987
|
-
major: 0,
|
|
988
|
-
minor: 0,
|
|
989
|
-
patch: 0
|
|
990
|
-
};
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
return {
|
|
994
|
-
major: Number(string),
|
|
995
|
-
minor: 0,
|
|
996
|
-
patch: 0
|
|
997
|
-
};
|
|
998
|
-
};
|
|
999
|
-
|
|
1000
|
-
var versionCompare = function versionCompare(versionA, versionB) {
|
|
1001
|
-
var semanticVersionA = valueToVersion(versionA);
|
|
1002
|
-
var semanticVersionB = valueToVersion(versionB);
|
|
1003
|
-
var majorDiff = semanticVersionA.major - semanticVersionB.major;
|
|
1004
|
-
|
|
1005
|
-
if (majorDiff > 0) {
|
|
1006
|
-
return majorDiff;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
if (majorDiff < 0) {
|
|
1010
|
-
return majorDiff;
|
|
1011
|
-
}
|
|
1012
|
-
|
|
1013
|
-
var minorDiff = semanticVersionA.minor - semanticVersionB.minor;
|
|
1014
|
-
|
|
1015
|
-
if (minorDiff > 0) {
|
|
1016
|
-
return minorDiff;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
if (minorDiff < 0) {
|
|
1020
|
-
return minorDiff;
|
|
1021
|
-
}
|
|
1022
|
-
|
|
1023
|
-
var patchDiff = semanticVersionA.patch - semanticVersionB.patch;
|
|
1024
|
-
|
|
1025
|
-
if (patchDiff > 0) {
|
|
1026
|
-
return patchDiff;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
if (patchDiff < 0) {
|
|
1030
|
-
return patchDiff;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
return 0;
|
|
1034
|
-
};
|
|
1035
|
-
|
|
1036
|
-
var versionIsBelow = function versionIsBelow(versionSupposedBelow, versionSupposedAbove) {
|
|
1037
|
-
return versionCompare(versionSupposedBelow, versionSupposedAbove) < 0;
|
|
1038
|
-
};
|
|
1039
|
-
|
|
1040
|
-
var findHighestVersion = function findHighestVersion() {
|
|
1041
|
-
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1042
|
-
values[_key] = arguments[_key];
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
if (values.length === 0) throw new Error("missing argument");
|
|
1046
|
-
return values.reduce(function (highestVersion, value) {
|
|
1047
|
-
if (versionIsBelow(highestVersion, value)) {
|
|
1048
|
-
return value;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
return highestVersion;
|
|
1052
|
-
});
|
|
1053
|
-
};
|
|
1054
|
-
|
|
1055
|
-
var resolveGroup = function resolveGroup(_ref, groupMap) {
|
|
1056
|
-
var name = _ref.name,
|
|
1057
|
-
version = _ref.version;
|
|
1058
|
-
return Object.keys(groupMap).find(function (compileIdCandidate) {
|
|
1059
|
-
var minRuntimeVersions = groupMap[compileIdCandidate].minRuntimeVersions;
|
|
1060
|
-
var versionForGroup = minRuntimeVersions[name];
|
|
1061
|
-
|
|
1062
|
-
if (!versionForGroup) {
|
|
1063
|
-
return false;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
var highestVersion = findHighestVersion(version, versionForGroup);
|
|
1067
|
-
return highestVersion === version;
|
|
1068
|
-
});
|
|
1069
|
-
};
|
|
1070
|
-
|
|
1071
905
|
function ownKeys(object, enumerableOnly) {
|
|
1072
906
|
var keys = Object.keys(object);
|
|
1073
907
|
|
|
@@ -1154,7 +988,7 @@
|
|
|
1154
988
|
/* eslint-env browser */
|
|
1155
989
|
|
|
1156
990
|
|
|
1157
|
-
function _await$
|
|
991
|
+
function _await$8(value, then, direct) {
|
|
1158
992
|
if (direct) {
|
|
1159
993
|
return then ? then(value) : value;
|
|
1160
994
|
}
|
|
@@ -1166,7 +1000,7 @@
|
|
|
1166
1000
|
return then ? value.then(then) : value;
|
|
1167
1001
|
}
|
|
1168
1002
|
|
|
1169
|
-
function _async$
|
|
1003
|
+
function _async$7(f) {
|
|
1170
1004
|
return function () {
|
|
1171
1005
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1172
1006
|
args[i] = arguments[i];
|
|
@@ -1193,7 +1027,7 @@
|
|
|
1193
1027
|
}
|
|
1194
1028
|
}
|
|
1195
1029
|
|
|
1196
|
-
var fetchUsingXHR = _async$
|
|
1030
|
+
var fetchUsingXHR = _async$7(function (url) {
|
|
1197
1031
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1198
1032
|
signal = _ref.signal,
|
|
1199
1033
|
_ref$method = _ref.method,
|
|
@@ -1277,7 +1111,7 @@
|
|
|
1277
1111
|
}
|
|
1278
1112
|
|
|
1279
1113
|
xhr.send(body);
|
|
1280
|
-
return _await$
|
|
1114
|
+
return _await$8(headersPromise, function () {
|
|
1281
1115
|
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL
|
|
1282
1116
|
var responseUrl = "responseURL" in xhr ? xhr.responseURL : headers["x-request-url"];
|
|
1283
1117
|
var responseStatus = xhr.status;
|
|
@@ -1285,7 +1119,7 @@
|
|
|
1285
1119
|
var responseHeaders = getHeadersFromXHR(xhr);
|
|
1286
1120
|
|
|
1287
1121
|
var readBody = function readBody() {
|
|
1288
|
-
return _await$
|
|
1122
|
+
return _await$8(bodyPromise, function () {
|
|
1289
1123
|
var status = xhr.status; // in Chrome on file:/// URLs, status is 0
|
|
1290
1124
|
|
|
1291
1125
|
if (status === 0) {
|
|
@@ -1321,7 +1155,7 @@
|
|
|
1321
1155
|
return _call$1(text, JSON.parse);
|
|
1322
1156
|
};
|
|
1323
1157
|
|
|
1324
|
-
var blob = _async$
|
|
1158
|
+
var blob = _async$7(function () {
|
|
1325
1159
|
if (!hasBlob) {
|
|
1326
1160
|
throw new Error("blob not supported");
|
|
1327
1161
|
}
|
|
@@ -1358,7 +1192,7 @@
|
|
|
1358
1192
|
});
|
|
1359
1193
|
};
|
|
1360
1194
|
|
|
1361
|
-
var formData = _async$
|
|
1195
|
+
var formData = _async$7(function () {
|
|
1362
1196
|
if (!hasFormData) {
|
|
1363
1197
|
throw new Error("formData not supported");
|
|
1364
1198
|
}
|
|
@@ -1539,7 +1373,7 @@
|
|
|
1539
1373
|
return form;
|
|
1540
1374
|
};
|
|
1541
1375
|
|
|
1542
|
-
var blobToArrayBuffer = _async$
|
|
1376
|
+
var blobToArrayBuffer = _async$7(function (blob) {
|
|
1543
1377
|
var reader = new FileReader();
|
|
1544
1378
|
var promise = fileReaderReady(reader);
|
|
1545
1379
|
reader.readAsArrayBuffer(blob);
|
|
@@ -1590,7 +1424,7 @@
|
|
|
1590
1424
|
|
|
1591
1425
|
var _excluded = ["mode"];
|
|
1592
1426
|
|
|
1593
|
-
function _await$
|
|
1427
|
+
function _await$7(value, then, direct) {
|
|
1594
1428
|
if (direct) {
|
|
1595
1429
|
return then ? then(value) : value;
|
|
1596
1430
|
}
|
|
@@ -1602,7 +1436,7 @@
|
|
|
1602
1436
|
return then ? value.then(then) : value;
|
|
1603
1437
|
}
|
|
1604
1438
|
|
|
1605
|
-
function _async$
|
|
1439
|
+
function _async$6(f) {
|
|
1606
1440
|
return function () {
|
|
1607
1441
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1608
1442
|
args[i] = arguments[i];
|
|
@@ -1616,14 +1450,14 @@
|
|
|
1616
1450
|
};
|
|
1617
1451
|
}
|
|
1618
1452
|
|
|
1619
|
-
var fetchNative = _async$
|
|
1453
|
+
var fetchNative = _async$6(function (url) {
|
|
1620
1454
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1621
1455
|
|
|
1622
1456
|
var _ref$mode = _ref.mode,
|
|
1623
1457
|
mode = _ref$mode === void 0 ? "cors" : _ref$mode,
|
|
1624
1458
|
options = _objectWithoutProperties(_ref, _excluded);
|
|
1625
1459
|
|
|
1626
|
-
return _await$
|
|
1460
|
+
return _await$7(window.fetch(url, _objectSpread2({
|
|
1627
1461
|
mode: mode
|
|
1628
1462
|
}, options)), function (response) {
|
|
1629
1463
|
return {
|
|
@@ -1660,7 +1494,7 @@
|
|
|
1660
1494
|
|
|
1661
1495
|
var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
|
|
1662
1496
|
|
|
1663
|
-
function _await$
|
|
1497
|
+
function _await$6(value, then, direct) {
|
|
1664
1498
|
if (direct) {
|
|
1665
1499
|
return then ? then(value) : value;
|
|
1666
1500
|
}
|
|
@@ -1672,7 +1506,7 @@
|
|
|
1672
1506
|
return then ? value.then(then) : value;
|
|
1673
1507
|
}
|
|
1674
1508
|
|
|
1675
|
-
function _async$
|
|
1509
|
+
function _async$5(f) {
|
|
1676
1510
|
return function () {
|
|
1677
1511
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1678
1512
|
args[i] = arguments[i];
|
|
@@ -1686,10 +1520,10 @@
|
|
|
1686
1520
|
};
|
|
1687
1521
|
}
|
|
1688
1522
|
|
|
1689
|
-
var fetchJson = _async$
|
|
1523
|
+
var fetchJson = _async$5(function (url) {
|
|
1690
1524
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1691
|
-
return _await$
|
|
1692
|
-
return _await$
|
|
1525
|
+
return _await$6(fetchUrl(url, options), function (response) {
|
|
1526
|
+
return _await$6(response.json());
|
|
1693
1527
|
});
|
|
1694
1528
|
});
|
|
1695
1529
|
/*
|
|
@@ -1951,7 +1785,32 @@
|
|
|
1951
1785
|
return version;
|
|
1952
1786
|
};
|
|
1953
1787
|
|
|
1954
|
-
function
|
|
1788
|
+
var executeWithScriptModuleInjection = function executeWithScriptModuleInjection(code) {
|
|
1789
|
+
var scriptModule = document.createElement("script");
|
|
1790
|
+
scriptModule.type = "module";
|
|
1791
|
+
var loadPromise = new Promise(function (resolve, reject) {
|
|
1792
|
+
scriptModule.onload = function () {
|
|
1793
|
+
document.body.removeChild(scriptModule);
|
|
1794
|
+
resolve();
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
scriptModule.onerror = function () {
|
|
1798
|
+
document.body.removeChild(scriptModule);
|
|
1799
|
+
reject();
|
|
1800
|
+
};
|
|
1801
|
+
|
|
1802
|
+
document.body.appendChild(scriptModule);
|
|
1803
|
+
});
|
|
1804
|
+
scriptModule.src = asBase64Url(code);
|
|
1805
|
+
return loadPromise;
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
var asBase64Url = function asBase64Url(text) {
|
|
1809
|
+
var mimeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "application/javascript";
|
|
1810
|
+
return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
function _await$5(value, then, direct) {
|
|
1955
1814
|
if (direct) {
|
|
1956
1815
|
return then ? then(value) : value;
|
|
1957
1816
|
}
|
|
@@ -1963,7 +1822,21 @@
|
|
|
1963
1822
|
return then ? value.then(then) : value;
|
|
1964
1823
|
}
|
|
1965
1824
|
|
|
1966
|
-
function
|
|
1825
|
+
function _catch$4(body, recover) {
|
|
1826
|
+
try {
|
|
1827
|
+
var result = body();
|
|
1828
|
+
} catch (e) {
|
|
1829
|
+
return recover(e);
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
if (result && result.then) {
|
|
1833
|
+
return result.then(void 0, recover);
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
return result;
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
function _async$4(f) {
|
|
1967
1840
|
return function () {
|
|
1968
1841
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1969
1842
|
args[i] = arguments[i];
|
|
@@ -1977,30 +1850,52 @@
|
|
|
1977
1850
|
};
|
|
1978
1851
|
}
|
|
1979
1852
|
|
|
1980
|
-
function
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1853
|
+
var supportsImportmap = _async$4(function () {
|
|
1854
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1855
|
+
_ref$remote = _ref.remote,
|
|
1856
|
+
remote = _ref$remote === void 0 ? true : _ref$remote;
|
|
1984
1857
|
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
}
|
|
1989
|
-
|
|
1858
|
+
var specifier = asBase64Url("export default false");
|
|
1859
|
+
var importMap = {
|
|
1860
|
+
imports: _defineProperty({}, specifier, asBase64Url("export default true"))
|
|
1861
|
+
};
|
|
1862
|
+
var importmapScript = document.createElement("script");
|
|
1863
|
+
var importmapString = JSON.stringify(importMap, null, " ");
|
|
1864
|
+
importmapScript.type = "importmap";
|
|
1865
|
+
|
|
1866
|
+
if (remote) {
|
|
1867
|
+
importmapScript.src = "data:application/json;base64,".concat(window.btoa(importmapString));
|
|
1868
|
+
} else {
|
|
1869
|
+
importmapScript.textContent = importmapString;
|
|
1990
1870
|
}
|
|
1991
|
-
}
|
|
1992
1871
|
|
|
1993
|
-
|
|
1994
|
-
|
|
1872
|
+
document.body.appendChild(importmapScript);
|
|
1873
|
+
return _catch$4(function () {
|
|
1874
|
+
return _await$5(executeWithScriptModuleInjection("import supported from \"".concat(specifier, "\"; window.__jsenv_runtime_test_importmap__ = supported")), function () {
|
|
1875
|
+
document.body.removeChild(importmapScript);
|
|
1876
|
+
var supported = window.__jsenv_runtime_test_importmap__;
|
|
1877
|
+
delete window.__jsenv_runtime_test_importmap__;
|
|
1878
|
+
return supported;
|
|
1879
|
+
});
|
|
1880
|
+
}, function () {
|
|
1881
|
+
document.body.removeChild(importmapScript);
|
|
1882
|
+
return false;
|
|
1883
|
+
});
|
|
1884
|
+
});
|
|
1995
1885
|
|
|
1996
|
-
|
|
1997
|
-
|
|
1886
|
+
function _await$4(value, then, direct) {
|
|
1887
|
+
if (direct) {
|
|
1888
|
+
return then ? then(value) : value;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
if (!value || !value.then) {
|
|
1892
|
+
value = Promise.resolve(value);
|
|
1998
1893
|
}
|
|
1999
1894
|
|
|
2000
|
-
return then(
|
|
1895
|
+
return then ? value.then(then) : value;
|
|
2001
1896
|
}
|
|
2002
1897
|
|
|
2003
|
-
function _catch(body, recover) {
|
|
1898
|
+
function _catch$3(body, recover) {
|
|
2004
1899
|
try {
|
|
2005
1900
|
var result = body();
|
|
2006
1901
|
} catch (e) {
|
|
@@ -2014,177 +1909,175 @@
|
|
|
2014
1909
|
return result;
|
|
2015
1910
|
}
|
|
2016
1911
|
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
topLevelAwait: undefined,
|
|
2039
|
-
jsonImportAssertions: undefined,
|
|
2040
|
-
cssImportAssertions: undefined,
|
|
2041
|
-
newStylesheet: undefined
|
|
2042
|
-
};
|
|
2043
|
-
return _await(detectSupportedFeatures({
|
|
2044
|
-
featuresReport: featuresReport,
|
|
2045
|
-
failFastOnFeatureDetection: failFastOnFeatureDetection,
|
|
2046
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML
|
|
2047
|
-
}), function () {
|
|
2048
|
-
return _await(adjustMissingFeatureNames(groupInfo, {
|
|
2049
|
-
featuresReport: featuresReport,
|
|
2050
|
-
coverageHandledFromOutside: coverageHandledFromOutside
|
|
2051
|
-
}), function (missingFeatureNames) {
|
|
2052
|
-
var canAvoidCompilation = customCompilerPatterns.length === 0 && missingFeatureNames.length === 0 && featuresReport.importmap && featuresReport.dynamicImport && featuresReport.topLevelAwait;
|
|
2053
|
-
return {
|
|
2054
|
-
canAvoidCompilation: canAvoidCompilation,
|
|
2055
|
-
featuresReport: featuresReport,
|
|
2056
|
-
customCompilerPatterns: customCompilerPatterns,
|
|
2057
|
-
missingFeatureNames: missingFeatureNames,
|
|
2058
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML,
|
|
2059
|
-
outDirectoryRelativeUrl: outDirectoryRelativeUrl,
|
|
2060
|
-
compileId: compileId,
|
|
2061
|
-
browser: browser
|
|
2062
|
-
};
|
|
1912
|
+
function _async$3(f) {
|
|
1913
|
+
return function () {
|
|
1914
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1915
|
+
args[i] = arguments[i];
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
try {
|
|
1919
|
+
return Promise.resolve(f.apply(this, args));
|
|
1920
|
+
} catch (e) {
|
|
1921
|
+
return Promise.reject(e);
|
|
1922
|
+
}
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
var supportsDynamicImport = _async$3(function () {
|
|
1927
|
+
var moduleSource = asBase64Url("export default 42");
|
|
1928
|
+
return _catch$3(function () {
|
|
1929
|
+
return _await$4(executeWithScriptModuleInjection("window.__jsenv_runtime_test_dynamic_import__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
1930
|
+
return _await$4(window.__jsenv_runtime_test_dynamic_import__, function (namespace) {
|
|
1931
|
+
delete window.__jsenv_runtime_test_dynamic_import__;
|
|
1932
|
+
return namespace.default === 42;
|
|
2063
1933
|
});
|
|
2064
1934
|
});
|
|
1935
|
+
}, function () {
|
|
1936
|
+
return false;
|
|
2065
1937
|
});
|
|
2066
1938
|
});
|
|
2067
1939
|
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
var missingFeatureNamesCopy = missingFeatureNames.slice();
|
|
1940
|
+
function _await$3(value, then, direct) {
|
|
1941
|
+
if (direct) {
|
|
1942
|
+
return then ? then(value) : value;
|
|
1943
|
+
}
|
|
2073
1944
|
|
|
2074
|
-
|
|
2075
|
-
|
|
1945
|
+
if (!value || !value.then) {
|
|
1946
|
+
value = Promise.resolve(value);
|
|
1947
|
+
}
|
|
2076
1948
|
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
}
|
|
2080
|
-
}; // When instrumentation CAN be handed by playwright
|
|
2081
|
-
// https://playwright.dev/docs/api/class-chromiumcoverage#chromiumcoveragestartjscoverageoptions
|
|
2082
|
-
// coverageHandledFromOutside is true and "transform-instrument" becomes non mandatory
|
|
1949
|
+
return then ? value.then(then) : value;
|
|
1950
|
+
}
|
|
2083
1951
|
|
|
1952
|
+
function _catch$2(body, recover) {
|
|
1953
|
+
try {
|
|
1954
|
+
var result = body();
|
|
1955
|
+
} catch (e) {
|
|
1956
|
+
return recover(e);
|
|
1957
|
+
}
|
|
2084
1958
|
|
|
2085
|
-
if (
|
|
2086
|
-
|
|
1959
|
+
if (result && result.then) {
|
|
1960
|
+
return result.then(void 0, recover);
|
|
2087
1961
|
}
|
|
2088
1962
|
|
|
2089
|
-
return
|
|
2090
|
-
|
|
2091
|
-
return _call(supportsJsonImportAssertions, function (jsonImportAssertions) {
|
|
2092
|
-
featuresReport.jsonImportAssertions = jsonImportAssertions;
|
|
2093
|
-
return _call(supportsCssImportAssertions, function (cssImportAssertions) {
|
|
2094
|
-
featuresReport.cssImportAssertions = cssImportAssertions;
|
|
1963
|
+
return result;
|
|
1964
|
+
}
|
|
2095
1965
|
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
1966
|
+
var supportsTopLevelAwait = function supportsTopLevelAwait() {
|
|
1967
|
+
return _await$3(_catch$2(function () {
|
|
1968
|
+
return _await$3(executeWithScriptModuleInjection("window.__jsenv_runtime_test_top_level_await__ = await Promise.resolve(42)"), function () {
|
|
1969
|
+
var supported = window.__jsenv_runtime_test_top_level_await__ === 42;
|
|
1970
|
+
delete window.__jsenv_runtime_test_top_level_await__;
|
|
1971
|
+
return supported;
|
|
1972
|
+
});
|
|
2102
1973
|
}, function () {
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
markAsSupported("new-stylesheet-as-jsenv-import");
|
|
2107
|
-
}
|
|
1974
|
+
return false;
|
|
1975
|
+
}));
|
|
1976
|
+
};
|
|
2108
1977
|
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
1978
|
+
function _await$2(value, then, direct) {
|
|
1979
|
+
if (direct) {
|
|
1980
|
+
return then ? then(value) : value;
|
|
1981
|
+
}
|
|
2112
1982
|
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML; // start testing importmap support first and not in paralell
|
|
2117
|
-
// so that there is not module script loaded beore importmap is injected
|
|
2118
|
-
// it would log an error in chrome console and return undefined
|
|
1983
|
+
if (!value || !value.then) {
|
|
1984
|
+
value = Promise.resolve(value);
|
|
1985
|
+
}
|
|
2119
1986
|
|
|
2120
|
-
return
|
|
2121
|
-
|
|
2122
|
-
// https://github.com/WICG/import-maps/issues/235
|
|
2123
|
-
// at this stage we won't know if the html file will use
|
|
2124
|
-
// an importmap or not and if that importmap is inline or specified with an src
|
|
2125
|
-
// so we should test if browser support local and remote importmap.
|
|
2126
|
-
// But there exploring server can inline importmap by transforming html
|
|
2127
|
-
// and in that case we can test only the local importmap support
|
|
2128
|
-
// so we test importmap support and the remote one
|
|
2129
|
-
remote: !inlineImportMapIntoHTML
|
|
2130
|
-
}), function (importmap) {
|
|
2131
|
-
featuresReport.importmap = importmap;
|
|
1987
|
+
return then ? value.then(then) : value;
|
|
1988
|
+
}
|
|
2132
1989
|
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
1990
|
+
function _catch$1(body, recover) {
|
|
1991
|
+
try {
|
|
1992
|
+
var result = body();
|
|
1993
|
+
} catch (e) {
|
|
1994
|
+
return recover(e);
|
|
1995
|
+
}
|
|
2136
1996
|
|
|
2137
|
-
|
|
2138
|
-
|
|
1997
|
+
if (result && result.then) {
|
|
1998
|
+
return result.then(void 0, recover);
|
|
1999
|
+
}
|
|
2139
2000
|
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2001
|
+
return result;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
function _async$2(f) {
|
|
2005
|
+
return function () {
|
|
2006
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2007
|
+
args[i] = arguments[i];
|
|
2008
|
+
}
|
|
2143
2009
|
|
|
2144
|
-
|
|
2145
|
-
|
|
2010
|
+
try {
|
|
2011
|
+
return Promise.resolve(f.apply(this, args));
|
|
2012
|
+
} catch (e) {
|
|
2013
|
+
return Promise.reject(e);
|
|
2014
|
+
}
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
var supportsJsonImportAssertions = _async$2(function () {
|
|
2019
|
+
var jsonBase64Url = asBase64Url("42", "application/json");
|
|
2020
|
+
var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\n export default data"));
|
|
2021
|
+
return _catch$1(function () {
|
|
2022
|
+
return _await$2(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2023
|
+
return _await$2(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
|
|
2024
|
+
var supported = namespace.default === 42;
|
|
2025
|
+
delete window.__jsenv_runtime_test_json_import_assertion__;
|
|
2026
|
+
return supported;
|
|
2146
2027
|
});
|
|
2147
2028
|
});
|
|
2029
|
+
}, function () {
|
|
2030
|
+
return false;
|
|
2148
2031
|
});
|
|
2149
2032
|
});
|
|
2150
2033
|
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2034
|
+
function _await$1(value, then, direct) {
|
|
2035
|
+
if (direct) {
|
|
2036
|
+
return then ? then(value) : value;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
if (!value || !value.then) {
|
|
2040
|
+
value = Promise.resolve(value);
|
|
2041
|
+
}
|
|
2155
2042
|
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
imports: _defineProperty({}, specifier, asBase64Url("export default true"))
|
|
2159
|
-
};
|
|
2160
|
-
var importmapScript = document.createElement("script");
|
|
2161
|
-
var importmapString = JSON.stringify(importMap, null, " ");
|
|
2162
|
-
importmapScript.type = "importmap";
|
|
2043
|
+
return then ? value.then(then) : value;
|
|
2044
|
+
}
|
|
2163
2045
|
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2046
|
+
function _catch(body, recover) {
|
|
2047
|
+
try {
|
|
2048
|
+
var result = body();
|
|
2049
|
+
} catch (e) {
|
|
2050
|
+
return recover(e);
|
|
2168
2051
|
}
|
|
2169
2052
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
document.body.removeChild(importmapScript);
|
|
2174
|
-
return window.__jsenv_runtime_test_importmap__;
|
|
2175
|
-
});
|
|
2176
|
-
}, function () {
|
|
2177
|
-
document.body.removeChild(importmapScript);
|
|
2178
|
-
return false;
|
|
2179
|
-
});
|
|
2180
|
-
});
|
|
2053
|
+
if (result && result.then) {
|
|
2054
|
+
return result.then(void 0, recover);
|
|
2055
|
+
}
|
|
2181
2056
|
|
|
2182
|
-
|
|
2183
|
-
|
|
2057
|
+
return result;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
function _async$1(f) {
|
|
2061
|
+
return function () {
|
|
2062
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2063
|
+
args[i] = arguments[i];
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
try {
|
|
2067
|
+
return Promise.resolve(f.apply(this, args));
|
|
2068
|
+
} catch (e) {
|
|
2069
|
+
return Promise.reject(e);
|
|
2070
|
+
}
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
|
|
2074
|
+
var supportsCssImportAssertions = _async$1(function () {
|
|
2075
|
+
var cssBase64Url = asBase64Url("p { color: red; }", "text/css");
|
|
2076
|
+
var moduleSource = asBase64Url("import css from \"".concat(cssBase64Url, "\" assert { type: \"css\" }\n export default css"));
|
|
2184
2077
|
return _catch(function () {
|
|
2185
|
-
return _await(executeWithScriptModuleInjection("window.
|
|
2186
|
-
return _await(window.
|
|
2187
|
-
return namespace.default
|
|
2078
|
+
return _await$1(executeWithScriptModuleInjection("window.__jsenv_runtime_test_css_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2079
|
+
return _await$1(window.__jsenv_runtime_test_css_import_assertion__, function (namespace) {
|
|
2080
|
+
return namespace.default instanceof CSSStyleSheet;
|
|
2188
2081
|
});
|
|
2189
2082
|
});
|
|
2190
2083
|
}, function () {
|
|
@@ -2202,74 +2095,140 @@
|
|
|
2202
2095
|
}
|
|
2203
2096
|
};
|
|
2204
2097
|
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
return
|
|
2208
|
-
|
|
2209
|
-
});
|
|
2210
|
-
}, function () {
|
|
2211
|
-
return false;
|
|
2212
|
-
}));
|
|
2213
|
-
}; // to execute in a browser devtools
|
|
2214
|
-
// const featuresReport = {}
|
|
2215
|
-
// await detectSupportedFeatures({ featuresReport, inlineImportMapIntoHTML: true })
|
|
2216
|
-
// console.log(featuresReport)
|
|
2098
|
+
function _await(value, then, direct) {
|
|
2099
|
+
if (direct) {
|
|
2100
|
+
return then ? then(value) : value;
|
|
2101
|
+
}
|
|
2217
2102
|
|
|
2103
|
+
if (!value || !value.then) {
|
|
2104
|
+
value = Promise.resolve(value);
|
|
2105
|
+
}
|
|
2218
2106
|
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\nexport default data"));
|
|
2222
|
-
return _catch(function () {
|
|
2223
|
-
return _await(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2224
|
-
return _await(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
|
|
2225
|
-
return namespace.default === 42;
|
|
2226
|
-
});
|
|
2227
|
-
});
|
|
2228
|
-
}, function () {
|
|
2229
|
-
return false;
|
|
2230
|
-
});
|
|
2231
|
-
});
|
|
2107
|
+
return then ? value.then(then) : value;
|
|
2108
|
+
}
|
|
2232
2109
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2110
|
+
function _async(f) {
|
|
2111
|
+
return function () {
|
|
2112
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2113
|
+
args[i] = arguments[i];
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
try {
|
|
2117
|
+
return Promise.resolve(f.apply(this, args));
|
|
2118
|
+
} catch (e) {
|
|
2119
|
+
return Promise.reject(e);
|
|
2120
|
+
}
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
function _call(body, then, direct) {
|
|
2125
|
+
if (direct) {
|
|
2126
|
+
return then ? then(body()) : body();
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
try {
|
|
2130
|
+
var result = Promise.resolve(body());
|
|
2131
|
+
return then ? result.then(then) : result;
|
|
2132
|
+
} catch (e) {
|
|
2133
|
+
return Promise.reject(e);
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
var scanBrowserRuntimeFeatures = _async(function () {
|
|
2138
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
2139
|
+
_ref$coverageHandledF = _ref.coverageHandledFromOutside,
|
|
2140
|
+
coverageHandledFromOutside = _ref$coverageHandledF === void 0 ? false : _ref$coverageHandledF,
|
|
2141
|
+
_ref$forceCompilation = _ref.forceCompilation,
|
|
2142
|
+
forceCompilation = _ref$forceCompilation === void 0 ? false : _ref$forceCompilation,
|
|
2143
|
+
_ref$forceSource = _ref.forceSource,
|
|
2144
|
+
forceSource = _ref$forceSource === void 0 ? false : _ref$forceSource;
|
|
2145
|
+
|
|
2146
|
+
var jsenvCompileProfileUrl = "/__jsenv_compile_profile__";
|
|
2147
|
+
return _await(fetchJson(jsenvCompileProfileUrl), function (_ref2) {
|
|
2148
|
+
var jsenvDirectoryRelativeUrl = _ref2.jsenvDirectoryRelativeUrl,
|
|
2149
|
+
inlineImportMapIntoHTML = _ref2.inlineImportMapIntoHTML;
|
|
2150
|
+
|
|
2151
|
+
var _detectBrowser = detectBrowser(),
|
|
2152
|
+
name = _detectBrowser.name,
|
|
2153
|
+
version = _detectBrowser.version;
|
|
2154
|
+
|
|
2155
|
+
return _await(detectSupportedFeatures({
|
|
2156
|
+
coverageHandledFromOutside: coverageHandledFromOutside,
|
|
2157
|
+
inlineImportMapIntoHTML: inlineImportMapIntoHTML
|
|
2158
|
+
}), function (featuresReport) {
|
|
2159
|
+
var runtimeReport = {
|
|
2160
|
+
env: {
|
|
2161
|
+
browser: true
|
|
2162
|
+
},
|
|
2163
|
+
name: name,
|
|
2164
|
+
version: version,
|
|
2165
|
+
featuresReport: featuresReport,
|
|
2166
|
+
forceSource: forceSource,
|
|
2167
|
+
forceCompilation: forceCompilation
|
|
2168
|
+
};
|
|
2169
|
+
return _await(fetchJson(jsenvCompileProfileUrl, {
|
|
2170
|
+
method: "POST",
|
|
2171
|
+
headers: {
|
|
2172
|
+
"content-type": "application/json"
|
|
2173
|
+
},
|
|
2174
|
+
body: JSON.stringify(runtimeReport)
|
|
2175
|
+
}), function (_ref3) {
|
|
2176
|
+
var compileProfile = _ref3.compileProfile,
|
|
2177
|
+
compileId = _ref3.compileId;
|
|
2178
|
+
return {
|
|
2179
|
+
jsenvDirectoryRelativeUrl: jsenvDirectoryRelativeUrl,
|
|
2180
|
+
inlineImportMapIntoHTML: inlineImportMapIntoHTML,
|
|
2181
|
+
compileProfile: compileProfile,
|
|
2182
|
+
compileId: compileId,
|
|
2183
|
+
runtimeReport: runtimeReport
|
|
2184
|
+
};
|
|
2240
2185
|
});
|
|
2241
2186
|
});
|
|
2242
|
-
}, function () {
|
|
2243
|
-
return false;
|
|
2244
2187
|
});
|
|
2245
2188
|
});
|
|
2246
2189
|
|
|
2247
|
-
var
|
|
2248
|
-
var
|
|
2249
|
-
|
|
2250
|
-
var
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2190
|
+
var detectSupportedFeatures = _async(function (_ref4) {
|
|
2191
|
+
var coverageHandledFromOutside = _ref4.coverageHandledFromOutside,
|
|
2192
|
+
inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML;
|
|
2193
|
+
var featuresReport = {};
|
|
2194
|
+
featuresReport["import_http"] = true;
|
|
2195
|
+
featuresReport["coverage_js"] = coverageHandledFromOutside; // new CSSStyleSheet
|
|
2196
|
+
|
|
2197
|
+
featuresReport["new_stylesheet"] = supportsNewStylesheet(); // importmap
|
|
2198
|
+
// start testing importmap support first and not in paralell
|
|
2199
|
+
// so that there is not module script loaded beore importmap is injected
|
|
2200
|
+
// it would log an error in chrome console and return undefined
|
|
2255
2201
|
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2202
|
+
return _await(supportsImportmap({
|
|
2203
|
+
// chrome supports inline but not remote importmap
|
|
2204
|
+
// https://github.com/WICG/import-maps/issues/235
|
|
2205
|
+
// at this stage we won't know if the html file will use
|
|
2206
|
+
// an importmap or not and if that importmap is inline or specified with an src
|
|
2207
|
+
// so we should test if browser support local and remote importmap.
|
|
2208
|
+
// But there exploring server can inline importmap by transforming html
|
|
2209
|
+
// and in that case we can test only the local importmap support
|
|
2210
|
+
// so we test importmap support and the remote one
|
|
2211
|
+
remote: !inlineImportMapIntoHTML
|
|
2212
|
+
}), function (_supportsImportmap) {
|
|
2213
|
+
featuresReport.importmap = _supportsImportmap; // dynamic import
|
|
2260
2214
|
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
scriptModule.src = asBase64Url(code);
|
|
2264
|
-
return loadPromise;
|
|
2265
|
-
};
|
|
2215
|
+
return _call(supportsDynamicImport, function (_supportsDynamicImpor) {
|
|
2216
|
+
featuresReport["import_dynamic"] = _supportsDynamicImpor; // top level await
|
|
2266
2217
|
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
|
|
2270
|
-
}; // const cssImportAssertions = await supportsCssImportAssertions()
|
|
2271
|
-
// console.log({ cssImportAssertions })
|
|
2218
|
+
return _call(supportsTopLevelAwait, function (_supportsTopLevelAwai) {
|
|
2219
|
+
featuresReport["top_level_await"] = _supportsTopLevelAwai; // import assertions
|
|
2272
2220
|
|
|
2221
|
+
return _call(supportsJsonImportAssertions, function (_supportsJsonImportAs) {
|
|
2222
|
+
featuresReport["import_assertion_type_json"] = _supportsJsonImportAs;
|
|
2223
|
+
return _call(supportsCssImportAssertions, function (_supportsCssImportAss) {
|
|
2224
|
+
featuresReport["import_assertion_type_css"] = _supportsCssImportAss;
|
|
2225
|
+
return featuresReport;
|
|
2226
|
+
});
|
|
2227
|
+
});
|
|
2228
|
+
});
|
|
2229
|
+
});
|
|
2230
|
+
});
|
|
2231
|
+
});
|
|
2273
2232
|
|
|
2274
2233
|
window.scanBrowserRuntimeFeatures = scanBrowserRuntimeFeatures;
|
|
2275
2234
|
window.resolveReadyPromise();
|
|
@@ -2277,7 +2236,7 @@
|
|
|
2277
2236
|
};
|
|
2278
2237
|
});
|
|
2279
2238
|
|
|
2280
|
-
//# sourceMappingURL=compile_proxy.
|
|
2239
|
+
//# sourceMappingURL=compile_proxy.html__inline__20_2334a374.js.map</script>
|
|
2281
2240
|
|
|
2282
2241
|
|
|
2283
2242
|
</body></html>
|