@atlaspack/bundler-default 2.14.5-canary.8 → 2.14.5-dev.14

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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # @atlaspack/bundler-default
2
2
 
3
+ ## 2.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#535](https://github.com/atlassian-labs/atlaspack/pull/535) [`a4bc259`](https://github.com/atlassian-labs/atlaspack/commit/a4bc2590196b6c1e743e4edcb0337e8c4c240ab4) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add `sharedBundleMergeThreshold` config option
8
+
9
+ In apps with lots of dynamic imports, many shared bundles are often removed
10
+ from the output to prevent an overload in network requests according to the
11
+ `maxParallelRequests` config. In these cases, setting `sharedBundleMergeThreshold` can
12
+ merge shared bundles with a high overlap in their source bundles (bundles that share the bundle).
13
+ This config trades-off potential overfetching to reduce asset duplication.
14
+
15
+ The following config would merge shared bundles that have a 75% or higher overlap in source bundles.
16
+
17
+ ```json
18
+ {
19
+ "@atlaspack/bundler-default": {
20
+ "sharedBundleMergeThreshold": 0.75
21
+ }
22
+ }
23
+ ```
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies [[`11d6f16`](https://github.com/atlassian-labs/atlaspack/commit/11d6f16b6397dee2f217167e5c98b39edb63f7a7), [`e2ba0f6`](https://github.com/atlassian-labs/atlaspack/commit/e2ba0f69702656f3d1ce95ab1454e35062b13b39), [`d2c50c2`](https://github.com/atlassian-labs/atlaspack/commit/d2c50c2c020888b33bb25b8690d9320c2b69e2a6), [`46a90dc`](https://github.com/atlassian-labs/atlaspack/commit/46a90dccd019a26b222c878a92d23acc75dc67c5)]:
28
+ - @atlaspack/feature-flags@2.14.3
29
+ - @atlaspack/rust@3.3.0
30
+ - @atlaspack/graph@3.4.3
31
+ - @atlaspack/utils@2.14.5
32
+ - @atlaspack/plugin@2.14.5
33
+
3
34
  ## 2.14.4
4
35
 
5
36
  ### Patch Changes
package/lib/idealGraph.js CHANGED
@@ -952,8 +952,8 @@ function createIdealGraph(assetGraph, config, entries, logger) {
952
952
  }
953
953
  }
954
954
  function mergeBundles(bundleGraph, bundleToKeepId, bundleToRemoveId, assetReference) {
955
- let bundleToKeep = (0, _nullthrows().default)(bundleGraph.getNode(bundleToKeepId), '18');
956
- let bundleToRemove = (0, _nullthrows().default)(bundleGraph.getNode(bundleToRemoveId), '19');
955
+ let bundleToKeep = (0, _nullthrows().default)(bundleGraph.getNode(bundleToKeepId));
956
+ let bundleToRemove = (0, _nullthrows().default)(bundleGraph.getNode(bundleToRemoveId));
957
957
  (0, _assert().default)(bundleToKeep !== 'root' && bundleToRemove !== 'root');
958
958
  for (let asset of bundleToRemove.assets) {
959
959
  bundleToKeep.assets.add(asset);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/bundler-default",
3
- "version": "2.14.5-canary.8+46a90dccd",
3
+ "version": "2.14.5-dev.14+8c369e38c",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -16,13 +16,13 @@
16
16
  "node": ">= 16.0.0"
17
17
  },
18
18
  "dependencies": {
19
- "@atlaspack/diagnostic": "2.14.1-canary.76+46a90dccd",
20
- "@atlaspack/feature-flags": "2.14.1-canary.76+46a90dccd",
21
- "@atlaspack/graph": "3.4.1-canary.76+46a90dccd",
22
- "@atlaspack/plugin": "2.14.5-canary.8+46a90dccd",
23
- "@atlaspack/rust": "3.2.1-canary.8+46a90dccd",
24
- "@atlaspack/utils": "2.14.5-canary.8+46a90dccd",
19
+ "@atlaspack/diagnostic": "2.14.1-dev.82+8c369e38c",
20
+ "@atlaspack/feature-flags": "2.14.1-dev.82+8c369e38c",
21
+ "@atlaspack/graph": "3.4.1-dev.82+8c369e38c",
22
+ "@atlaspack/plugin": "2.14.5-dev.14+8c369e38c",
23
+ "@atlaspack/rust": "3.2.1-dev.14+8c369e38c",
24
+ "@atlaspack/utils": "2.14.5-dev.14+8c369e38c",
25
25
  "nullthrows": "^1.1.1"
26
26
  },
27
- "gitHead": "46a90dccd019a26b222c878a92d23acc75dc67c5"
27
+ "gitHead": "8c369e38ccd428409811114aebd6044c27f90705"
28
28
  }
package/src/idealGraph.js CHANGED
@@ -1262,11 +1262,8 @@ export function createIdealGraph(
1262
1262
  bundleToRemoveId: NodeId,
1263
1263
  assetReference: DefaultMap<Asset, Array<[Dependency, Bundle]>>,
1264
1264
  ) {
1265
- let bundleToKeep = nullthrows(bundleGraph.getNode(bundleToKeepId), '18');
1266
- let bundleToRemove = nullthrows(
1267
- bundleGraph.getNode(bundleToRemoveId),
1268
- '19',
1269
- );
1265
+ let bundleToKeep = nullthrows(bundleGraph.getNode(bundleToKeepId));
1266
+ let bundleToRemove = nullthrows(bundleGraph.getNode(bundleToRemoveId));
1270
1267
  invariant(bundleToKeep !== 'root' && bundleToRemove !== 'root');
1271
1268
  for (let asset of bundleToRemove.assets) {
1272
1269
  bundleToKeep.assets.add(asset);