@atlaspack/runtime-browser-hmr 2.12.1-dev.3450 → 2.12.1-dev.3466
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/runtime-browser-hmr",
|
|
3
|
-
"version": "2.12.1-dev.
|
|
3
|
+
"version": "2.12.1-dev.3466+9a12fb8bd",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"source": "src/HMRRuntime.js",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">= 16.0.0",
|
|
16
|
-
"parcel": "^2.12.1-dev.
|
|
16
|
+
"parcel": "^2.12.1-dev.3466+9a12fb8bd"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atlaspack/plugin": "2.12.1-dev.
|
|
20
|
-
"@atlaspack/utils": "2.12.1-dev.
|
|
19
|
+
"@atlaspack/plugin": "2.12.1-dev.3466+9a12fb8bd",
|
|
20
|
+
"@atlaspack/utils": "2.12.1-dev.3466+9a12fb8bd"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "9a12fb8bd1b72e407ed043e20337dc60fbec9cbe"
|
|
23
23
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type {
|
|
6
6
|
HMRAsset,
|
|
7
7
|
HMRMessage,
|
|
8
|
-
} from '@atlaspack/reporter-dev-server/src/HMRServer
|
|
8
|
+
} from '@atlaspack/reporter-dev-server/src/HMRServer';
|
|
9
9
|
interface ParcelRequire {
|
|
10
10
|
(string): mixed;
|
|
11
11
|
cache: {|[string]: ParcelModule|};
|
|
@@ -147,10 +147,12 @@ if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
|
147
147
|
removeErrorOverlay();
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
let assets = data.assets.filter(
|
|
150
|
+
let assets = data.assets.filter(
|
|
151
|
+
(asset) => asset.envHash === HMR_ENV_HASH,
|
|
152
|
+
);
|
|
151
153
|
|
|
152
154
|
// Handle HMR Update
|
|
153
|
-
let handled = assets.every(asset => {
|
|
155
|
+
let handled = assets.every((asset) => {
|
|
154
156
|
return (
|
|
155
157
|
asset.type === 'css' ||
|
|
156
158
|
(asset.type === 'js' &&
|
|
@@ -270,7 +272,9 @@ ${frame.code}`;
|
|
|
270
272
|
</div>
|
|
271
273
|
<pre>${stack}</pre>
|
|
272
274
|
<div>
|
|
273
|
-
${diagnostic.hints
|
|
275
|
+
${diagnostic.hints
|
|
276
|
+
.map((hint) => '<div>💡 ' + hint + '</div>')
|
|
277
|
+
.join('')}
|
|
274
278
|
</div>
|
|
275
279
|
${
|
|
276
280
|
diagnostic.documentation
|
|
@@ -418,8 +422,8 @@ async function hmrApplyUpdates(assets) {
|
|
|
418
422
|
// https://bugs.webkit.org/show_bug.cgi?id=137297
|
|
419
423
|
// This path is also taken if a CSP disallows eval.
|
|
420
424
|
if (!supportsSourceURL) {
|
|
421
|
-
let promises = assets.map(asset =>
|
|
422
|
-
hmrDownload(asset)?.catch(err => {
|
|
425
|
+
let promises = assets.map((asset) =>
|
|
426
|
+
hmrDownload(asset)?.catch((err) => {
|
|
423
427
|
// Web extension fix
|
|
424
428
|
if (
|
|
425
429
|
extCtx &&
|
|
@@ -445,7 +449,7 @@ async function hmrApplyUpdates(assets) {
|
|
|
445
449
|
delete global.parcelHotUpdate;
|
|
446
450
|
|
|
447
451
|
if (scriptsToRemove) {
|
|
448
|
-
scriptsToRemove.forEach(script => {
|
|
452
|
+
scriptsToRemove.forEach((script) => {
|
|
449
453
|
if (script) {
|
|
450
454
|
document.head?.removeChild(script);
|
|
451
455
|
}
|
|
@@ -517,7 +521,7 @@ function hmrDelete(bundle, id) {
|
|
|
517
521
|
delete bundle.cache[id];
|
|
518
522
|
|
|
519
523
|
// Now delete the orphans.
|
|
520
|
-
orphans.forEach(id => {
|
|
524
|
+
orphans.forEach((id) => {
|
|
521
525
|
hmrDelete(module.bundle.root, id);
|
|
522
526
|
});
|
|
523
527
|
} else if (bundle.parent) {
|