Commit facec3e
authored
[Fiber] Schedule passive effects using the regular ensureRootIsScheduled flow (facebook#31785)
This treats workInProgressRoot work and rootWithPendingPassiveEffects
the same way. Basically as long as there's some work on the root, yield
the current task. Including passive effects. This means that passive
effects are now a continuation instead of a separate callback. This can
mean they're earlier or later than before. Later for Idle in case
there's other non-React work. Earlier for same Default if there's other
Default priority work.
This makes sense since increasing priority of the passive effects beyond
Idle doesn't really make sense for an Idle render.
However, for any given render at same priority it's more important to
complete this work than start something new.
Since we special case continuations to always yield to the browser, this
has the same effect as facebook#31784 without implementing `requestPaint`. At
least assuming nothing else calls `requestPaint`.
<img width="587" alt="Screenshot 2024-12-14 at 5 37 37 PM"
src="https://github.com/user-attachments/assets/8641b172-8842-4191-8bf0-50cbe263a30c"
/>1 parent f5077bc commit facec3e
File tree
18 files changed
+161
-48
lines changed- packages
- react-dom/src/__tests__
- react-reconciler/src
- __tests__
- use-subscription/src/__tests__
18 files changed
+161
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
911 | 911 | | |
912 | 912 | | |
913 | 913 | | |
914 | | - | |
915 | | - | |
916 | | - | |
| 914 | + | |
917 | 915 | | |
918 | 916 | | |
919 | 917 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3743 | 3743 | | |
3744 | 3744 | | |
3745 | 3745 | | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
3746 | 3750 | | |
3747 | 3751 | | |
3748 | 3752 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
| 330 | + | |
| 331 | + | |
327 | 332 | | |
328 | 333 | | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
333 | 345 | | |
334 | 346 | | |
335 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
613 | | - | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
641 | 649 | | |
642 | 650 | | |
643 | 651 | | |
| |||
3210 | 3218 | | |
3211 | 3219 | | |
3212 | 3220 | | |
3213 | | - | |
3214 | | - | |
3215 | | - | |
3216 | | - | |
3217 | | - | |
3218 | | - | |
3219 | 3221 | | |
3220 | 3222 | | |
3221 | 3223 | | |
| |||
3253 | 3255 | | |
3254 | 3256 | | |
3255 | 3257 | | |
| 3258 | + | |
3256 | 3259 | | |
3257 | 3260 | | |
3258 | 3261 | | |
| |||
3261 | 3264 | | |
3262 | 3265 | | |
3263 | 3266 | | |
3264 | | - | |
3265 | | - | |
3266 | | - | |
3267 | | - | |
3268 | | - | |
3269 | | - | |
3270 | | - | |
3271 | | - | |
3272 | | - | |
3273 | | - | |
3274 | | - | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
| 3275 | + | |
| 3276 | + | |
| 3277 | + | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
3275 | 3286 | | |
3276 | 3287 | | |
3277 | 3288 | | |
| |||
3285 | 3296 | | |
3286 | 3297 | | |
3287 | 3298 | | |
| 3299 | + | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
| 3304 | + | |
3288 | 3305 | | |
3289 | 3306 | | |
3290 | 3307 | | |
| |||
3441 | 3458 | | |
3442 | 3459 | | |
3443 | 3460 | | |
3444 | | - | |
3445 | | - | |
3446 | | - | |
3447 | | - | |
3448 | 3461 | | |
3449 | 3462 | | |
3450 | 3463 | | |
| |||
3480 | 3493 | | |
3481 | 3494 | | |
3482 | 3495 | | |
| 3496 | + | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
3483 | 3500 | | |
3484 | 3501 | | |
3485 | 3502 | | |
| |||
3648 | 3665 | | |
3649 | 3666 | | |
3650 | 3667 | | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
3651 | 3675 | | |
3652 | 3676 | | |
3653 | 3677 | | |
| |||
3745 | 3769 | | |
3746 | 3770 | | |
3747 | 3771 | | |
| 3772 | + | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
3748 | 3780 | | |
3749 | 3781 | | |
3750 | 3782 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
756 | 760 | | |
757 | 761 | | |
758 | 762 | | |
| |||
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
759 | 763 | | |
760 | 764 | | |
761 | | - | |
762 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
763 | 769 | | |
764 | 770 | | |
Lines changed: 17 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2695 | 2695 | | |
2696 | 2696 | | |
2697 | 2697 | | |
2698 | | - | |
2699 | | - | |
2700 | | - | |
2701 | | - | |
2702 | | - | |
2703 | | - | |
2704 | | - | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
2705 | 2715 | | |
2706 | 2716 | | |
2707 | 2717 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
203 | 207 | | |
204 | 208 | | |
205 | 209 | | |
| |||
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
240 | 248 | | |
241 | 249 | | |
242 | 250 | | |
| |||
452 | 460 | | |
453 | 461 | | |
454 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
455 | 467 | | |
456 | 468 | | |
457 | 469 | | |
| |||
471 | 483 | | |
472 | 484 | | |
473 | 485 | | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
474 | 490 | | |
475 | 491 | | |
476 | 492 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1901 | 1901 | | |
1902 | 1902 | | |
1903 | 1903 | | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
1904 | 1908 | | |
1905 | 1909 | | |
1906 | 1910 | | |
| |||
Lines changed: 20 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
92 | 104 | | |
93 | 105 | | |
94 | 106 | | |
| |||
0 commit comments