-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
chore: tidy up hydration code #10891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
A few minor cosmetic changes:
current_hydration_fragment
->hydrate_nodes
— three syllables instead of seven, and avoids a confusing use of the word 'fragment' (which implies aDocumentFragment
). In some cases, this allows Prettier to put things on a single line where previously it would have taken moreset_current_hydration_fragment(null)
andset_current_hydration_fragment([])
as an indirect way of settinghydrating
tofalse
ortrue
(it has no other effect), we just have aset_hydrating
function. This is much easier to understandhydration.js
,get_hydration_fragment
andset_current_hydration_fragment
were always called together. The intent of this pair of functions is to updatehydrate_nodes
, and as such they have been replaced with a combinedupdate_hydrate_nodes(...)
functioncapture_fragment_from_node
intohydration.js
I believe there are some further opportunities for simplification but wanted to land this first to keep PRs manageable. No behaviour changes so I'll self-merge once green