Commit 1720405
authored
[Float] fix coordination of resource identity and hydration (#25569)
there are a few bugs where dom representations from SSR aren't
identified as Resources when they should be.
There are 3 semantics
Resource -> hoist to head, deduping, etc...
hydratable Component -> SSR'd and hydrated in place
non-hydratable Component -> never SSR'd, never hydrated, always inserted
on the client
this last category is small
(non stylesheet) links with onLoad and/or onError
async scripts with onLoad and/or onError
The reason we have this distinction for now is we need every SSR'd async
script to be assumable to be a Resource. we don't currently encode
onLoad on the server and so we couldn't otherwise tell if an async
script is a Resource or is an async script with an onLoad which would
not be a resource. To avoid this ambiguity we never emit the scripts in
SSR and assume they need to be inserted on the client.
We can explore changes to these semantics in the future or possibly
encode some identifier when we want to opt out of resource semantics but
still SSR the link or script.1 parent fecc288 commit 1720405
File tree
4 files changed
+94
-22
lines changed- packages
- react-dom-bindings/src
- client
- server
- react-dom/src/__tests__
4 files changed
+94
-22
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
| 1468 | + | |
1468 | 1469 | | |
1469 | | - | |
1470 | | - | |
| 1470 | + | |
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
| |||
Lines changed: 33 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
805 | | - | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
806 | 814 | | |
807 | 815 | | |
808 | 816 | | |
| |||
902 | 910 | | |
903 | 911 | | |
904 | 912 | | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
905 | 921 | | |
906 | 922 | | |
907 | | - | |
| 923 | + | |
| 924 | + | |
908 | 925 | | |
909 | | - | |
910 | | - | |
| 926 | + | |
| 927 | + | |
911 | 928 | | |
912 | | - | |
| 929 | + | |
913 | 930 | | |
914 | | - | |
| 931 | + | |
915 | 932 | | |
916 | 933 | | |
917 | 934 | | |
| |||
927 | 944 | | |
928 | 945 | | |
929 | 946 | | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | 947 | | |
937 | 948 | | |
938 | 949 | | |
| |||
942 | 953 | | |
943 | 954 | | |
944 | 955 | | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
945 | 961 | | |
946 | 962 | | |
947 | | - | |
| 963 | + | |
| 964 | + | |
948 | 965 | | |
949 | | - | |
950 | | - | |
| 966 | + | |
| 967 | + | |
951 | 968 | | |
952 | | - | |
| 969 | + | |
953 | 970 | | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | 971 | | |
958 | 972 | | |
959 | 973 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
866 | | - | |
| 866 | + | |
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
284 | 342 | | |
285 | 343 | | |
286 | 344 | | |
| |||
0 commit comments