@jsenv/core 24.6.5 → 25.0.0-alpha.3
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 -1
- package/dist/browser_runtime/{browser_runtime-bb0e3aa4.js → browser_runtime_91c5a3b8.js} +137 -26
- package/dist/browser_runtime/browser_runtime_91c5a3b8.js.map +1089 -0
- package/dist/build_manifest.js +6 -6
- package/dist/compile_proxy/asset-manifest.json +2 -1
- package/dist/compile_proxy/{compile_proxy-6eb67db4.html → compile_proxy_7ad5faa6.html} +119 -26
- package/dist/compile_proxy/{compile_proxy.html__inline__20-9e168143.js.map → compile_proxy_e3b0c442_809f35f7.js.map} +6 -6
- package/dist/event_source_client/asset-manifest.json +2 -1
- package/dist/event_source_client/{event_source_client-9f14c8b9.js → event_source_client_80644aee.js} +2 -2
- package/dist/event_source_client/{event_source_client-9f14c8b9.js.map → event_source_client_80644aee.js.map} +4 -3
- package/dist/redirector/asset-manifest.json +2 -1
- package/dist/redirector/{redirector.html__inline__15-3a34a156.js.map → redirector_e3b0c442_e391410e.js.map} +6 -6
- package/dist/redirector/{redirector-b6ad84bf.html → redirector_eb92e8a7.html} +119 -26
- package/dist/toolbar/asset-manifest.json +11 -10
- package/dist/toolbar/assets/{compilation.css-209d68b4.map → compilation.css_e37c747b.map} +1 -1
- package/dist/toolbar/assets/{eventsource.css-38cd0a36.map → eventsource.css_c0c71e7b.map} +1 -1
- package/dist/toolbar/assets/{execution.css-0ebe522f.map → execution.css_f3377c10.map} +1 -1
- package/dist/toolbar/assets/{focus.css-3f9c156d.map → focus.css_896f3e45.map} +1 -1
- package/dist/toolbar/assets/{light-theme.css-78b19a80.map → light-theme.css_72a60fa3.map} +1 -1
- package/dist/toolbar/assets/{overflow-menu.css-d9688a1c.map → overflow-menu.css_2859d519.map} +1 -1
- package/dist/toolbar/assets/{settings.css-2b81b245.map → settings.css_61548139.map} +1 -1
- package/dist/toolbar/assets/{toolbar.main.css-846920e9.map → toolbar.main.css_269d7ce2.map} +9 -9
- package/dist/toolbar/assets/{tooltip.css-03395ee6.map → tooltip.css_a94a8bdd.map} +1 -1
- package/dist/toolbar/{toolbar.main-a5ef2c60.js.map → toolbar.main2_6c1b3d82.js.map} +8 -8
- package/dist/toolbar/{toolbar-1fbf8dcb.html → toolbar_04ba410c.html} +129 -36
- package/dist/toolbar_injector/asset-manifest.json +3 -2
- package/dist/toolbar_injector/assets/{jsenv-logo-188b9ca6.svg → jsenv-logo_188b9ca6.svg} +0 -0
- package/dist/toolbar_injector/{toolbar_injector-997dbaa0.js → toolbar_injector_4a48bc53.js} +3 -3
- package/dist/toolbar_injector/{toolbar_injector-997dbaa0.js.map → toolbar_injector_4a48bc53.js.map} +2 -2
- package/package.json +5 -4
- package/readme.md +24 -91
- package/src/buildProject.js +51 -27
- package/src/dev_server.js +8 -2
- package/src/execute.js +7 -1
- package/src/executeTestPlan.js +17 -0
- package/src/internal/browser_feature_detection/browser_feature_detection.js +18 -25
- package/src/internal/browser_runtime/browser_runtime.js +2 -2
- package/src/internal/browser_runtime/createBrowserRuntime.js +1 -1
- package/src/internal/browser_runtime/displayErrorInDocument.js +2 -0
- package/src/internal/browser_runtime/displayErrorNotification.js +1 -1
- package/src/internal/building/buildUsingRollup.js +12 -15
- package/src/internal/building/build_logs.js +2 -2
- package/src/internal/building/build_stats.js +11 -1
- package/src/internal/building/html/parseHtmlRessource.js +2 -26
- package/src/internal/building/js/parseJsRessource.js +3 -2
- package/src/internal/building/json_module.js +11 -0
- package/src/internal/building/parseRessource.js +1 -1
- package/src/internal/building/ressource_builder.js +210 -216
- package/src/internal/building/rollup_plugin_jsenv.js +554 -378
- package/src/internal/building/url_loader.js +8 -145
- package/src/internal/building/url_versioning.js +220 -0
- package/src/internal/compiling/compileHtml.js +8 -1
- package/src/internal/compiling/createCompiledFileService.js +28 -40
- package/src/internal/compiling/html_source_file_service.js +66 -51
- package/src/internal/compiling/js-compilation-service/babel_plugin_systemjs_prepend.js +23 -0
- package/src/internal/compiling/js-compilation-service/jsenvTransform.js +16 -12
- package/src/internal/compiling/js-compilation-service/transformJs.js +2 -0
- package/src/internal/compiling/jsenvCompilerForHtml.js +43 -44
- package/src/internal/compiling/jsenvCompilerForImportmap.js +15 -76
- package/src/internal/compiling/jsenvCompilerForJavaScript.js +9 -0
- package/src/internal/compiling/startCompileServer.js +29 -5
- package/src/internal/dev_server/event_source_client/livereload_preference.js +1 -1
- package/src/internal/dev_server/toolbar/compilation/toolbar.compilation.js +9 -9
- package/src/internal/executing/executePlan.js +6 -0
- package/src/internal/generateGroupMap/{jsenvBabelPluginCompatMap.js → babel_plugins_compatibility.js} +0 -0
- package/src/internal/generateGroupMap/{featuresCompatMap.js → features_compatibility.js} +9 -1
- package/src/internal/generateGroupMap/generateGroupMap.js +6 -35
- package/src/internal/generateGroupMap/one_runtime_compat.js +9 -12
- package/src/internal/generateGroupMap/runtime_compat.js +10 -15
- package/src/internal/generateGroupMap/runtime_compat_composition.js +2 -2
- package/src/internal/generateGroupMap/shake_babel_plugin_map.js +21 -0
- package/src/internal/import-resolution/importmap_default.js +52 -0
- package/src/internal/node_feature_detection/node_feature_detection.js +25 -19
- package/src/internal/runtime/s.js +101 -6
- package/src/internal/unevalException.js +1 -1
- package/src/jsenvServiceWorkerFinalizer.js +12 -17
- package/dist/browser_runtime/browser_runtime-bb0e3aa4.js.map +0 -1067
- package/src/internal/building/asset_url_versioning.js +0 -50
- package/src/internal/building/rollup_build_sourcemap.js +0 -54
- package/src/internal/building/url-versioning.js +0 -96
- package/src/internal/generateGroupMap/jsenvPluginCompatMap.js +0 -1
- package/src/internal/import-resolution/importmap-default.js +0 -34
- package/src/internal/renderNamePattern.js +0 -6
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
(function () {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var nativeTypeOf = function nativeTypeOf(obj) {
|
|
5
|
+
return typeof obj;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
var customTypeOf = function customTypeOf(obj) {
|
|
9
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? nativeTypeOf : customTypeOf;
|
|
13
|
+
|
|
4
14
|
var _defineProperty = (function (obj, key, value) {
|
|
5
15
|
// Shortcircuit the slow defineProperty path when possible.
|
|
6
16
|
// We are trying to avoid issues where setters defined on the
|
|
@@ -118,16 +128,6 @@
|
|
|
118
128
|
return "".concat(name, ": ").concat(message).concat(stackString);
|
|
119
129
|
};
|
|
120
130
|
|
|
121
|
-
var nativeTypeOf = function nativeTypeOf(obj) {
|
|
122
|
-
return typeof obj;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var customTypeOf = function customTypeOf(obj) {
|
|
126
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? nativeTypeOf : customTypeOf;
|
|
130
|
-
|
|
131
131
|
/* eslint-env browser, node */
|
|
132
132
|
var parseDataUrl = function parseDataUrl(dataUrl) {
|
|
133
133
|
var afterDataProtocol = dataUrl.slice("data:".length);
|
|
@@ -2500,7 +2500,7 @@
|
|
|
2500
2500
|
};
|
|
2501
2501
|
|
|
2502
2502
|
var unevalException = function unevalException(value) {
|
|
2503
|
-
if (value.hasOwnProperty("toString")) {
|
|
2503
|
+
if (value && value.hasOwnProperty("toString")) {
|
|
2504
2504
|
delete value.toString;
|
|
2505
2505
|
}
|
|
2506
2506
|
|
|
@@ -2576,6 +2576,8 @@
|
|
|
2576
2576
|
}
|
|
2577
2577
|
} else if (typeof error === "string") {
|
|
2578
2578
|
html = error;
|
|
2579
|
+
} else if (error === undefined) {
|
|
2580
|
+
html = "undefined";
|
|
2579
2581
|
} else {
|
|
2580
2582
|
html = JSON.stringify(error);
|
|
2581
2583
|
}
|
|
@@ -2721,7 +2723,7 @@
|
|
|
2721
2723
|
if (Notification.permission === "granted") {
|
|
2722
2724
|
var notification = new Notification("An error occured", {
|
|
2723
2725
|
lang: "en",
|
|
2724
|
-
body: error.stack,
|
|
2726
|
+
body: error ? error.stack : "undefined",
|
|
2725
2727
|
icon: icon
|
|
2726
2728
|
});
|
|
2727
2729
|
|
|
@@ -4029,7 +4031,9 @@
|
|
|
4029
4031
|
scopes: {},
|
|
4030
4032
|
depcache: {},
|
|
4031
4033
|
integrity: {}
|
|
4032
|
-
};
|
|
4034
|
+
};
|
|
4035
|
+
systemJSPrototype.importMap = importMap;
|
|
4036
|
+
systemJSPrototype.baseUrl = baseUrl; // Scripts are processed immediately, on the first System.import, and on DOMReady.
|
|
4033
4037
|
// Import map scripts are processed only once (by being marked) and in order for each phase.
|
|
4034
4038
|
// This is to avoid using DOM mutation observers in core, although that would be an alternative.
|
|
4035
4039
|
|
|
@@ -4089,6 +4093,7 @@
|
|
|
4089
4093
|
return fetchPromise;
|
|
4090
4094
|
}).then(function (text) {
|
|
4091
4095
|
extendImportMap(importMap, text, script.src || baseUrl);
|
|
4096
|
+
return importMap;
|
|
4092
4097
|
});
|
|
4093
4098
|
}
|
|
4094
4099
|
});
|
|
@@ -4105,11 +4110,12 @@
|
|
|
4105
4110
|
|
|
4106
4111
|
resolveAndComposeImportMap(newMap, newMapUrl, importMap);
|
|
4107
4112
|
}
|
|
4113
|
+
|
|
4114
|
+
System.extendImportMap = extendImportMap;
|
|
4108
4115
|
/*
|
|
4109
4116
|
* Script instantiation loading
|
|
4110
4117
|
*/
|
|
4111
4118
|
|
|
4112
|
-
|
|
4113
4119
|
if (hasDocument) {
|
|
4114
4120
|
window.addEventListener('error', function (evt) {
|
|
4115
4121
|
lastWindowErrorUrl = evt.filename;
|
|
@@ -4258,20 +4264,32 @@
|
|
|
4258
4264
|
*/
|
|
4259
4265
|
|
|
4260
4266
|
|
|
4261
|
-
if (hasSelf && typeof importScripts === 'function')
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4267
|
+
if (hasSelf && typeof importScripts === 'function') {
|
|
4268
|
+
systemJSPrototype.instantiate = function (url) {
|
|
4269
|
+
var loader = this;
|
|
4270
|
+
return self.fetch(url, {
|
|
4271
|
+
credentials: 'same-origin'
|
|
4272
|
+
}).then(function (response) {
|
|
4273
|
+
if (!response.ok) {
|
|
4274
|
+
throw Error(errMsg(7, [response.status, response.statusText, url].join(', ')));
|
|
4275
|
+
}
|
|
4276
|
+
|
|
4277
|
+
return response.text();
|
|
4278
|
+
}).then(function (source) {
|
|
4279
|
+
if (source.indexOf('//# sourceURL=') < 0) source += '\n//# sourceURL=' + url;
|
|
4280
|
+
(0, eval)(source);
|
|
4281
|
+
return loader.getRegister(url);
|
|
4282
|
+
});
|
|
4283
|
+
};
|
|
4284
|
+
}
|
|
4268
4285
|
})();
|
|
4269
4286
|
|
|
4270
4287
|
(function () {
|
|
4271
4288
|
var envGlobal = typeof self !== 'undefined' ? self : global;
|
|
4272
4289
|
var System = envGlobal.System;
|
|
4273
|
-
var register = System.register;
|
|
4274
4290
|
var registerRegistry = Object.create(null);
|
|
4291
|
+
var register = System.register;
|
|
4292
|
+
System.registerRegistry = registerRegistry;
|
|
4275
4293
|
|
|
4276
4294
|
System.register = function (name, deps, declare) {
|
|
4277
4295
|
if (typeof name !== 'string') return register.apply(this, arguments);
|
|
@@ -4306,6 +4324,99 @@
|
|
|
4306
4324
|
};
|
|
4307
4325
|
})();
|
|
4308
4326
|
|
|
4327
|
+
(function () {
|
|
4328
|
+
// worker or service worker
|
|
4329
|
+
if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) {
|
|
4330
|
+
var importMapFromParentPromise = new Promise(function (resolve) {
|
|
4331
|
+
var importmapMessageCallback = function importmapMessageCallback(e) {
|
|
4332
|
+
if (e.data === "__importmap_init__") {
|
|
4333
|
+
self.removeEventListener("message", importmapMessageCallback);
|
|
4334
|
+
|
|
4335
|
+
e.ports[0].onmessage = function (message) {
|
|
4336
|
+
resolve(message.data);
|
|
4337
|
+
};
|
|
4338
|
+
|
|
4339
|
+
e.ports[0].postMessage('__importmap_request__');
|
|
4340
|
+
}
|
|
4341
|
+
};
|
|
4342
|
+
|
|
4343
|
+
self.addEventListener("message", importmapMessageCallback);
|
|
4344
|
+
}); // var prepareImport = System.prepareImport
|
|
4345
|
+
|
|
4346
|
+
System.prepareImport = function () {
|
|
4347
|
+
return importMapFromParentPromise.then(function (importmap) {
|
|
4348
|
+
System.extendImportMap(System.importMap, JSON.stringify(importmap), System.baseUrl);
|
|
4349
|
+
});
|
|
4350
|
+
}; // auto import first register
|
|
4351
|
+
|
|
4352
|
+
|
|
4353
|
+
var messageEvents = [];
|
|
4354
|
+
|
|
4355
|
+
var messageCallback = function messageCallback(event) {
|
|
4356
|
+
messageEvents.push(event);
|
|
4357
|
+
};
|
|
4358
|
+
|
|
4359
|
+
self.addEventListener('message', messageCallback);
|
|
4360
|
+
var register = System.register;
|
|
4361
|
+
|
|
4362
|
+
System.register = function (deps, declare) {
|
|
4363
|
+
System.register = register;
|
|
4364
|
+
System.registerRegistry[self.location.href] = [deps, declare];
|
|
4365
|
+
System.import(self.location.href).then(function () {
|
|
4366
|
+
self.removeEventListener('message', messageCallback);
|
|
4367
|
+
messageEvents.forEach(function (messageEvent) {
|
|
4368
|
+
self.dispatchEvent(messageEvent);
|
|
4369
|
+
});
|
|
4370
|
+
messageEvents = null;
|
|
4371
|
+
});
|
|
4372
|
+
};
|
|
4373
|
+
} else if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object') {
|
|
4374
|
+
var WorkerConstructor = window.Worker;
|
|
4375
|
+
|
|
4376
|
+
if (typeof WorkerConstructor === 'function') {
|
|
4377
|
+
window.Worker = function (url, options) {
|
|
4378
|
+
var worker = new WorkerConstructor(url, options);
|
|
4379
|
+
var importmapChannel = new MessageChannel();
|
|
4380
|
+
|
|
4381
|
+
importmapChannel.port1.onmessage = function (message) {
|
|
4382
|
+
System.prepareImport().then(function (importmap) {
|
|
4383
|
+
message.target.postMessage(importmap);
|
|
4384
|
+
});
|
|
4385
|
+
};
|
|
4386
|
+
|
|
4387
|
+
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
4388
|
+
return worker;
|
|
4389
|
+
};
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
var serviceWorker = navigator.serviceWorker;
|
|
4393
|
+
|
|
4394
|
+
if (serviceWorker) {
|
|
4395
|
+
var register = serviceWorker.register;
|
|
4396
|
+
|
|
4397
|
+
serviceWorker.register = function (url, options) {
|
|
4398
|
+
var registrationPromise = register.call(this, url, options);
|
|
4399
|
+
registrationPromise.then(function (registration) {
|
|
4400
|
+
var installing = registration.installing;
|
|
4401
|
+
var waiting = registration.waiting;
|
|
4402
|
+
var active = registration.active;
|
|
4403
|
+
var worker = installing || waiting || active;
|
|
4404
|
+
var importmapChannel = new MessageChannel();
|
|
4405
|
+
|
|
4406
|
+
importmapChannel.port1.onmessage = function (message) {
|
|
4407
|
+
System.prepareImport().then(function (importmap) {
|
|
4408
|
+
message.target.postMessage(importmap);
|
|
4409
|
+
});
|
|
4410
|
+
};
|
|
4411
|
+
|
|
4412
|
+
worker.postMessage('__importmap_init__', [importmapChannel.port2]);
|
|
4413
|
+
});
|
|
4414
|
+
return registrationPromise;
|
|
4415
|
+
};
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
})();
|
|
4419
|
+
|
|
4309
4420
|
/* eslint-env browser */
|
|
4310
4421
|
|
|
4311
4422
|
function _await$2(value, then, direct) {
|
|
@@ -4763,7 +4874,7 @@
|
|
|
4763
4874
|
var compileDirectoryRelativeUrl = "".concat(outDirectoryRelativeUrl).concat(compileId, "/"); // if there is an importmap in the document we use it instead of fetching.
|
|
4764
4875
|
// systemjs style with systemjs-importmap
|
|
4765
4876
|
|
|
4766
|
-
var importmapScript = document.querySelector("script[type=\"
|
|
4877
|
+
var importmapScript = document.querySelector("script[type=\"systemjs-importmap\"]");
|
|
4767
4878
|
var importMap;
|
|
4768
4879
|
var importMapUrl;
|
|
4769
4880
|
return _invoke$1(function () {
|
|
@@ -5076,12 +5187,12 @@
|
|
|
5076
5187
|
errorExposureInDocument = _ref$errorExposureInD === void 0 ? true : _ref$errorExposureInD;
|
|
5077
5188
|
var error = executionResult.error;
|
|
5078
5189
|
|
|
5079
|
-
if (error.code === "NETWORK_FAILURE") {
|
|
5190
|
+
if (error && error.code === "NETWORK_FAILURE") {
|
|
5080
5191
|
if (currentScript) {
|
|
5081
5192
|
var errorEvent = new Event("error");
|
|
5082
5193
|
currentScript.dispatchEvent(errorEvent);
|
|
5083
5194
|
}
|
|
5084
|
-
} else {
|
|
5195
|
+
} else if (_typeof(error) === "object") {
|
|
5085
5196
|
var parsingError = error.parsingError;
|
|
5086
5197
|
var globalErrorEvent = new Event("error");
|
|
5087
5198
|
|
|
@@ -5185,4 +5296,4 @@
|
|
|
5185
5296
|
|
|
5186
5297
|
})();
|
|
5187
5298
|
|
|
5188
|
-
//# sourceMappingURL=
|
|
5299
|
+
//# sourceMappingURL=browser_runtime_91c5a3b8.js.map
|