react/packages
Josh Story 978fae4b4f
[Float][Fiber] implement a faster hydration match for hoistable elements (#26154)
This PR is now based on #26256 

The original matching function for `hydrateHoistable` some challenging
time complexity since we built up the list of matchable nodes for each
link of that type and then had to check to exclusion. This new
implementation aims to improve the complexity

For hoisted title tags we match the first title if it is valid (not in
SVG context and does not have `itemprop`, the two ways you opt out of
hoisting when rendering titles). This path is much faster than others
and we use it because valid Documents only have 1 title anyway and if we
did have a mismatch the rendered title still ends up as the
Document.title so there is no functional degradation for misses.

For hoisted link and meta tags we track all potentially hydratable
Elements of this type in a cache per Document. The cache is refreshed
once each commit if and only if there is a title or meta hoistable
hydrating. The caches are partitioned by a natural key for each type
(href for link and content for meta). Then secondary attributes are
checked to see if the potential match is matchable.

For link we check `rel`, `title`, and `crossorigin`. These should
provide enough entropy that we never have collisions except is contrived
cases and even then it should not affect functionality of the page. This
should also be tolerant of links being injected in arbitrary places in
the Document by 3rd party scripts and browser extensions

For meta we check `name`, `property`, `http-equiv`, and `charset`. These
should provide enough entropy that we don't have meaningful collisions.
It is concievable with og tags that there may be true duplciates `<meta
property="og:image:size:height" content="100" />` but even if we did
bind to the wrong instance meta tags are typically only read from SSR by
bots and rarely inserted by 3rd parties so an adverse functional outcome
is not expected.
2023-03-06 19:52:35 -08:00
..
dom-event-testing-library Update jest printBasicPrototype config (#26142) 2023-02-10 09:58:57 +01:00
eslint-plugin-react-hooks Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
internal-test-utils SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
jest-react SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-art Cleanup enableSyncDefaultUpdate flag (#26236) 2023-02-27 14:04:02 -05:00
react-cache SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-client SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-debug-tools Codemod tests to waitFor pattern (2/?) (#26296) 2023-03-03 17:01:57 -05:00
react-devtools [DevTools] improve troubleshooting in README (#26235) 2023-03-03 14:02:21 -05:00
react-devtools-core React DevTools 4.27.1 -> 4.27.2 (#26185) 2023-02-16 16:46:23 -05:00
react-devtools-extensions Upgrade Flow to 0.201 (#26326) 2023-03-06 10:33:22 -05:00
react-devtools-inline React DevTools 4.27.1 -> 4.27.2 (#26185) 2023-02-16 16:46:23 -05:00
react-devtools-shared SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-devtools-shell Upgrade Flow to 0.201 (#26326) 2023-03-06 10:33:22 -05:00
react-devtools-timeline React DevTools 4.27.1 -> 4.27.2 (#26185) 2023-02-16 16:46:23 -05:00
react-dom [Float][Fiber] implement a faster hydration match for hoistable elements (#26154) 2023-03-06 19:52:35 -08:00
react-dom-bindings [Float][Fiber] implement a faster hydration match for hoistable elements (#26154) 2023-03-06 19:52:35 -08:00
react-interactions [flow] enable LTI inference mode (#26104) 2023-02-09 17:07:39 -05:00
react-is [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
react-native-renderer Extract duplicated methods in Fabric and the legacy renderer to a shared module (#26319) 2023-03-06 10:51:59 +00:00
react-noop-renderer SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-reconciler [Float][Fiber] implement a faster hydration match for hoistable elements (#26154) 2023-03-06 19:52:35 -08:00
react-refresh SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
react-server Upgrade Flow to 0.201 (#26326) 2023-03-06 10:33:22 -05:00
react-server-dom-relay Simplify Webpack References by encoding file path + export name as single id (#26300) 2023-03-04 19:51:34 -05:00
react-server-dom-webpack [Flight] Send server reference error chunks to the client (#26293) 2023-03-04 22:56:19 -05:00
react-server-native-relay Simplify Webpack References by encoding file path + export name as single id (#26300) 2023-03-04 19:51:34 -05:00
react-suspense-test-utils [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
react-test-renderer SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
scheduler SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
shared SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
use-subscription SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00
use-sync-external-store SchedulerMock.unstable_yieldValue -> SchedulerMock.log (#26312) 2023-03-06 11:09:07 -05:00