@atlaspack/core 2.16.2-canary.13 → 2.16.2-canary.130

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 (95) hide show
  1. package/CHANGELOG.md +284 -0
  2. package/index.d.ts +4 -0
  3. package/lib/AssetGraph.js +27 -7
  4. package/lib/Atlaspack.js +35 -27
  5. package/lib/AtlaspackConfig.schema.js +7 -1
  6. package/lib/BundleGraph.js +8 -5
  7. package/lib/Dependency.js +6 -2
  8. package/lib/Environment.js +5 -3
  9. package/lib/EnvironmentManager.js +137 -0
  10. package/lib/InternalConfig.js +3 -2
  11. package/lib/PackagerRunner.js +54 -16
  12. package/lib/RequestTracker.js +345 -132
  13. package/lib/SymbolPropagation.js +14 -0
  14. package/lib/Transformation.js +2 -2
  15. package/lib/UncommittedAsset.js +20 -2
  16. package/lib/applyRuntimes.js +2 -1
  17. package/lib/assetUtils.js +2 -1
  18. package/lib/atlaspack-v3/AtlaspackV3.js +16 -3
  19. package/lib/atlaspack-v3/worker/compat/environment.js +2 -2
  20. package/lib/atlaspack-v3/worker/compat/mutable-asset.js +6 -6
  21. package/lib/atlaspack-v3/worker/compat/plugin-config.js +5 -5
  22. package/lib/atlaspack-v3/worker/index.js +3 -0
  23. package/lib/atlaspack-v3/worker/worker.js +8 -0
  24. package/lib/dumpGraphToGraphViz.js +1 -1
  25. package/lib/index.js +29 -1
  26. package/lib/public/Asset.js +7 -9
  27. package/lib/public/Bundle.js +12 -13
  28. package/lib/public/BundleGraph.js +3 -2
  29. package/lib/public/BundleGroup.js +2 -3
  30. package/lib/public/Config.js +95 -8
  31. package/lib/public/Dependency.js +4 -4
  32. package/lib/public/Environment.js +2 -3
  33. package/lib/public/MutableBundleGraph.js +5 -4
  34. package/lib/public/PluginOptions.js +1 -2
  35. package/lib/public/Target.js +4 -4
  36. package/lib/requests/AssetGraphRequest.js +13 -1
  37. package/lib/requests/AssetGraphRequestRust.js +17 -2
  38. package/lib/requests/AssetRequest.js +2 -1
  39. package/lib/requests/BundleGraphRequest.js +13 -1
  40. package/lib/requests/ConfigRequest.js +27 -4
  41. package/lib/requests/DevDepRequest.js +11 -1
  42. package/lib/requests/PathRequest.js +10 -0
  43. package/lib/requests/TargetRequest.js +18 -16
  44. package/lib/requests/WriteBundleRequest.js +15 -3
  45. package/lib/requests/WriteBundlesRequest.js +22 -1
  46. package/lib/resolveOptions.js +7 -4
  47. package/lib/worker.js +18 -1
  48. package/package.json +18 -25
  49. package/src/AssetGraph.js +30 -7
  50. package/src/Atlaspack.js +40 -23
  51. package/src/BundleGraph.js +13 -8
  52. package/src/Dependency.js +13 -5
  53. package/src/Environment.js +9 -6
  54. package/src/EnvironmentManager.js +145 -0
  55. package/src/InternalConfig.js +6 -5
  56. package/src/PackagerRunner.js +72 -20
  57. package/src/RequestTracker.js +526 -157
  58. package/src/SymbolPropagation.js +13 -1
  59. package/src/UncommittedAsset.js +23 -3
  60. package/src/applyRuntimes.js +6 -1
  61. package/src/assetUtils.js +4 -3
  62. package/src/atlaspack-v3/AtlaspackV3.js +24 -3
  63. package/src/atlaspack-v3/worker/compat/plugin-config.js +9 -5
  64. package/src/atlaspack-v3/worker/index.js +2 -1
  65. package/src/atlaspack-v3/worker/worker.js +7 -0
  66. package/src/index.js +5 -1
  67. package/src/public/Asset.js +13 -6
  68. package/src/public/Bundle.js +12 -11
  69. package/src/public/BundleGraph.js +10 -2
  70. package/src/public/BundleGroup.js +2 -2
  71. package/src/public/Config.js +132 -18
  72. package/src/public/Dependency.js +4 -3
  73. package/src/public/Environment.js +2 -2
  74. package/src/public/MutableBundleGraph.js +8 -5
  75. package/src/public/PluginOptions.js +1 -1
  76. package/src/public/Target.js +4 -3
  77. package/src/requests/AssetGraphRequest.js +13 -3
  78. package/src/requests/AssetGraphRequestRust.js +14 -2
  79. package/src/requests/AssetRequest.js +2 -1
  80. package/src/requests/BundleGraphRequest.js +13 -3
  81. package/src/requests/ConfigRequest.js +33 -9
  82. package/src/requests/DevDepRequest.js +22 -9
  83. package/src/requests/PathRequest.js +4 -0
  84. package/src/requests/TargetRequest.js +19 -25
  85. package/src/requests/WriteBundleRequest.js +14 -8
  86. package/src/requests/WriteBundlesRequest.js +31 -3
  87. package/src/resolveOptions.js +4 -2
  88. package/src/types.js +10 -7
  89. package/test/Environment.test.js +43 -34
  90. package/test/EnvironmentManager.test.js +192 -0
  91. package/test/PublicEnvironment.test.js +10 -7
  92. package/test/RequestTracker.test.js +124 -29
  93. package/test/public/Config.test.js +108 -0
  94. package/test/requests/ConfigRequest.test.js +199 -7
  95. package/test/test-utils.js +4 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,289 @@
