Commit c022a52
committed
Change hydration warning index algorithm to use
The stack was required to track where to return after child siblings traversal.
The `fiber.return` pointers were made for that purpose,
it's safe to overwrite them because they are only used to traverse the fiber tree,
and their values outside the traversal functions are not relied upon.
One test fails for yet unknown reason, the text node is inserted too early:
```
● ReactMount › should warn when hydrate inserts a text node after matching elements (insertion diff)
Error: Unexpected warning recorded: - Expected
+ Received
Warning: Expected server HTML to contain a matching text node for {'SSRMismatchTest client text'} in <div>.
<div data-reactroot="">
<div data-ssr-mismatch-padding-before="1"><span></span></div>
<div data-ssr-mismatch-padding-before="2"></div>
+ + {'SSRMismatchTest client text'}
<div data-ssr-mismatch-padding-before="3"></div>
<div data-ssr-mismatch-padding-before="4"></div>
<div data-ssr-mismatch-padding-before="5"></div>
<div data-ssr-mismatch-padding-before="6"></div>
<div data-ssr-mismatch-padding-before="7"></div>
<div data-ssr-mismatch-padding-before="8"></div>
<div data-ssr-mismatch-padding-before="9"></div>
<div data-ssr-mismatch-padding-before="10"></div>
<div data-ssr-mismatch-padding-before="11"></div>
<div data-ssr-mismatch-padding-before="12"></div>
<div data-ssr-mismatch-padding-before="13"></div>
- + {'SSRMismatchTest client text'}
</div>
in div (at **)
```.return pointers, not stack1 parent 7d11bf3 commit c022a52
File tree
2 files changed
+48
-30
lines changed- packages
- react-dom/src/__tests__
- react-reconciler/src
2 files changed
+48
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
683 | 685 | | |
684 | 686 | | |
685 | 687 | | |
| |||
739 | 741 | | |
740 | 742 | | |
741 | 743 | | |
742 | | - | |
| 744 | + | |
743 | 745 | | |
744 | 746 | | |
745 | 747 | | |
| |||
910 | 912 | | |
911 | 913 | | |
912 | 914 | | |
913 | | - | |
| 915 | + | |
914 | 916 | | |
915 | 917 | | |
916 | 918 | | |
917 | 919 | | |
918 | 920 | | |
919 | 921 | | |
920 | | - | |
921 | | - | |
| 922 | + | |
| 923 | + | |
922 | 924 | | |
923 | 925 | | |
924 | 926 | | |
| |||
928 | 930 | | |
929 | 931 | | |
930 | 932 | | |
931 | | - | |
932 | | - | |
| 933 | + | |
| 934 | + | |
933 | 935 | | |
934 | | - | |
935 | | - | |
936 | 936 | | |
| 937 | + | |
937 | 938 | | |
938 | 939 | | |
939 | 940 | | |
| |||
942 | 943 | | |
943 | 944 | | |
944 | 945 | | |
945 | | - | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
946 | 951 | | |
947 | | - | |
948 | 952 | | |
949 | 953 | | |
| 954 | + | |
950 | 955 | | |
951 | 956 | | |
952 | 957 | | |
953 | 958 | | |
954 | 959 | | |
955 | 960 | | |
956 | 961 | | |
957 | | - | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
958 | 967 | | |
959 | | - | |
960 | 968 | | |
961 | 969 | | |
962 | | - | |
| 970 | + | |
| 971 | + | |
963 | 972 | | |
964 | 973 | | |
965 | 974 | | |
966 | 975 | | |
967 | 976 | | |
968 | 977 | | |
969 | 978 | | |
970 | | - | |
| 979 | + | |
971 | 980 | | |
972 | 981 | | |
973 | 982 | | |
| |||
979 | 988 | | |
980 | 989 | | |
981 | 990 | | |
| 991 | + | |
982 | 992 | | |
983 | 993 | | |
984 | 994 | | |
| |||
Lines changed: 23 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
108 | 113 | | |
109 | 114 | | |
110 | 115 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
115 | 120 | | |
116 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
117 | 129 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
123 | 133 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 134 | + | |
129 | 135 | | |
| 136 | + | |
| 137 | + | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
| |||
0 commit comments