@atlaspack/bundler-default 2.14.5-canary.30 → 2.14.5-canary.301

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +496 -0
  2. package/dist/DefaultBundler.js +84 -0
  3. package/dist/MonolithicBundler.js +68 -0
  4. package/dist/bundleMerge.js +137 -0
  5. package/dist/bundlerConfig.js +223 -0
  6. package/dist/decorateLegacyGraph.js +189 -0
  7. package/dist/idealGraph.js +1471 -0
  8. package/dist/memoize.js +31 -0
  9. package/dist/stats.js +69 -0
  10. package/lib/DefaultBundler.js +6 -1
  11. package/lib/MonolithicBundler.js +11 -3
  12. package/lib/bundleMerge.js +106 -37
  13. package/lib/bundlerConfig.js +52 -6
  14. package/lib/decorateLegacyGraph.js +24 -3
  15. package/lib/idealGraph.js +410 -55
  16. package/lib/memoize.js +39 -0
  17. package/lib/stats.js +85 -0
  18. package/lib/types/DefaultBundler.d.ts +18 -0
  19. package/lib/types/MonolithicBundler.d.ts +2 -0
  20. package/lib/types/bundleMerge.d.ts +9 -0
  21. package/lib/types/bundlerConfig.d.ts +36 -0
  22. package/lib/types/decorateLegacyGraph.d.ts +3 -0
  23. package/lib/types/idealGraph.d.ts +40 -0
  24. package/lib/types/memoize.d.ts +2 -0
  25. package/lib/types/stats.d.ts +16 -0
  26. package/package.json +20 -12
  27. package/src/{DefaultBundler.js → DefaultBundler.ts} +21 -6
  28. package/src/{MonolithicBundler.js → MonolithicBundler.ts} +17 -5
  29. package/src/bundleMerge.ts +250 -0
  30. package/src/{bundlerConfig.js → bundlerConfig.ts} +106 -45
  31. package/src/{decorateLegacyGraph.js → decorateLegacyGraph.ts} +26 -7
  32. package/src/{idealGraph.js → idealGraph.ts} +729 -137
  33. package/src/memoize.ts +32 -0
  34. package/src/stats.ts +97 -0
  35. package/tsconfig.json +30 -0
  36. package/tsconfig.tsbuildinfo +1 -0
  37. package/src/bundleMerge.js +0 -103
package/CHANGELOG.md CHANGED
@@ -1,5 +1,501 @@
1
1
  # @atlaspack/bundler-default
2
2
 
