Commit 6c082d0
committed
[DevTools] Don't capture durations for disconnected subtrees when profiling (facebook#35718)
After facebook#34089, when updating
(possibly, mounting) inside disconnected subtree, we don't record this
as an operation. This only happens during reconnect. The issue is that
`recordProfilingDurations()` can be called, which diffs tree base
duration and reports it to the Frontend:
https://github.com/facebook/react/blob/65db1000b944c8a07b5947c06b38eb8364dce4f2/packages/react-devtools-shared/src/backend/fiber/renderer.js#L4506-L4521
This operation can be recorded before the "Add" operation, and it will
not be resolved properly on the Frontend side.
Before the fix:
```
commit tree › Suspense › should handle transitioning from fallback back to content during profiling
Could not clone the node: commit tree does not contain fiber "5". This is a bug in React DevTools.
162 | const existingNode = nodes.get(id);
163 | if (existingNode == null) {
> 164 | throw new Error(
| ^
165 | `Could not clone the node: commit tree does not contain fiber "${id}". This is a bug in React DevTools.`,
166 | );
167 | }
at getClonedNode (packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js:164:13)
at updateTree (packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js:348:24)
at getCommitTree (packages/react-devtools-shared/src/devtools/views/Profiler/CommitTreeBuilder.js:112:20)
at ProfilingCache.getCommitTree (packages/react-devtools-shared/src/devtools/ProfilingCache.js:40:46)
at Object.<anonymous> (packages/react-devtools-shared/src/__tests__/profilingCommitTreeBuilder-test.js:257:44)
```
DiffTrain build for [c6bb26b](facebook@c6bb26b)1 parent 47f4f1b commit 6c082d0
21 files changed
Lines changed: 128 additions & 160 deletions
File tree
- compiled-rn
- facebook-fbsource/xplat/js
- RKJSModules/vendor/react
- react-dom/cjs
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
- tools/eslint-plugin-react-hooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
| 413 | + | |
414 | 414 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
Lines changed: 20 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
7282 | 7282 | | |
7283 | 7283 | | |
7284 | 7284 | | |
7285 | | - | |
7286 | | - | |
7287 | | - | |
7288 | | - | |
7289 | | - | |
7290 | | - | |
7291 | | - | |
7292 | | - | |
7293 | | - | |
7294 | | - | |
| 7285 | + | |
| 7286 | + | |
| 7287 | + | |
| 7288 | + | |
| 7289 | + | |
7295 | 7290 | | |
7296 | 7291 | | |
7297 | | - | |
7298 | | - | |
7299 | | - | |
| 7292 | + | |
| 7293 | + | |
| 7294 | + | |
7300 | 7295 | | |
7301 | 7296 | | |
7302 | 7297 | | |
7303 | | - | |
7304 | | - | |
| 7298 | + | |
| 7299 | + | |
7305 | 7300 | | |
7306 | 7301 | | |
7307 | 7302 | | |
7308 | 7303 | | |
7309 | | - | |
7310 | | - | |
| 7304 | + | |
7311 | 7305 | | |
7312 | 7306 | | |
7313 | 7307 | | |
7314 | 7308 | | |
7315 | 7309 | | |
7316 | 7310 | | |
7317 | 7311 | | |
7318 | | - | |
| 7312 | + | |
7319 | 7313 | | |
7320 | 7314 | | |
7321 | 7315 | | |
7322 | 7316 | | |
7323 | 7317 | | |
7324 | | - | |
| 7318 | + | |
7325 | 7319 | | |
7326 | 7320 | | |
7327 | | - | |
| 7321 | + | |
7328 | 7322 | | |
7329 | 7323 | | |
7330 | | - | |
7331 | | - | |
7332 | 7324 | | |
7333 | 7325 | | |
7334 | 7326 | | |
| |||
30203 | 30195 | | |
30204 | 30196 | | |
30205 | 30197 | | |
30206 | | - | |
| 30198 | + | |
30207 | 30199 | | |
30208 | 30200 | | |
30209 | 30201 | | |
30210 | | - | |
| 30202 | + | |
30211 | 30203 | | |
30212 | 30204 | | |
30213 | 30205 | | |
| |||
30244 | 30236 | | |
30245 | 30237 | | |
30246 | 30238 | | |
30247 | | - | |
| 30239 | + | |
30248 | 30240 | | |
30249 | 30241 | | |
30250 | | - | |
| 30242 | + | |
30251 | 30243 | | |
30252 | 30244 | | |
30253 | 30245 | | |
| |||
30397 | 30389 | | |
30398 | 30390 | | |
30399 | 30391 | | |
30400 | | - | |
| 30392 | + | |
30401 | 30393 | | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
17759 | 17759 | | |
17760 | 17760 | | |
17761 | 17761 | | |
17762 | | - | |
| 17762 | + | |
17763 | 17763 | | |
17764 | 17764 | | |
17765 | 17765 | | |
17766 | 17766 | | |
17767 | 17767 | | |
17768 | 17768 | | |
17769 | | - | |
| 17769 | + | |
17770 | 17770 | | |
17771 | 17771 | | |
17772 | 17772 | | |
| |||
17788 | 17788 | | |
17789 | 17789 | | |
17790 | 17790 | | |
17791 | | - | |
| 17791 | + | |
17792 | 17792 | | |
17793 | 17793 | | |
17794 | | - | |
| 17794 | + | |
17795 | 17795 | | |
17796 | 17796 | | |
17797 | 17797 | | |
| |||
17898 | 17898 | | |
17899 | 17899 | | |
17900 | 17900 | | |
17901 | | - | |
| 17901 | + | |
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
19748 | 19748 | | |
19749 | 19749 | | |
19750 | 19750 | | |
19751 | | - | |
| 19751 | + | |
19752 | 19752 | | |
19753 | 19753 | | |
19754 | 19754 | | |
19755 | 19755 | | |
19756 | 19756 | | |
19757 | 19757 | | |
19758 | | - | |
| 19758 | + | |
19759 | 19759 | | |
19760 | 19760 | | |
19761 | 19761 | | |
| |||
19777 | 19777 | | |
19778 | 19778 | | |
19779 | 19779 | | |
19780 | | - | |
| 19780 | + | |
19781 | 19781 | | |
19782 | 19782 | | |
19783 | | - | |
| 19783 | + | |
19784 | 19784 | | |
19785 | 19785 | | |
19786 | 19786 | | |
| |||
19903 | 19903 | | |
19904 | 19904 | | |
19905 | 19905 | | |
19906 | | - | |
| 19906 | + | |
Lines changed: 20 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
7290 | 7290 | | |
7291 | 7291 | | |
7292 | 7292 | | |
7293 | | - | |
7294 | | - | |
7295 | | - | |
7296 | | - | |
7297 | | - | |
7298 | | - | |
7299 | | - | |
7300 | | - | |
7301 | | - | |
7302 | | - | |
| 7293 | + | |
| 7294 | + | |
| 7295 | + | |
| 7296 | + | |
| 7297 | + | |
7303 | 7298 | | |
7304 | 7299 | | |
7305 | | - | |
7306 | | - | |
7307 | | - | |
| 7300 | + | |
| 7301 | + | |
| 7302 | + | |
7308 | 7303 | | |
7309 | 7304 | | |
7310 | 7305 | | |
7311 | | - | |
7312 | | - | |
| 7306 | + | |
| 7307 | + | |
7313 | 7308 | | |
7314 | 7309 | | |
7315 | 7310 | | |
7316 | 7311 | | |
7317 | | - | |
7318 | | - | |
| 7312 | + | |
7319 | 7313 | | |
7320 | 7314 | | |
7321 | 7315 | | |
7322 | 7316 | | |
7323 | 7317 | | |
7324 | 7318 | | |
7325 | 7319 | | |
7326 | | - | |
| 7320 | + | |
7327 | 7321 | | |
7328 | 7322 | | |
7329 | 7323 | | |
7330 | 7324 | | |
7331 | 7325 | | |
7332 | | - | |
| 7326 | + | |
7333 | 7327 | | |
7334 | 7328 | | |
7335 | | - | |
| 7329 | + | |
7336 | 7330 | | |
7337 | 7331 | | |
7338 | | - | |
7339 | | - | |
7340 | 7332 | | |
7341 | 7333 | | |
7342 | 7334 | | |
| |||
30265 | 30257 | | |
30266 | 30258 | | |
30267 | 30259 | | |
30268 | | - | |
| 30260 | + | |
30269 | 30261 | | |
30270 | 30262 | | |
30271 | 30263 | | |
30272 | | - | |
| 30264 | + | |
30273 | 30265 | | |
30274 | 30266 | | |
30275 | 30267 | | |
| |||
30306 | 30298 | | |
30307 | 30299 | | |
30308 | 30300 | | |
30309 | | - | |
| 30301 | + | |
30310 | 30302 | | |
30311 | 30303 | | |
30312 | | - | |
| 30304 | + | |
30313 | 30305 | | |
30314 | 30306 | | |
30315 | 30307 | | |
| |||
30775 | 30767 | | |
30776 | 30768 | | |
30777 | 30769 | | |
30778 | | - | |
| 30770 | + | |
30779 | 30771 | | |
30780 | 30772 | | |
30781 | 30773 | | |
| |||
0 commit comments