Commit 8d3e7a7
committed
Prerendering support for useDeferredValue (#27512)
### Based on #27509
Revealing a prerendered tree (hidden -> visible) is considered the same
as mounting a brand new tree. So, when an initialValue argument is
passed to useDeferredValue, and it's prerendered inside a hidden tree,
we should first prerender the initial value.
After the initial value has been prerendered, we switch to prerendering
the final one. This is the same sequence that we use when mounting new
visible tree. Depending on how much prerendering work has been finished
by the time the tree is revealed, we may or may not be able to skip all
the way to the final value.
This means we get the benefits of both prerendering and preview states:
if we have enough resources to prerender the whole thing, we do that. If
we don't, we have a preview state to show for immediate feedback.
DiffTrain build for commit 75c1bd7.1 parent b763135 commit 8d3e7a7
13 files changed
Lines changed: 342 additions & 295 deletions
File tree
- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
- implementations
Lines changed: 36 additions & 33 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 | | |
| |||
8580 | 8580 | | |
8581 | 8581 | | |
8582 | 8582 | | |
8583 | | - | |
8584 | | - | |
8585 | | - | |
8586 | | - | |
8587 | | - | |
8588 | | - | |
8589 | | - | |
8590 | | - | |
| 8583 | + | |
| 8584 | + | |
| 8585 | + | |
| 8586 | + | |
| 8587 | + | |
| 8588 | + | |
| 8589 | + | |
| 8590 | + | |
| 8591 | + | |
| 8592 | + | |
| 8593 | + | |
| 8594 | + | |
| 8595 | + | |
| 8596 | + | |
| 8597 | + | |
| 8598 | + | |
| 8599 | + | |
| 8600 | + | |
| 8601 | + | |
| 8602 | + | |
| 8603 | + | |
| 8604 | + | |
| 8605 | + | |
| 8606 | + | |
| 8607 | + | |
8591 | 8608 | | |
8592 | 8609 | | |
8593 | 8610 | | |
8594 | 8611 | | |
8595 | 8612 | | |
8596 | 8613 | | |
8597 | | - | |
8598 | | - | |
8599 | | - | |
8600 | | - | |
| 8614 | + | |
| 8615 | + | |
8601 | 8616 | | |
8602 | | - | |
8603 | | - | |
8604 | | - | |
8605 | | - | |
8606 | | - | |
8607 | | - | |
8608 | | - | |
8609 | | - | |
8610 | | - | |
8611 | | - | |
8612 | | - | |
8613 | | - | |
8614 | | - | |
8615 | | - | |
8616 | | - | |
8617 | | - | |
| 8617 | + | |
| 8618 | + | |
| 8619 | + | |
| 8620 | + | |
| 8621 | + | |
8618 | 8622 | | |
| 8623 | + | |
| 8624 | + | |
8619 | 8625 | | |
8620 | | - | |
8621 | | - | |
8622 | | - | |
8623 | 8626 | | |
8624 | 8627 | | |
8625 | 8628 | | |
| |||
24875 | 24878 | | |
24876 | 24879 | | |
24877 | 24880 | | |
24878 | | - | |
| 24881 | + | |
24879 | 24882 | | |
24880 | 24883 | | |
24881 | 24884 | | |
| |||
Lines changed: 31 additions & 29 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 | | |
| |||
2849 | 2849 | | |
2850 | 2850 | | |
2851 | 2851 | | |
2852 | | - | |
| 2852 | + | |
| 2853 | + | |
2853 | 2854 | | |
2854 | | - | |
2855 | | - | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
2856 | 2858 | | |
2857 | | - | |
2858 | | - | |
2859 | | - | |
2860 | | - | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
2864 | | - | |
2865 | | - | |
2866 | | - | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
2867 | 2869 | | |
2868 | 2870 | | |
2869 | 2871 | | |
| |||
9015 | 9017 | | |
9016 | 9018 | | |
9017 | 9019 | | |
9018 | | - | |
| 9020 | + | |
9019 | 9021 | | |
9020 | 9022 | | |
9021 | 9023 | | |
9022 | 9024 | | |
9023 | | - | |
| 9025 | + | |
9024 | 9026 | | |
9025 | 9027 | | |
9026 | | - | |
9027 | | - | |
9028 | | - | |
9029 | | - | |
9030 | | - | |
| 9028 | + | |
| 9029 | + | |
| 9030 | + | |
| 9031 | + | |
| 9032 | + | |
9031 | 9033 | | |
9032 | 9034 | | |
9033 | 9035 | | |
| |||
9044 | 9046 | | |
9045 | 9047 | | |
9046 | 9048 | | |
9047 | | - | |
| 9049 | + | |
9048 | 9050 | | |
9049 | 9051 | | |
9050 | 9052 | | |
9051 | 9053 | | |
9052 | 9054 | | |
9053 | 9055 | | |
9054 | | - | |
| 9056 | + | |
9055 | 9057 | | |
9056 | 9058 | | |
9057 | | - | |
| 9059 | + | |
9058 | 9060 | | |
9059 | | - | |
9060 | | - | |
| 9061 | + | |
| 9062 | + | |
9061 | 9063 | | |
9062 | 9064 | | |
9063 | | - | |
9064 | | - | |
| 9065 | + | |
| 9066 | + | |
9065 | 9067 | | |
9066 | | - | |
| 9068 | + | |
9067 | 9069 | | |
9068 | 9070 | | |
9069 | 9071 | | |
| |||
Lines changed: 31 additions & 29 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 | | |
| |||
2869 | 2869 | | |
2870 | 2870 | | |
2871 | 2871 | | |
2872 | | - | |
| 2872 | + | |
| 2873 | + | |
2873 | 2874 | | |
2874 | | - | |
2875 | | - | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
2876 | 2878 | | |
2877 | | - | |
2878 | | - | |
2879 | | - | |
2880 | | - | |
2881 | | - | |
2882 | | - | |
2883 | | - | |
2884 | | - | |
2885 | | - | |
2886 | | - | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
2887 | 2889 | | |
2888 | 2890 | | |
2889 | 2891 | | |
| |||
9441 | 9443 | | |
9442 | 9444 | | |
9443 | 9445 | | |
9444 | | - | |
| 9446 | + | |
9445 | 9447 | | |
9446 | 9448 | | |
9447 | 9449 | | |
9448 | 9450 | | |
9449 | | - | |
| 9451 | + | |
9450 | 9452 | | |
9451 | 9453 | | |
9452 | | - | |
9453 | | - | |
9454 | | - | |
9455 | | - | |
9456 | | - | |
| 9454 | + | |
| 9455 | + | |
| 9456 | + | |
| 9457 | + | |
| 9458 | + | |
9457 | 9459 | | |
9458 | 9460 | | |
9459 | 9461 | | |
| |||
9470 | 9472 | | |
9471 | 9473 | | |
9472 | 9474 | | |
9473 | | - | |
| 9475 | + | |
9474 | 9476 | | |
9475 | 9477 | | |
9476 | 9478 | | |
9477 | 9479 | | |
9478 | 9480 | | |
9479 | 9481 | | |
9480 | | - | |
| 9482 | + | |
9481 | 9483 | | |
9482 | 9484 | | |
9483 | | - | |
| 9485 | + | |
9484 | 9486 | | |
9485 | | - | |
9486 | | - | |
| 9487 | + | |
| 9488 | + | |
9487 | 9489 | | |
9488 | 9490 | | |
9489 | | - | |
9490 | | - | |
| 9491 | + | |
| 9492 | + | |
9491 | 9493 | | |
9492 | | - | |
| 9494 | + | |
9493 | 9495 | | |
9494 | 9496 | | |
9495 | 9497 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
| 586 | + | |
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments