@jsenv/core 38.2.11 → 38.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/jsenv_core.js +1388 -1371
- package/package.json +1 -1
- package/src/dev/file_service.js +1 -1
- package/src/kitchen/url_graph/references.js +2 -2
- package/src/kitchen/url_graph/url_graph.js +14 -4
- package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +10 -2
- package/src/plugins/plugins.js +0 -2
- package/src/plugins/reference_analysis/html/jsenv_plugin_html_reference_analysis.js +505 -310
- package/src/plugins/ribbon/jsenv_plugin_ribbon.js +2 -2
- package/src/plugins/importmap/jsenv_plugin_importmap.js +0 -205
package/package.json
CHANGED
package/src/dev/file_service.js
CHANGED
|
@@ -135,7 +135,7 @@ export const createFileService = ({
|
|
|
135
135
|
associations: watchAssociations,
|
|
136
136
|
});
|
|
137
137
|
urlInfoCreated.isWatched = watch;
|
|
138
|
-
//
|
|
138
|
+
// when an url depends on many others, we check all these (like package.json)
|
|
139
139
|
urlInfoCreated.isValid = () => {
|
|
140
140
|
if (!urlInfoCreated.url.startsWith("file:")) {
|
|
141
141
|
return false;
|
|
@@ -386,12 +386,12 @@ const createReference = ({
|
|
|
386
386
|
ownerUrlInfo.context.finalizeReference(reference);
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
-
// "
|
|
389
|
+
// "formatReference" can be async BUT this is an exception
|
|
390
390
|
// for most cases it will be sync. We want to favor the sync signature to keep things simpler
|
|
391
391
|
// The only case where it needs to be async is when
|
|
392
392
|
// the specifier is a `data:*` url
|
|
393
393
|
// in this case we'll wait for the promise returned by
|
|
394
|
-
// "
|
|
394
|
+
// "formatReference"
|
|
395
395
|
reference.readGeneratedSpecifier = () => {
|
|
396
396
|
if (reference.generatedSpecifier.then) {
|
|
397
397
|
return reference.generatedSpecifier.then((value) => {
|
|
@@ -255,6 +255,9 @@ const createUrlInfo = (url, context) => {
|
|
|
255
255
|
continue;
|
|
256
256
|
}
|
|
257
257
|
if (ref.gotInlined()) {
|
|
258
|
+
if (ref.ownerUrlInfo.isUsed()) {
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
258
261
|
// the url info was inlined, an other reference is required
|
|
259
262
|
// to consider the non-inlined urlInfo as used
|
|
260
263
|
continue;
|
|
@@ -354,7 +357,7 @@ const createUrlInfo = (url, context) => {
|
|
|
354
357
|
};
|
|
355
358
|
urlInfo.onModified = ({ modifiedTimestamp = Date.now() } = {}) => {
|
|
356
359
|
const visitedSet = new Set();
|
|
357
|
-
const
|
|
360
|
+
const considerModified = (urlInfo) => {
|
|
358
361
|
if (visitedSet.has(urlInfo)) {
|
|
359
362
|
return;
|
|
360
363
|
}
|
|
@@ -364,14 +367,21 @@ const createUrlInfo = (url, context) => {
|
|
|
364
367
|
for (const referenceToOther of urlInfo.referenceToOthersSet) {
|
|
365
368
|
const referencedUrlInfo = referenceToOther.urlInfo;
|
|
366
369
|
if (referencedUrlInfo.isInline) {
|
|
367
|
-
|
|
370
|
+
considerModified(referencedUrlInfo);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
for (const referenceFromOther of urlInfo.referenceFromOthersSet) {
|
|
374
|
+
if (referenceFromOther.gotInlined()) {
|
|
375
|
+
const urlInfoReferencingThisOne = referenceFromOther.ownerUrlInfo;
|
|
376
|
+
considerModified(urlInfoReferencingThisOne);
|
|
368
377
|
}
|
|
369
378
|
}
|
|
370
379
|
for (const searchParamVariant of urlInfo.searchParamVariantSet) {
|
|
371
|
-
|
|
380
|
+
considerModified(searchParamVariant);
|
|
372
381
|
}
|
|
373
382
|
};
|
|
374
|
-
|
|
383
|
+
considerModified(urlInfo);
|
|
384
|
+
visitedSet.clear();
|
|
375
385
|
};
|
|
376
386
|
urlInfo.onDereferenced = (lastReferenceFromOther) => {
|
|
377
387
|
urlInfo.dereferencedTimestamp = Date.now();
|
|
@@ -130,14 +130,22 @@ export const jsenvPluginAutoreloadServer = ({
|
|
|
130
130
|
return iterateMemoized(firstUrlInfo, []);
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
let propagationResult = propagateUpdate(firstUrlInfo);
|
|
134
134
|
const seen = new Set();
|
|
135
135
|
const invalidateImporters = (urlInfo) => {
|
|
136
136
|
// to indicate this urlInfo should be modified
|
|
137
137
|
for (const referenceFromOther of urlInfo.referenceFromOthersSet) {
|
|
138
138
|
const urlInfoReferencingThisOne = referenceFromOther.ownerUrlInfo;
|
|
139
|
-
const { hotAcceptDependencies = [] } =
|
|
139
|
+
const { hotDecline, hotAcceptDependencies = [] } =
|
|
140
140
|
urlInfoReferencingThisOne.data;
|
|
141
|
+
if (hotDecline) {
|
|
142
|
+
propagationResult = {
|
|
143
|
+
declined: true,
|
|
144
|
+
reason: `file declines hot reload`,
|
|
145
|
+
declinedBy: formatUrlForClient(urlInfoReferencingThisOne.url),
|
|
146
|
+
};
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
141
149
|
if (hotAcceptDependencies.includes(urlInfo.url)) {
|
|
142
150
|
continue;
|
|
143
151
|
}
|
package/src/plugins/plugins.js
CHANGED
|
@@ -2,7 +2,6 @@ import { jsenvPluginSupervisor } from "@jsenv/plugin-supervisor";
|
|
|
2
2
|
import { jsenvPluginTranspilation } from "@jsenv/plugin-transpilation";
|
|
3
3
|
|
|
4
4
|
import { jsenvPluginReferenceAnalysis } from "./reference_analysis/jsenv_plugin_reference_analysis.js";
|
|
5
|
-
import { jsenvPluginImportmap } from "./importmap/jsenv_plugin_importmap.js";
|
|
6
5
|
import { jsenvPluginNodeEsmResolution } from "./resolution_node_esm/jsenv_plugin_node_esm_resolution.js";
|
|
7
6
|
import { jsenvPluginWebResolution } from "./resolution_web/jsenv_plugin_web_resolution.js";
|
|
8
7
|
import { jsenvPluginVersionSearchParam } from "./version_search_param/jsenv_plugin_version_search_param.js";
|
|
@@ -55,7 +54,6 @@ export const getCorePlugins = ({
|
|
|
55
54
|
jsenvPluginReferenceAnalysis(referenceAnalysis),
|
|
56
55
|
...(injections ? [jsenvPluginInjections(injections)] : []),
|
|
57
56
|
jsenvPluginTranspilation(transpilation),
|
|
58
|
-
jsenvPluginImportmap(),
|
|
59
57
|
...(inlining ? [jsenvPluginInlining()] : []),
|
|
60
58
|
...(supervisor ? [jsenvPluginSupervisor(supervisor)] : []), // after inline as it needs inline script to be cooked
|
|
61
59
|
|