@jsenv/core 25.3.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 +12 -11
- package/src/buildProject.js +31 -26
- package/src/dev_server.js +76 -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/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/transformJs.js +153 -23
- package/src/internal/compiling/jsenvCompilerForHtml.js +29 -32
- 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 +1 -1
- 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/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 -242
- 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/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
|
@@ -872,7 +872,7 @@
|
|
|
872
872
|
<script type="systemjs-importmap">{
|
|
873
873
|
"imports": {}
|
|
874
874
|
}</script>
|
|
875
|
-
<script>System.register("redirector.
|
|
875
|
+
<script>System.register("redirector.html__inline__12.js", [], function () {
|
|
876
876
|
'use strict';
|
|
877
877
|
|
|
878
878
|
return {
|
|
@@ -897,172 +897,6 @@
|
|
|
897
897
|
return obj;
|
|
898
898
|
};
|
|
899
899
|
|
|
900
|
-
var createDetailedMessage = function createDetailedMessage(message) {
|
|
901
|
-
var details = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
902
|
-
var string = "".concat(message);
|
|
903
|
-
Object.keys(details).forEach(function (key) {
|
|
904
|
-
var value = details[key];
|
|
905
|
-
string += "\n--- ".concat(key, " ---\n").concat(Array.isArray(value) ? value.join("\n") : value);
|
|
906
|
-
});
|
|
907
|
-
return string;
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
var COMPILE_ID_OTHERWISE = "otherwise";
|
|
911
|
-
|
|
912
|
-
var computeCompileIdFromGroupId = function computeCompileIdFromGroupId(_ref) {
|
|
913
|
-
var groupId = _ref.groupId,
|
|
914
|
-
groupMap = _ref.groupMap;
|
|
915
|
-
|
|
916
|
-
if (typeof groupId === "undefined") {
|
|
917
|
-
if (COMPILE_ID_OTHERWISE in groupMap) {
|
|
918
|
-
return COMPILE_ID_OTHERWISE;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
var keys = Object.keys(groupMap);
|
|
922
|
-
|
|
923
|
-
if (keys.length === 1) {
|
|
924
|
-
return keys[0];
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
throw new Error(createUnexpectedGroupIdMessage({
|
|
928
|
-
groupMap: groupMap
|
|
929
|
-
}));
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
if (groupId in groupMap === false) {
|
|
933
|
-
throw new Error(createUnexpectedGroupIdMessage({
|
|
934
|
-
groupId: groupId,
|
|
935
|
-
groupMap: groupMap
|
|
936
|
-
}));
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
return groupId;
|
|
940
|
-
};
|
|
941
|
-
|
|
942
|
-
var createUnexpectedGroupIdMessage = function createUnexpectedGroupIdMessage(_ref2) {
|
|
943
|
-
var _createDetailedMessag;
|
|
944
|
-
|
|
945
|
-
var compileId = _ref2.compileId,
|
|
946
|
-
groupMap = _ref2.groupMap;
|
|
947
|
-
return createDetailedMessage("unexpected groupId.", (_createDetailedMessag = {}, _defineProperty(_createDetailedMessag, "expected compiled id", Object.keys(groupMap)), _defineProperty(_createDetailedMessag, "received compile id", compileId), _createDetailedMessag));
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
var valueToVersion = function valueToVersion(value) {
|
|
951
|
-
if (typeof value === "number") {
|
|
952
|
-
return numberToVersion(value);
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
if (typeof value === "string") {
|
|
956
|
-
return stringToVersion(value);
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
throw new TypeError("version must be a number or a string, got ".concat(value));
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
var numberToVersion = function numberToVersion(number) {
|
|
963
|
-
return {
|
|
964
|
-
major: number,
|
|
965
|
-
minor: 0,
|
|
966
|
-
patch: 0
|
|
967
|
-
};
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
var stringToVersion = function stringToVersion(string) {
|
|
971
|
-
if (string.indexOf(".") > -1) {
|
|
972
|
-
var parts = string.split(".");
|
|
973
|
-
return {
|
|
974
|
-
major: Number(parts[0]),
|
|
975
|
-
minor: parts[1] ? Number(parts[1]) : 0,
|
|
976
|
-
patch: parts[2] ? Number(parts[2]) : 0
|
|
977
|
-
};
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
if (isNaN(string)) {
|
|
981
|
-
return {
|
|
982
|
-
major: 0,
|
|
983
|
-
minor: 0,
|
|
984
|
-
patch: 0
|
|
985
|
-
};
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
return {
|
|
989
|
-
major: Number(string),
|
|
990
|
-
minor: 0,
|
|
991
|
-
patch: 0
|
|
992
|
-
};
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
var versionCompare = function versionCompare(versionA, versionB) {
|
|
996
|
-
var semanticVersionA = valueToVersion(versionA);
|
|
997
|
-
var semanticVersionB = valueToVersion(versionB);
|
|
998
|
-
var majorDiff = semanticVersionA.major - semanticVersionB.major;
|
|
999
|
-
|
|
1000
|
-
if (majorDiff > 0) {
|
|
1001
|
-
return majorDiff;
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
if (majorDiff < 0) {
|
|
1005
|
-
return majorDiff;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
var minorDiff = semanticVersionA.minor - semanticVersionB.minor;
|
|
1009
|
-
|
|
1010
|
-
if (minorDiff > 0) {
|
|
1011
|
-
return minorDiff;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
if (minorDiff < 0) {
|
|
1015
|
-
return minorDiff;
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
var patchDiff = semanticVersionA.patch - semanticVersionB.patch;
|
|
1019
|
-
|
|
1020
|
-
if (patchDiff > 0) {
|
|
1021
|
-
return patchDiff;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
if (patchDiff < 0) {
|
|
1025
|
-
return patchDiff;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
return 0;
|
|
1029
|
-
};
|
|
1030
|
-
|
|
1031
|
-
var versionIsBelow = function versionIsBelow(versionSupposedBelow, versionSupposedAbove) {
|
|
1032
|
-
return versionCompare(versionSupposedBelow, versionSupposedAbove) < 0;
|
|
1033
|
-
};
|
|
1034
|
-
|
|
1035
|
-
var findHighestVersion = function findHighestVersion() {
|
|
1036
|
-
for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1037
|
-
values[_key] = arguments[_key];
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
if (values.length === 0) throw new Error("missing argument");
|
|
1041
|
-
return values.reduce(function (highestVersion, value) {
|
|
1042
|
-
if (versionIsBelow(highestVersion, value)) {
|
|
1043
|
-
return value;
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
return highestVersion;
|
|
1047
|
-
});
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
var resolveGroup = function resolveGroup(_ref, groupMap) {
|
|
1051
|
-
var name = _ref.name,
|
|
1052
|
-
version = _ref.version;
|
|
1053
|
-
return Object.keys(groupMap).find(function (compileIdCandidate) {
|
|
1054
|
-
var minRuntimeVersions = groupMap[compileIdCandidate].minRuntimeVersions;
|
|
1055
|
-
var versionForGroup = minRuntimeVersions[name];
|
|
1056
|
-
|
|
1057
|
-
if (!versionForGroup) {
|
|
1058
|
-
return false;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
var highestVersion = findHighestVersion(version, versionForGroup);
|
|
1062
|
-
return highestVersion === version;
|
|
1063
|
-
});
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
900
|
function ownKeys(object, enumerableOnly) {
|
|
1067
901
|
var keys = Object.keys(object);
|
|
1068
902
|
|
|
@@ -1149,7 +983,7 @@
|
|
|
1149
983
|
/* eslint-env browser */
|
|
1150
984
|
|
|
1151
985
|
|
|
1152
|
-
function _await$
|
|
986
|
+
function _await$8(value, then, direct) {
|
|
1153
987
|
if (direct) {
|
|
1154
988
|
return then ? then(value) : value;
|
|
1155
989
|
}
|
|
@@ -1161,7 +995,7 @@
|
|
|
1161
995
|
return then ? value.then(then) : value;
|
|
1162
996
|
}
|
|
1163
997
|
|
|
1164
|
-
function _async$
|
|
998
|
+
function _async$8(f) {
|
|
1165
999
|
return function () {
|
|
1166
1000
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1167
1001
|
args[i] = arguments[i];
|
|
@@ -1175,7 +1009,7 @@
|
|
|
1175
1009
|
};
|
|
1176
1010
|
}
|
|
1177
1011
|
|
|
1178
|
-
function _call$
|
|
1012
|
+
function _call$2(body, then, direct) {
|
|
1179
1013
|
if (direct) {
|
|
1180
1014
|
return then ? then(body()) : body();
|
|
1181
1015
|
}
|
|
@@ -1188,7 +1022,7 @@
|
|
|
1188
1022
|
}
|
|
1189
1023
|
}
|
|
1190
1024
|
|
|
1191
|
-
var fetchUsingXHR = _async$
|
|
1025
|
+
var fetchUsingXHR = _async$8(function (url) {
|
|
1192
1026
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
1193
1027
|
signal = _ref.signal,
|
|
1194
1028
|
_ref$method = _ref.method,
|
|
@@ -1272,7 +1106,7 @@
|
|
|
1272
1106
|
}
|
|
1273
1107
|
|
|
1274
1108
|
xhr.send(body);
|
|
1275
|
-
return _await$
|
|
1109
|
+
return _await$8(headersPromise, function () {
|
|
1276
1110
|
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseURL
|
|
1277
1111
|
var responseUrl = "responseURL" in xhr ? xhr.responseURL : headers["x-request-url"];
|
|
1278
1112
|
var responseStatus = xhr.status;
|
|
@@ -1280,7 +1114,7 @@
|
|
|
1280
1114
|
var responseHeaders = getHeadersFromXHR(xhr);
|
|
1281
1115
|
|
|
1282
1116
|
var readBody = function readBody() {
|
|
1283
|
-
return _await$
|
|
1117
|
+
return _await$8(bodyPromise, function () {
|
|
1284
1118
|
var status = xhr.status; // in Chrome on file:/// URLs, status is 0
|
|
1285
1119
|
|
|
1286
1120
|
if (status === 0) {
|
|
@@ -1296,7 +1130,7 @@
|
|
|
1296
1130
|
};
|
|
1297
1131
|
|
|
1298
1132
|
var text = function text() {
|
|
1299
|
-
return _call$
|
|
1133
|
+
return _call$2(readBody, function (_ref2) {
|
|
1300
1134
|
var responseBody = _ref2.responseBody,
|
|
1301
1135
|
responseBodyType = _ref2.responseBodyType;
|
|
1302
1136
|
|
|
@@ -1313,15 +1147,15 @@
|
|
|
1313
1147
|
};
|
|
1314
1148
|
|
|
1315
1149
|
var json = function json() {
|
|
1316
|
-
return _call$
|
|
1150
|
+
return _call$2(text, JSON.parse);
|
|
1317
1151
|
};
|
|
1318
1152
|
|
|
1319
|
-
var blob = _async$
|
|
1153
|
+
var blob = _async$8(function () {
|
|
1320
1154
|
if (!hasBlob) {
|
|
1321
1155
|
throw new Error("blob not supported");
|
|
1322
1156
|
}
|
|
1323
1157
|
|
|
1324
|
-
return _call$
|
|
1158
|
+
return _call$2(readBody, function (_ref3) {
|
|
1325
1159
|
var responseBody = _ref3.responseBody,
|
|
1326
1160
|
responseBodyType = _ref3.responseBodyType;
|
|
1327
1161
|
|
|
@@ -1346,19 +1180,19 @@
|
|
|
1346
1180
|
});
|
|
1347
1181
|
|
|
1348
1182
|
var arrayBuffer = function arrayBuffer() {
|
|
1349
|
-
return _call$
|
|
1183
|
+
return _call$2(readBody, function (_ref4) {
|
|
1350
1184
|
var responseBody = _ref4.responseBody,
|
|
1351
1185
|
responseBodyType = _ref4.responseBodyType;
|
|
1352
|
-
return responseBodyType === "arrayBuffer" ? cloneBuffer(responseBody) : _call$
|
|
1186
|
+
return responseBodyType === "arrayBuffer" ? cloneBuffer(responseBody) : _call$2(blob, blobToArrayBuffer);
|
|
1353
1187
|
});
|
|
1354
1188
|
};
|
|
1355
1189
|
|
|
1356
|
-
var formData = _async$
|
|
1190
|
+
var formData = _async$8(function () {
|
|
1357
1191
|
if (!hasFormData) {
|
|
1358
1192
|
throw new Error("formData not supported");
|
|
1359
1193
|
}
|
|
1360
1194
|
|
|
1361
|
-
return _call$
|
|
1195
|
+
return _call$2(text, textToFormData);
|
|
1362
1196
|
});
|
|
1363
1197
|
|
|
1364
1198
|
return {
|
|
@@ -1534,7 +1368,7 @@
|
|
|
1534
1368
|
return form;
|
|
1535
1369
|
};
|
|
1536
1370
|
|
|
1537
|
-
var blobToArrayBuffer = _async$
|
|
1371
|
+
var blobToArrayBuffer = _async$8(function (blob) {
|
|
1538
1372
|
var reader = new FileReader();
|
|
1539
1373
|
var promise = fileReaderReady(reader);
|
|
1540
1374
|
reader.readAsArrayBuffer(blob);
|
|
@@ -1585,7 +1419,7 @@
|
|
|
1585
1419
|
|
|
1586
1420
|
var _excluded = ["mode"];
|
|
1587
1421
|
|
|
1588
|
-
function _await$
|
|
1422
|
+
function _await$7(value, then, direct) {
|
|
1589
1423
|
if (direct) {
|
|
1590
1424
|
return then ? then(value) : value;
|
|
1591
1425
|
}
|
|
@@ -1597,7 +1431,7 @@
|
|
|
1597
1431
|
return then ? value.then(then) : value;
|
|
1598
1432
|
}
|
|
1599
1433
|
|
|
1600
|
-
function _async$
|
|
1434
|
+
function _async$7(f) {
|
|
1601
1435
|
return function () {
|
|
1602
1436
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1603
1437
|
args[i] = arguments[i];
|
|
@@ -1611,14 +1445,14 @@
|
|
|
1611
1445
|
};
|
|
1612
1446
|
}
|
|
1613
1447
|
|
|
1614
|
-
var fetchNative = _async$
|
|
1448
|
+
var fetchNative = _async$7(function (url) {
|
|
1615
1449
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1616
1450
|
|
|
1617
1451
|
var _ref$mode = _ref.mode,
|
|
1618
1452
|
mode = _ref$mode === void 0 ? "cors" : _ref$mode,
|
|
1619
1453
|
options = _objectWithoutProperties(_ref, _excluded);
|
|
1620
1454
|
|
|
1621
|
-
return _await$
|
|
1455
|
+
return _await$7(window.fetch(url, _objectSpread2({
|
|
1622
1456
|
mode: mode
|
|
1623
1457
|
}, options)), function (response) {
|
|
1624
1458
|
return {
|
|
@@ -1655,7 +1489,7 @@
|
|
|
1655
1489
|
|
|
1656
1490
|
var fetchUrl = typeof window.fetch === "function" && typeof window.AbortController === "function" ? fetchNative : fetchUsingXHR;
|
|
1657
1491
|
|
|
1658
|
-
function _await$
|
|
1492
|
+
function _await$6(value, then, direct) {
|
|
1659
1493
|
if (direct) {
|
|
1660
1494
|
return then ? then(value) : value;
|
|
1661
1495
|
}
|
|
@@ -1667,7 +1501,7 @@
|
|
|
1667
1501
|
return then ? value.then(then) : value;
|
|
1668
1502
|
}
|
|
1669
1503
|
|
|
1670
|
-
function _async$
|
|
1504
|
+
function _async$6(f) {
|
|
1671
1505
|
return function () {
|
|
1672
1506
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1673
1507
|
args[i] = arguments[i];
|
|
@@ -1681,10 +1515,10 @@
|
|
|
1681
1515
|
};
|
|
1682
1516
|
}
|
|
1683
1517
|
|
|
1684
|
-
var fetchJson = _async$
|
|
1518
|
+
var fetchJson = _async$6(function (url) {
|
|
1685
1519
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1686
|
-
return _await$
|
|
1687
|
-
return _await$
|
|
1520
|
+
return _await$6(fetchUrl(url, options), function (response) {
|
|
1521
|
+
return _await$6(response.json());
|
|
1688
1522
|
});
|
|
1689
1523
|
});
|
|
1690
1524
|
/*
|
|
@@ -1946,7 +1780,32 @@
|
|
|
1946
1780
|
return version;
|
|
1947
1781
|
};
|
|
1948
1782
|
|
|
1949
|
-
function
|
|
1783
|
+
var executeWithScriptModuleInjection = function executeWithScriptModuleInjection(code) {
|
|
1784
|
+
var scriptModule = document.createElement("script");
|
|
1785
|
+
scriptModule.type = "module";
|
|
1786
|
+
var loadPromise = new Promise(function (resolve, reject) {
|
|
1787
|
+
scriptModule.onload = function () {
|
|
1788
|
+
document.body.removeChild(scriptModule);
|
|
1789
|
+
resolve();
|
|
1790
|
+
};
|
|
1791
|
+
|
|
1792
|
+
scriptModule.onerror = function () {
|
|
1793
|
+
document.body.removeChild(scriptModule);
|
|
1794
|
+
reject();
|
|
1795
|
+
};
|
|
1796
|
+
|
|
1797
|
+
document.body.appendChild(scriptModule);
|
|
1798
|
+
});
|
|
1799
|
+
scriptModule.src = asBase64Url(code);
|
|
1800
|
+
return loadPromise;
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
var asBase64Url = function asBase64Url(text) {
|
|
1804
|
+
var mimeType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "application/javascript";
|
|
1805
|
+
return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
|
|
1806
|
+
};
|
|
1807
|
+
|
|
1808
|
+
function _await$5(value, then, direct) {
|
|
1950
1809
|
if (direct) {
|
|
1951
1810
|
return then ? then(value) : value;
|
|
1952
1811
|
}
|
|
@@ -1958,7 +1817,21 @@
|
|
|
1958
1817
|
return then ? value.then(then) : value;
|
|
1959
1818
|
}
|
|
1960
1819
|
|
|
1961
|
-
function
|
|
1820
|
+
function _catch$4(body, recover) {
|
|
1821
|
+
try {
|
|
1822
|
+
var result = body();
|
|
1823
|
+
} catch (e) {
|
|
1824
|
+
return recover(e);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
if (result && result.then) {
|
|
1828
|
+
return result.then(void 0, recover);
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
return result;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
function _async$5(f) {
|
|
1962
1835
|
return function () {
|
|
1963
1836
|
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1964
1837
|
args[i] = arguments[i];
|
|
@@ -1972,30 +1845,52 @@
|
|
|
1972
1845
|
};
|
|
1973
1846
|
}
|
|
1974
1847
|
|
|
1975
|
-
function
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1848
|
+
var supportsImportmap = _async$5(function () {
|
|
1849
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1850
|
+
_ref$remote = _ref.remote,
|
|
1851
|
+
remote = _ref$remote === void 0 ? true : _ref$remote;
|
|
1979
1852
|
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1853
|
+
var specifier = asBase64Url("export default false");
|
|
1854
|
+
var importMap = {
|
|
1855
|
+
imports: _defineProperty({}, specifier, asBase64Url("export default true"))
|
|
1856
|
+
};
|
|
1857
|
+
var importmapScript = document.createElement("script");
|
|
1858
|
+
var importmapString = JSON.stringify(importMap, null, " ");
|
|
1859
|
+
importmapScript.type = "importmap";
|
|
1860
|
+
|
|
1861
|
+
if (remote) {
|
|
1862
|
+
importmapScript.src = "data:application/json;base64,".concat(window.btoa(importmapString));
|
|
1863
|
+
} else {
|
|
1864
|
+
importmapScript.textContent = importmapString;
|
|
1985
1865
|
}
|
|
1986
|
-
}
|
|
1987
1866
|
|
|
1988
|
-
|
|
1989
|
-
|
|
1867
|
+
document.body.appendChild(importmapScript);
|
|
1868
|
+
return _catch$4(function () {
|
|
1869
|
+
return _await$5(executeWithScriptModuleInjection("import supported from \"".concat(specifier, "\"; window.__jsenv_runtime_test_importmap__ = supported")), function () {
|
|
1870
|
+
document.body.removeChild(importmapScript);
|
|
1871
|
+
var supported = window.__jsenv_runtime_test_importmap__;
|
|
1872
|
+
delete window.__jsenv_runtime_test_importmap__;
|
|
1873
|
+
return supported;
|
|
1874
|
+
});
|
|
1875
|
+
}, function () {
|
|
1876
|
+
document.body.removeChild(importmapScript);
|
|
1877
|
+
return false;
|
|
1878
|
+
});
|
|
1879
|
+
});
|
|
1990
1880
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1881
|
+
function _await$4(value, then, direct) {
|
|
1882
|
+
if (direct) {
|
|
1883
|
+
return then ? then(value) : value;
|
|
1993
1884
|
}
|
|
1994
1885
|
|
|
1995
|
-
|
|
1886
|
+
if (!value || !value.then) {
|
|
1887
|
+
value = Promise.resolve(value);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
return then ? value.then(then) : value;
|
|
1996
1891
|
}
|
|
1997
1892
|
|
|
1998
|
-
function _catch(body, recover) {
|
|
1893
|
+
function _catch$3(body, recover) {
|
|
1999
1894
|
try {
|
|
2000
1895
|
var result = body();
|
|
2001
1896
|
} catch (e) {
|
|
@@ -2009,177 +1904,175 @@
|
|
|
2009
1904
|
return result;
|
|
2010
1905
|
}
|
|
2011
1906
|
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
topLevelAwait: undefined,
|
|
2034
|
-
jsonImportAssertions: undefined,
|
|
2035
|
-
cssImportAssertions: undefined,
|
|
2036
|
-
newStylesheet: undefined
|
|
2037
|
-
};
|
|
2038
|
-
return _await$1(detectSupportedFeatures({
|
|
2039
|
-
featuresReport: featuresReport,
|
|
2040
|
-
failFastOnFeatureDetection: failFastOnFeatureDetection,
|
|
2041
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML
|
|
2042
|
-
}), function () {
|
|
2043
|
-
return _await$1(adjustMissingFeatureNames(groupInfo, {
|
|
2044
|
-
featuresReport: featuresReport,
|
|
2045
|
-
coverageHandledFromOutside: coverageHandledFromOutside
|
|
2046
|
-
}), function (missingFeatureNames) {
|
|
2047
|
-
var canAvoidCompilation = customCompilerPatterns.length === 0 && missingFeatureNames.length === 0 && featuresReport.importmap && featuresReport.dynamicImport && featuresReport.topLevelAwait;
|
|
2048
|
-
return {
|
|
2049
|
-
canAvoidCompilation: canAvoidCompilation,
|
|
2050
|
-
featuresReport: featuresReport,
|
|
2051
|
-
customCompilerPatterns: customCompilerPatterns,
|
|
2052
|
-
missingFeatureNames: missingFeatureNames,
|
|
2053
|
-
inlineImportMapIntoHTML: inlineImportMapIntoHTML,
|
|
2054
|
-
outDirectoryRelativeUrl: outDirectoryRelativeUrl,
|
|
2055
|
-
compileId: compileId,
|
|
2056
|
-
browser: browser
|
|
2057
|
-
};
|
|
1907
|
+
function _async$4(f) {
|
|
1908
|
+
return function () {
|
|
1909
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
1910
|
+
args[i] = arguments[i];
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
try {
|
|
1914
|
+
return Promise.resolve(f.apply(this, args));
|
|
1915
|
+
} catch (e) {
|
|
1916
|
+
return Promise.reject(e);
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
var supportsDynamicImport = _async$4(function () {
|
|
1922
|
+
var moduleSource = asBase64Url("export default 42");
|
|
1923
|
+
return _catch$3(function () {
|
|
1924
|
+
return _await$4(executeWithScriptModuleInjection("window.__jsenv_runtime_test_dynamic_import__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
1925
|
+
return _await$4(window.__jsenv_runtime_test_dynamic_import__, function (namespace) {
|
|
1926
|
+
delete window.__jsenv_runtime_test_dynamic_import__;
|
|
1927
|
+
return namespace.default === 42;
|
|
2058
1928
|
});
|
|
2059
1929
|
});
|
|
1930
|
+
}, function () {
|
|
1931
|
+
return false;
|
|
2060
1932
|
});
|
|
2061
1933
|
});
|
|
2062
1934
|
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
var missingFeatureNamesCopy = missingFeatureNames.slice();
|
|
1935
|
+
function _await$3(value, then, direct) {
|
|
1936
|
+
if (direct) {
|
|
1937
|
+
return then ? then(value) : value;
|
|
1938
|
+
}
|
|
2068
1939
|
|
|
2069
|
-
|
|
2070
|
-
|
|
1940
|
+
if (!value || !value.then) {
|
|
1941
|
+
value = Promise.resolve(value);
|
|
1942
|
+
}
|
|
2071
1943
|
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
}
|
|
2075
|
-
}; // When instrumentation CAN be handed by playwright
|
|
2076
|
-
// https://playwright.dev/docs/api/class-chromiumcoverage#chromiumcoveragestartjscoverageoptions
|
|
2077
|
-
// coverageHandledFromOutside is true and "transform-instrument" becomes non mandatory
|
|
1944
|
+
return then ? value.then(then) : value;
|
|
1945
|
+
}
|
|
2078
1946
|
|
|
1947
|
+
function _catch$2(body, recover) {
|
|
1948
|
+
try {
|
|
1949
|
+
var result = body();
|
|
1950
|
+
} catch (e) {
|
|
1951
|
+
return recover(e);
|
|
1952
|
+
}
|
|
2079
1953
|
|
|
2080
|
-
if (
|
|
2081
|
-
|
|
1954
|
+
if (result && result.then) {
|
|
1955
|
+
return result.then(void 0, recover);
|
|
2082
1956
|
}
|
|
2083
1957
|
|
|
2084
|
-
return
|
|
2085
|
-
|
|
2086
|
-
return _call(supportsJsonImportAssertions, function (jsonImportAssertions) {
|
|
2087
|
-
featuresReport.jsonImportAssertions = jsonImportAssertions;
|
|
2088
|
-
return _call(supportsCssImportAssertions, function (cssImportAssertions) {
|
|
2089
|
-
featuresReport.cssImportAssertions = cssImportAssertions;
|
|
1958
|
+
return result;
|
|
1959
|
+
}
|
|
2090
1960
|
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
1961
|
+
var supportsTopLevelAwait = function supportsTopLevelAwait() {
|
|
1962
|
+
return _await$3(_catch$2(function () {
|
|
1963
|
+
return _await$3(executeWithScriptModuleInjection("window.__jsenv_runtime_test_top_level_await__ = await Promise.resolve(42)"), function () {
|
|
1964
|
+
var supported = window.__jsenv_runtime_test_top_level_await__ === 42;
|
|
1965
|
+
delete window.__jsenv_runtime_test_top_level_await__;
|
|
1966
|
+
return supported;
|
|
1967
|
+
});
|
|
2097
1968
|
}, function () {
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
markAsSupported("new-stylesheet-as-jsenv-import");
|
|
2102
|
-
}
|
|
1969
|
+
return false;
|
|
1970
|
+
}));
|
|
1971
|
+
};
|
|
2103
1972
|
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
1973
|
+
function _await$2(value, then, direct) {
|
|
1974
|
+
if (direct) {
|
|
1975
|
+
return then ? then(value) : value;
|
|
1976
|
+
}
|
|
2107
1977
|
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML; // start testing importmap support first and not in paralell
|
|
2112
|
-
// so that there is not module script loaded beore importmap is injected
|
|
2113
|
-
// it would log an error in chrome console and return undefined
|
|
1978
|
+
if (!value || !value.then) {
|
|
1979
|
+
value = Promise.resolve(value);
|
|
1980
|
+
}
|
|
2114
1981
|
|
|
2115
|
-
return
|
|
2116
|
-
|
|
2117
|
-
// https://github.com/WICG/import-maps/issues/235
|
|
2118
|
-
// at this stage we won't know if the html file will use
|
|
2119
|
-
// an importmap or not and if that importmap is inline or specified with an src
|
|
2120
|
-
// so we should test if browser support local and remote importmap.
|
|
2121
|
-
// But there exploring server can inline importmap by transforming html
|
|
2122
|
-
// and in that case we can test only the local importmap support
|
|
2123
|
-
// so we test importmap support and the remote one
|
|
2124
|
-
remote: !inlineImportMapIntoHTML
|
|
2125
|
-
}), function (importmap) {
|
|
2126
|
-
featuresReport.importmap = importmap;
|
|
1982
|
+
return then ? value.then(then) : value;
|
|
1983
|
+
}
|
|
2127
1984
|
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
1985
|
+
function _catch$1(body, recover) {
|
|
1986
|
+
try {
|
|
1987
|
+
var result = body();
|
|
1988
|
+
} catch (e) {
|
|
1989
|
+
return recover(e);
|
|
1990
|
+
}
|
|
2131
1991
|
|
|
2132
|
-
|
|
2133
|
-
|
|
1992
|
+
if (result && result.then) {
|
|
1993
|
+
return result.then(void 0, recover);
|
|
1994
|
+
}
|
|
2134
1995
|
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
1996
|
+
return result;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
function _async$3(f) {
|
|
2000
|
+
return function () {
|
|
2001
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2002
|
+
args[i] = arguments[i];
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
try {
|
|
2006
|
+
return Promise.resolve(f.apply(this, args));
|
|
2007
|
+
} catch (e) {
|
|
2008
|
+
return Promise.reject(e);
|
|
2009
|
+
}
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2138
2012
|
|
|
2139
|
-
|
|
2140
|
-
|
|
2013
|
+
var supportsJsonImportAssertions = _async$3(function () {
|
|
2014
|
+
var jsonBase64Url = asBase64Url("42", "application/json");
|
|
2015
|
+
var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\n export default data"));
|
|
2016
|
+
return _catch$1(function () {
|
|
2017
|
+
return _await$2(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2018
|
+
return _await$2(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
|
|
2019
|
+
var supported = namespace.default === 42;
|
|
2020
|
+
delete window.__jsenv_runtime_test_json_import_assertion__;
|
|
2021
|
+
return supported;
|
|
2141
2022
|
});
|
|
2142
2023
|
});
|
|
2024
|
+
}, function () {
|
|
2025
|
+
return false;
|
|
2143
2026
|
});
|
|
2144
2027
|
});
|
|
2145
2028
|
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2029
|
+
function _await$1(value, then, direct) {
|
|
2030
|
+
if (direct) {
|
|
2031
|
+
return then ? then(value) : value;
|
|
2032
|
+
}
|
|
2150
2033
|
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
};
|
|
2155
|
-
var importmapScript = document.createElement("script");
|
|
2156
|
-
var importmapString = JSON.stringify(importMap, null, " ");
|
|
2157
|
-
importmapScript.type = "importmap";
|
|
2034
|
+
if (!value || !value.then) {
|
|
2035
|
+
value = Promise.resolve(value);
|
|
2036
|
+
}
|
|
2158
2037
|
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2038
|
+
return then ? value.then(then) : value;
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
function _catch(body, recover) {
|
|
2042
|
+
try {
|
|
2043
|
+
var result = body();
|
|
2044
|
+
} catch (e) {
|
|
2045
|
+
return recover(e);
|
|
2163
2046
|
}
|
|
2164
2047
|
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
document.body.removeChild(importmapScript);
|
|
2169
|
-
return window.__jsenv_runtime_test_importmap__;
|
|
2170
|
-
});
|
|
2171
|
-
}, function () {
|
|
2172
|
-
document.body.removeChild(importmapScript);
|
|
2173
|
-
return false;
|
|
2174
|
-
});
|
|
2175
|
-
});
|
|
2048
|
+
if (result && result.then) {
|
|
2049
|
+
return result.then(void 0, recover);
|
|
2050
|
+
}
|
|
2176
2051
|
|
|
2177
|
-
|
|
2178
|
-
|
|
2052
|
+
return result;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
function _async$2(f) {
|
|
2056
|
+
return function () {
|
|
2057
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2058
|
+
args[i] = arguments[i];
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
try {
|
|
2062
|
+
return Promise.resolve(f.apply(this, args));
|
|
2063
|
+
} catch (e) {
|
|
2064
|
+
return Promise.reject(e);
|
|
2065
|
+
}
|
|
2066
|
+
};
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
var supportsCssImportAssertions = _async$2(function () {
|
|
2070
|
+
var cssBase64Url = asBase64Url("p { color: red; }", "text/css");
|
|
2071
|
+
var moduleSource = asBase64Url("import css from \"".concat(cssBase64Url, "\" assert { type: \"css\" }\n export default css"));
|
|
2179
2072
|
return _catch(function () {
|
|
2180
|
-
return _await$1(executeWithScriptModuleInjection("window.
|
|
2181
|
-
return _await$1(window.
|
|
2182
|
-
return namespace.default
|
|
2073
|
+
return _await$1(executeWithScriptModuleInjection("window.__jsenv_runtime_test_css_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2074
|
+
return _await$1(window.__jsenv_runtime_test_css_import_assertion__, function (namespace) {
|
|
2075
|
+
return namespace.default instanceof CSSStyleSheet;
|
|
2183
2076
|
});
|
|
2184
2077
|
});
|
|
2185
2078
|
}, function () {
|
|
@@ -2197,93 +2090,158 @@
|
|
|
2197
2090
|
}
|
|
2198
2091
|
};
|
|
2199
2092
|
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
return
|
|
2203
|
-
|
|
2204
|
-
});
|
|
2205
|
-
}, function () {
|
|
2206
|
-
return false;
|
|
2207
|
-
}));
|
|
2208
|
-
}; // to execute in a browser devtools
|
|
2209
|
-
// const featuresReport = {}
|
|
2210
|
-
// await detectSupportedFeatures({ featuresReport, inlineImportMapIntoHTML: true })
|
|
2211
|
-
// console.log(featuresReport)
|
|
2093
|
+
function _await(value, then, direct) {
|
|
2094
|
+
if (direct) {
|
|
2095
|
+
return then ? then(value) : value;
|
|
2096
|
+
}
|
|
2212
2097
|
|
|
2098
|
+
if (!value || !value.then) {
|
|
2099
|
+
value = Promise.resolve(value);
|
|
2100
|
+
}
|
|
2213
2101
|
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
var moduleSource = asBase64Url("import data from \"".concat(jsonBase64Url, "\" assert { type: \"json\" }\nexport default data"));
|
|
2217
|
-
return _catch(function () {
|
|
2218
|
-
return _await$1(executeWithScriptModuleInjection("window.__jsenv_runtime_test_json_import_assertion__ = import(".concat(JSON.stringify(moduleSource), ")")), function () {
|
|
2219
|
-
return _await$1(window.__jsenv_runtime_test_json_import_assertion__, function (namespace) {
|
|
2220
|
-
return namespace.default === 42;
|
|
2221
|
-
});
|
|
2222
|
-
});
|
|
2223
|
-
}, function () {
|
|
2224
|
-
return false;
|
|
2225
|
-
});
|
|
2226
|
-
});
|
|
2102
|
+
return then ? value.then(then) : value;
|
|
2103
|
+
}
|
|
2227
2104
|
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2105
|
+
function _async$1(f) {
|
|
2106
|
+
return function () {
|
|
2107
|
+
for (var args = [], i = 0; i < arguments.length; i++) {
|
|
2108
|
+
args[i] = arguments[i];
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
try {
|
|
2112
|
+
return Promise.resolve(f.apply(this, args));
|
|
2113
|
+
} catch (e) {
|
|
2114
|
+
return Promise.reject(e);
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
|
|
2119
|
+
function _call$1(body, then, direct) {
|
|
2120
|
+
if (direct) {
|
|
2121
|
+
return then ? then(body()) : body();
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
try {
|
|
2125
|
+
var result = Promise.resolve(body());
|
|
2126
|
+
return then ? result.then(then) : result;
|
|
2127
|
+
} catch (e) {
|
|
2128
|
+
return Promise.reject(e);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
var scanBrowserRuntimeFeatures = _async$1(function () {
|
|
2133
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
2134
|
+
_ref$coverageHandledF = _ref.coverageHandledFromOutside,
|
|
2135
|
+
coverageHandledFromOutside = _ref$coverageHandledF === void 0 ? false : _ref$coverageHandledF,
|
|
2136
|
+
_ref$forceCompilation = _ref.forceCompilation,
|
|
2137
|
+
forceCompilation = _ref$forceCompilation === void 0 ? false : _ref$forceCompilation,
|
|
2138
|
+
_ref$forceSource = _ref.forceSource,
|
|
2139
|
+
forceSource = _ref$forceSource === void 0 ? false : _ref$forceSource;
|
|
2140
|
+
|
|
2141
|
+
var jsenvCompileProfileUrl = "/__jsenv_compile_profile__";
|
|
2142
|
+
return _await(fetchJson(jsenvCompileProfileUrl), function (_ref2) {
|
|
2143
|
+
var jsenvDirectoryRelativeUrl = _ref2.jsenvDirectoryRelativeUrl,
|
|
2144
|
+
inlineImportMapIntoHTML = _ref2.inlineImportMapIntoHTML;
|
|
2145
|
+
|
|
2146
|
+
var _detectBrowser = detectBrowser(),
|
|
2147
|
+
name = _detectBrowser.name,
|
|
2148
|
+
version = _detectBrowser.version;
|
|
2149
|
+
|
|
2150
|
+
return _await(detectSupportedFeatures({
|
|
2151
|
+
coverageHandledFromOutside: coverageHandledFromOutside,
|
|
2152
|
+
inlineImportMapIntoHTML: inlineImportMapIntoHTML
|
|
2153
|
+
}), function (featuresReport) {
|
|
2154
|
+
var runtimeReport = {
|
|
2155
|
+
env: {
|
|
2156
|
+
browser: true
|
|
2157
|
+
},
|
|
2158
|
+
name: name,
|
|
2159
|
+
version: version,
|
|
2160
|
+
featuresReport: featuresReport,
|
|
2161
|
+
forceSource: forceSource,
|
|
2162
|
+
forceCompilation: forceCompilation
|
|
2163
|
+
};
|
|
2164
|
+
return _await(fetchJson(jsenvCompileProfileUrl, {
|
|
2165
|
+
method: "POST",
|
|
2166
|
+
headers: {
|
|
2167
|
+
"content-type": "application/json"
|
|
2168
|
+
},
|
|
2169
|
+
body: JSON.stringify(runtimeReport)
|
|
2170
|
+
}), function (_ref3) {
|
|
2171
|
+
var compileProfile = _ref3.compileProfile,
|
|
2172
|
+
compileId = _ref3.compileId;
|
|
2173
|
+
return {
|
|
2174
|
+
jsenvDirectoryRelativeUrl: jsenvDirectoryRelativeUrl,
|
|
2175
|
+
inlineImportMapIntoHTML: inlineImportMapIntoHTML,
|
|
2176
|
+
compileProfile: compileProfile,
|
|
2177
|
+
compileId: compileId,
|
|
2178
|
+
runtimeReport: runtimeReport
|
|
2179
|
+
};
|
|
2235
2180
|
});
|
|
2236
2181
|
});
|
|
2237
|
-
}, function () {
|
|
2238
|
-
return false;
|
|
2239
2182
|
});
|
|
2240
2183
|
});
|
|
2241
2184
|
|
|
2242
|
-
var
|
|
2243
|
-
var
|
|
2244
|
-
|
|
2245
|
-
var
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2185
|
+
var detectSupportedFeatures = _async$1(function (_ref4) {
|
|
2186
|
+
var coverageHandledFromOutside = _ref4.coverageHandledFromOutside,
|
|
2187
|
+
inlineImportMapIntoHTML = _ref4.inlineImportMapIntoHTML;
|
|
2188
|
+
var featuresReport = {};
|
|
2189
|
+
featuresReport["import_http"] = true;
|
|
2190
|
+
featuresReport["coverage_js"] = coverageHandledFromOutside; // new CSSStyleSheet
|
|
2191
|
+
|
|
2192
|
+
featuresReport["new_stylesheet"] = supportsNewStylesheet(); // importmap
|
|
2193
|
+
// start testing importmap support first and not in paralell
|
|
2194
|
+
// so that there is not module script loaded beore importmap is injected
|
|
2195
|
+
// it would log an error in chrome console and return undefined
|
|
2250
2196
|
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2197
|
+
return _await(supportsImportmap({
|
|
2198
|
+
// chrome supports inline but not remote importmap
|
|
2199
|
+
// https://github.com/WICG/import-maps/issues/235
|
|
2200
|
+
// at this stage we won't know if the html file will use
|
|
2201
|
+
// an importmap or not and if that importmap is inline or specified with an src
|
|
2202
|
+
// so we should test if browser support local and remote importmap.
|
|
2203
|
+
// But there exploring server can inline importmap by transforming html
|
|
2204
|
+
// and in that case we can test only the local importmap support
|
|
2205
|
+
// so we test importmap support and the remote one
|
|
2206
|
+
remote: !inlineImportMapIntoHTML
|
|
2207
|
+
}), function (_supportsImportmap) {
|
|
2208
|
+
featuresReport.importmap = _supportsImportmap; // dynamic import
|
|
2255
2209
|
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
scriptModule.src = asBase64Url(code);
|
|
2259
|
-
return loadPromise;
|
|
2260
|
-
};
|
|
2210
|
+
return _call$1(supportsDynamicImport, function (_supportsDynamicImpor) {
|
|
2211
|
+
featuresReport["import_dynamic"] = _supportsDynamicImpor; // top level await
|
|
2261
2212
|
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
return "data:".concat(mimeType, ";base64,").concat(window.btoa(text));
|
|
2265
|
-
}; // const cssImportAssertions = await supportsCssImportAssertions()
|
|
2266
|
-
// console.log({ cssImportAssertions })
|
|
2213
|
+
return _call$1(supportsTopLevelAwait, function (_supportsTopLevelAwai) {
|
|
2214
|
+
featuresReport["top_level_await"] = _supportsTopLevelAwai; // import assertions
|
|
2267
2215
|
|
|
2216
|
+
return _call$1(supportsJsonImportAssertions, function (_supportsJsonImportAs) {
|
|
2217
|
+
featuresReport["import_assertion_type_json"] = _supportsJsonImportAs;
|
|
2218
|
+
return _call$1(supportsCssImportAssertions, function (_supportsCssImportAss) {
|
|
2219
|
+
featuresReport["import_assertion_type_css"] = _supportsCssImportAss;
|
|
2220
|
+
return featuresReport;
|
|
2221
|
+
});
|
|
2222
|
+
});
|
|
2223
|
+
});
|
|
2224
|
+
});
|
|
2225
|
+
});
|
|
2226
|
+
});
|
|
2268
2227
|
|
|
2269
|
-
function
|
|
2228
|
+
function _call(body, then, direct) {
|
|
2270
2229
|
if (direct) {
|
|
2271
|
-
return then ? then(
|
|
2230
|
+
return then ? then(body()) : body();
|
|
2272
2231
|
}
|
|
2273
2232
|
|
|
2274
|
-
|
|
2275
|
-
|
|
2233
|
+
try {
|
|
2234
|
+
var result = Promise.resolve(body());
|
|
2235
|
+
return then ? result.then(then) : result;
|
|
2236
|
+
} catch (e) {
|
|
2237
|
+
return Promise.reject(e);
|
|
2276
2238
|
}
|
|
2277
|
-
|
|
2278
|
-
return then ? value.then(then) : value;
|
|
2279
2239
|
}
|
|
2280
2240
|
|
|
2281
2241
|
var redirect = _async(function () {
|
|
2282
2242
|
var redirectTarget = new URLSearchParams(window.location.search).get("redirect");
|
|
2283
|
-
return
|
|
2284
|
-
|
|
2285
|
-
}), function (browserRuntimeFeaturesReport) {
|
|
2286
|
-
var href = "".concat(getDirectoryUrl(browserRuntimeFeaturesReport)).concat(redirectTarget); // It's IMPORTANT to use location.replace and NOT location.href = url
|
|
2243
|
+
return _call(scanBrowserRuntimeFeatures, function (browserRuntimeProfile) {
|
|
2244
|
+
var href = "".concat(getDirectoryUrl(browserRuntimeProfile)).concat(redirectTarget); // It's IMPORTANT to use location.replace and NOT location.href = url
|
|
2287
2245
|
// otherwise it would break the back button
|
|
2288
2246
|
|
|
2289
2247
|
window.location.replace(href);
|
|
@@ -2305,15 +2263,14 @@
|
|
|
2305
2263
|
}
|
|
2306
2264
|
|
|
2307
2265
|
var getDirectoryUrl = function getDirectoryUrl(_ref) {
|
|
2308
|
-
var
|
|
2309
|
-
outDirectoryRelativeUrl = _ref.outDirectoryRelativeUrl,
|
|
2266
|
+
var jsenvDirectoryRelativeUrl = _ref.jsenvDirectoryRelativeUrl,
|
|
2310
2267
|
compileId = _ref.compileId;
|
|
2311
2268
|
|
|
2312
|
-
if (
|
|
2313
|
-
return "/";
|
|
2269
|
+
if (compileId) {
|
|
2270
|
+
return "/".concat(jsenvDirectoryRelativeUrl).concat(compileId, "/");
|
|
2314
2271
|
}
|
|
2315
2272
|
|
|
2316
|
-
return "/"
|
|
2273
|
+
return "/";
|
|
2317
2274
|
};
|
|
2318
2275
|
|
|
2319
2276
|
redirect();
|
|
@@ -2321,7 +2278,7 @@
|
|
|
2321
2278
|
};
|
|
2322
2279
|
});
|
|
2323
2280
|
|
|
2324
|
-
//# sourceMappingURL=redirector.
|
|
2281
|
+
//# sourceMappingURL=redirector.html__inline__12_009c47c7.js.map</script>
|
|
2325
2282
|
|
|
2326
2283
|
|
|
2327
2284
|
</body></html>
|