1
1
  # @atlaspack/core
2
2
 
3
+ ## 2.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#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
8
+
9
+ - [#693](https://github.com/atlassian-labs/atlaspack/pull/693) [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417) Thanks [@mattcompiles](https://github.com/mattcompiles)! - These packages should have been bumped in [pull request 691](https://github.com/atlassian-labs/atlaspack/pull/691).
10
+
11
+ Rectifying by creating a new changeset now.
12
+
13
+ ### Patch Changes
14
+
15
+ - [#690](https://github.com/atlassian-labs/atlaspack/pull/690) [`c4415a4`](https://github.com/atlassian-labs/atlaspack/commit/c4415a455543d984ca28452c2cb87a794d22497c) Thanks [@yamadapc](https://github.com/yamadapc)! - Bug fix for build abort state corruption
16
+
17
+ - [#685](https://github.com/atlassian-labs/atlaspack/pull/685) [`f0f7c71`](https://github.com/atlassian-labs/atlaspack/commit/f0f7c7168a1d3d18c6f30d2daed611275692b7c5) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Fixes an issue where star re-exports of empty files (usually occurring in compiled typescript libraries) could cause exports to undefined at runtime.
18
+ Fix is behind the feature-flag `emptyFileStarRexportFix`.
19
+
20
+ - [#678](https://github.com/atlassian-labs/atlaspack/pull/678) [`3ba1aee`](https://github.com/atlassian-labs/atlaspack/commit/3ba1aee6a794a26b2f0255aaf6d003981532d0ae) Thanks [@marcins](https://github.com/marcins)! - Move adding of Atlaspack V3 disposable to be conditional on Atlaspack V3
21
+
22
+ - 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), [`c9631af`](https://github.com/atlassian-labs/atlaspack/commit/c9631aff284b2c1c27e8a52f9da392ce65d666e8), [`18a57cf`](https://github.com/atlassian-labs/atlaspack/commit/18a57cf8a4789b2de5ad8e2676f317a26cc91417), [`a5ed1b4`](https://github.com/atlassian-labs/atlaspack/commit/a5ed1b414498560f393ff491af4da25b6e8dde56)]:
23
+ - @atlaspack/feature-flags@2.19.0
24
+ - @atlaspack/utils@2.17.0
25
+ - @atlaspack/rust@3.4.1
26
+ - @atlaspack/package-manager@2.14.18
27
+ - @atlaspack/fs@2.15.13
28
+ - @atlaspack/cache@3.2.13
29
+ - @atlaspack/graph@3.5.7
30
+ - @atlaspack/workers@2.14.18
31
+ - @atlaspack/logger@2.14.13
32
+ - @atlaspack/profiler@2.14.15
33
+ - @atlaspack/types@2.15.8
34
+ - @atlaspack/plugin@2.14.18
35
+
36
+ ## 2.18.8
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies [[`c75bf55`](https://github.com/atlassian-labs/atlaspack/commit/c75bf553fff4decc285b5fd499a275853b18f8f2)]:
41
+ - @atlaspack/rust@3.4.0
42
+ - @atlaspack/cache@3.2.12
43
+ - @atlaspack/fs@2.15.12
44
+ - @atlaspack/logger@2.14.12
45
+ - @atlaspack/utils@2.16.1
46
+ - @atlaspack/package-manager@2.14.17
47
+ - @atlaspack/workers@2.14.17
48
+ - @atlaspack/types@2.15.7
49
+ - @atlaspack/plugin@2.14.17
50
+
51
+ ## 2.18.7
52
+
53
+ ### Patch Changes
54
+
55
+ - [#666](https://github.com/atlassian-labs/atlaspack/pull/666) [`1ff31f1`](https://github.com/atlassian-labs/atlaspack/commit/1ff31f10391c48780c9fcfc243b4e828a1b285e0) Thanks [@marcins](https://github.com/marcins)! - Ensure tracer is disabled if it was enabled on teardown
56
+
57
+ - [#661](https://github.com/atlassian-labs/atlaspack/pull/661) [`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c) Thanks [@marcins](https://github.com/marcins)! - Add new feature flag atlaspackV3CleanShutdown which will dispose of the NAPI worker pool when disposing of the Atlaspack class
58
+
59
+ - Updated dependencies [[`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c), [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
60
+ - @atlaspack/feature-flags@2.18.4
61
+ - @atlaspack/utils@2.16.0
62
+ - @atlaspack/cache@3.2.11
63
+ - @atlaspack/fs@2.15.11
64
+ - @atlaspack/graph@3.5.6
65
+ - @atlaspack/package-manager@2.14.16
66
+ - @atlaspack/workers@2.14.16
67
+ - @atlaspack/profiler@2.14.14
68
+ - @atlaspack/types@2.15.6
69
+ - @atlaspack/plugin@2.14.16
70
+
71
+ ## 2.18.6
72
+
73
+ ### Patch Changes
74
+
75
+ - [#655](https://github.com/atlassian-labs/atlaspack/pull/655) [`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be) Thanks [@yamadapc](https://github.com/yamadapc)! - Clean-up inline requires multi-threading feature-flag
76
+
77
+ - [#658](https://github.com/atlassian-labs/atlaspack/pull/658) [`74fd942`](https://github.com/atlassian-labs/atlaspack/commit/74fd94236ac697207082c4b755b079e56f5564fb) Thanks [@yamadapc](https://github.com/yamadapc)! - Fix environment deduplication issues
78
+
79
+ - Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be)]:
80
+ - @atlaspack/feature-flags@2.18.3
81
+ - @atlaspack/cache@3.2.10
82
+ - @atlaspack/fs@2.15.10
83
+ - @atlaspack/graph@3.5.5
84
+ - @atlaspack/utils@2.15.3
85
+ - @atlaspack/package-manager@2.14.15
86
+ - @atlaspack/profiler@2.14.13
87
+ - @atlaspack/types@2.15.5
88
+ - @atlaspack/workers@2.14.15
89
+ - @atlaspack/plugin@2.14.15
90
+
91
+ ## 2.18.5
92
+
93
+ ### Patch Changes
94
+
95
+ - [#652](https://github.com/atlassian-labs/atlaspack/pull/652) [`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956) Thanks [@yamadapc](https://github.com/yamadapc)! - Fix bugs related to build aborts. Builds and cache writes will no longer be aborted.
96
+
97
+ - Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
98
+ - @atlaspack/feature-flags@2.18.2
99
+ - @atlaspack/cache@3.2.9
100
+ - @atlaspack/fs@2.15.9
101
+ - @atlaspack/graph@3.5.4
102
+ - @atlaspack/utils@2.15.2
103
+ - @atlaspack/package-manager@2.14.14
104
+ - @atlaspack/profiler@2.14.12
105
+ - @atlaspack/types@2.15.4
106
+ - @atlaspack/workers@2.14.14
107
+ - @atlaspack/plugin@2.14.14
108
+
109
+ ## 2.18.4
110
+
111
+ ### Patch Changes
112
+
113
+ - [#650](https://github.com/atlassian-labs/atlaspack/pull/650) [`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb) Thanks [@alshdavid](https://github.com/alshdavid)! - Remove package.json#exports
114
+
115
+ - [#646](https://github.com/atlassian-labs/atlaspack/pull/646) [`6b1f5ff`](https://github.com/atlassian-labs/atlaspack/commit/6b1f5fff68d7131fae075e14f4d2c02606dc6058) Thanks [@alshdavid](https://github.com/alshdavid)! - Export WORKER_PATH from @atlaspack/core
116
+
117
+ - [#633](https://github.com/atlassian-labs/atlaspack/pull/633) [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b) Thanks [@sbhuiyan-atlassian](https://github.com/sbhuiyan-atlassian)! - Ported various HMR changes from Parcel
118
+
119
+ - [#648](https://github.com/atlassian-labs/atlaspack/pull/648) [`c8f7df4`](https://github.com/atlassian-labs/atlaspack/commit/c8f7df4eadfc4718040fceb065dae6e96a4051e7) Thanks [@alshdavid](https://github.com/alshdavid)! - Export ATLASPACK_VERSION and other internals
120
+
121
+ - [#626](https://github.com/atlassian-labs/atlaspack/pull/626) [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca) Thanks [@yamadapc](https://github.com/yamadapc)! - Clean-up tsconfig invalidation improvements feature-flag
122
+
123
+ - Updated dependencies [[`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb), [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
124
+ - @atlaspack/workers@2.14.13
125
+ - @atlaspack/logger@2.14.11
126
+ - @atlaspack/feature-flags@2.18.1
127
+ - @atlaspack/fs@2.15.8
128
+ - @atlaspack/package-manager@2.14.13
129
+ - @atlaspack/types@2.15.3
130
+ - @atlaspack/cache@3.2.8
131
+ - @atlaspack/utils@2.15.1
132
+ - @atlaspack/graph@3.5.3
133
+ - @atlaspack/plugin@2.14.13
134
+ - @atlaspack/profiler@2.14.11
135
+
136
+ ## 2.18.3
137
+
138
+ ### Patch Changes
139
+
140
+ - 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)]:
141
+ - @atlaspack/feature-flags@2.18.0
142
+ - @atlaspack/utils@2.15.0
143
+ - @atlaspack/cache@3.2.7
144
+ - @atlaspack/fs@2.15.7
145
+ - @atlaspack/graph@3.5.2
146
+ - @atlaspack/package-manager@2.14.12
147
+ - @atlaspack/workers@2.14.12
148
+ - @atlaspack/profiler@2.14.10
149
+ - @atlaspack/types@2.15.2
150
+ - @atlaspack/plugin@2.14.12
151
+
152
+ ## 2.18.2
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
157
+ - @atlaspack/feature-flags@2.17.0
158
+ - @atlaspack/cache@3.2.6
159
+ - @atlaspack/fs@2.15.6
160
+ - @atlaspack/graph@3.5.1
161
+ - @atlaspack/utils@2.14.11
162
+ - @atlaspack/package-manager@2.14.11
163
+ - @atlaspack/profiler@2.14.9
164
+ - @atlaspack/types@2.15.1
165
+ - @atlaspack/workers@2.14.11
166
+ - @atlaspack/plugin@2.14.11
167
+
168
+ ## 2.18.1
169
+
170
+ ### Patch Changes
171
+
172
+ - Updated dependencies [[`1b52b99`](https://github.com/atlassian-labs/atlaspack/commit/1b52b99db4298b04c1a6eb0f97994d75a2d436f9)]:
173
+ - @atlaspack/graph@3.5.0
174
+
175
+ ## 2.18.0
176
+
177
+ ### Minor Changes
178
+
179
+ - [#601](https://github.com/atlassian-labs/atlaspack/pull/601) [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196) Thanks [@yamadapc](https://github.com/yamadapc)! - Improve granular configuration file invalidations
180
+
181
+ - [#599](https://github.com/atlassian-labs/atlaspack/pull/599) [`0b2f6f5`](https://github.com/atlassian-labs/atlaspack/commit/0b2f6f55794d3ff6e2f5a41f963e7e5dd8ad9f8d) Thanks [@pancaspe87](https://github.com/pancaspe87)! - load and write env to cache - change is feature flagged
182
+
183
+ ### Patch Changes
184
+
185
+ - [#595](https://github.com/atlassian-labs/atlaspack/pull/595) [`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b) Thanks [@yamadapc](https://github.com/yamadapc)! - Add bundleId to write bundle request results
186
+
187
+ - [#572](https://github.com/atlassian-labs/atlaspack/pull/572) [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca) Thanks [@yamadapc](https://github.com/yamadapc)! - Add feature-flagged change which removes all environment duplication around objects
188
+
189
+ - Updated dependencies [[`0999fb7`](https://github.com/atlassian-labs/atlaspack/commit/0999fb78da519a6c7582d212883e515fcf6c1252), [`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b), [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196), [`35fdd4b`](https://github.com/atlassian-labs/atlaspack/commit/35fdd4b52da0af20f74667f7b8adfb2f90279b7c), [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca)]:
190
+ - @atlaspack/fs@2.15.5
191
+ - @atlaspack/types@2.15.0
192
+ - @atlaspack/rust@3.3.5
193
+ - @atlaspack/cache@3.2.5
194
+ - @atlaspack/package-manager@2.14.10
195
+ - @atlaspack/profiler@2.14.8
196
+ - @atlaspack/workers@2.14.10
197
+ - @atlaspack/plugin@2.14.10
198
+ - @atlaspack/logger@2.14.10
199
+ - @atlaspack/utils@2.14.10
200
+
201
+ ## 2.17.4
202
+
203
+ ### Patch Changes
204
+
205
+ - [#588](https://github.com/atlassian-labs/atlaspack/pull/588) [`1940859`](https://github.com/atlassian-labs/atlaspack/commit/194085942f0e86532e9d039fc3f8039badce4594) Thanks [@yamadapc](https://github.com/yamadapc)! - Do not invalidate all javascript files when tsconfig files change
206
+
207
+ - [#592](https://github.com/atlassian-labs/atlaspack/pull/592) [`15b6155`](https://github.com/atlassian-labs/atlaspack/commit/15b61556e9114203ebbc9de94b864118ca764598) Thanks [@yamadapc](https://github.com/yamadapc)! - Report large file invalidations
208
+
209
+ - [#503](https://github.com/atlassian-labs/atlaspack/pull/503) [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818) Thanks [@JakeLane](https://github.com/JakeLane)! - Fix conditional bundling reporter when condition is reused
210
+
211
+ - [#562](https://github.com/atlassian-labs/atlaspack/pull/562) [`d04de26`](https://github.com/atlassian-labs/atlaspack/commit/d04de26af684d7abfba5091fbe3df16a12cd0ebc) Thanks [@yamadapc](https://github.com/yamadapc)! - Update with feature-flagged change to write packages into files rather than LMDB
212
+
213
+ - 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)]:
214
+ - @atlaspack/cache@3.2.4
215
+ - @atlaspack/rust@3.3.4
216
+ - @atlaspack/fs@2.15.4
217
+ - @atlaspack/feature-flags@2.16.0
218
+ - @atlaspack/logger@2.14.9
219
+ - @atlaspack/utils@2.14.9
220
+ - @atlaspack/package-manager@2.14.9
221
+ - @atlaspack/graph@3.4.7
222
+ - @atlaspack/workers@2.14.9
223
+ - @atlaspack/profiler@2.14.7
224
+ - @atlaspack/types@2.14.9
225
+ - @atlaspack/plugin@2.14.9
226
+
227
+ ## 2.17.3
228
+
229
+ ### Patch Changes
230
+
231
+ - [#551](https://github.com/atlassian-labs/atlaspack/pull/551) [`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b) Thanks [@yamadapc](https://github.com/yamadapc)! - Log request tracker invalidation counts on start-up
232
+
233
+ - [#550](https://github.com/atlassian-labs/atlaspack/pull/550) [`3a3e8e7`](https://github.com/atlassian-labs/atlaspack/commit/3a3e8e7be9e2dffd7304436d792f0f595d59665a) Thanks [@yamadapc](https://github.com/yamadapc)! - Fix typescript declaration files
234
+
235
+ - [#555](https://github.com/atlassian-labs/atlaspack/pull/555) [`15c1e3c`](https://github.com/atlassian-labs/atlaspack/commit/15c1e3c0628bae4c768d76cf3afc53d6d0d7ce7c) Thanks [@alshdavid](https://github.com/alshdavid)! - Added ATLASPACK_NATIVE_THREADS env variable to control the number of threads used by the native thread schedular
236
+
237
+ - Updated dependencies [[`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b), [`3a3e8e7`](https://github.com/atlassian-labs/atlaspack/commit/3a3e8e7be9e2dffd7304436d792f0f595d59665a), [`1ab0a27`](https://github.com/atlassian-labs/atlaspack/commit/1ab0a275aeca40350415e2b03e7440d1dddc6228), [`b8a4ae8`](https://github.com/atlassian-labs/atlaspack/commit/b8a4ae8f83dc0a83d8b145c5f729936ce52080a3)]:
238
+ - @atlaspack/feature-flags@2.15.1
239
+ - @atlaspack/fs@2.15.3
240
+ - @atlaspack/rust@3.3.3
241
+ - @atlaspack/cache@3.2.3
242
+ - @atlaspack/graph@3.4.6
243
+ - @atlaspack/utils@2.14.8
244
+ - @atlaspack/package-manager@2.14.8
245
+ - @atlaspack/logger@2.14.8
246
+ - @atlaspack/profiler@2.14.6
247
+ - @atlaspack/types@2.14.8
248
+ - @atlaspack/workers@2.14.8
249
+ - @atlaspack/plugin@2.14.8
250
+
251
+ ## 2.17.2
252
+
253
+ ### Patch Changes
254
+
255
+ - Updated dependencies [[`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929), [`556d6ab`](https://github.com/atlassian-labs/atlaspack/commit/556d6ab8ede759fa7f37fcd3f4da336ef1c55e8f)]:
256
+ - @atlaspack/feature-flags@2.15.0
257
+ - @atlaspack/logger@2.14.7
258
+ - @atlaspack/rust@3.3.2
259
+ - @atlaspack/cache@3.2.2
260
+ - @atlaspack/fs@2.15.2
261
+ - @atlaspack/graph@3.4.5
262
+ - @atlaspack/utils@2.14.7
263
+ - @atlaspack/package-manager@2.14.7
264
+ - @atlaspack/workers@2.14.7
265
+ - @atlaspack/profiler@2.14.5
266
+ - @atlaspack/types@2.14.7
267
+ - @atlaspack/plugin@2.14.7
268
+
269
+ ## 2.17.1
270
+
271
+ ### Patch Changes
272
+
273
+ - Updated dependencies [[`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09)]:
274
+ - @atlaspack/feature-flags@2.14.4
275
+ - @atlaspack/rust@3.3.1
276
+ - @atlaspack/cache@3.2.1
277
+ - @atlaspack/fs@2.15.1
278
+ - @atlaspack/graph@3.4.4
279
+ - @atlaspack/utils@2.14.6
280
+ - @atlaspack/logger@2.14.6
281
+ - @atlaspack/package-manager@2.14.6
282
+ - @atlaspack/profiler@2.14.4
283
+ - @atlaspack/types@2.14.6
284
+ - @atlaspack/workers@2.14.6
285
+ - @atlaspack/plugin@2.14.6
286
+
3
287
  ## 2.17.0
4
288
 
5
289
  ### Minor Changes
package/index.d.ts CHANGED
@@ -4,9 +4,13 @@ import type {
4
4
  BuildSuccessEvent,
5
5
  AsyncSubscription,
6
6
  } from '@atlaspack/types';
7
+
7
8
  import type {FarmOptions} from '@atlaspack/workers';
9
+
8
10
  import type WorkerFarm from '@atlaspack/workers';
9
11
 
12
+ export declare const ATLASPACK_VERSION: string;
13
+
10
14
  export class Atlaspack {
11
15
  constructor(options: InitialAtlaspackOptions);
12
16
  run(): Promise<BuildSuccessEvent>;
package/lib/AssetGraph.js CHANGED
@@ -46,6 +46,14 @@ function _graph() {
46
46
  }
47
47
  var _Dependency = require("./Dependency");
48
48
  var _projectPath = require("./projectPath");
49
+ var _EnvironmentManager = require("./EnvironmentManager");
50
+ function _featureFlags() {
51
+ const data = require("@atlaspack/feature-flags");
52
+ _featureFlags = function () {
53
+ return data;
54
+ };
55
+ return data;
56
+ }
49
57
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50
58
  function nodeFromDep(dep) {
51
59
  return {
@@ -63,7 +71,7 @@ function nodeFromDep(dep) {
63
71
  }
64
72
  function nodeFromAssetGroup(assetGroup) {
65
73
  return {
66
- id: (0, _rust().hashString)((0, _projectPath.fromProjectPathRelative)(assetGroup.filePath) + assetGroup.env.id + String(assetGroup.isSource) + String(assetGroup.sideEffects) + (assetGroup.code ?? '') + ':' + (assetGroup.pipeline ?? '') + ':' + (assetGroup.query ?? '')),
74
+ id: (0, _rust().hashString)((0, _projectPath.fromProjectPathRelative)(assetGroup.filePath) + (0, _EnvironmentManager.toEnvironmentId)(assetGroup.env) + String(assetGroup.isSource) + String(assetGroup.sideEffects) + (assetGroup.code ?? '') + ':' + (assetGroup.pipeline ?? '') + ':' + (assetGroup.query ?? '')),
67
75
  type: 'asset_group',
68
76
  value: assetGroup,
69
77
  usedSymbolsDownDirty: true
@@ -130,16 +138,19 @@ class AssetGraph extends _graph().ContentGraph {
130
138
 
131
139
  // Deduplicates Environments by making them referentially equal
132
140
  normalizeEnvironment(input) {
141
+ if ((0, _featureFlags().getFeatureFlag)('environmentDeduplication')) {
142
+ return;
143
+ }
133
144
  let {
134
145
  id,
135
146
  context
136
- } = input.env;
147
+ } = (0, _EnvironmentManager.fromEnvironmentId)(input.env);
137
148
  let idAndContext = `${id}-${context}`;
138
149
  let env = this.envCache.get(idAndContext);
139
150
  if (env) {
140
- input.env = env;
151
+ input.env = (0, _EnvironmentManager.toEnvironmentRef)(env);
141
152
  } else {
142
- this.envCache.set(idAndContext, input.env);
153
+ this.envCache.set(idAndContext, (0, _EnvironmentManager.fromEnvironmentId)(input.env));
143
154
  }
144
155
  }
145
156
  setRootConnections({
@@ -199,13 +210,13 @@ class AssetGraph extends _graph().ContentGraph {
199
210
  env: target.env,
200
211
  isEntry: true,
201
212
  needsStableName: true,
202
- symbols: target.env.isLibrary ? new Map([['*', {
213
+ symbols: (0, _EnvironmentManager.fromEnvironmentId)(target.env).isLibrary ? new Map([['*', {
203
214
  local: '*',
204
215
  isWeak: true,
205
216
  loc: null
206
217
  }]]) : undefined
207
218
  }));
208
- if (node.value.env.isLibrary) {
219
+ if ((0, _EnvironmentManager.fromEnvironmentId)(node.value.env).isLibrary) {
209
220
  // in library mode, all of the entry's symbols are "used"
210
221
  node.usedSymbolsDown.add('*');
211
222
  node.usedSymbolsUp.set('*', undefined);
@@ -348,7 +359,7 @@ class AssetGraph extends _graph().ContentGraph {
348
359
  if (this.undeferredDependencies.has(d)) {
349
360
  return false;
350
361
  }
351
- let depIsDeferrable = d.symbols && !(d.env.isLibrary && d.isEntry) && !d.symbols.has('*') && ![...d.symbols.keys()].some(symbol => {
362
+ let depIsDeferrable = d.symbols && !((0, _EnvironmentManager.fromEnvironmentId)(d.env).isLibrary && d.isEntry) && !d.symbols.has('*') && ![...d.symbols.keys()].some(symbol => {
352
363
  var _resolvedAsset$symbol;
353
364
  let assetSymbol = (_resolvedAsset$symbol = resolvedAsset.symbols) === null || _resolvedAsset$symbol === void 0 || (_resolvedAsset$symbol = _resolvedAsset$symbol.get(symbol)) === null || _resolvedAsset$symbol === void 0 ? void 0 : _resolvedAsset$symbol.local;
354
365
  return assetSymbol != null && symbols.has(assetSymbol);
@@ -432,6 +443,15 @@ class AssetGraph extends _graph().ContentGraph {
432
443
  ...depNode.value.meta,
433
444
  ...existing.value.resolverMeta
434
445
  };
446
+ if ((0, _featureFlags().getFeatureFlag)('hmrImprovements')) {
447
+ depNode.value.resolverMeta = existing.value.resolverMeta;
448
+ }
449
+ }
450
+ if ((0, _featureFlags().getFeatureFlag)('hmrImprovements')) {
451
+ if ((existing === null || existing === void 0 ? void 0 : existing.type) === 'dependency' && existing.value.resolverPriority != null) {
452
+ depNode.value.priority = existing.value.resolverPriority;
453
+ depNode.value.resolverPriority = existing.value.resolverPriority;
454
+ }
435
455
  }
436
456
  let dependentAsset = dependentAssets.find(a => a.uniqueKey === dep.specifier);
437
457
  if (dependentAsset) {
package/lib/Atlaspack.js CHANGED
@@ -128,32 +128,23 @@ const INTERNAL_TRANSFORM = exports.INTERNAL_TRANSFORM = Symbol('internal_transfo
128
128
  const INTERNAL_RESOLVE = exports.INTERNAL_RESOLVE = Symbol('internal_resolve');
129
129
  const WORKER_PATH = exports.WORKER_PATH = _path().default.join(__dirname, 'worker.js');
130
130
  class Atlaspack {
131
- #requestTracker /*: RequestTracker*/;
132
- #config /*: AtlaspackConfig*/;
133
- #farm /*: WorkerFarm*/;
134
- #initialized /*: boolean*/ = false;
135
- #disposable /*: Disposable */;
136
- #initialOptions /*: InitialAtlaspackOptions */;
137
- #reporterRunner /*: ReporterRunner*/;
138
- #resolvedOptions /*: ?AtlaspackOptions*/ = null;
139
- #optionsRef /*: SharedReference */;
140
- #watchAbortController /*: AbortController*/;
141
- #watchQueue /*: PromiseQueue<?BuildEvent>*/ = new (_utils2().PromiseQueue)({
131
+ #requestTracker;
132
+ #config;
133
+ #farm;
134
+ #initialized = false;
135
+ #disposable;
136
+ #initialOptions;
137
+ #reporterRunner;
138
+ #resolvedOptions = null;
139
+ #optionsRef;
140
+ #watchAbortController;
141
+ #watchQueue = new (_utils2().PromiseQueue)({
142
142
  maxConcurrent: 1
143
143
  });
144
- #watchEvents /*: ValueEmitter<
145
- | {|
146
- +error: Error,
147
- +buildEvent?: void,
148
- |}
149
- | {|
150
- +buildEvent: BuildEvent,
151
- +error?: void,
152
- |},
153
- > */;
154
- #watcherSubscription /*: ?AsyncSubscription*/;
155
- #watcherCount /*: number*/ = 0;
156
- #requestedAssetIds /*: Set<string>*/ = new Set();
144
+ #watchEvents;
145
+ #watcherSubscription;
146
+ #watcherCount = 0;
147
+ #requestedAssetIds = new Set();
157
148
  constructor(options) {
158
149
  this.#initialOptions = options;
159
150
  }
@@ -207,10 +198,16 @@ class Atlaspack {
207
198
  // $FlowFixMe
208
199
  const version = require('../package.json').version;
209
200
  await lmdb.put('current_session_version', Buffer.from(version));
201
+ let threads = undefined;
202
+ if (process.env.ATLASPACK_NATIVE_THREADS !== undefined) {
203
+ threads = parseInt(process.env.ATLASPACK_NATIVE_THREADS, 10);
204
+ } else if (process.env.NODE_ENV === 'test') {
205
+ threads = 2;
206
+ }
210
207
  rustAtlaspack = await _atlaspackV.AtlaspackV3.create({
211
208
  ...options,
212
209
  corePath: _path().default.join(__dirname, '..'),
213
- threads: process.env.NODE_ENV === 'test' ? 2 : undefined,
210
+ threads,
214
211
  entries: Array.isArray(entries) ? entries : entries == null ? undefined : [entries],
215
212
  env: resolvedOptions.env,
216
213
  fs: inputFS && new _atlaspackV.FileSystemV3(inputFS),
@@ -218,6 +215,11 @@ class Atlaspack {
218
215
  defaultTargetOptions: resolvedOptions.defaultTargetOptions,
219
216
  lmdb
220
217
  });
218
+ if (featureFlags.atlaspackV3CleanShutdown) {
219
+ this.#disposable.add(() => {
220
+ rustAtlaspack.end();
221
+ });
222
+ }
221
223
  }
222
224
  this.rustAtlaspack = rustAtlaspack;
223
225
  let {
@@ -381,7 +383,6 @@ class Atlaspack {
381
383
  } = {
382
384
  /*::...null*/
383
385
  }) {
384
- this.#requestTracker.setSignal(signal);
385
386
  let options = (0, _nullthrows().default)(this.#resolvedOptions);
386
387
  try {
387
388
  if (options.shouldProfile) {
@@ -389,6 +390,11 @@ class Atlaspack {
389
390
  }
390
391
  if (options.shouldTrace) {
391
392
  _profiler().tracer.enable();
393
+ // We need to ensure the tracer is disabled when Atlaspack is disposed as it is a module level object.
394
+ // While rare (except for tests), if another instance is created later it should not have tracing enabled.
395
+ this.#disposable.add(() => {
396
+ _profiler().tracer.disable();
397
+ });
392
398
  }
393
399
  await this.#reporterRunner.report({
394
400
  type: 'buildStart'
@@ -504,7 +510,9 @@ class Atlaspack {
504
510
  if (this.rustAtlaspack) {
505
511
  nativeInvalid = await this.rustAtlaspack.respondToFsEvents(events);
506
512
  }
507
- let isInvalid = await this.#requestTracker.respondToFSEvents(events, Number.POSITIVE_INFINITY);
513
+ let {
514
+ didInvalidate: isInvalid
515
+ } = await this.#requestTracker.respondToFSEvents(events, Number.POSITIVE_INFINITY);
508
516
  if ((nativeInvalid || isInvalid) && this.#watchQueue.getNumWaiting() === 0) {
509
517
  if (this.#watchAbortController) {
510
518
  this.#watchAbortController.abort();
@@ -14,7 +14,13 @@ exports.validatePackageName = validatePackageName;
14
14
  // * We do not care about package names
15
15
  // * Validation makes interop between parcel/atlaspack confusing.
16
16
  //
17
- function validatePackageName() {}
17
+ function validatePackageName(
18
+ // eslint-disable-next-line no-unused-vars
19
+ pkg,
20
+ // eslint-disable-next-line no-unused-vars
21
+ pluginType,
22
+ // eslint-disable-next-line no-unused-vars
23
+ key) {}
18
24
  const validatePluginName = (pluginType, key) => {
19
25
  return val => {
20
26
  // allow plugin spread...
@@ -51,6 +51,7 @@ function _featureFlags() {
51
51
  };
52
52
  return data;
53
53
  }
54
+ var _EnvironmentManager = require("./EnvironmentManager");
54
55
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
55
56
  const bundleGraphEdgeTypes = exports.bundleGraphEdgeTypes = {
56
57
  // A lack of an edge type indicates to follow the edge while traversing
@@ -207,7 +208,7 @@ class BundleGraph {
207
208
  }
208
209
  }
209
210
  }
210
- if (node.type === 'dependency' && node.value.symbols != null && node.value.env.shouldScopeHoist &&
211
+ if (node.type === 'dependency' && node.value.symbols != null && (0, _EnvironmentManager.fromEnvironmentId)(node.value.env).shouldScopeHoist &&
211
212
  // Disable in dev mode because this feature is at odds with safeToIncrementallyBundle
212
213
  isProduction) {
213
214
  let nodeValueSymbols = node.value.symbols;
@@ -859,13 +860,14 @@ class BundleGraph {
859
860
  return;
860
861
  }
861
862
  visitedBundles.add(descendant);
862
- if (descendant.type !== bundle.type || descendant.env.context !== bundle.env.context) {
863
+ if (descendant.type !== bundle.type || (0, _EnvironmentManager.fromEnvironmentId)(descendant.env).context !== (0, _EnvironmentManager.fromEnvironmentId)(bundle.env).context) {
863
864
  actions.skipChildren();
864
865
  return;
865
866
  }
866
867
  if (bundleHasReference(descendant)) {
867
868
  isReferenced = true;
868
869
  actions.stop();
870
+ return;
869
871
  }
870
872
  }, referencer);
871
873
  return isReferenced;
@@ -887,7 +889,7 @@ class BundleGraph {
887
889
  isAssetReachableFromBundle(asset, bundle) {
888
890
  // If a bundle's environment is isolated, it can't access assets present
889
891
  // in any ancestor bundles. Don't consider any assets reachable.
890
- if (_Environment.ISOLATED_ENVS.has(bundle.env.context) || !bundle.isSplittable || bundle.bundleBehavior === _types.BundleBehavior.isolated || bundle.bundleBehavior === _types.BundleBehavior.inline) {
892
+ if (_Environment.ISOLATED_ENVS.has((0, _EnvironmentManager.fromEnvironmentId)(bundle.env).context) || !bundle.isSplittable || bundle.bundleBehavior === _types.BundleBehavior.isolated || bundle.bundleBehavior === _types.BundleBehavior.inline) {
891
893
  return false;
892
894
  }
893
895
 
@@ -915,7 +917,7 @@ class BundleGraph {
915
917
  let node = (0, _nullthrows().default)(this._graph.getNode(nodeId));
916
918
  // If we've reached the root or a context change without
917
919
  // finding this asset in the ancestry, it is not reachable.
918
- if (node.type === 'root' || node.type === 'bundle' && (node.value.id === bundle.id || node.value.env.context !== bundle.env.context)) {
920
+ if (node.type === 'root' || node.type === 'bundle' && (node.value.id === bundle.id || (0, _EnvironmentManager.fromEnvironmentId)(node.value.env).context !== (0, _EnvironmentManager.fromEnvironmentId)(bundle.env).context)) {
919
921
  isReachable = false;
920
922
  actions.stop();
921
923
  return;
@@ -924,6 +926,7 @@ class BundleGraph {
924
926
  let childBundles = this.getBundlesInBundleGroup(node.value);
925
927
  if (childBundles.some(b => b.id !== bundle.id && b.bundleBehavior !== _types.BundleBehavior.isolated && b.bundleBehavior !== _types.BundleBehavior.inline && this.bundleHasAsset(b, asset))) {
926
928
  actions.skipChildren();
929
+ return;
927
930
  }
928
931
  }
929
932
  }, [bundleGraphEdgeTypes.references, bundleGraphEdgeTypes.bundle]);
@@ -1410,7 +1413,7 @@ class BundleGraph {
1410
1413
  for (let referencedBundle of this.getReferencedBundles(bundle)) {
1411
1414
  hash.writeString(referencedBundle.id);
1412
1415
  }
1413
- hash.writeString(JSON.stringify((0, _utils().objectSortedEntriesDeep)(bundle.env)));
1416
+ hash.writeString(JSON.stringify((0, _utils().objectSortedEntriesDeep)((0, _EnvironmentManager.fromEnvironmentId)(bundle.env))));
1414
1417
  return hash.finish();
1415
1418
  }
1416
1419
  getBundleGraphHash() {
package/lib/Dependency.js CHANGED
@@ -24,6 +24,7 @@ function _assert() {
24
24
  return data;
25
25
  }
26
26
  var _IdentifierRegistry = require("./IdentifierRegistry");
27
+ var _EnvironmentManager = require("./EnvironmentManager");
27
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
28
29
  function createDependencyId({
29
30
  sourceAssetId,
@@ -41,8 +42,11 @@ function createDependencyId({
41
42
  const params = {
42
43
  sourceAssetId,
43
44
  specifier,
44
- environmentId: env.id,
45
- target,
45
+ environmentId: (0, _EnvironmentManager.toEnvironmentId)(env),
46
+ target: target != null ? {
47
+ ...target,
48
+ env: (0, _EnvironmentManager.fromEnvironmentId)(target.env)
49
+ } : null,
46
50
  pipeline,
47
51
  specifierType: _types.SpecifierType[specifierType],
48
52
  bundleBehavior,
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.createEnvironment = createEnvironment;
7
+ exports.getEnvironmentHash = getEnvironmentHash;
7
8
  exports.mergeEnvironments = mergeEnvironments;
8
9
  function _rust() {
9
10
  const data = require("@atlaspack/rust");
@@ -15,6 +16,7 @@ function _rust() {
15
16
  var _utils = require("./utils");
16
17
  var _Environment = _interopRequireWildcard(require("./public/Environment"));
17
18
  var _IdentifierRegistry = require("./IdentifierRegistry");
19
+ var _EnvironmentManager = require("./EnvironmentManager");
18
20
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
19
21
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
20
22
  const DEFAULT_ENGINES = {
@@ -108,15 +110,15 @@ function createEnvironment({
108
110
  loc
109
111
  };
110
112
  res.id = getEnvironmentHash(res);
111
- return Object.freeze(res);
113
+ return (0, _EnvironmentManager.toEnvironmentRef)(Object.freeze(res));
112
114
  }
113
115
  function mergeEnvironments(projectRoot, a, b) {
114
116
  // If merging the same object, avoid copying.
115
117
  if (a === b || !b) {
116
- return a;
118
+ return (0, _EnvironmentManager.toEnvironmentRef)(a);
117
119
  }
118
120
  if (b instanceof _Environment.default) {
119
- return (0, _Environment.environmentToInternalEnvironment)(b);
121
+ return (0, _EnvironmentManager.toEnvironmentRef)((0, _Environment.environmentToInternalEnvironment)(b));
120
122
  }
121
123
 
122
124
  // $FlowFixMe - ignore the `id` that is already on a