Commit 42f15b3
authored
[DevTools][Transition Tracing] onTransitionComplete and onTransitionStart implmentation (#23313)
* add transition name to startTransition
Add a transitionName to start transition, store the transition start time and name in the batch config, and pass it to the root on render
* Transition Tracing Types and Consts
* Root begin work
The root operates as a tracing marker that has all transitions on it. This PR only tested the root with one transition so far
- Store transitions in memoizedState. Do this in updateHostRoot AND attemptEarlyBailoutIfNoScheduledUpdate. We need to do this in the latter part because even if the root itself doesn't have an update, it could still have new transitions in its transitionLanes map that we need to process.
* Transition Tracing commit phase
- adds a module scoped pending transition callbacks object that contains all transition callbacks that have not yet been processed. This contains all callbacks before the next paint occurs.
- Add code in the mutation phase to:
* For the root, if there are transitions that were initialized during this commit in the root transition lanes map, add a transition start call to the pending transition callbacks object. Then, remove the transitions from the root transition lanes map.
* For roots, in the commit phase, add a transition complete call
We add this code in the mutation phase because we can't add it to the passive phase because then the paint might have occurred before we even know which callbacks to call
* Process Callbacks after paint
At the end of the commit phase, call scheduleTransitionCallbacks to schedule all pending transition callbacks to be called after paint. Then clear the callbacks1 parent 68cb55f commit 42f15b3
File tree
25 files changed
+831
-37
lines changed- packages
- react-debug-tools/src
- react-reconciler/src
- __tests__
- react-server/src
- react/src
25 files changed
+831
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
291 | 292 | | |
292 | 293 | | |
293 | 294 | | |
294 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
295 | 299 | | |
296 | 300 | | |
297 | 301 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
1336 | 1337 | | |
1337 | 1338 | | |
1338 | 1339 | | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1339 | 1344 | | |
1340 | 1345 | | |
1341 | 1346 | | |
| |||
3495 | 3500 | | |
3496 | 3501 | | |
3497 | 3502 | | |
| 3503 | + | |
3498 | 3504 | | |
3499 | | - | |
3500 | 3505 | | |
3501 | 3506 | | |
3502 | 3507 | | |
3503 | 3508 | | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
3504 | 3512 | | |
3505 | 3513 | | |
3506 | 3514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
1336 | 1337 | | |
1337 | 1338 | | |
1338 | 1339 | | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
1339 | 1344 | | |
1340 | 1345 | | |
1341 | 1346 | | |
| |||
3495 | 3500 | | |
3496 | 3501 | | |
3497 | 3502 | | |
| 3503 | + | |
3498 | 3504 | | |
3499 | | - | |
3500 | 3505 | | |
3501 | 3506 | | |
3502 | 3507 | | |
3503 | 3508 | | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
3504 | 3512 | | |
3505 | 3513 | | |
3506 | 3514 | | |
| |||
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
983 | 987 | | |
984 | 988 | | |
985 | 989 | | |
986 | | - | |
| 990 | + | |
987 | 991 | | |
| 992 | + | |
| 993 | + | |
988 | 994 | | |
989 | 995 | | |
990 | 996 | | |
| |||
2137 | 2143 | | |
2138 | 2144 | | |
2139 | 2145 | | |
2140 | | - | |
| 2146 | + | |
2141 | 2147 | | |
2142 | 2148 | | |
2143 | 2149 | | |
2144 | 2150 | | |
2145 | 2151 | | |
2146 | | - | |
| 2152 | + | |
2147 | 2153 | | |
2148 | 2154 | | |
2149 | 2155 | | |
| |||
2166 | 2172 | | |
2167 | 2173 | | |
2168 | 2174 | | |
2169 | | - | |
| 2175 | + | |
2170 | 2176 | | |
2171 | 2177 | | |
2172 | 2178 | | |
2173 | 2179 | | |
2174 | | - | |
| 2180 | + | |
2175 | 2181 | | |
2176 | 2182 | | |
2177 | 2183 | | |
2178 | 2184 | | |
2179 | | - | |
| 2185 | + | |
2180 | 2186 | | |
2181 | 2187 | | |
2182 | 2188 | | |
| |||
2194 | 2200 | | |
2195 | 2201 | | |
2196 | 2202 | | |
2197 | | - | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2198 | 2208 | | |
2199 | 2209 | | |
2200 | 2210 | | |
2201 | 2211 | | |
2202 | 2212 | | |
2203 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
2204 | 2240 | | |
2205 | 2241 | | |
2206 | 2242 | | |
| |||
Lines changed: 43 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
983 | 987 | | |
984 | 988 | | |
985 | 989 | | |
986 | | - | |
| 990 | + | |
987 | 991 | | |
| 992 | + | |
| 993 | + | |
988 | 994 | | |
989 | 995 | | |
990 | 996 | | |
| |||
2137 | 2143 | | |
2138 | 2144 | | |
2139 | 2145 | | |
2140 | | - | |
| 2146 | + | |
2141 | 2147 | | |
2142 | 2148 | | |
2143 | 2149 | | |
2144 | 2150 | | |
2145 | 2151 | | |
2146 | | - | |
| 2152 | + | |
2147 | 2153 | | |
2148 | 2154 | | |
2149 | 2155 | | |
| |||
2166 | 2172 | | |
2167 | 2173 | | |
2168 | 2174 | | |
2169 | | - | |
| 2175 | + | |
2170 | 2176 | | |
2171 | 2177 | | |
2172 | 2178 | | |
2173 | 2179 | | |
2174 | | - | |
| 2180 | + | |
2175 | 2181 | | |
2176 | 2182 | | |
2177 | 2183 | | |
2178 | 2184 | | |
2179 | | - | |
| 2185 | + | |
2180 | 2186 | | |
2181 | 2187 | | |
2182 | 2188 | | |
| |||
2194 | 2200 | | |
2195 | 2201 | | |
2196 | 2202 | | |
2197 | | - | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2198 | 2208 | | |
2199 | 2209 | | |
2200 | 2210 | | |
2201 | 2211 | | |
2202 | 2212 | | |
2203 | 2213 | | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
| 2226 | + | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
2204 | 2240 | | |
2205 | 2241 | | |
2206 | 2242 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
1570 | 1572 | | |
1571 | 1573 | | |
1572 | 1574 | | |
1573 | | - | |
1574 | 1575 | | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
1575 | 1584 | | |
1576 | 1585 | | |
1577 | 1586 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
1570 | 1572 | | |
1571 | 1573 | | |
1572 | 1574 | | |
1573 | | - | |
1574 | 1575 | | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
1575 | 1584 | | |
1576 | 1585 | | |
1577 | 1586 | | |
| |||
0 commit comments