3
+ ## 3.4.11
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`7dd5bd8`](https://github.com/atlassian-labs/atlaspack/commit/7dd5bd89ff60c7b324347d772729eb4c3314f01e), [`c8a0e51`](https://github.com/atlassian-labs/atlaspack/commit/c8a0e51b1096d038a64644ad02fe68383f58682a), [`8eb84ee`](https://github.com/atlassian-labs/atlaspack/commit/8eb84ee61a42bfe87c58079b610802b07a6a13e4), [`71900f3`](https://github.com/atlassian-labs/atlaspack/commit/71900f3508d53c3882ca8ea71501ba3069687d4e), [`73168c2`](https://github.com/atlassian-labs/atlaspack/commit/73168c275a5d9abff9907bcf536b340bca1ed5f0), [`617a318`](https://github.com/atlassian-labs/atlaspack/commit/617a318ddc9419b38360257353fec50b9051ee13), [`2c4953e`](https://github.com/atlassian-labs/atlaspack/commit/2c4953e20dc1a6b012792081667aefeb9340505e), [`3fe7d4e`](https://github.com/atlassian-labs/atlaspack/commit/3fe7d4e821bee162fcbbaf9278b107a5eead944f)]:
8
+ - @atlaspack/rust@3.11.0
9
+ - @atlaspack/types-internal@2.21.0
10
+ - @atlaspack/feature-flags@2.27.0
11
+ - @atlaspack/utils@3.2.0
12
+ - @atlaspack/graph@3.6.1
13
+ - @atlaspack/plugin@2.14.39
14
+
15
+ ## 3.4.10
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [[`ec3abe4`](https://github.com/atlassian-labs/atlaspack/commit/ec3abe4dffc98560a850fd2f71fb566577e6c99c), [`c7fe3f7`](https://github.com/atlassian-labs/atlaspack/commit/c7fe3f76f247e9e20299e205e2df0a16c418eaf2), [`cfb4707`](https://github.com/atlassian-labs/atlaspack/commit/cfb4707087498e4fa4dcf10753fe984a248d196b), [`1468695`](https://github.com/atlassian-labs/atlaspack/commit/1468695fc0c9d06f060a6da9e9b0e154f11dff34), [`f31b041`](https://github.com/atlassian-labs/atlaspack/commit/f31b04107e9077c9946aadb99f6f91bb69703bb7), [`8180981`](https://github.com/atlassian-labs/atlaspack/commit/8180981be14c00f9570adb70d3f350bd91d6ec0a), [`ae77e74`](https://github.com/atlassian-labs/atlaspack/commit/ae77e7452a466b43b3fa5bed24d4ba26345ed765), [`f0a496f`](https://github.com/atlassian-labs/atlaspack/commit/f0a496f70fc8652e090cf1b3f6260e8cfbb796e2), [`7d7a55d`](https://github.com/atlassian-labs/atlaspack/commit/7d7a55dd6395ec391a2e4c33b3dec0d1ea477d4c), [`540f253`](https://github.com/atlassian-labs/atlaspack/commit/540f253dfdcd1a5caebbdc0b197319d439404aae)]:
20
+ - @atlaspack/feature-flags@2.26.2
21
+ - @atlaspack/rust@3.10.0
22
+ - @atlaspack/graph@3.6.0
23
+ - @atlaspack/utils@3.1.2
24
+ - @atlaspack/types-internal@2.20.8
25
+ - @atlaspack/plugin@2.14.38
26
+
27
+ ## 3.4.9
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [[`339b600`](https://github.com/atlassian-labs/atlaspack/commit/339b60095d755742cea50f811d08ccc44a4ae521), [`373ee2d`](https://github.com/atlassian-labs/atlaspack/commit/373ee2d3b5cc315df1e90e647619f915892e2b87)]:
32
+ - @atlaspack/rust@3.9.1
33
+ - @atlaspack/feature-flags@2.26.1
34
+ - @atlaspack/utils@3.1.1
35
+ - @atlaspack/graph@3.5.26
36
+ - @atlaspack/types-internal@2.20.7
37
+ - @atlaspack/plugin@2.14.37
38
+
39
+ ## 3.4.8
40
+
41
+ ### Patch Changes
42
+
43
+ - [#852](https://github.com/atlassian-labs/atlaspack/pull/852) [`5776be2`](https://github.com/atlassian-labs/atlaspack/commit/5776be21f70a3f2b9471ba33da3ba1a883f21f1a) Thanks [@marcins](https://github.com/marcins)! - Support passing a function for source property in schema validation to allow for deferred reads of files
44
+
45
+ - Updated dependencies [[`02f6aa1`](https://github.com/atlassian-labs/atlaspack/commit/02f6aa1906953fc184d2b49c905c2ef815cb878d), [`58527ee`](https://github.com/atlassian-labs/atlaspack/commit/58527eec15c1aebaaadbeb63586f3082c16beae3), [`525898e`](https://github.com/atlassian-labs/atlaspack/commit/525898e33cc229a4bc938ae853732be36d20c01a), [`cfb39a0`](https://github.com/atlassian-labs/atlaspack/commit/cfb39a0d729eb620cf2ca1611750a2bf7a080d08), [`d0c7bea`](https://github.com/atlassian-labs/atlaspack/commit/d0c7bea04458255b4c5d4299600e734b5f919fe1), [`1086c6a`](https://github.com/atlassian-labs/atlaspack/commit/1086c6a2c59271b63b3fb78e6acdb9d3a0dbf354), [`9cd9521`](https://github.com/atlassian-labs/atlaspack/commit/9cd9521978f783046e2ae4ce78f2de7aeb07d073), [`5776be2`](https://github.com/atlassian-labs/atlaspack/commit/5776be21f70a3f2b9471ba33da3ba1a883f21f1a)]:
46
+ - @atlaspack/rust@3.9.0
47
+ - @atlaspack/feature-flags@2.26.0
48
+ - @atlaspack/utils@3.1.0
49
+ - @atlaspack/graph@3.5.25
50
+ - @atlaspack/types-internal@2.20.6
51
+ - @atlaspack/plugin@2.14.36
52
+
53
+ ## 3.4.7
54
+
55
+ ### Patch Changes
56
+
57
+ - 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)]:
58
+ - @atlaspack/feature-flags@2.25.5
59
+ - @atlaspack/rust@3.8.3
60
+ - @atlaspack/types-internal@2.20.5
61
+ - @atlaspack/utils@3.0.3
62
+ - @atlaspack/graph@3.5.24
63
+ - @atlaspack/plugin@2.14.35
64
+
65
+ ## 3.4.6
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [[`662d3c6`](https://github.com/atlassian-labs/atlaspack/commit/662d3c627888b16bf27df15cfac5a9094509e93d)]:
70
+ - @atlaspack/feature-flags@2.25.4
71
+ - @atlaspack/graph@3.5.23
72
+ - @atlaspack/types-internal@2.20.4
73
+ - @atlaspack/utils@3.0.2
74
+ - @atlaspack/plugin@2.14.34
75
+
76
+ ## 3.4.5
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [[`236e546`](https://github.com/atlassian-labs/atlaspack/commit/236e5465863dca6044a7191e05260a5b924c342e), [`f07351a`](https://github.com/atlassian-labs/atlaspack/commit/f07351a2398b6a8e5155a2daad77e69b7dcb2b4b)]:
81
+ - @atlaspack/utils@3.0.1
82
+ - @atlaspack/feature-flags@2.25.3
83
+ - @atlaspack/graph@3.5.22
84
+ - @atlaspack/types-internal@2.20.3
85
+ - @atlaspack/plugin@2.14.33
86
+
87
+ ## 3.4.4
88
+
89
+ ### Patch Changes
90
+
91
+ - Updated dependencies [[`0207171`](https://github.com/atlassian-labs/atlaspack/commit/0207171e59e985c51e105aec2e0a99de174374bd), [`10ee3fa`](https://github.com/atlassian-labs/atlaspack/commit/10ee3fa5b75a92acde8973673d9b3c5b6f3958e5), [`bbe4e28`](https://github.com/atlassian-labs/atlaspack/commit/bbe4e28c89e5e9284bd730075d4d6f2a3cb37b21), [`1180103`](https://github.com/atlassian-labs/atlaspack/commit/118010351ed444f8178988afb3f77807154dd933), [`2bc93b1`](https://github.com/atlassian-labs/atlaspack/commit/2bc93b17cea07fd7cbb68acec84d8471345a22b4)]:
92
+ - @atlaspack/feature-flags@2.25.2
93
+ - @atlaspack/rust@3.8.2
94
+ - @atlaspack/utils@3.0.0
95
+ - @atlaspack/graph@3.5.21
96
+ - @atlaspack/types-internal@2.20.2
97
+ - @atlaspack/plugin@2.14.32
98
+
99
+ ## 3.4.3
100
+
101
+ ### Patch Changes
102
+
103
+ - [#785](https://github.com/atlassian-labs/atlaspack/pull/785) [`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922) Thanks [@matt-koko](https://github.com/matt-koko)! - We need to re-publish every package in Atlaspack with the corrected types field.
104
+
105
+ - Updated dependencies [[`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922), [`686a398`](https://github.com/atlassian-labs/atlaspack/commit/686a398faa1f9e19cbf9274add2c46e246bafba8)]:
106
+ - @atlaspack/diagnostic@2.14.4
107
+ - @atlaspack/feature-flags@2.25.1
108
+ - @atlaspack/graph@3.5.20
109
+ - @atlaspack/plugin@2.14.31
110
+ - @atlaspack/rust@3.8.1
111
+ - @atlaspack/types-internal@2.20.1
112
+ - @atlaspack/utils@2.19.3
113
+
114
+ ## 3.4.2
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [[`7a52bab`](https://github.com/atlassian-labs/atlaspack/commit/7a52bab6281e8edbfa66af248eb6f872c6b4b7bd), [`eedcbc4`](https://github.com/atlassian-labs/atlaspack/commit/eedcbc408fc1e86a2a8e25f1a41c57146d8529e1), [`5a0363f`](https://github.com/atlassian-labs/atlaspack/commit/5a0363f1086e81068959b87e92064bed5a11a9b4), [`038e87a`](https://github.com/atlassian-labs/atlaspack/commit/038e87a7858d39556d59d3a2d17db534d45f62c6), [`f6532d7`](https://github.com/atlassian-labs/atlaspack/commit/f6532d7a4f7f007bd4e5e36af04dd466f0b9f572), [`0684997`](https://github.com/atlassian-labs/atlaspack/commit/0684997c127a6204af1376b36e556fddd1ba5557), [`602f8ed`](https://github.com/atlassian-labs/atlaspack/commit/602f8ed9d8381301df8b2cc82c1d5cf6f2f94fec)]:
119
+ - @atlaspack/feature-flags@2.25.0
120
+ - @atlaspack/types-internal@2.20.0
121
+ - @atlaspack/rust@3.8.0
122
+ - @atlaspack/graph@3.5.19
123
+ - @atlaspack/utils@2.19.2
124
+ - @atlaspack/plugin@2.14.30
125
+
126
+ ## 3.4.1
127
+
128
+ ### Patch Changes
129
+
130
+ - Updated dependencies [[`830261d`](https://github.com/atlassian-labs/atlaspack/commit/830261dcf4a40293090b61cab52fd75d5683c73f), [`53dd47b`](https://github.com/atlassian-labs/atlaspack/commit/53dd47bd6d23cd47f87297347f03a609ab38a03d)]:
131
+ - @atlaspack/feature-flags@2.24.1
132
+ - @atlaspack/rust@3.7.0
133
+ - @atlaspack/graph@3.5.18
134
+ - @atlaspack/types-internal@2.19.5
135
+ - @atlaspack/utils@2.19.1
136
+ - @atlaspack/plugin@2.14.29
137
+
138
+ ## 3.4.0
139
+
140
+ ### Minor Changes
141
+
142
+ - [#753](https://github.com/atlassian-labs/atlaspack/pull/753) [`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add configurable async bundle merging and redundant shared bundle removal behind a feature flag.
143
+
144
+ ### Patch Changes
145
+
146
+ - [#761](https://github.com/atlassian-labs/atlaspack/pull/761) [`8843980`](https://github.com/atlassian-labs/atlaspack/commit/88439807be20025fd3433380204ff1205079729e) Thanks [@marcins](https://github.com/marcins)! - Adds a new feature flag `singleFileOutputStableName` - when enabled, bundles produced by the experimental single file output bundler will have stable names (i.e. no hash).
147
+
148
+ - Updated dependencies [[`f0349a6`](https://github.com/atlassian-labs/atlaspack/commit/f0349a6b9b04755088f121095ca6301a2ada3767), [`a5081c3`](https://github.com/atlassian-labs/atlaspack/commit/a5081c3f9207d28716ee4edd3841de1830ea4b80), [`f930003`](https://github.com/atlassian-labs/atlaspack/commit/f930003364fdc31e5487520ebe256f1a9389f579), [`f930003`](https://github.com/atlassian-labs/atlaspack/commit/f930003364fdc31e5487520ebe256f1a9389f579), [`8843980`](https://github.com/atlassian-labs/atlaspack/commit/88439807be20025fd3433380204ff1205079729e)]:
149
+ - @atlaspack/feature-flags@2.24.0
150
+ - @atlaspack/utils@2.19.0
151
+ - @atlaspack/graph@3.5.17
152
+ - @atlaspack/types-internal@2.19.4
153
+ - @atlaspack/plugin@2.14.28
154
+
155
+ ## 3.3.4
156
+
157
+ ### Patch Changes
158
+
159
+ - Updated dependencies [[`3cfb7cf`](https://github.com/atlassian-labs/atlaspack/commit/3cfb7cfd90b78a5c48ce717e779ff789769825a3)]:
160
+ - @atlaspack/feature-flags@2.23.2
161
+ - @atlaspack/rust@3.6.2
162
+ - @atlaspack/graph@3.5.16
163
+ - @atlaspack/types-internal@2.19.3
164
+ - @atlaspack/utils@2.18.4
165
+ - @atlaspack/plugin@2.14.27
166
+
167
+ ## 3.3.3
168
+
169
+ ### Patch Changes
170
+
171
+ - [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
172
+
173
+ - Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2)]:
174
+ - @atlaspack/types-internal@2.19.2
175
+ - @atlaspack/feature-flags@2.23.1
176
+ - @atlaspack/diagnostic@2.14.3
177
+ - @atlaspack/plugin@2.14.26
178
+ - @atlaspack/graph@3.5.15
179
+ - @atlaspack/utils@2.18.3
180
+ - @atlaspack/rust@3.6.1
181
+
182
+ ## 3.3.2
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [[`f6b3f22`](https://github.com/atlassian-labs/atlaspack/commit/f6b3f2276c7e417580b49c4879563aab51f156b1)]:
187
+ - @atlaspack/feature-flags@2.23.0
188
+ - @atlaspack/graph@3.5.14
189
+ - @atlaspack/types-internal@2.19.1
190
+ - @atlaspack/utils@2.18.2
191
+ - @atlaspack/plugin@2.14.25
192
+
193
+ ## 3.3.1
194
+
195
+ ### Patch Changes
196
+
197
+ - Updated dependencies [[`ad26146`](https://github.com/atlassian-labs/atlaspack/commit/ad26146f13b4c1cc65d4a0f9c67060b90ef14ff3), [`f1b48e7`](https://github.com/atlassian-labs/atlaspack/commit/f1b48e7a04e005cef0f36a3e692087a9ecdb6f7a), [`7f5841c`](https://github.com/atlassian-labs/atlaspack/commit/7f5841c39df049f9546cccbeea2a7337e0337b45), [`73dd7ba`](https://github.com/atlassian-labs/atlaspack/commit/73dd7baab69456ef2f6e4a0cc7dbb04f407eb148)]:
198
+ - @atlaspack/rust@3.6.0
199
+ - @atlaspack/types-internal@2.19.0
200
+ - @atlaspack/feature-flags@2.22.0
201
+ - @atlaspack/utils@2.18.1
202
+ - @atlaspack/graph@3.5.13
203
+ - @atlaspack/plugin@2.14.24
204
+
205
+ ## 3.3.0
206
+
207
+ ### Minor Changes
208
+
209
+ - [#731](https://github.com/atlassian-labs/atlaspack/pull/731) [`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2) Thanks [@marcins](https://github.com/marcins)! - Implement "inline isolated" scripts
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
214
+ - @atlaspack/feature-flags@2.21.0
215
+ - @atlaspack/utils@2.18.0
216
+ - @atlaspack/rust@3.5.0
217
+ - @atlaspack/graph@3.5.12
218
+ - @atlaspack/plugin@2.14.23
219
+
220
+ ## 3.2.1
221
+
222
+ ### Patch Changes
223
+
224
+ - [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
225
+
226
+ - Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94), [`12bee0e`](https://github.com/atlassian-labs/atlaspack/commit/12bee0e23f0464d7f6bd3e24fbe0d19c126d587d)]:
227
+ - @atlaspack/feature-flags@2.20.1
228
+ - @atlaspack/diagnostic@2.14.2
229
+ - @atlaspack/plugin@2.14.22
230
+ - @atlaspack/graph@3.5.11
231
+ - @atlaspack/utils@2.17.4
232
+ - @atlaspack/rust@3.4.2
233
+
234
+ ## 3.2.0
235
+
236
+ ### Minor Changes
237
+
238
+ - [#721](https://github.com/atlassian-labs/atlaspack/pull/721) [`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd) Thanks [@benjervis](https://github.com/benjervis)! - Add support for bundle merging based on `webpackChunkName` comments.
239
+
240
+ Adding a `webpackChunkName` comment to an import will allow the bundler to merge multiple imports into a single bundle.
241
+
242
+ e.g.:
243
+
244
+ ```ts
245
+ import(/* webpackChunkName: "my-chunk" */ './my-module');
246
+ import(/* webpackChunkName: "my-chunk" */ './another-module');
247
+ ```
248
+
249
+ This can be enabled with the feature flag `supportWebpackChunkName`.
250
+
251
+ ### Patch Changes
252
+
253
+ - Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
254
+ - @atlaspack/feature-flags@2.20.0
255
+ - @atlaspack/graph@3.5.10
256
+ - @atlaspack/utils@2.17.3
257
+ - @atlaspack/plugin@2.14.21
258
+
259
+ ## 3.1.2
260
+
261
+ ### Patch Changes
262
+
263
+ - [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
264
+
265
+ - Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa), [`1c7865a`](https://github.com/atlassian-labs/atlaspack/commit/1c7865a64451116d94015e248302435839d347c0), [`a0b959f`](https://github.com/atlassian-labs/atlaspack/commit/a0b959fbf61fc3f820ff03c7e8988945fe40a91a)]:
266
+ - @atlaspack/plugin@2.14.20
267
+ - @atlaspack/feature-flags@2.19.2
268
+ - @atlaspack/graph@3.5.9
269
+ - @atlaspack/utils@2.17.2
270
+
271
+ ## 3.1.1
272
+
273
+ ### Patch Changes
274
+
275
+ - Updated dependencies [[`13aef17`](https://github.com/atlassian-labs/atlaspack/commit/13aef177eea289a6e40d2113b5ec1ac9be18a33d)]:
276
+ - @atlaspack/feature-flags@2.19.1
277
+ - @atlaspack/graph@3.5.8
278
+ - @atlaspack/utils@2.17.1
279
+ - @atlaspack/plugin@2.14.19
280
+
281
+ ## 3.1.0
282
+
283
+ ### Minor Changes
284
+
285
+ - [#640](https://github.com/atlassian-labs/atlaspack/pull/640) [`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d) Thanks [@JakeLane](https://github.com/JakeLane)! - Clean up conditional bundling feature flags
286
+
287
+ ### Patch Changes
288
+
289
+ - Updated dependencies [[`dbb4072`](https://github.com/atlassian-labs/atlaspack/commit/dbb40721ebeb45990a14ba04e6b44e7f836fb32d), [`becf977`](https://github.com/atlassian-labs/atlaspack/commit/becf977f625d5ee46dae3d4c679f173bf5f40cc0), [`becf977`](https://github.com/atlassian-labs/atlaspack/commit/becf977f625d5ee46dae3d4c679f173bf5f40cc0), [`c4415a4`](https://github.com/atlassian-labs/atlaspack/commit/c4415a455543d984ca28452c2cb87a794d22497c), [`f0f7c71`](https://github.com/atlassian-labs/atlaspack/commit/f0f7c7168a1d3d18c6f30d2daed611275692b7c5), [`de23e0c`](https://github.com/atlassian-labs/atlaspack/commit/de23e0ce49d5504fe3947ac26640a3d951087da3), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
290
+ - @atlaspack/feature-flags@2.19.0
291
+ - @atlaspack/utils@2.17.0
292
+ - @atlaspack/rust@3.4.1
293
+ - @atlaspack/graph@3.5.7
294
+ - @atlaspack/plugin@2.14.18
295
+
296
+ ## 3.0.8
297
+
298
+ ### Patch Changes
299
+
300
+ - Updated dependencies [[`c75bf55`](https://github.com/atlassian-labs/atlaspack/commit/c75bf553fff4decc285b5fd499a275853b18f8f2)]:
301
+ - @atlaspack/rust@3.4.0
302
+ - @atlaspack/utils@2.16.1
303
+ - @atlaspack/plugin@2.14.17
304
+
305
+ ## 3.0.7
306
+
307
+ ### Patch Changes
308
+
309
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c), [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
310
+ - @atlaspack/feature-flags@2.18.4
311
+ - @atlaspack/utils@2.16.0
312
+ - @atlaspack/graph@3.5.6
313
+ - @atlaspack/plugin@2.14.16
314
+
315
+ ## 3.0.6
316
+
317
+ ### Patch Changes
318
+
319
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
320
+ - @atlaspack/feature-flags@2.18.3
321
+ - @atlaspack/graph@3.5.5
322
+ - @atlaspack/utils@2.15.3
323
+ - @atlaspack/plugin@2.14.15
324
+
325
+ ## 3.0.5
326
+
327
+ ### Patch Changes
328
+
329
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
330
+ - @atlaspack/feature-flags@2.18.2
331
+ - @atlaspack/graph@3.5.4
332
+ - @atlaspack/utils@2.15.2
333
+ - @atlaspack/plugin@2.14.14
334
+
335
+ ## 3.0.4
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies [[`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
340
+ - @atlaspack/feature-flags@2.18.1
341
+ - @atlaspack/utils@2.15.1
342
+ - @atlaspack/graph@3.5.3
343
+ - @atlaspack/plugin@2.14.13
344
+
345
+ ## 3.0.3
346
+
347
+ ### Patch Changes
348
+
349
+ - [#622](https://github.com/atlassian-labs/atlaspack/pull/622) [`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c) Thanks [@benjervis](https://github.com/benjervis)! - Change the overlap calculation system in findMergeCandidates to improve performance
350
+
351
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2), [`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c)]:
352
+ - @atlaspack/feature-flags@2.18.0
353
+ - @atlaspack/utils@2.15.0
354
+ - @atlaspack/graph@3.5.2
355
+ - @atlaspack/plugin@2.14.12
356
+
357
+ ## 3.0.2
358
+
359
+ ### Patch Changes
360
+
361
+ - [#613](https://github.com/atlassian-labs/atlaspack/pull/613) [`4ca19d8`](https://github.com/atlassian-labs/atlaspack/commit/4ca19d8060dfcd279183e4039f2ecb43334ac44c) Thanks [@marcins](https://github.com/marcins)! - Ensure that constant modules are correctly included in MSBs even if they wouldn't otherwise be.
362
+
363
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
364
+ - @atlaspack/feature-flags@2.17.0
365
+ - @atlaspack/graph@3.5.1
366
+ - @atlaspack/utils@2.14.11
367
+ - @atlaspack/plugin@2.14.11
368
+
369
+ ## 3.0.1
370
+
371
+ ### Patch Changes
372
+
373
+ - [#608](https://github.com/atlassian-labs/atlaspack/pull/608) [`471b99e`](https://github.com/atlassian-labs/atlaspack/commit/471b99e41b4d97328c88f65e90bea284372cb1b0) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fix require of ES Module error
374
+
375
+ ## 3.0.0
376
+
377
+ ### Major Changes
378
+
379
+ - [#600](https://github.com/atlassian-labs/atlaspack/pull/600) [`1b52b99`](https://github.com/atlassian-labs/atlaspack/commit/1b52b99db4298b04c1a6eb0f97994d75a2d436f9) Thanks [@mattcompiles](https://github.com/mattcompiles)! - ### Breaking change
380
+
381
+ This new config replaces the previously released `sharedBundleMergeThreshold`.
382
+
383
+ The following options are available for each merge group.
384
+
385
+ ### Options
386
+
387
+ #### overlapThreshold
388
+
389
+ > The same as `sharedBundleMergeThreshold` from #535
390
+
391
+ Merge bundles share a percentage of source bundles
392
+
393
+ ```json
394
+ "@atlaspack/bundler-default": {
395
+ "sharedBundleMerge": [{
396
+ "overlapThreshold": 0.75
397
+ }]
398
+ }
399
+ ```
400
+
401
+ #### maxBundleSize
402
+
403
+ Merge bundles that are smaller than a configured amount of bytes.
404
+
405
+ > Keep in mind these bytes are pre-optimisation
406
+
407
+ ```json
408
+ "@atlaspack/bundler-default": {
409
+ "sharedBundleMerge": [{
410
+ "maxBundleSize": 20000
411
+ }]
412
+ }
413
+ ```
414
+
415
+ #### sourceBundles
416
+
417
+ Merge bundles that share a set of source bundles. The matching is relative to the project root, like how manual shared bundle roots work.
418
+
419
+ ```json
420
+ "@atlaspack/bundler-default": {
421
+ "sharedBundleMerge": [{
422
+ "sourceBundles": ["src/important-route", "src/important-route-2"]
423
+ }]
424
+ }
425
+ ```
426
+
427
+ #### minBundlesInGroup
428
+
429
+ Merge bundles that belong to a bundle group that's larger than a set amount. This is useful for targetting bundles that would be deleted by the `maxParallelRequests` option.
430
+
431
+ ```json
432
+ "@atlaspack/bundler-default": {
433
+ "maxParallelRequests": 30,
434
+ "sharedBundleMerge": [{
435
+ "minBundlesInGroup": 30
436
+ }]
437
+ }
438
+ ```
439
+
440
+ ## Combining options
441
+
442
+ When multiple options are provided, all must be true for a merge to be relevant.
443
+
444
+ For example, merge bundles that are smaller than 20kb and share at least 50% of the same source bundles.
445
+
446
+ ```json
447
+ "@atlaspack/bundler-default": {
448
+ "sharedBundleMerge": [{
449
+ "overlapThreshold": 0.5,
450
+ "maxBundleSize": 20000
451
+ }]
452
+ }
453
+ ```
454
+
455
+ ## Multiple merges
456
+
457
+ You can also have multiple merge configs.
458
+
459
+ ```json
460
+ "@atlaspack/bundler-default": {
461
+ "sharedBundleMerge": [
462
+ {
463
+ "overlapThreshold": 0.75,
464
+ "maxBundleSize": 20000
465
+ },
466
+ {
467
+ "minBundlesInGroup": 30
468
+ "sourceBundles": ["src/important-route", "src/important-route-2"]
469
+ }
470
+ ]
471
+ }
472
+ ```
473
+
474
+ ### Patch Changes
475
+
476
+ - Updated dependencies [[`1b52b99`](https://github.com/atlassian-labs/atlaspack/commit/1b52b99db4298b04c1a6eb0f97994d75a2d436f9)]:
477
+ - @atlaspack/graph@3.5.0
478
+
479
+ ## 2.16.3
480
+
481
+ ### Patch Changes
482
+
483
+ - Updated dependencies [[`35fdd4b`](https://github.com/atlassian-labs/atlaspack/commit/35fdd4b52da0af20f74667f7b8adfb2f90279b7c), [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca)]:
484
+ - @atlaspack/rust@3.3.5
485
+ - @atlaspack/plugin@2.14.10
486
+ - @atlaspack/utils@2.14.10
487
+
488
+ ## 2.16.2
489
+
490
+ ### Patch Changes
491
+
492
+ - Updated dependencies [[`124b7ff`](https://github.com/atlassian-labs/atlaspack/commit/124b7fff44f71aac9fbad289a9a9509b3dfc9aaa), [`e052521`](https://github.com/atlassian-labs/atlaspack/commit/e0525210850ed1606146eb86991049cf567c5dec), [`15c6d70`](https://github.com/atlassian-labs/atlaspack/commit/15c6d7000bd89da876bc590aa75b17a619a41896), [`e4d966c`](https://github.com/atlassian-labs/atlaspack/commit/e4d966c3c9c4292c5013372ae65b10d19d4bacc6), [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818), [`42a775d`](https://github.com/atlassian-labs/atlaspack/commit/42a775de8eec638ad188f3271964170d8c04d84b), [`29c2f10`](https://github.com/atlassian-labs/atlaspack/commit/29c2f106de9679adfb5afa04e1910471dc65a427), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b), [`1ef91fc`](https://github.com/atlassian-labs/atlaspack/commit/1ef91fcc863fdd2831511937083dbbc1263b3d9d)]:
493
+ - @atlaspack/rust@3.3.4
494
+ - @atlaspack/feature-flags@2.16.0
495
+ - @atlaspack/utils@2.14.9
496
+ - @atlaspack/graph@3.4.7
497
+ - @atlaspack/plugin@2.14.9
498
+
3
499
  ## 2.16.1
4
500
 
5
501
  ### Patch Changes
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const plugin_1 = require("@atlaspack/plugin");
7
+ const utils_1 = require("@atlaspack/utils");
8
+ const assert_1 = __importDefault(require("assert"));
9
+ const bundlerConfig_1 = require("./bundlerConfig");
10
+ const decorateLegacyGraph_1 = require("./decorateLegacyGraph");
11
+ const idealGraph_1 = require("./idealGraph");
12
+ const MonolithicBundler_1 = require("./MonolithicBundler");
13
+ /**
14
+ *
15
+ * The Bundler works by creating an IdealGraph, which contains a BundleGraph that models bundles
16
+ * connected to other bundles by what references them, and thus models BundleGroups.
17
+ *
18
+ * First, we enter `bundle({bundleGraph, config})`. Here, "bundleGraph" is actually just the
19
+ * assetGraph turned into a type `MutableBundleGraph`, which will then be mutated in decorate,
20
+ * and turned into what we expect the bundleGraph to be as per the old (default) bundler structure
21
+ * & what the rest of Atlaspack expects a BundleGraph to be.
22
+ *
23
+ * `bundle({bundleGraph, config})` First gets a Mapping of target to entries, In most cases there is
24
+ * only one target, and one or more entries. (Targets are pertinent in monorepos or projects where you
25
+ * will have two or more distDirs, or output folders.) Then calls create IdealGraph and Decorate per target.
26
+ *
27
+ */
28
+ exports.default = new plugin_1.Bundler({
29
+ loadConfig({ config, options, logger }) {
30
+ return (0, bundlerConfig_1.loadBundlerConfig)(config, options, logger);
31
+ },
32
+ bundle({ bundleGraph, config, logger }) {
33
+ let targetMap = getEntryByTarget(bundleGraph); // Organize entries by target output folder/ distDir
34
+ // @ts-expect-error TS2304
35
+ let graphs = [];
36
+ for (let entries of targetMap.values()) {
37
+ let singleFileEntries = new Map();
38
+ let idealGraphEntries = new Map();
39
+ // Separate out the monolith bundles based on the option on target
40
+ for (let [entryAsset, entryDep] of entries.entries()) {
41
+ if (entryDep.target?.env.unstableSingleFileOutput === true) {
42
+ singleFileEntries.set(entryAsset, entryDep);
43
+ }
44
+ else {
45
+ idealGraphEntries.set(entryAsset, entryDep);
46
+ }
47
+ }
48
+ // Create separate bundleGraphs per distDir
49
+ graphs.push((0, idealGraph_1.createIdealGraph)(bundleGraph, config, idealGraphEntries, logger));
50
+ // Do this after the ideal graph so that the mutation of the bundleGraph doesn't
51
+ // interfere with the main bundling algorithm
52
+ for (let [entryAsset, entryDep] of singleFileEntries.entries()) {
53
+ (0, MonolithicBundler_1.addJSMonolithBundle)(bundleGraph, entryAsset, entryDep);
54
+ }
55
+ }
56
+ for (let g of graphs) {
57
+ (0, decorateLegacyGraph_1.decorateLegacyGraph)(g, bundleGraph); //mutate original graph
58
+ }
59
+ },
60
+ optimize() { },
61
+ });
62
+ function getEntryByTarget(bundleGraph) {
63
+ // Find entries from assetGraph per target
64
+ let targets = new utils_1.DefaultMap(() => new Map());
65
+ bundleGraph.traverse({
66
+ enter(
67
+ // @ts-expect-error TS2304
68
+ node, context,
69
+ // @ts-expect-error TS2304
70
+ actions) {
71
+ if (node.type !== 'asset') {
72
+ return node;
73
+ }
74
+ (0, assert_1.default)(context != null &&
75
+ context.type === 'dependency' &&
76
+ context.value.isEntry &&
77
+ context.value.target != null);
78
+ targets.get(context.value.target.distDir).set(node.value, context.value);
79
+ actions.skipChildren();
80
+ return node;
81
+ },
82
+ });
83
+ return targets;
84
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.addJSMonolithBundle = addJSMonolithBundle;
7
+ const feature_flags_1 = require("@atlaspack/feature-flags");
8
+ const nullthrows_1 = __importDefault(require("nullthrows"));
9
+ function addJSMonolithBundle(bundleGraph, entryAsset, entryDep) {
10
+ let target = (0, nullthrows_1.default)(entryDep.target, 'Expected dependency to have a valid target');
11
+ // Create a single bundle to hold all JS assets
12
+ let bundle = bundleGraph.createBundle({
13
+ entryAsset,
14
+ target,
15
+ needsStableName: (0, feature_flags_1.getFeatureFlag)('singleFileOutputStableName'),
16
+ });
17
+ bundleGraph.traverse((node, _, actions) => {
18
+ // JS assets can be added to the bundle, but the rest are ignored
19
+ if (node.type === 'asset' && node.value.type === 'js') {
20
+ bundleGraph.addAssetToBundle(node.value, bundle);
21
+ return;
22
+ }
23
+ if (node.type !== 'dependency') {
24
+ return;
25
+ }
26
+ let dependency = node.value;
27
+ if (dependency.priority === 'lazy') {
28
+ // Any async dependencies need to be internalized into the bundle, and will
29
+ // be included by the asset check above
30
+ bundleGraph.internalizeAsyncDependency(bundle, dependency);
31
+ return;
32
+ }
33
+ let assets = bundleGraph.getDependencyAssets(dependency);
34
+ for (const asset of assets) {
35
+ if (asset.bundleBehavior === 'isolated' ||
36
+ asset.bundleBehavior === 'inlineIsolated') {
37
+ throw new Error(`${asset.bundleBehavior === 'isolated' ? 'Isolated' : 'Inline isolated'} assets are not supported for single file output builds`);
38
+ }
39
+ // For assets marked as inline, we create new bundles and let other
40
+ // plugins like optimizers include them in the primary bundle
41
+ if (asset.bundleBehavior === 'inline') {
42
+ // Create a new bundle to hold the isolated asset
43
+ let isolatedBundle = bundleGraph.createBundle({
44
+ entryAsset: asset,
45
+ target,
46
+ bundleBehavior: asset.bundleBehavior,
47
+ });
48
+ bundleGraph.addAssetToBundle(asset, isolatedBundle);
49
+ // Add the new bundle to the bundle graph, in its own bundle group
50
+ bundleGraph.createBundleReference(bundle, isolatedBundle);
51
+ bundleGraph.addBundleToBundleGroup(isolatedBundle, bundleGraph.createBundleGroup(dependency, target));
52
+ // Nothing below the isolated asset needs to go in the main bundle, so
53
+ // we can stop traversal here
54
+ actions.skipChildren();
55
+ // To be properly isolated, all of this asset's dependencies need to go
56
+ // in this new bundle
57
+ bundleGraph.traverse((subNode) => {
58
+ if (subNode.type === 'asset' && subNode.value.type === 'js') {
59
+ bundleGraph.addAssetToBundle(subNode.value, isolatedBundle);
60
+ return;
61
+ }
62
+ }, asset, { skipUnusedDependencies: true });
63
+ }
64
+ }
65
+ }, entryAsset, { skipUnusedDependencies: true });
66
+ let bundleGroup = bundleGraph.createBundleGroup(entryDep, target);
67
+ bundleGraph.addBundleToBundleGroup(bundle, bundleGroup);
68
+ }