@atlaspack/core 2.18.9-typescript-d6e6d169c.0 → 2.18.9-typescript-6de04fbae.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/lib/SymbolPropagation.js +14 -0
- package/package.json +18 -18
- package/src/SymbolPropagation.js +13 -1
- package/test/RequestTracker.test.js +6 -6
package/lib/SymbolPropagation.js
CHANGED
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.propagateSymbols = propagateSymbols;
|
|
7
|
+
function _featureFlags() {
|
|
8
|
+
const data = require("@atlaspack/feature-flags");
|
|
9
|
+
_featureFlags = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _assert() {
|
|
8
15
|
const data = _interopRequireDefault(require("assert"));
|
|
9
16
|
_assert = function () {
|
|
@@ -72,6 +79,13 @@ function propagateSymbols({
|
|
|
72
79
|
|
|
73
80
|
// Propagate the requested symbols down from the root to the leaves
|
|
74
81
|
propagateSymbolsDown(assetGraph, changedAssets, assetGroupsWithRemovedParents, (assetNode, incomingDeps, outgoingDeps) => {
|
|
82
|
+
if ((0, _featureFlags().getFeatureFlag)('emptyFileStarRexportFix')) {
|
|
83
|
+
if (assetNode.value.meta.emptyFileStarReexport && incomingDeps.every(d => d.value.specifierType === _types.SpecifierType.esm)) {
|
|
84
|
+
var _assetNode$value$symb;
|
|
85
|
+
(_assetNode$value$symb = assetNode.value.symbols) === null || _assetNode$value$symb === void 0 || _assetNode$value$symb.delete('*');
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
75
89
|
// exportSymbol -> identifier
|
|
76
90
|
let assetSymbols = assetNode.value.symbols;
|
|
77
91
|
// identifier -> exportSymbol
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.18.9-typescript-
|
|
3
|
+
"version": "2.18.9-typescript-6de04fbae.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"check-ts": "tsc --noEmit index.d.ts"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@atlaspack/build-cache": "2.13.4-typescript-
|
|
25
|
-
"@atlaspack/cache": "3.2.13-typescript-
|
|
26
|
-
"@atlaspack/diagnostic": "2.14.2-typescript-
|
|
27
|
-
"@atlaspack/events": "2.14.2-typescript-
|
|
28
|
-
"@atlaspack/feature-flags": "2.18.5-typescript-
|
|
29
|
-
"@atlaspack/fs": "2.15.13-typescript-
|
|
30
|
-
"@atlaspack/graph": "3.5.7-typescript-
|
|
31
|
-
"@atlaspack/logger": "2.14.13-typescript-
|
|
32
|
-
"@atlaspack/package-manager": "2.14.18-typescript-
|
|
33
|
-
"@atlaspack/plugin": "2.14.18-typescript-
|
|
34
|
-
"@atlaspack/profiler": "2.14.15-typescript-
|
|
35
|
-
"@atlaspack/rust": "3.4.1-typescript-
|
|
36
|
-
"@atlaspack/types": "2.15.8-typescript-
|
|
37
|
-
"@atlaspack/utils": "2.16.2-typescript-
|
|
38
|
-
"@atlaspack/workers": "2.14.18-typescript-
|
|
24
|
+
"@atlaspack/build-cache": "2.13.4-typescript-6de04fbae.0",
|
|
25
|
+
"@atlaspack/cache": "3.2.13-typescript-6de04fbae.0",
|
|
26
|
+
"@atlaspack/diagnostic": "2.14.2-typescript-6de04fbae.0",
|
|
27
|
+
"@atlaspack/events": "2.14.2-typescript-6de04fbae.0",
|
|
28
|
+
"@atlaspack/feature-flags": "2.18.5-typescript-6de04fbae.0",
|
|
29
|
+
"@atlaspack/fs": "2.15.13-typescript-6de04fbae.0",
|
|
30
|
+
"@atlaspack/graph": "3.5.7-typescript-6de04fbae.0",
|
|
31
|
+
"@atlaspack/logger": "2.14.13-typescript-6de04fbae.0",
|
|
32
|
+
"@atlaspack/package-manager": "2.14.18-typescript-6de04fbae.0",
|
|
33
|
+
"@atlaspack/plugin": "2.14.18-typescript-6de04fbae.0",
|
|
34
|
+
"@atlaspack/profiler": "2.14.15-typescript-6de04fbae.0",
|
|
35
|
+
"@atlaspack/rust": "3.4.1-typescript-6de04fbae.0",
|
|
36
|
+
"@atlaspack/types": "2.15.8-typescript-6de04fbae.0",
|
|
37
|
+
"@atlaspack/utils": "2.16.2-typescript-6de04fbae.0",
|
|
38
|
+
"@atlaspack/workers": "2.14.18-typescript-6de04fbae.0",
|
|
39
39
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
40
40
|
"@parcel/source-map": "^2.1.1",
|
|
41
41
|
"base-x": "^3.0.8",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"semver": "^7.5.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@atlaspack/babel-register": "2.14.2-typescript-
|
|
52
|
+
"@atlaspack/babel-register": "2.14.2-typescript-6de04fbae.0",
|
|
53
53
|
"@types/node": ">= 18",
|
|
54
54
|
"graphviz": "^0.0.9",
|
|
55
55
|
"jest-diff": "*",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
61
61
|
},
|
|
62
62
|
"type": "commonjs",
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "6de04fbaeccfba1e7832c737f6318cbd603fc74d"
|
|
64
64
|
}
|
package/src/SymbolPropagation.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type {ContentKey, NodeId} from '@atlaspack/graph';
|
|
4
4
|
import type {Meta, Symbol} from '@atlaspack/types';
|
|
5
5
|
import type {Diagnostic} from '@atlaspack/diagnostic';
|
|
6
|
+
import {getFeatureFlag} from '@atlaspack/feature-flags';
|
|
6
7
|
import type {
|
|
7
8
|
AssetNode,
|
|
8
9
|
DependencyNode,
|
|
@@ -17,7 +18,7 @@ import {setEqual} from '@atlaspack/utils';
|
|
|
17
18
|
import logger from '@atlaspack/logger';
|
|
18
19
|
import {md, convertSourceLocationToHighlight} from '@atlaspack/diagnostic';
|
|
19
20
|
import {instrument} from '@atlaspack/logger';
|
|
20
|
-
import {BundleBehavior, Priority} from './types';
|
|
21
|
+
import {BundleBehavior, Priority, SpecifierType} from './types';
|
|
21
22
|
import {fromProjectPathRelative, fromProjectPath} from './projectPath';
|
|
22
23
|
|
|
23
24
|
export function propagateSymbols({
|
|
@@ -62,6 +63,17 @@ export function propagateSymbols({
|
|
|
62
63
|
changedAssets,
|
|
63
64
|
assetGroupsWithRemovedParents,
|
|
64
65
|
(assetNode, incomingDeps, outgoingDeps) => {
|
|
66
|
+
if (getFeatureFlag('emptyFileStarRexportFix')) {
|
|
67
|
+
if (
|
|
68
|
+
assetNode.value.meta.emptyFileStarReexport &&
|
|
69
|
+
incomingDeps.every(
|
|
70
|
+
(d) => d.value.specifierType === SpecifierType.esm,
|
|
71
|
+
)
|
|
72
|
+
) {
|
|
73
|
+
assetNode.value.symbols?.delete('*');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
65
77
|
// exportSymbol -> identifier
|
|
66
78
|
let assetSymbols: ?$ReadOnlyMap<
|
|
67
79
|
Symbol,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// @flow strict-local
|
|
2
2
|
|
|
3
3
|
import assert from 'assert';
|
|
4
|
+
import {DEFAULT_FEATURE_FLAGS, setFeatureFlags} from '@atlaspack/feature-flags';
|
|
5
|
+
import {Graph} from '@atlaspack/graph';
|
|
6
|
+
import {LMDBLiteCache} from '@atlaspack/cache';
|
|
7
|
+
import WorkerFarm from '@atlaspack/workers';
|
|
8
|
+
import {makeDeferredWithPromise} from '@atlaspack/utils';
|
|
4
9
|
import nullthrows from 'nullthrows';
|
|
10
|
+
import sinon from 'sinon';
|
|
5
11
|
import RequestTracker, {
|
|
6
12
|
type RunAPI,
|
|
7
13
|
cleanUpOrphans,
|
|
@@ -9,15 +15,9 @@ import RequestTracker, {
|
|
|
9
15
|
getBiggestFSEventsInvalidations,
|
|
10
16
|
invalidateRequestGraphFSEvents,
|
|
11
17
|
} from '../src/RequestTracker';
|
|
12
|
-
import {Graph} from '@atlaspack/graph';
|
|
13
|
-
import {LMDBLiteCache} from '@atlaspack/cache';
|
|
14
|
-
import WorkerFarm from '@atlaspack/workers';
|
|
15
18
|
import {DEFAULT_OPTIONS} from './test-utils';
|
|
16
19
|
import {FILE_CREATE, FILE_UPDATE, INITIAL_BUILD} from '../src/constants';
|
|
17
|
-
import {makeDeferredWithPromise} from '@atlaspack/utils';
|
|
18
20
|
import {toProjectPath} from '../src/projectPath';
|
|
19
|
-
import {DEFAULT_FEATURE_FLAGS, setFeatureFlags} from '../../feature-flags/src';
|
|
20
|
-
import sinon from 'sinon';
|
|
21
21
|
import type {AtlaspackOptions} from '../src/types';
|
|
22
22
|
|
|
23
23
|
const options = {
|