@atlaspack/core 2.25.2-dev-native-compiled-test-712d92d32.0 → 2.26.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/CHANGELOG.md +32 -0
- package/dist/CommittedAsset.js +0 -3
- package/dist/UncommittedAsset.js +0 -9
- package/dist/atlaspack-v3/worker/compat/mutable-asset.js +0 -4
- package/dist/public/Asset.js +0 -6
- package/dist/requests/AssetGraphRequestRust.js +1 -2
- package/dist/requests/BundleGraphRequest.js +5 -1
- package/dist/requests/TargetRequest.js +1 -0
- package/dist/requests/asset-graph-diff.js +6 -4
- package/lib/CommittedAsset.js +0 -3
- package/lib/UncommittedAsset.js +0 -9
- package/lib/atlaspack-v3/worker/compat/mutable-asset.js +0 -4
- package/lib/public/Asset.js +0 -6
- package/lib/requests/AssetGraphRequestRust.js +4 -2
- package/lib/requests/BundleGraphRequest.js +5 -1
- package/lib/requests/TargetRequest.js +2 -1
- package/lib/requests/asset-graph-diff.js +4 -4
- package/lib/types/CommittedAsset.d.ts +0 -1
- package/lib/types/UncommittedAsset.d.ts +0 -2
- package/lib/types/atlaspack-v3/worker/compat/mutable-asset.d.ts +0 -2
- package/lib/types/public/Asset.d.ts +0 -2
- package/lib/types/types.d.ts +0 -1
- package/package.json +20 -21
- package/src/CommittedAsset.ts +0 -4
- package/src/UncommittedAsset.ts +0 -11
- package/src/atlaspack-v3/worker/compat/mutable-asset.ts +0 -6
- package/src/atlaspack-v3/worker/worker.ts +1 -1
- package/src/public/Asset.ts +0 -8
- package/src/requests/AssetGraphRequestRust.ts +1 -2
- package/src/requests/BundleGraphRequest.ts +5 -1
- package/src/requests/TargetRequest.ts +1 -0
- package/src/requests/asset-graph-diff.ts +11 -7
- package/src/types.ts +0 -1
- package/test/TargetRequest.test.ts +12 -0
- package/test/fixtures/custom-targets/package.json +6 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/LICENSE +0 -201
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @atlaspack/core
|
|
2
2
|
|
|
3
|
+
## 2.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#827](https://github.com/atlassian-labs/atlaspack/pull/827) [`ff8ac84`](https://github.com/atlassian-labs/atlaspack/commit/ff8ac84bd0be15caa7c7af21bf5b6e47b6d36438) Thanks [@OscarCookeAbbott](https://github.com/OscarCookeAbbott)! - Fix custom environment properties sometimes being ignored
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#817](https://github.com/atlassian-labs/atlaspack/pull/817) [`3da8e69`](https://github.com/atlassian-labs/atlaspack/commit/3da8e690605472d81c531366b65fa9844f8ca337) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix an issue when creating the BundleGraph and some Dependency.sourceAssetId values have diverged from the actual Asset.id values.
|
|
12
|
+
|
|
13
|
+
Fix behind flag `sourceAssetIdBundleGraphFix`
|
|
14
|
+
|
|
15
|
+
- [#810](https://github.com/atlassian-labs/atlaspack/pull/810) [`c372f3f`](https://github.com/atlassian-labs/atlaspack/commit/c372f3fd6fce8200d5cf47f41bc7895c6cbb5558) Thanks [@benjervis](https://github.com/benjervis)! - Add the `scope-hosting-stats` debug tool to report on the percentage of assets that were able to be scope hoisted during the build.
|
|
16
|
+
|
|
17
|
+
- [#831](https://github.com/atlassian-labs/atlaspack/pull/831) [`27fd73f`](https://github.com/atlassian-labs/atlaspack/commit/27fd73fa07d358653f1be6f2d15d72dc5d8fc2fd) Thanks [@benjervis](https://github.com/benjervis)! - Update some Rust internals to use Arcs instead of passing references. This won't make any difference in the immediate term, but is required setup for the next set of changes
|
|
18
|
+
|
|
19
|
+
- [#834](https://github.com/atlassian-labs/atlaspack/pull/834) [`3091fa3`](https://github.com/atlassian-labs/atlaspack/commit/3091fa36425ecffe3938e55247a035b08cda37a2) Thanks [@benjervis](https://github.com/benjervis)! - We no longer want to use `meta` fields internally in Atlaspack, so they have been removed from the Rust side of the codebase, and are mapped back to the legacy format on the JS side.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`79a7e22`](https://github.com/atlassian-labs/atlaspack/commit/79a7e22ef119891a2f4180a9d3cc66b38dd52092), [`3da8e69`](https://github.com/atlassian-labs/atlaspack/commit/3da8e690605472d81c531366b65fa9844f8ca337), [`c372f3f`](https://github.com/atlassian-labs/atlaspack/commit/c372f3fd6fce8200d5cf47f41bc7895c6cbb5558), [`17dfea9`](https://github.com/atlassian-labs/atlaspack/commit/17dfea9e9f3169807808520df9c09ebf70dc8b10), [`f1070ec`](https://github.com/atlassian-labs/atlaspack/commit/f1070ec48e99b4ec111a03179c5ab5b74163fab1), [`27fd73f`](https://github.com/atlassian-labs/atlaspack/commit/27fd73fa07d358653f1be6f2d15d72dc5d8fc2fd), [`3091fa3`](https://github.com/atlassian-labs/atlaspack/commit/3091fa36425ecffe3938e55247a035b08cda37a2)]:
|
|
22
|
+
- @atlaspack/feature-flags@2.25.5
|
|
23
|
+
- @atlaspack/rust@3.8.3
|
|
24
|
+
- @atlaspack/utils@3.0.3
|
|
25
|
+
- @atlaspack/cache@3.2.30
|
|
26
|
+
- @atlaspack/fs@2.15.30
|
|
27
|
+
- @atlaspack/graph@3.5.24
|
|
28
|
+
- @atlaspack/package-manager@2.14.35
|
|
29
|
+
- @atlaspack/logger@2.14.27
|
|
30
|
+
- @atlaspack/plugin@2.14.35
|
|
31
|
+
- @atlaspack/profiler@2.14.32
|
|
32
|
+
- @atlaspack/types@2.15.25
|
|
33
|
+
- @atlaspack/workers@2.14.35
|
|
34
|
+
|
|
3
35
|
## 2.25.1
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/CommittedAsset.js
CHANGED
package/dist/UncommittedAsset.js
CHANGED
|
@@ -311,14 +311,5 @@ class UncommittedAsset {
|
|
|
311
311
|
// @ts-expect-error TS2345
|
|
312
312
|
this.value.id = (0, assetUtils_1.createAssetIdFromOptions)(this.value);
|
|
313
313
|
}
|
|
314
|
-
setCompiledCssStyles(styles) {
|
|
315
|
-
if (styles.length > 0) {
|
|
316
|
-
console.log('setCompiledCssStyles', styles);
|
|
317
|
-
}
|
|
318
|
-
this.value.compiledCssStyles = styles;
|
|
319
|
-
}
|
|
320
|
-
getCompiledCssStyles() {
|
|
321
|
-
return this.value.compiledCssStyles;
|
|
322
|
-
}
|
|
323
314
|
}
|
|
324
315
|
exports.default = UncommittedAsset;
|
|
@@ -51,7 +51,6 @@ class MutableAsset {
|
|
|
51
51
|
this.symbols = new asset_symbols_1.MutableAssetSymbols(asset.symbols);
|
|
52
52
|
this.type = asset.type;
|
|
53
53
|
this.uniqueKey = asset.uniqueKey;
|
|
54
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
55
54
|
__classPrivateFieldSet(this, _MutableAsset_astDirty, false, "f");
|
|
56
55
|
__classPrivateFieldSet(this, _MutableAsset_contents, contents, "f");
|
|
57
56
|
__classPrivateFieldSet(this, _MutableAsset_inner, asset, "f");
|
|
@@ -148,9 +147,6 @@ class MutableAsset {
|
|
|
148
147
|
invalidateOnBuild() {
|
|
149
148
|
// TODO: Forward invalidations to Rust
|
|
150
149
|
}
|
|
151
|
-
setCompiledCssStyles(styles) {
|
|
152
|
-
this.compiledCssStyles = styles;
|
|
153
|
-
}
|
|
154
150
|
}
|
|
155
151
|
exports.MutableAsset = MutableAsset;
|
|
156
152
|
_MutableAsset_astDirty = new WeakMap(), _MutableAsset_ast = new WeakMap(), _MutableAsset_contents = new WeakMap(), _MutableAsset_inner = new WeakMap(), _MutableAsset_map = new WeakMap(), _MutableAsset_projectRoot = new WeakMap(), _MutableAsset_sourceMap = new WeakMap();
|
package/dist/public/Asset.js
CHANGED
|
@@ -133,9 +133,6 @@ class BaseAsset {
|
|
|
133
133
|
getMapBuffer() {
|
|
134
134
|
return __classPrivateFieldGet(this, _BaseAsset_asset, "f").getMapBuffer();
|
|
135
135
|
}
|
|
136
|
-
getCompiledCssStyles() {
|
|
137
|
-
return __classPrivateFieldGet(this, _BaseAsset_asset, "f").getCompiledCssStyles();
|
|
138
|
-
}
|
|
139
136
|
}
|
|
140
137
|
class Asset extends BaseAsset {
|
|
141
138
|
constructor(asset) {
|
|
@@ -277,9 +274,6 @@ class MutableAsset extends BaseAsset {
|
|
|
277
274
|
});
|
|
278
275
|
__classPrivateFieldGet(this, _MutableAsset_asset, "f").updateId();
|
|
279
276
|
}
|
|
280
|
-
setCompiledCssStyles(styles) {
|
|
281
|
-
__classPrivateFieldGet(this, _MutableAsset_asset, "f").setCompiledCssStyles(styles);
|
|
282
|
-
}
|
|
283
277
|
}
|
|
284
278
|
exports.MutableAsset = MutableAsset;
|
|
285
279
|
_MutableAsset_asset = new WeakMap();
|
|
@@ -180,8 +180,7 @@ function getAssetGraph(serializedGraph) {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
else if (node.type === 'dependency') {
|
|
183
|
-
let id = node.value
|
|
184
|
-
let dependency = node.value.dependency;
|
|
183
|
+
let { dependency, id } = node.value;
|
|
185
184
|
dependency.id = id;
|
|
186
185
|
dependency.env.id = (0, feature_flags_1.getFeatureFlag)('environmentDeduplication')
|
|
187
186
|
? // TODO: Rust can do this and avoid copying a significant amount of data over
|
|
@@ -142,7 +142,11 @@ function createBundleGraphRequest(input) {
|
|
|
142
142
|
// force: true,
|
|
143
143
|
// },
|
|
144
144
|
// );
|
|
145
|
-
// require('./asset-graph-diff.
|
|
145
|
+
// require('./asset-graph-diff.ts')(
|
|
146
|
+
// jsAssetGraph,
|
|
147
|
+
// assetGraph,
|
|
148
|
+
// options.projectRoot,
|
|
149
|
+
// );
|
|
146
150
|
// }
|
|
147
151
|
measurement && measurement.end();
|
|
148
152
|
(0, utils_2.assertSignalNotAborted)(signal);
|
|
@@ -887,6 +887,7 @@ class TargetResolver {
|
|
|
887
887
|
: descriptor.optimize !== false),
|
|
888
888
|
shouldScopeHoist: shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
889
889
|
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
890
|
+
customEnv: descriptor.env,
|
|
890
891
|
}),
|
|
891
892
|
loc: (0, utils_2.toInternalSourceLocation)(this.options.projectRoot, loc),
|
|
892
893
|
});
|
|
@@ -67,7 +67,7 @@ function compactDeep(obj, ignoredPatterns = [], currentPath = '$') {
|
|
|
67
67
|
return obj;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
70
|
+
function assetGraphDiff(jsAssetGraph, rustAssetGraph, projectRoot) {
|
|
71
71
|
const getNodes = (graph) => {
|
|
72
72
|
let nodes = {};
|
|
73
73
|
// @ts-expect-error implicit any
|
|
@@ -76,11 +76,13 @@ function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
|
76
76
|
if (!node)
|
|
77
77
|
return;
|
|
78
78
|
if (node.type === 'dependency') {
|
|
79
|
-
let sourcePath = node.value.sourcePath
|
|
80
|
-
|
|
79
|
+
let sourcePath = node.value.sourcePath
|
|
80
|
+
? (0, projectPath_1.toProjectPath)(projectRoot, node.value.sourcePath)
|
|
81
|
+
: (0, projectPath_1.toProjectPath)(projectRoot, 'entry');
|
|
82
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
81
83
|
}
|
|
82
84
|
else if (node.type === 'asset') {
|
|
83
|
-
nodes[`asset:${(0, projectPath_1.
|
|
85
|
+
nodes[`asset:${(0, projectPath_1.toProjectPath)(projectRoot, node.value.filePath)}`] =
|
|
84
86
|
filterNode(node);
|
|
85
87
|
}
|
|
86
88
|
});
|
package/lib/CommittedAsset.js
CHANGED
package/lib/UncommittedAsset.js
CHANGED
|
@@ -365,14 +365,5 @@ class UncommittedAsset {
|
|
|
365
365
|
// @ts-expect-error TS2345
|
|
366
366
|
this.value.id = (0, _assetUtils.createAssetIdFromOptions)(this.value);
|
|
367
367
|
}
|
|
368
|
-
setCompiledCssStyles(styles) {
|
|
369
|
-
if (styles.length > 0) {
|
|
370
|
-
console.log('setCompiledCssStyles', styles);
|
|
371
|
-
}
|
|
372
|
-
this.value.compiledCssStyles = styles;
|
|
373
|
-
}
|
|
374
|
-
getCompiledCssStyles() {
|
|
375
|
-
return this.value.compiledCssStyles;
|
|
376
|
-
}
|
|
377
368
|
}
|
|
378
369
|
exports.default = UncommittedAsset;
|
|
@@ -59,7 +59,6 @@ class MutableAsset {
|
|
|
59
59
|
this.symbols = new _assetSymbols.MutableAssetSymbols(asset.symbols);
|
|
60
60
|
this.type = asset.type;
|
|
61
61
|
this.uniqueKey = asset.uniqueKey;
|
|
62
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
63
62
|
this.#astDirty = false;
|
|
64
63
|
this.#contents = contents;
|
|
65
64
|
this.#inner = asset;
|
|
@@ -166,8 +165,5 @@ class MutableAsset {
|
|
|
166
165
|
invalidateOnBuild() {
|
|
167
166
|
// TODO: Forward invalidations to Rust
|
|
168
167
|
}
|
|
169
|
-
setCompiledCssStyles(styles) {
|
|
170
|
-
this.compiledCssStyles = styles;
|
|
171
|
-
}
|
|
172
168
|
}
|
|
173
169
|
exports.MutableAsset = MutableAsset;
|
package/lib/public/Asset.js
CHANGED
|
@@ -124,9 +124,6 @@ class BaseAsset {
|
|
|
124
124
|
getMapBuffer() {
|
|
125
125
|
return this.#asset.getMapBuffer();
|
|
126
126
|
}
|
|
127
|
-
getCompiledCssStyles() {
|
|
128
|
-
return this.#asset.getCompiledCssStyles();
|
|
129
|
-
}
|
|
130
127
|
}
|
|
131
128
|
class Asset extends BaseAsset {
|
|
132
129
|
// @ts-expect-error TS2564
|
|
@@ -268,8 +265,5 @@ class MutableAsset extends BaseAsset {
|
|
|
268
265
|
});
|
|
269
266
|
this.#asset.updateId();
|
|
270
267
|
}
|
|
271
|
-
setCompiledCssStyles(styles) {
|
|
272
|
-
this.#asset.setCompiledCssStyles(styles);
|
|
273
|
-
}
|
|
274
268
|
}
|
|
275
269
|
exports.MutableAsset = MutableAsset;
|
|
@@ -170,8 +170,10 @@ function getAssetGraph(serializedGraph) {
|
|
|
170
170
|
value: asset
|
|
171
171
|
});
|
|
172
172
|
} else if (node.type === 'dependency') {
|
|
173
|
-
let
|
|
174
|
-
|
|
173
|
+
let {
|
|
174
|
+
dependency,
|
|
175
|
+
id
|
|
176
|
+
} = node.value;
|
|
175
177
|
dependency.id = id;
|
|
176
178
|
dependency.env.id = (0, _featureFlags().getFeatureFlag)('environmentDeduplication') ?
|
|
177
179
|
// TODO: Rust can do this and avoid copying a significant amount of data over
|
|
@@ -178,7 +178,11 @@ function createBundleGraphRequest(input) {
|
|
|
178
178
|
// force: true,
|
|
179
179
|
// },
|
|
180
180
|
// );
|
|
181
|
-
// require('./asset-graph-diff.
|
|
181
|
+
// require('./asset-graph-diff.ts')(
|
|
182
|
+
// jsAssetGraph,
|
|
183
|
+
// assetGraph,
|
|
184
|
+
// options.projectRoot,
|
|
185
|
+
// );
|
|
182
186
|
// }
|
|
183
187
|
|
|
184
188
|
measurement && measurement.end();
|
|
@@ -830,7 +830,8 @@ class TargetResolver {
|
|
|
830
830
|
// Libraries are not optimized by default, users must explicitly configure this.
|
|
831
831
|
isLibrary ? descriptor.optimize === true : descriptor.optimize !== false),
|
|
832
832
|
shouldScopeHoist: shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
833
|
-
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap)
|
|
833
|
+
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
834
|
+
customEnv: descriptor.env
|
|
834
835
|
}),
|
|
835
836
|
loc: (0, _utils2.toInternalSourceLocation)(this.options.projectRoot, loc)
|
|
836
837
|
});
|
|
@@ -77,7 +77,7 @@ function compactDeep(obj, ignoredPatterns = [], currentPath = '$') {
|
|
|
77
77
|
return obj;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
80
|
+
function assetGraphDiff(jsAssetGraph, rustAssetGraph, projectRoot) {
|
|
81
81
|
const getNodes = graph => {
|
|
82
82
|
let nodes = {};
|
|
83
83
|
|
|
@@ -86,10 +86,10 @@ function assetGraphDiff(jsAssetGraph, rustAssetGraph) {
|
|
|
86
86
|
let node = graph.getNode(nodeId) ?? null;
|
|
87
87
|
if (!node) return;
|
|
88
88
|
if (node.type === 'dependency') {
|
|
89
|
-
let sourcePath = node.value.sourcePath
|
|
90
|
-
nodes[`dep:${
|
|
89
|
+
let sourcePath = node.value.sourcePath ? (0, _projectPath.toProjectPath)(projectRoot, node.value.sourcePath) : (0, _projectPath.toProjectPath)(projectRoot, 'entry');
|
|
90
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
91
91
|
} else if (node.type === 'asset') {
|
|
92
|
-
nodes[`asset:${(0, _projectPath.
|
|
92
|
+
nodes[`asset:${(0, _projectPath.toProjectPath)(projectRoot, node.value.filePath)}`] = filterNode(node);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
return nodes;
|
|
@@ -57,7 +57,5 @@ export default class UncommittedAsset {
|
|
|
57
57
|
getDependencies(): Array<Dependency>;
|
|
58
58
|
createChildAsset(result: TransformerResult, plugin: PackageName, configPath: ProjectPath, configKeyPath?: string): UncommittedAsset;
|
|
59
59
|
updateId(): void;
|
|
60
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
61
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined;
|
|
62
60
|
}
|
|
63
61
|
export {};
|
|
@@ -22,7 +22,6 @@ export declare class MutableAsset implements IMutableAsset {
|
|
|
22
22
|
symbols: MutableAssetSymbols;
|
|
23
23
|
type: string;
|
|
24
24
|
uniqueKey: string | null | undefined;
|
|
25
|
-
compiledCssStyles?: string[];
|
|
26
25
|
get astGenerator(): ASTGenerator | null | undefined;
|
|
27
26
|
set astGenerator(value?: ASTGenerator | null);
|
|
28
27
|
constructor(asset: InnerAsset, contents: Buffer, env: Environment, fs: FileSystem, map: string | null | undefined, projectRoot: string);
|
|
@@ -47,5 +46,4 @@ export declare class MutableAsset implements IMutableAsset {
|
|
|
47
46
|
invalidateOnEnvChange(invalidation: string): void;
|
|
48
47
|
invalidateOnStartup(): void;
|
|
49
48
|
invalidateOnBuild(): void;
|
|
50
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
51
49
|
}
|
|
@@ -35,7 +35,6 @@ declare class BaseAsset {
|
|
|
35
35
|
getMap(): Promise<SourceMap | null | undefined>;
|
|
36
36
|
getAST(): Promise<AST | null | undefined>;
|
|
37
37
|
getMapBuffer(): Promise<Buffer | null | undefined>;
|
|
38
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined;
|
|
39
38
|
}
|
|
40
39
|
export declare class Asset extends BaseAsset implements IAsset {
|
|
41
40
|
#private;
|
|
@@ -71,6 +70,5 @@ export declare class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
|
71
70
|
setAST(ast: AST): void;
|
|
72
71
|
addURLDependency(url: string, opts: Partial<DependencyOptions>): string;
|
|
73
72
|
setEnvironment(env: EnvironmentOptions): void;
|
|
74
|
-
setCompiledCssStyles(styles: string[]): void;
|
|
75
73
|
}
|
|
76
74
|
export {};
|
package/lib/types/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.26.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaspack/build-cache": "2.13.7-dev-native-compiled-test-712d92d32.0",
|
|
26
|
-
"@atlaspack/cache": "3.2.30-dev-native-compiled-test-712d92d32.0",
|
|
27
|
-
"@atlaspack/diagnostic": "2.14.5-dev-native-compiled-test-712d92d32.0",
|
|
28
|
-
"@atlaspack/events": "2.14.5-dev-native-compiled-test-712d92d32.0",
|
|
29
|
-
"@atlaspack/feature-flags": "2.25.5-dev-native-compiled-test-712d92d32.0",
|
|
30
|
-
"@atlaspack/fs": "2.15.30-dev-native-compiled-test-712d92d32.0",
|
|
31
|
-
"@atlaspack/graph": "3.5.24-dev-native-compiled-test-712d92d32.0",
|
|
32
|
-
"@atlaspack/logger": "2.14.27-dev-native-compiled-test-712d92d32.0",
|
|
33
|
-
"@atlaspack/package-manager": "2.14.35-dev-native-compiled-test-712d92d32.0",
|
|
34
|
-
"@atlaspack/plugin": "2.14.35-dev-native-compiled-test-712d92d32.0",
|
|
35
|
-
"@atlaspack/profiler": "2.14.32-dev-native-compiled-test-712d92d32.0",
|
|
36
|
-
"@atlaspack/rust": "3.8.3-dev-native-compiled-test-712d92d32.0",
|
|
37
|
-
"@atlaspack/types": "2.15.25-dev-native-compiled-test-712d92d32.0",
|
|
38
|
-
"@atlaspack/utils": "3.0.3-dev-native-compiled-test-712d92d32.0",
|
|
39
|
-
"@atlaspack/workers": "2.14.35-dev-native-compiled-test-712d92d32.0",
|
|
40
25
|
"@mischnic/json-sourcemap": "^0.1.0",
|
|
26
|
+
"@atlaspack/build-cache": "2.13.6",
|
|
27
|
+
"@atlaspack/cache": "3.2.30",
|
|
28
|
+
"@atlaspack/diagnostic": "2.14.4",
|
|
29
|
+
"@atlaspack/events": "2.14.4",
|
|
30
|
+
"@atlaspack/feature-flags": "2.25.5",
|
|
31
|
+
"@atlaspack/fs": "2.15.30",
|
|
32
|
+
"@atlaspack/graph": "3.5.24",
|
|
33
|
+
"@atlaspack/logger": "2.14.27",
|
|
34
|
+
"@atlaspack/package-manager": "2.14.35",
|
|
35
|
+
"@atlaspack/plugin": "2.14.35",
|
|
36
|
+
"@atlaspack/profiler": "2.14.32",
|
|
37
|
+
"@atlaspack/rust": "3.8.3",
|
|
38
|
+
"@atlaspack/types": "2.15.25",
|
|
39
|
+
"@atlaspack/utils": "3.0.3",
|
|
40
|
+
"@atlaspack/workers": "2.14.35",
|
|
41
41
|
"@parcel/source-map": "^2.1.1",
|
|
42
42
|
"base-x": "^3.0.8",
|
|
43
43
|
"browserslist": "^4.6.6",
|
|
@@ -50,16 +50,15 @@
|
|
|
50
50
|
"semver": "^7.5.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@atlaspack/babel-register": "2.14.
|
|
53
|
+
"@atlaspack/babel-register": "2.14.4",
|
|
54
54
|
"@types/node": ">= 18",
|
|
55
|
-
"graphviz": "^0.0.9",
|
|
56
|
-
"jest-diff": "*",
|
|
57
55
|
"rfdc": "1",
|
|
56
|
+
"jest-diff": "*",
|
|
57
|
+
"graphviz": "^0.0.9",
|
|
58
58
|
"tempy": "^0.2.1"
|
|
59
59
|
},
|
|
60
60
|
"browser": {
|
|
61
61
|
"./src/serializerCore.js": "./src/serializerCore.browser.js"
|
|
62
62
|
},
|
|
63
|
-
"type": "commonjs"
|
|
64
|
-
"gitHead": "712d92d323f25ef36c76ecd254b8f227fe518b89"
|
|
63
|
+
"type": "commonjs"
|
|
65
64
|
}
|
package/src/CommittedAsset.ts
CHANGED
|
@@ -162,8 +162,4 @@ export default class CommittedAsset {
|
|
|
162
162
|
getDependencies(): Array<Dependency> {
|
|
163
163
|
return Array.from(this.value.dependencies.values());
|
|
164
164
|
}
|
|
165
|
-
|
|
166
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
167
|
-
return this.value.compiledCssStyles;
|
|
168
|
-
}
|
|
169
165
|
}
|
package/src/UncommittedAsset.ts
CHANGED
|
@@ -444,15 +444,4 @@ export default class UncommittedAsset {
|
|
|
444
444
|
// @ts-expect-error TS2345
|
|
445
445
|
this.value.id = createAssetIdFromOptions(this.value);
|
|
446
446
|
}
|
|
447
|
-
|
|
448
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
449
|
-
if (styles.length > 0) {
|
|
450
|
-
console.log('setCompiledCssStyles', styles);
|
|
451
|
-
}
|
|
452
|
-
this.value.compiledCssStyles = styles;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
456
|
-
return this.value.compiledCssStyles;
|
|
457
|
-
}
|
|
458
447
|
}
|
|
@@ -41,7 +41,6 @@ export class MutableAsset implements IMutableAsset {
|
|
|
41
41
|
symbols: MutableAssetSymbols;
|
|
42
42
|
type: string;
|
|
43
43
|
uniqueKey: string | null | undefined;
|
|
44
|
-
compiledCssStyles?: string[];
|
|
45
44
|
|
|
46
45
|
#astDirty: boolean;
|
|
47
46
|
#ast: AST | null | undefined;
|
|
@@ -83,7 +82,6 @@ export class MutableAsset implements IMutableAsset {
|
|
|
83
82
|
this.symbols = new MutableAssetSymbols(asset.symbols);
|
|
84
83
|
this.type = asset.type;
|
|
85
84
|
this.uniqueKey = asset.uniqueKey;
|
|
86
|
-
this.compiledCssStyles = asset.compiledCssStyles;
|
|
87
85
|
|
|
88
86
|
this.#astDirty = false;
|
|
89
87
|
this.#contents = contents;
|
|
@@ -208,8 +206,4 @@ export class MutableAsset implements IMutableAsset {
|
|
|
208
206
|
invalidateOnBuild(): void {
|
|
209
207
|
// TODO: Forward invalidations to Rust
|
|
210
208
|
}
|
|
211
|
-
|
|
212
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
213
|
-
this.compiledCssStyles = styles;
|
|
214
|
-
}
|
|
215
209
|
}
|
package/src/public/Asset.ts
CHANGED
|
@@ -190,10 +190,6 @@ class BaseAsset {
|
|
|
190
190
|
getMapBuffer(): Promise<Buffer | null | undefined> {
|
|
191
191
|
return this.#asset.getMapBuffer();
|
|
192
192
|
}
|
|
193
|
-
|
|
194
|
-
getCompiledCssStyles(): ReadonlyArray<string> | undefined {
|
|
195
|
-
return this.#asset.getCompiledCssStyles();
|
|
196
|
-
}
|
|
197
193
|
}
|
|
198
194
|
|
|
199
195
|
export class Asset extends BaseAsset implements IAsset {
|
|
@@ -373,8 +369,4 @@ export class MutableAsset extends BaseAsset implements IMutableAsset {
|
|
|
373
369
|
});
|
|
374
370
|
this.#asset.updateId();
|
|
375
371
|
}
|
|
376
|
-
|
|
377
|
-
setCompiledCssStyles(styles: string[]): void {
|
|
378
|
-
this.#asset.setCompiledCssStyles(styles);
|
|
379
|
-
}
|
|
380
372
|
}
|
|
@@ -193,8 +193,7 @@ export function getAssetGraph(serializedGraph: any): {
|
|
|
193
193
|
value: asset,
|
|
194
194
|
});
|
|
195
195
|
} else if (node.type === 'dependency') {
|
|
196
|
-
let id = node.value
|
|
197
|
-
let dependency = node.value.dependency;
|
|
196
|
+
let {dependency, id} = node.value;
|
|
198
197
|
|
|
199
198
|
dependency.id = id;
|
|
200
199
|
dependency.env.id = getFeatureFlag('environmentDeduplication')
|
|
@@ -192,7 +192,11 @@ export default function createBundleGraphRequest(
|
|
|
192
192
|
// force: true,
|
|
193
193
|
// },
|
|
194
194
|
// );
|
|
195
|
-
// require('./asset-graph-diff.
|
|
195
|
+
// require('./asset-graph-diff.ts')(
|
|
196
|
+
// jsAssetGraph,
|
|
197
|
+
// assetGraph,
|
|
198
|
+
// options.projectRoot,
|
|
199
|
+
// );
|
|
196
200
|
// }
|
|
197
201
|
|
|
198
202
|
measurement && measurement.end();
|
|
@@ -1151,6 +1151,7 @@ export class TargetResolver {
|
|
|
1151
1151
|
shouldScopeHoist:
|
|
1152
1152
|
shouldScopeHoist && descriptor.scopeHoist !== false,
|
|
1153
1153
|
sourceMap: normalizeSourceMap(this.options, descriptor.sourceMap),
|
|
1154
|
+
customEnv: descriptor.env,
|
|
1154
1155
|
}),
|
|
1155
1156
|
loc: toInternalSourceLocation(this.options.projectRoot, loc),
|
|
1156
1157
|
});
|
|
@@ -4,7 +4,7 @@ import deepClone from 'rfdc/default';
|
|
|
4
4
|
import {diff} from 'jest-diff';
|
|
5
5
|
import AssetGraph from '../AssetGraph';
|
|
6
6
|
import type {AssetGraphNode} from '../types';
|
|
7
|
-
import {
|
|
7
|
+
import {toProjectPath} from '../projectPath';
|
|
8
8
|
|
|
9
9
|
function filterNode(node: any) {
|
|
10
10
|
let clone = deepClone(node);
|
|
@@ -71,7 +71,11 @@ function compactDeep(
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
function assetGraphDiff(
|
|
74
|
+
function assetGraphDiff(
|
|
75
|
+
jsAssetGraph: AssetGraph,
|
|
76
|
+
rustAssetGraph: AssetGraph,
|
|
77
|
+
projectRoot: string,
|
|
78
|
+
) {
|
|
75
79
|
const getNodes = (graph: any) => {
|
|
76
80
|
let nodes: Record<string, any> = {};
|
|
77
81
|
|
|
@@ -81,12 +85,12 @@ function assetGraphDiff(jsAssetGraph: AssetGraph, rustAssetGraph: AssetGraph) {
|
|
|
81
85
|
if (!node) return;
|
|
82
86
|
|
|
83
87
|
if (node.type === 'dependency') {
|
|
84
|
-
let sourcePath = node.value.sourcePath
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
] = filterNode(node);
|
|
88
|
+
let sourcePath = node.value.sourcePath
|
|
89
|
+
? toProjectPath(projectRoot, node.value.sourcePath)
|
|
90
|
+
: toProjectPath(projectRoot, 'entry');
|
|
91
|
+
nodes[`dep:${sourcePath}:${node.value.specifier}`] = filterNode(node);
|
|
88
92
|
} else if (node.type === 'asset') {
|
|
89
|
-
nodes[`asset:${
|
|
93
|
+
nodes[`asset:${toProjectPath(projectRoot, node.value.filePath)}`] =
|
|
90
94
|
filterNode(node);
|
|
91
95
|
}
|
|
92
96
|
});
|
package/src/types.ts
CHANGED
|
@@ -382,6 +382,9 @@ describe('TargetResolver', () => {
|
|
|
382
382
|
loc: undefined,
|
|
383
383
|
sourceType: 'module',
|
|
384
384
|
unstableSingleFileOutput: false,
|
|
385
|
+
customEnv: {
|
|
386
|
+
useFlag: 'false',
|
|
387
|
+
},
|
|
385
388
|
}),
|
|
386
389
|
loc: {
|
|
387
390
|
filePath: relative(
|
|
@@ -416,6 +419,9 @@ describe('TargetResolver', () => {
|
|
|
416
419
|
loc: undefined,
|
|
417
420
|
sourceType: 'module',
|
|
418
421
|
unstableSingleFileOutput: false,
|
|
422
|
+
customEnv: {
|
|
423
|
+
useFlag: 'true',
|
|
424
|
+
},
|
|
419
425
|
}),
|
|
420
426
|
loc: {
|
|
421
427
|
filePath: relative(
|
|
@@ -501,6 +507,9 @@ describe('TargetResolver', () => {
|
|
|
501
507
|
loc: undefined,
|
|
502
508
|
sourceType: 'module',
|
|
503
509
|
unstableSingleFileOutput: false,
|
|
510
|
+
customEnv: {
|
|
511
|
+
useFlag: 'false',
|
|
512
|
+
},
|
|
504
513
|
}),
|
|
505
514
|
loc: {
|
|
506
515
|
filePath: relative(
|
|
@@ -535,6 +544,9 @@ describe('TargetResolver', () => {
|
|
|
535
544
|
loc: undefined,
|
|
536
545
|
sourceType: 'module',
|
|
537
546
|
unstableSingleFileOutput: false,
|
|
547
|
+
customEnv: {
|
|
548
|
+
useFlag: 'true',
|
|
549
|
+
},
|
|
538
550
|
}),
|
|
539
551
|
loc: {
|
|
540
552
|
filePath: relative(
|