@atlaspack/bundler-experimental 2.13.7-canary.28 → 2.13.7-canary.280
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 +398 -0
- package/dist/DominatorBundler/EdgeContentGraph.js +67 -0
- package/dist/DominatorBundler/cycleBreaker/findStronglyConnectedComponents.js +58 -0
- package/dist/DominatorBundler/findAssetDominators/simpleFastDominance.js +129 -0
- package/lib/DominatorBundler/EdgeContentGraph.js +2 -1
- package/lib/DominatorBundler/cycleBreaker/findStronglyConnectedComponents.js +2 -0
- package/lib/DominatorBundler/findAssetDominators/simpleFastDominance.js +11 -2
- package/lib/types/DominatorBundler/EdgeContentGraph.d.ts +13 -0
- package/lib/types/DominatorBundler/cycleBreaker/findStronglyConnectedComponents.d.ts +12 -0
- package/lib/types/DominatorBundler/findAssetDominators/simpleFastDominance.d.ts +58 -0
- package/package.json +19 -15
- package/src/DominatorBundler/{EdgeContentGraph.js → EdgeContentGraph.ts} +3 -4
- package/src/DominatorBundler/cycleBreaker/{findStronglyConnectedComponents.js → findStronglyConnectedComponents.ts} +12 -12
- package/src/DominatorBundler/findAssetDominators/{simpleFastDominance.js → simpleFastDominance.ts} +9 -5
- package/test/DominatorBundler/{EdgeContentGraph.test.js → EdgeContentGraph.test.ts} +0 -2
- package/test/DominatorBundler/cycleBreaker/{findStronglyConnectedComponents.js → findStronglyConnectedComponents.ts} +0 -2
- package/test/DominatorBundler/findAssetDominators/{simpleFastDominance.test.js → simpleFastDominance.test.ts} +0 -2
- package/test/{fixtureFromGraph.test.js → fixtureFromGraph.test.ts} +0 -2
- package/test/{fixtureFromGraph.js → fixtureFromGraph.ts} +22 -24
- package/tsconfig.json +39 -0
- package/tsconfig.tsbuildinfo +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,403 @@
|
|
|
1
1
|
# @atlaspack/bundler-experimental
|
|
2
2
|
|
|
3
|
+
## 2.13.40
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`339b600`](https://github.com/atlassian-labs/atlaspack/commit/339b60095d755742cea50f811d08ccc44a4ae521), [`373ee2d`](https://github.com/atlassian-labs/atlaspack/commit/373ee2d3b5cc315df1e90e647619f915892e2b87)]:
|
|
8
|
+
- @atlaspack/rust@3.9.1
|
|
9
|
+
- @atlaspack/feature-flags@2.26.1
|
|
10
|
+
- @atlaspack/core@2.26.2
|
|
11
|
+
- @atlaspack/logger@2.14.29
|
|
12
|
+
- @atlaspack/utils@3.1.1
|
|
13
|
+
- @atlaspack/graph@3.5.26
|
|
14
|
+
- @atlaspack/plugin@2.14.37
|
|
15
|
+
- @atlaspack/types@2.15.27
|
|
16
|
+
|
|
17
|
+
## 2.13.39
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 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), [`9cd9521`](https://github.com/atlassian-labs/atlaspack/commit/9cd9521978f783046e2ae4ce78f2de7aeb07d073), [`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), [`1086c6a`](https://github.com/atlassian-labs/atlaspack/commit/1086c6a2c59271b63b3fb78e6acdb9d3a0dbf354), [`5776be2`](https://github.com/atlassian-labs/atlaspack/commit/5776be21f70a3f2b9471ba33da3ba1a883f21f1a)]:
|
|
22
|
+
- @atlaspack/rust@3.9.0
|
|
23
|
+
- @atlaspack/feature-flags@2.26.0
|
|
24
|
+
- @atlaspack/core@2.26.1
|
|
25
|
+
- @atlaspack/utils@3.1.0
|
|
26
|
+
- @atlaspack/logger@2.14.28
|
|
27
|
+
- @atlaspack/graph@3.5.25
|
|
28
|
+
- @atlaspack/plugin@2.14.36
|
|
29
|
+
- @atlaspack/types@2.15.26
|
|
30
|
+
|
|
31
|
+
## 2.13.38
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [[`79a7e22`](https://github.com/atlassian-labs/atlaspack/commit/79a7e22ef119891a2f4180a9d3cc66b38dd52092), [`ff8ac84`](https://github.com/atlassian-labs/atlaspack/commit/ff8ac84bd0be15caa7c7af21bf5b6e47b6d36438), [`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)]:
|
|
36
|
+
- @atlaspack/feature-flags@2.25.5
|
|
37
|
+
- @atlaspack/rust@3.8.3
|
|
38
|
+
- @atlaspack/core@2.26.0
|
|
39
|
+
- @atlaspack/utils@3.0.3
|
|
40
|
+
- @atlaspack/graph@3.5.24
|
|
41
|
+
- @atlaspack/logger@2.14.27
|
|
42
|
+
- @atlaspack/plugin@2.14.35
|
|
43
|
+
- @atlaspack/types@2.15.25
|
|
44
|
+
|
|
45
|
+
## 2.13.37
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [[`662d3c6`](https://github.com/atlassian-labs/atlaspack/commit/662d3c627888b16bf27df15cfac5a9094509e93d)]:
|
|
50
|
+
- @atlaspack/feature-flags@2.25.4
|
|
51
|
+
- @atlaspack/core@2.25.1
|
|
52
|
+
- @atlaspack/types@2.15.24
|
|
53
|
+
- @atlaspack/graph@3.5.23
|
|
54
|
+
- @atlaspack/utils@3.0.2
|
|
55
|
+
- @atlaspack/logger@2.14.26
|
|
56
|
+
- @atlaspack/plugin@2.14.34
|
|
57
|
+
|
|
58
|
+
## 2.13.36
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- Updated dependencies [[`236e546`](https://github.com/atlassian-labs/atlaspack/commit/236e5465863dca6044a7191e05260a5b924c342e), [`f07351a`](https://github.com/atlassian-labs/atlaspack/commit/f07351a2398b6a8e5155a2daad77e69b7dcb2b4b)]:
|
|
63
|
+
- @atlaspack/utils@3.0.1
|
|
64
|
+
- @atlaspack/core@2.25.0
|
|
65
|
+
- @atlaspack/feature-flags@2.25.3
|
|
66
|
+
- @atlaspack/graph@3.5.22
|
|
67
|
+
- @atlaspack/types@2.15.23
|
|
68
|
+
- @atlaspack/logger@2.14.25
|
|
69
|
+
- @atlaspack/plugin@2.14.33
|
|
70
|
+
|
|
71
|
+
## 2.13.35
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- 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)]:
|
|
76
|
+
- @atlaspack/feature-flags@2.25.2
|
|
77
|
+
- @atlaspack/rust@3.8.2
|
|
78
|
+
- @atlaspack/core@2.24.2
|
|
79
|
+
- @atlaspack/utils@3.0.0
|
|
80
|
+
- @atlaspack/graph@3.5.21
|
|
81
|
+
- @atlaspack/logger@2.14.24
|
|
82
|
+
- @atlaspack/plugin@2.14.32
|
|
83
|
+
- @atlaspack/types@2.15.22
|
|
84
|
+
|
|
85
|
+
## 2.13.34
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- [#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.
|
|
90
|
+
|
|
91
|
+
- Updated dependencies [[`0e7dd5e`](https://github.com/atlassian-labs/atlaspack/commit/0e7dd5ec6fbe05aa9e0bb5775a9d0975f206a922), [`686a398`](https://github.com/atlassian-labs/atlaspack/commit/686a398faa1f9e19cbf9274add2c46e246bafba8)]:
|
|
92
|
+
- @atlaspack/core@2.24.1
|
|
93
|
+
- @atlaspack/diagnostic@2.14.4
|
|
94
|
+
- @atlaspack/feature-flags@2.25.1
|
|
95
|
+
- @atlaspack/graph@3.5.20
|
|
96
|
+
- @atlaspack/logger@2.14.23
|
|
97
|
+
- @atlaspack/plugin@2.14.31
|
|
98
|
+
- @atlaspack/rust@3.8.1
|
|
99
|
+
- @atlaspack/types@2.15.21
|
|
100
|
+
- @atlaspack/utils@2.19.3
|
|
101
|
+
|
|
102
|
+
## 2.13.33
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 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), [`8604d2a`](https://github.com/atlassian-labs/atlaspack/commit/8604d2a49ace5e9194ec4f76e71f06b93610f6b4)]:
|
|
107
|
+
- @atlaspack/feature-flags@2.25.0
|
|
108
|
+
- @atlaspack/core@2.24.0
|
|
109
|
+
- @atlaspack/rust@3.8.0
|
|
110
|
+
- @atlaspack/graph@3.5.19
|
|
111
|
+
- @atlaspack/utils@2.19.2
|
|
112
|
+
- @atlaspack/logger@2.14.22
|
|
113
|
+
- @atlaspack/plugin@2.14.30
|
|
114
|
+
- @atlaspack/types@2.15.20
|
|
115
|
+
|
|
116
|
+
## 2.13.32
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [[`830261d`](https://github.com/atlassian-labs/atlaspack/commit/830261dcf4a40293090b61cab52fd75d5683c73f), [`53dd47b`](https://github.com/atlassian-labs/atlaspack/commit/53dd47bd6d23cd47f87297347f03a609ab38a03d)]:
|
|
121
|
+
- @atlaspack/feature-flags@2.24.1
|
|
122
|
+
- @atlaspack/rust@3.7.0
|
|
123
|
+
- @atlaspack/core@2.23.5
|
|
124
|
+
- @atlaspack/graph@3.5.18
|
|
125
|
+
- @atlaspack/utils@2.19.1
|
|
126
|
+
- @atlaspack/logger@2.14.21
|
|
127
|
+
- @atlaspack/plugin@2.14.29
|
|
128
|
+
- @atlaspack/types@2.15.19
|
|
129
|
+
|
|
130
|
+
## 2.13.31
|
|
131
|
+
|
|
132
|
+
### Patch Changes
|
|
133
|
+
|
|
134
|
+
- 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)]:
|
|
135
|
+
- @atlaspack/feature-flags@2.24.0
|
|
136
|
+
- @atlaspack/utils@2.19.0
|
|
137
|
+
- @atlaspack/core@2.23.4
|
|
138
|
+
- @atlaspack/graph@3.5.17
|
|
139
|
+
- @atlaspack/logger@2.14.20
|
|
140
|
+
- @atlaspack/plugin@2.14.28
|
|
141
|
+
- @atlaspack/types@2.15.18
|
|
142
|
+
|
|
143
|
+
## 2.13.30
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [[`3cfb7cf`](https://github.com/atlassian-labs/atlaspack/commit/3cfb7cfd90b78a5c48ce717e779ff789769825a3)]:
|
|
148
|
+
- @atlaspack/feature-flags@2.23.2
|
|
149
|
+
- @atlaspack/rust@3.6.2
|
|
150
|
+
- @atlaspack/core@2.23.3
|
|
151
|
+
- @atlaspack/graph@3.5.16
|
|
152
|
+
- @atlaspack/utils@2.18.4
|
|
153
|
+
- @atlaspack/logger@2.14.19
|
|
154
|
+
- @atlaspack/plugin@2.14.27
|
|
155
|
+
- @atlaspack/types@2.15.17
|
|
156
|
+
|
|
157
|
+
## 2.13.29
|
|
158
|
+
|
|
159
|
+
### Patch Changes
|
|
160
|
+
|
|
161
|
+
- [#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
|
|
162
|
+
|
|
163
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd), [`889c65c`](https://github.com/atlassian-labs/atlaspack/commit/889c65cd25b811045e26a117e7404f694dde77a2), [`b6e72b6`](https://github.com/atlassian-labs/atlaspack/commit/b6e72b6dd2b517cbb0e700fa69e63332d3eacb1e)]:
|
|
164
|
+
- @atlaspack/feature-flags@2.23.1
|
|
165
|
+
- @atlaspack/diagnostic@2.14.3
|
|
166
|
+
- @atlaspack/logger@2.14.18
|
|
167
|
+
- @atlaspack/plugin@2.14.26
|
|
168
|
+
- @atlaspack/graph@3.5.15
|
|
169
|
+
- @atlaspack/types@2.15.16
|
|
170
|
+
- @atlaspack/utils@2.18.3
|
|
171
|
+
- @atlaspack/core@2.23.2
|
|
172
|
+
- @atlaspack/rust@3.6.1
|
|
173
|
+
|
|
174
|
+
## 2.13.28
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- Updated dependencies [[`f6b3f22`](https://github.com/atlassian-labs/atlaspack/commit/f6b3f2276c7e417580b49c4879563aab51f156b1)]:
|
|
179
|
+
- @atlaspack/feature-flags@2.23.0
|
|
180
|
+
- @atlaspack/core@2.23.1
|
|
181
|
+
- @atlaspack/graph@3.5.14
|
|
182
|
+
- @atlaspack/utils@2.18.2
|
|
183
|
+
- @atlaspack/logger@2.14.17
|
|
184
|
+
- @atlaspack/plugin@2.14.25
|
|
185
|
+
- @atlaspack/types@2.15.15
|
|
186
|
+
|
|
187
|
+
## 2.13.27
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- 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)]:
|
|
192
|
+
- @atlaspack/rust@3.6.0
|
|
193
|
+
- @atlaspack/core@2.23.0
|
|
194
|
+
- @atlaspack/feature-flags@2.22.0
|
|
195
|
+
- @atlaspack/logger@2.14.16
|
|
196
|
+
- @atlaspack/utils@2.18.1
|
|
197
|
+
- @atlaspack/graph@3.5.13
|
|
198
|
+
- @atlaspack/plugin@2.14.24
|
|
199
|
+
- @atlaspack/types@2.15.14
|
|
200
|
+
|
|
201
|
+
## 2.13.26
|
|
202
|
+
|
|
203
|
+
### Patch Changes
|
|
204
|
+
|
|
205
|
+
- Updated dependencies [[`23d561e`](https://github.com/atlassian-labs/atlaspack/commit/23d561e51e68b0c38fd1ff4e4fb173e5e7b01cf2)]:
|
|
206
|
+
- @atlaspack/feature-flags@2.21.0
|
|
207
|
+
- @atlaspack/utils@2.18.0
|
|
208
|
+
- @atlaspack/core@2.22.0
|
|
209
|
+
- @atlaspack/rust@3.5.0
|
|
210
|
+
- @atlaspack/graph@3.5.12
|
|
211
|
+
- @atlaspack/logger@2.14.15
|
|
212
|
+
- @atlaspack/types@2.15.13
|
|
213
|
+
- @atlaspack/plugin@2.14.23
|
|
214
|
+
|
|
215
|
+
## 2.13.25
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- [#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
|
|
220
|
+
|
|
221
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94), [`43fdd22`](https://github.com/atlassian-labs/atlaspack/commit/43fdd223860fbc97af17d68c65419b97412cb888), [`12bee0e`](https://github.com/atlassian-labs/atlaspack/commit/12bee0e23f0464d7f6bd3e24fbe0d19c126d587d)]:
|
|
222
|
+
- @atlaspack/feature-flags@2.20.1
|
|
223
|
+
- @atlaspack/diagnostic@2.14.2
|
|
224
|
+
- @atlaspack/logger@2.14.14
|
|
225
|
+
- @atlaspack/plugin@2.14.22
|
|
226
|
+
- @atlaspack/graph@3.5.11
|
|
227
|
+
- @atlaspack/types@2.15.12
|
|
228
|
+
- @atlaspack/utils@2.17.4
|
|
229
|
+
- @atlaspack/core@2.21.0
|
|
230
|
+
- @atlaspack/rust@3.4.2
|
|
231
|
+
|
|
232
|
+
## 2.13.24
|
|
233
|
+
|
|
234
|
+
### Patch Changes
|
|
235
|
+
|
|
236
|
+
- Updated dependencies [[`069de47`](https://github.com/atlassian-labs/atlaspack/commit/069de478e64fb5889f6f2ce023eb510782767fbd)]:
|
|
237
|
+
- @atlaspack/feature-flags@2.20.0
|
|
238
|
+
- @atlaspack/core@2.20.0
|
|
239
|
+
- @atlaspack/types@2.15.11
|
|
240
|
+
- @atlaspack/graph@3.5.10
|
|
241
|
+
- @atlaspack/utils@2.17.3
|
|
242
|
+
- @atlaspack/plugin@2.14.21
|
|
243
|
+
|
|
244
|
+
## 2.13.23
|
|
245
|
+
|
|
246
|
+
### Patch Changes
|
|
247
|
+
|
|
248
|
+
- 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)]:
|
|
249
|
+
- @atlaspack/plugin@2.14.20
|
|
250
|
+
- @atlaspack/feature-flags@2.19.2
|
|
251
|
+
- @atlaspack/core@2.19.2
|
|
252
|
+
- @atlaspack/graph@3.5.9
|
|
253
|
+
- @atlaspack/utils@2.17.2
|
|
254
|
+
- @atlaspack/types@2.15.10
|
|
255
|
+
|
|
256
|
+
## 2.13.22
|
|
257
|
+
|
|
258
|
+
### Patch Changes
|
|
259
|
+
|
|
260
|
+
- Updated dependencies [[`13aef17`](https://github.com/atlassian-labs/atlaspack/commit/13aef177eea289a6e40d2113b5ec1ac9be18a33d)]:
|
|
261
|
+
- @atlaspack/feature-flags@2.19.1
|
|
262
|
+
- @atlaspack/core@2.19.1
|
|
263
|
+
- @atlaspack/graph@3.5.8
|
|
264
|
+
- @atlaspack/utils@2.17.1
|
|
265
|
+
- @atlaspack/types@2.15.9
|
|
266
|
+
- @atlaspack/plugin@2.14.19
|
|
267
|
+
|
|
268
|
+
## 2.13.21
|
|
269
|
+
|
|
270
|
+
### Patch Changes
|
|
271
|
+
|
|
272
|
+
- 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), [`3ba1aee`](https://github.com/atlassian-labs/atlaspack/commit/3ba1aee6a794a26b2f0255aaf6d003981532d0ae)]:
|
|
273
|
+
- @atlaspack/feature-flags@2.19.0
|
|
274
|
+
- @atlaspack/utils@2.17.0
|
|
275
|
+
- @atlaspack/core@2.19.0
|
|
276
|
+
- @atlaspack/rust@3.4.1
|
|
277
|
+
- @atlaspack/graph@3.5.7
|
|
278
|
+
- @atlaspack/logger@2.14.13
|
|
279
|
+
- @atlaspack/types@2.15.8
|
|
280
|
+
- @atlaspack/plugin@2.14.18
|
|
281
|
+
|
|
282
|
+
## 2.13.20
|
|
283
|
+
|
|
284
|
+
### Patch Changes
|
|
285
|
+
|
|
286
|
+
- Updated dependencies [[`c75bf55`](https://github.com/atlassian-labs/atlaspack/commit/c75bf553fff4decc285b5fd499a275853b18f8f2)]:
|
|
287
|
+
- @atlaspack/rust@3.4.0
|
|
288
|
+
- @atlaspack/core@2.18.8
|
|
289
|
+
- @atlaspack/logger@2.14.12
|
|
290
|
+
- @atlaspack/utils@2.16.1
|
|
291
|
+
- @atlaspack/types@2.15.7
|
|
292
|
+
- @atlaspack/plugin@2.14.17
|
|
293
|
+
|
|
294
|
+
## 2.13.19
|
|
295
|
+
|
|
296
|
+
### Patch Changes
|
|
297
|
+
|
|
298
|
+
- Updated dependencies [[`1ff31f1`](https://github.com/atlassian-labs/atlaspack/commit/1ff31f10391c48780c9fcfc243b4e828a1b285e0), [`e8a60ff`](https://github.com/atlassian-labs/atlaspack/commit/e8a60ffbea41caef265786bbf73349771760081c), [`30ee2cf`](https://github.com/atlassian-labs/atlaspack/commit/30ee2cfcd34cf2646ded0eda13fdb80a2a5de529)]:
|
|
299
|
+
- @atlaspack/core@2.18.7
|
|
300
|
+
- @atlaspack/feature-flags@2.18.4
|
|
301
|
+
- @atlaspack/utils@2.16.0
|
|
302
|
+
- @atlaspack/graph@3.5.6
|
|
303
|
+
- @atlaspack/types@2.15.6
|
|
304
|
+
- @atlaspack/plugin@2.14.16
|
|
305
|
+
|
|
306
|
+
## 2.13.18
|
|
307
|
+
|
|
308
|
+
### Patch Changes
|
|
309
|
+
|
|
310
|
+
- Updated dependencies [[`5ded263`](https://github.com/atlassian-labs/atlaspack/commit/5ded263c7f11b866e8885b81c73e20dd060b25be), [`74fd942`](https://github.com/atlassian-labs/atlaspack/commit/74fd94236ac697207082c4b755b079e56f5564fb)]:
|
|
311
|
+
- @atlaspack/feature-flags@2.18.3
|
|
312
|
+
- @atlaspack/core@2.18.6
|
|
313
|
+
- @atlaspack/graph@3.5.5
|
|
314
|
+
- @atlaspack/utils@2.15.3
|
|
315
|
+
- @atlaspack/types@2.15.5
|
|
316
|
+
- @atlaspack/plugin@2.14.15
|
|
317
|
+
|
|
318
|
+
## 2.13.17
|
|
319
|
+
|
|
320
|
+
### Patch Changes
|
|
321
|
+
|
|
322
|
+
- Updated dependencies [[`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956)]:
|
|
323
|
+
- @atlaspack/feature-flags@2.18.2
|
|
324
|
+
- @atlaspack/core@2.18.5
|
|
325
|
+
- @atlaspack/graph@3.5.4
|
|
326
|
+
- @atlaspack/utils@2.15.2
|
|
327
|
+
- @atlaspack/types@2.15.4
|
|
328
|
+
- @atlaspack/plugin@2.14.14
|
|
329
|
+
|
|
330
|
+
## 2.13.16
|
|
331
|
+
|
|
332
|
+
### Patch Changes
|
|
333
|
+
|
|
334
|
+
- Updated dependencies [[`ef3d622`](https://github.com/atlassian-labs/atlaspack/commit/ef3d6228f4e006702198a19c61e051d194d325cb), [`6b1f5ff`](https://github.com/atlassian-labs/atlaspack/commit/6b1f5fff68d7131fae075e14f4d2c02606dc6058), [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b), [`c8f7df4`](https://github.com/atlassian-labs/atlaspack/commit/c8f7df4eadfc4718040fceb065dae6e96a4051e7), [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca)]:
|
|
335
|
+
- @atlaspack/logger@2.14.11
|
|
336
|
+
- @atlaspack/core@2.18.4
|
|
337
|
+
- @atlaspack/feature-flags@2.18.1
|
|
338
|
+
- @atlaspack/types@2.15.3
|
|
339
|
+
- @atlaspack/utils@2.15.1
|
|
340
|
+
- @atlaspack/graph@3.5.3
|
|
341
|
+
- @atlaspack/plugin@2.14.13
|
|
342
|
+
|
|
343
|
+
## 2.13.15
|
|
344
|
+
|
|
345
|
+
### Patch Changes
|
|
346
|
+
|
|
347
|
+
- 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)]:
|
|
348
|
+
- @atlaspack/feature-flags@2.18.0
|
|
349
|
+
- @atlaspack/utils@2.15.0
|
|
350
|
+
- @atlaspack/core@2.18.3
|
|
351
|
+
- @atlaspack/graph@3.5.2
|
|
352
|
+
- @atlaspack/types@2.15.2
|
|
353
|
+
- @atlaspack/plugin@2.14.12
|
|
354
|
+
|
|
355
|
+
## 2.13.14
|
|
356
|
+
|
|
357
|
+
### Patch Changes
|
|
358
|
+
|
|
359
|
+
- Updated dependencies [[`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3), [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef)]:
|
|
360
|
+
- @atlaspack/feature-flags@2.17.0
|
|
361
|
+
- @atlaspack/core@2.18.2
|
|
362
|
+
- @atlaspack/graph@3.5.1
|
|
363
|
+
- @atlaspack/utils@2.14.11
|
|
364
|
+
- @atlaspack/types@2.15.1
|
|
365
|
+
- @atlaspack/plugin@2.14.11
|
|
366
|
+
|
|
367
|
+
## 2.13.13
|
|
368
|
+
|
|
369
|
+
### Patch Changes
|
|
370
|
+
|
|
371
|
+
- Updated dependencies [[`1b52b99`](https://github.com/atlassian-labs/atlaspack/commit/1b52b99db4298b04c1a6eb0f97994d75a2d436f9)]:
|
|
372
|
+
- @atlaspack/graph@3.5.0
|
|
373
|
+
- @atlaspack/core@2.18.1
|
|
374
|
+
|
|
375
|
+
## 2.13.12
|
|
376
|
+
|
|
377
|
+
### Patch Changes
|
|
378
|
+
|
|
379
|
+
- Updated dependencies [[`51aba5f`](https://github.com/atlassian-labs/atlaspack/commit/51aba5fc0e49235ee06bbc3c376f48c3e7da5c4b), [`1e32d4e`](https://github.com/atlassian-labs/atlaspack/commit/1e32d4eae6b3af3968e8a0ef97d35b4347fd4196), [`0b2f6f5`](https://github.com/atlassian-labs/atlaspack/commit/0b2f6f55794d3ff6e2f5a41f963e7e5dd8ad9f8d), [`35fdd4b`](https://github.com/atlassian-labs/atlaspack/commit/35fdd4b52da0af20f74667f7b8adfb2f90279b7c), [`6dd4ccb`](https://github.com/atlassian-labs/atlaspack/commit/6dd4ccb753541de32322d881f973d571dd57e4ca)]:
|
|
380
|
+
- @atlaspack/types@2.15.0
|
|
381
|
+
- @atlaspack/core@2.18.0
|
|
382
|
+
- @atlaspack/rust@3.3.5
|
|
383
|
+
- @atlaspack/plugin@2.14.10
|
|
384
|
+
- @atlaspack/logger@2.14.10
|
|
385
|
+
- @atlaspack/utils@2.14.10
|
|
386
|
+
|
|
387
|
+
## 2.13.11
|
|
388
|
+
|
|
389
|
+
### Patch Changes
|
|
390
|
+
|
|
391
|
+
- Updated dependencies [[`1940859`](https://github.com/atlassian-labs/atlaspack/commit/194085942f0e86532e9d039fc3f8039badce4594), [`15b6155`](https://github.com/atlassian-labs/atlaspack/commit/15b61556e9114203ebbc9de94b864118ca764598), [`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), [`d04de26`](https://github.com/atlassian-labs/atlaspack/commit/d04de26af684d7abfba5091fbe3df16a12cd0ebc), [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b), [`1ef91fc`](https://github.com/atlassian-labs/atlaspack/commit/1ef91fcc863fdd2831511937083dbbc1263b3d9d)]:
|
|
392
|
+
- @atlaspack/core@2.17.4
|
|
393
|
+
- @atlaspack/rust@3.3.4
|
|
394
|
+
- @atlaspack/feature-flags@2.16.0
|
|
395
|
+
- @atlaspack/logger@2.14.9
|
|
396
|
+
- @atlaspack/utils@2.14.9
|
|
397
|
+
- @atlaspack/graph@3.4.7
|
|
398
|
+
- @atlaspack/types@2.14.9
|
|
399
|
+
- @atlaspack/plugin@2.14.9
|
|
400
|
+
|
|
3
401
|
## 2.13.10
|
|
4
402
|
|
|
5
403
|
### Patch Changes
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
var _EdgeContentGraph_edgeWeights;
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EdgeContentGraph = void 0;
|
|
13
|
+
const graph_1 = require("@atlaspack/graph");
|
|
14
|
+
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
15
|
+
/**
|
|
16
|
+
* A `ContentGraph` that also stores weights on edges.
|
|
17
|
+
*
|
|
18
|
+
* @template N The type of the node weight.
|
|
19
|
+
* @template EW The type of the edge weight.
|
|
20
|
+
*/
|
|
21
|
+
class EdgeContentGraph extends graph_1.ContentGraph {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
_EdgeContentGraph_edgeWeights.set(this, new Map());
|
|
25
|
+
}
|
|
26
|
+
clone() {
|
|
27
|
+
const newGraph = new EdgeContentGraph();
|
|
28
|
+
let nodeId = 0;
|
|
29
|
+
for (let node of this.nodes) {
|
|
30
|
+
const contentKey = this._nodeIdToContentKey.get(nodeId);
|
|
31
|
+
if (node == null) {
|
|
32
|
+
// Add null node to preserve node ids
|
|
33
|
+
// @ts-expect-error TS2345
|
|
34
|
+
newGraph.addNode(null);
|
|
35
|
+
}
|
|
36
|
+
else if (contentKey == null) {
|
|
37
|
+
newGraph.addNode(node);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
newGraph.addNodeByContentKey(contentKey, node);
|
|
41
|
+
}
|
|
42
|
+
nodeId += 1;
|
|
43
|
+
}
|
|
44
|
+
// @ts-expect-error TS2488
|
|
45
|
+
for (let edge of this.getAllEdges()) {
|
|
46
|
+
const weight = this.getEdgeWeight(edge.from, edge.to);
|
|
47
|
+
newGraph.addWeightedEdge(edge.from, edge.to, edge.type, weight);
|
|
48
|
+
}
|
|
49
|
+
if (this.rootNodeId != null) {
|
|
50
|
+
const rootNodeContentKey = this._nodeIdToContentKey.get(this.rootNodeId);
|
|
51
|
+
const newGraphRootNodeId = newGraph.getNodeIdByContentKey((0, nullthrows_1.default)(rootNodeContentKey));
|
|
52
|
+
newGraph.setRootNodeId(newGraphRootNodeId);
|
|
53
|
+
}
|
|
54
|
+
return newGraph;
|
|
55
|
+
}
|
|
56
|
+
addWeightedEdge(from, to, type, weight) {
|
|
57
|
+
this.addEdge(from, to, type);
|
|
58
|
+
if (weight != null) {
|
|
59
|
+
__classPrivateFieldGet(this, _EdgeContentGraph_edgeWeights, "f").set([String(from), String(to)].join(','), weight);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
getEdgeWeight(from, to) {
|
|
63
|
+
return __classPrivateFieldGet(this, _EdgeContentGraph_edgeWeights, "f").get([String(from), String(to)].join(',')) ?? null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.EdgeContentGraph = EdgeContentGraph;
|
|
67
|
+
_EdgeContentGraph_edgeWeights = new WeakMap();
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findStronglyConnectedComponents = findStronglyConnectedComponents;
|
|
4
|
+
/**
|
|
5
|
+
* Robert Tarjan's algorithm to find strongly connected components in a graph.
|
|
6
|
+
*
|
|
7
|
+
* Time complexity: O(V + E)
|
|
8
|
+
* Space complexity (worst case): O(V)
|
|
9
|
+
*
|
|
10
|
+
* * https://web.archive.org/web/20170829214726id_/http://www.cs.ucsb.edu/~gilbert/cs240a/old/cs240aSpr2011/slides/TarjanDFS.pdf
|
|
11
|
+
* * https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
|
|
12
|
+
*/
|
|
13
|
+
function findStronglyConnectedComponents(graph) {
|
|
14
|
+
const result = [];
|
|
15
|
+
let index = 0;
|
|
16
|
+
const stack = [];
|
|
17
|
+
const state = new Array(graph.nodes.length).fill(null).map(() => ({
|
|
18
|
+
index: null,
|
|
19
|
+
lowlink: null,
|
|
20
|
+
onStack: false,
|
|
21
|
+
}));
|
|
22
|
+
graph.nodes.forEach((node, nodeId) => {
|
|
23
|
+
if (node != null && state[nodeId].index == null) {
|
|
24
|
+
strongConnect(nodeId);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
function strongConnect(nodeId) {
|
|
28
|
+
const nodeState = state[nodeId];
|
|
29
|
+
nodeState.index = index;
|
|
30
|
+
nodeState.lowlink = index;
|
|
31
|
+
index += 1;
|
|
32
|
+
stack.push(nodeId);
|
|
33
|
+
nodeState.onStack = true;
|
|
34
|
+
for (let neighborId of graph.getNodeIdsConnectedFrom(nodeId)) {
|
|
35
|
+
const neighborState = state[neighborId];
|
|
36
|
+
if (neighborState.index == null) {
|
|
37
|
+
strongConnect(neighborId);
|
|
38
|
+
nodeState.lowlink = Math.min(Number(nodeState.lowlink), Number(neighborState.lowlink));
|
|
39
|
+
}
|
|
40
|
+
else if (neighborState.onStack) {
|
|
41
|
+
nodeState.lowlink = Math.min(Number(nodeState.lowlink), Number(neighborState.index));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (nodeState.lowlink === nodeState.index) {
|
|
45
|
+
const component = [];
|
|
46
|
+
let member;
|
|
47
|
+
do {
|
|
48
|
+
member = stack.pop();
|
|
49
|
+
// @ts-expect-error TS2538
|
|
50
|
+
state[member].onStack = false;
|
|
51
|
+
// @ts-expect-error TS2345
|
|
52
|
+
component.push(member);
|
|
53
|
+
} while (member !== nodeId);
|
|
54
|
+
result.push(component);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.simpleFastDominance = simpleFastDominance;
|
|
4
|
+
exports.getGraphPostOrder = getGraphPostOrder;
|
|
5
|
+
exports.intersect = intersect;
|
|
6
|
+
const graph_1 = require("@atlaspack/graph");
|
|
7
|
+
/**
|
|
8
|
+
* Implements "A simple, fast dominance algorithm", to find the immediate
|
|
9
|
+
* dominators of all nodes in a graph.
|
|
10
|
+
*
|
|
11
|
+
* Returns a map of node IDs to their immediate dominator's node ID.
|
|
12
|
+
* This map is represented by an array where the index is the node ID and the
|
|
13
|
+
* value is its dominator.
|
|
14
|
+
*
|
|
15
|
+
* For example, given a node `3`, `dominators[3]` is the immediate dominator
|
|
16
|
+
* of node 3.
|
|
17
|
+
*
|
|
18
|
+
* - https://www.cs.tufts.edu/comp/150FP/archive/keith-cooper/dom14.pdf
|
|
19
|
+
*/
|
|
20
|
+
function simpleFastDominance(graph) {
|
|
21
|
+
const rootNodeId = graph.rootNodeId;
|
|
22
|
+
if (rootNodeId == null) {
|
|
23
|
+
throw new Error('Graph must have a root node');
|
|
24
|
+
}
|
|
25
|
+
const postOrder = getGraphPostOrder(graph);
|
|
26
|
+
const reversedPostOrder = postOrder.slice().reverse();
|
|
27
|
+
const dominators = Array(graph.nodes.length).fill(null);
|
|
28
|
+
const postOrderIndexes = Array(graph.nodes.length).fill(null);
|
|
29
|
+
for (let i = 0; i < postOrder.length; i++) {
|
|
30
|
+
postOrderIndexes[postOrder[i]] = i;
|
|
31
|
+
}
|
|
32
|
+
dominators[rootNodeId] = graph.rootNodeId;
|
|
33
|
+
let changed = true;
|
|
34
|
+
while (changed) {
|
|
35
|
+
changed = false;
|
|
36
|
+
for (let node of reversedPostOrder) {
|
|
37
|
+
if (node === graph.rootNodeId)
|
|
38
|
+
continue;
|
|
39
|
+
// @ts-expect-error TS7034
|
|
40
|
+
let newImmediateDominator = null;
|
|
41
|
+
graph.forEachNodeIdConnectedTo(node,
|
|
42
|
+
// @ts-expect-error TS2345
|
|
43
|
+
(predecessor) => {
|
|
44
|
+
// @ts-expect-error TS7005
|
|
45
|
+
if (newImmediateDominator == null) {
|
|
46
|
+
newImmediateDominator = predecessor;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (dominators[predecessor] == null) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
newImmediateDominator = intersect(postOrderIndexes, dominators, predecessor,
|
|
53
|
+
// @ts-expect-error TS7005
|
|
54
|
+
newImmediateDominator);
|
|
55
|
+
}
|
|
56
|
+
}, graph_1.ALL_EDGE_TYPES);
|
|
57
|
+
if (dominators[node] !== newImmediateDominator) {
|
|
58
|
+
dominators[node] = newImmediateDominator;
|
|
59
|
+
changed = true;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return dominators;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Return the post-order of the graph.
|
|
67
|
+
*/
|
|
68
|
+
function getGraphPostOrder(graph, type = 1) {
|
|
69
|
+
const postOrder = [];
|
|
70
|
+
graph.traverse({
|
|
71
|
+
exit: (node) => {
|
|
72
|
+
postOrder.push(node);
|
|
73
|
+
},
|
|
74
|
+
}, graph.rootNodeId, type);
|
|
75
|
+
return postOrder;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* From "A Simple, Fast Dominance Algorithm"
|
|
79
|
+
* Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy:
|
|
80
|
+
*
|
|
81
|
+
* > The intersection routine appears at the bottom of the figure.
|
|
82
|
+
* > It implements a “two-finger” algorithm – one can imagine a finger pointing
|
|
83
|
+
* > to each dominator set, each finger moving independently as the comparisons
|
|
84
|
+
* > dictate. In this case, the comparisons are on postorder numbers; for each
|
|
85
|
+
* > intersection, we start the two fingers at the ends of the two sets, and,
|
|
86
|
+
* > until the fingers point to the same postorder number, we move the finger
|
|
87
|
+
* > pointing to the smaller number back one element. Remember that nodes higher
|
|
88
|
+
* > in the dominator tree have higher postorder numbers, which is why intersect
|
|
89
|
+
* > moves the finger whose value is less than the other finger’s. When the two
|
|
90
|
+
* > fingers point at the same element, intersect returns that element. The set
|
|
91
|
+
* > resulting from the intersection begins with the returned element and chains
|
|
92
|
+
* > its way up the doms array to the entry node.
|
|
93
|
+
*
|
|
94
|
+
* `postOrder` is the post-order node list of the graph.
|
|
95
|
+
*
|
|
96
|
+
* `dominators` is the current immediate dominator state for node in the graph.
|
|
97
|
+
*
|
|
98
|
+
* This is coupled with the fact node ids are indexes into an array. It is a map
|
|
99
|
+
* of NodeId -> NodeId, where the value at index `i` is the immediate dominator
|
|
100
|
+
* of the node `i`.
|
|
101
|
+
*
|
|
102
|
+
* `predecessor` is one predecessor node id of the node we're currently
|
|
103
|
+
* computing the immediate dominator for.
|
|
104
|
+
*
|
|
105
|
+
* `newImmediateDominator` is current best immediate dominator candidate for the
|
|
106
|
+
* node we're computing the immediate dominator for.
|
|
107
|
+
*
|
|
108
|
+
* The algorithm is intersecting the dominator sets of the two predecessors and
|
|
109
|
+
* returning dominator node with the highest post-order number by walking up
|
|
110
|
+
* the dominator tree until the two sets intersect.
|
|
111
|
+
*
|
|
112
|
+
* The node with the highest post-order index is the immediate dominator, as
|
|
113
|
+
* it is the closest to the node we're computing for.
|
|
114
|
+
*/
|
|
115
|
+
function intersect(postOrderIndexes, dominators, predecessor, newImmediateDominator) {
|
|
116
|
+
let n1 = predecessor;
|
|
117
|
+
let n2 = newImmediateDominator;
|
|
118
|
+
while (n1 !== n2) {
|
|
119
|
+
while (postOrderIndexes[n1] < postOrderIndexes[n2]) {
|
|
120
|
+
// @ts-expect-error TS7053
|
|
121
|
+
n1 = Number(dominators[n1]);
|
|
122
|
+
}
|
|
123
|
+
while (postOrderIndexes[n2] < postOrderIndexes[n1]) {
|
|
124
|
+
// @ts-expect-error TS7053
|
|
125
|
+
n2 = Number(dominators[n2]);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return n1;
|
|
129
|
+
}
|