@jsenv/core 28.0.0 → 28.1.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/controllable_child_process.mjs +1 -2
- package/dist/controllable_worker_thread.mjs +1 -2
- package/dist/js/autoreload.js +27 -11
- package/dist/js/execute_using_dynamic_import.js +804 -1
- package/dist/js/script_type_module_supervisor.js +129 -0
- package/dist/js/supervisor.js +921 -0
- package/dist/js/{wrapper.mjs → ws.js} +0 -0
- package/dist/main.js +555 -616
- package/package.json +13 -13
- package/readme.md +2 -2
- package/src/build/build.js +8 -8
- package/src/build/inject_global_version_mappings.js +3 -3
- package/src/build/{resync_ressource_hints.js → resync_resource_hints.js} +10 -12
- package/src/build/start_build_server.js +4 -7
- package/src/dev/start_dev_server.js +2 -2
- package/src/execute/execute.js +1 -1
- package/src/execute/run.js +26 -38
- package/src/execute/runtimes/browsers/from_playwright.js +51 -77
- package/src/execute/runtimes/node/node_child_process.js +36 -36
- package/src/execute/runtimes/node/node_worker_thread.js +36 -36
- package/src/omega/kitchen.js +33 -14
- package/src/omega/omega_server.js +2 -2
- package/src/omega/server/file_service.js +5 -5
- package/src/omega/url_graph/url_graph_load.js +4 -4
- package/src/omega/url_graph/url_info_transformations.js +8 -1
- package/src/omega/url_graph.js +3 -3
- package/src/plugins/autoreload/client/reload.js +22 -9
- package/src/plugins/autoreload/jsenv_plugin_autoreload_client.js +5 -5
- package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +3 -3
- package/src/plugins/autoreload/jsenv_plugin_hmr.js +1 -1
- package/src/plugins/explorer/jsenv_plugin_explorer.js +1 -1
- package/src/plugins/import_meta_hot/html_hot_dependencies.js +6 -6
- package/src/plugins/importmap/jsenv_plugin_importmap.js +5 -3
- package/src/plugins/inject_globals/inject_globals.js +3 -3
- package/src/plugins/inline/jsenv_plugin_data_urls.js +1 -1
- package/src/plugins/inline/jsenv_plugin_html_inline_content.js +10 -5
- package/src/plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +2 -13
- package/src/plugins/plugin_controller.js +2 -2
- package/src/plugins/plugins.js +5 -5
- package/src/plugins/server_events/jsenv_plugin_server_events_client_injection.js +4 -4
- package/src/plugins/supervisor/client/script_type_module_supervisor.js +108 -0
- package/src/plugins/supervisor/client/supervisor.js +921 -0
- package/src/plugins/{html_supervisor/jsenv_plugin_html_supervisor.js → supervisor/jsenv_plugin_supervisor.js} +131 -105
- package/src/plugins/toolbar/client/execution/toolbar_execution.js +1 -1
- package/src/plugins/toolbar/jsenv_plugin_toolbar.js +5 -5
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic.js +9 -7
- package/src/plugins/transpilation/as_js_classic/jsenv_plugin_as_js_classic_html.js +8 -7
- package/src/plugins/transpilation/babel/jsenv_plugin_babel.js +13 -7
- package/src/plugins/transpilation/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +6 -4
- package/src/plugins/transpilation/jsenv_plugin_transpilation.js +4 -2
- package/src/plugins/url_analysis/html/html_urls.js +13 -12
- package/src/plugins/url_analysis/jsenv_plugin_url_analysis.js +1 -1
- package/src/test/coverage/babel_plugin_instrument.js +1 -35
- package/src/test/coverage/empty_coverage_factory.js +1 -1
- package/src/test/execute_plan.js +7 -3
- package/src/test/execute_test_plan.js +2 -1
- package/src/test/logs_file_execution.js +49 -8
- package/dist/js/html_supervisor_installer.js +0 -1091
- package/dist/js/html_supervisor_setup.js +0 -89
- package/dist/js/uneval.js +0 -804
- package/src/plugins/html_supervisor/client/error_formatter.js +0 -426
- package/src/plugins/html_supervisor/client/error_in_notification.js +0 -21
- package/src/plugins/html_supervisor/client/error_overlay.js +0 -191
- package/src/plugins/html_supervisor/client/html_supervisor_installer.js +0 -315
- package/src/plugins/html_supervisor/client/html_supervisor_setup.js +0 -89
- package/src/plugins/html_supervisor/client/perf_browser.js +0 -17
- package/src/plugins/html_supervisor/client/uneval_exception.js +0 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { u as uneval } from "./js/
|
|
2
|
-
import { e as executeUsingDynamicImport } from "./js/execute_using_dynamic_import.js";
|
|
1
|
+
import { u as uneval, e as executeUsingDynamicImport } from "./js/execute_using_dynamic_import.js";
|
|
3
2
|
import "node:fs";
|
|
4
3
|
import "node:inspector";
|
|
5
4
|
import "node:perf_hooks";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { parentPort } from "node:worker_threads";
|
|
2
|
-
import { u as uneval } from "./js/
|
|
3
|
-
import { e as executeUsingDynamicImport } from "./js/execute_using_dynamic_import.js";
|
|
2
|
+
import { u as uneval, e as executeUsingDynamicImport } from "./js/execute_using_dynamic_import.js";
|
|
4
3
|
import "node:fs";
|
|
5
4
|
import "node:inspector";
|
|
6
5
|
import "node:perf_hooks";
|
package/dist/js/autoreload.js
CHANGED
|
@@ -66,9 +66,25 @@ const getDOMNodesUsingUrl = urlToReload => {
|
|
|
66
66
|
nodes.push({
|
|
67
67
|
node,
|
|
68
68
|
reload: () => {
|
|
69
|
-
node
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
if (node.nodeName === "SCRIPT") {
|
|
70
|
+
const copy = document.createElement("script");
|
|
71
|
+
Array.from(node.attributes).forEach(attribute => {
|
|
72
|
+
copy.setAttribute(attribute.nodeName, attribute.nodeValue);
|
|
73
|
+
});
|
|
74
|
+
copy.src = injectQuery(node.src, {
|
|
75
|
+
hmr: Date.now()
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
if (node.parentNode) {
|
|
79
|
+
node.parentNode.replaceChild(copy, node);
|
|
80
|
+
} else {
|
|
81
|
+
document.body.appendChild(copy);
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
node[attributeName] = injectQuery(attribute, {
|
|
85
|
+
hmr: Date.now()
|
|
86
|
+
});
|
|
87
|
+
}
|
|
72
88
|
}
|
|
73
89
|
});
|
|
74
90
|
};
|
|
@@ -81,23 +97,23 @@ const getDOMNodesUsingUrl = urlToReload => {
|
|
|
81
97
|
});
|
|
82
98
|
Array.from(document.querySelectorAll("script")).forEach(script => {
|
|
83
99
|
visitNodeAttributeAsUrl(script, "src");
|
|
84
|
-
const
|
|
100
|
+
const inlinedFromSrc = script.getAttribute("inlined-from-src");
|
|
85
101
|
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
102
|
+
if (inlinedFromSrc) {
|
|
103
|
+
const inlinedFromUrl = new URL(inlinedFromSrc, window.location.origin).href;
|
|
88
104
|
|
|
89
|
-
if (shouldReloadUrl(
|
|
105
|
+
if (shouldReloadUrl(inlinedFromUrl)) {
|
|
90
106
|
nodes.push({
|
|
91
107
|
node: script,
|
|
92
|
-
reload: () => window.
|
|
108
|
+
reload: () => window.__supervisor__.reloadSupervisedScript({
|
|
93
109
|
type: script.type,
|
|
94
|
-
src:
|
|
110
|
+
src: inlinedFromSrc
|
|
95
111
|
})
|
|
96
112
|
});
|
|
97
113
|
}
|
|
98
114
|
}
|
|
99
|
-
}); // There is no real need to update a.href because the
|
|
100
|
-
// But in a scenario where the
|
|
115
|
+
}); // There is no real need to update a.href because the resource will be fetched when clicked.
|
|
116
|
+
// But in a scenario where the resource was already visited and is in browser cache, adding
|
|
101
117
|
// the dynamic query param ensure the cache is invalidated
|
|
102
118
|
|
|
103
119
|
Array.from(document.querySelectorAll("a")).forEach(a => {
|