@atlaspack/packager-js 2.14.5-canary.88 → 2.14.5-canary.89
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/lib/DevPackager.js +18 -0
- package/package.json +8 -8
- package/src/DevPackager.js +13 -0
package/lib/DevPackager.js
CHANGED
|
@@ -18,6 +18,13 @@ function _sourceMap() {
|
|
|
18
18
|
};
|
|
19
19
|
return data;
|
|
20
20
|
}
|
|
21
|
+
function _featureFlags() {
|
|
22
|
+
const data = require("@atlaspack/feature-flags");
|
|
23
|
+
_featureFlags = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
21
28
|
function _assert() {
|
|
22
29
|
const data = _interopRequireDefault(require("assert"));
|
|
23
30
|
_assert = function () {
|
|
@@ -108,6 +115,17 @@ class DevPackager {
|
|
|
108
115
|
deps[specifier] = dep.specifier;
|
|
109
116
|
}
|
|
110
117
|
}
|
|
118
|
+
if ((0, _featureFlags().getFeatureFlag)('hmrImprovements')) {
|
|
119
|
+
// Add dependencies for parcelRequire calls added by runtimes
|
|
120
|
+
// so that the HMR runtime can correctly traverse parents.
|
|
121
|
+
let hmrDeps = asset.meta.hmrDeps;
|
|
122
|
+
if (this.options.hmrOptions && Array.isArray(hmrDeps)) {
|
|
123
|
+
for (let id of hmrDeps) {
|
|
124
|
+
(0, _assert().default)(typeof id === 'string');
|
|
125
|
+
deps[id] = id;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
111
129
|
let {
|
|
112
130
|
code,
|
|
113
131
|
mapBuffer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/packager-js",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.89+26aa9c599",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"node": ">= 16.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
19
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
20
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
21
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
22
|
-
"@atlaspack/types": "2.14.5-canary.
|
|
23
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
18
|
+
"@atlaspack/diagnostic": "2.14.1-canary.157+26aa9c599",
|
|
19
|
+
"@atlaspack/feature-flags": "2.14.1-canary.157+26aa9c599",
|
|
20
|
+
"@atlaspack/plugin": "2.14.5-canary.89+26aa9c599",
|
|
21
|
+
"@atlaspack/rust": "3.2.1-canary.89+26aa9c599",
|
|
22
|
+
"@atlaspack/types": "2.14.5-canary.89+26aa9c599",
|
|
23
|
+
"@atlaspack/utils": "2.14.5-canary.89+26aa9c599",
|
|
24
24
|
"@parcel/source-map": "^2.1.1",
|
|
25
25
|
"globals": "^13.2.0",
|
|
26
26
|
"nullthrows": "^1.1.1"
|
|
27
27
|
},
|
|
28
28
|
"type": "commonjs",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "26aa9c599d2be45ce1438a74c5fa22f39b9b554b"
|
|
30
30
|
}
|
package/src/DevPackager.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
normalizeSeparators,
|
|
9
9
|
} from '@atlaspack/utils';
|
|
10
10
|
import SourceMap from '@parcel/source-map';
|
|
11
|
+
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
11
12
|
import invariant from 'assert';
|
|
12
13
|
import path from 'path';
|
|
13
14
|
import fs from 'fs';
|
|
@@ -112,6 +113,18 @@ export class DevPackager {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
if (getFeatureFlag('hmrImprovements')) {
|
|
117
|
+
// Add dependencies for parcelRequire calls added by runtimes
|
|
118
|
+
// so that the HMR runtime can correctly traverse parents.
|
|
119
|
+
let hmrDeps = asset.meta.hmrDeps;
|
|
120
|
+
if (this.options.hmrOptions && Array.isArray(hmrDeps)) {
|
|
121
|
+
for (let id of hmrDeps) {
|
|
122
|
+
invariant(typeof id === 'string');
|
|
123
|
+
deps[id] = id;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
115
128
|
let {code, mapBuffer} = results[i];
|
|
116
129
|
let output = code || '';
|
|
117
130
|
wrapped +=
|