You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a number of open requests for more efficient hydration. Most notably #4308, but also #4297, #2152, #4444, and others. However, they all seem to still be doing far more work than I think is necessary.
React will attempt to attach event listeners to the existing markup. React expects that the rendered content is identical between the server and the client. In development mode, React warns about mismatches during hydration. There are no guarantees that attribute differences will be patched up in case of mismatches. This is important for performance reasons because in most apps, mismatches are rare, and so validating all markup would be prohibitively expensive.
This is what I would intuitively think hydration should do. I.e. attach event listeners and nothing more. This would be much more efficient at runtime as well as resulting in smaller bundles.
I'm not sure if there's a reason why SvelteJS today does a diff operation that compares the initial DOM to expected DOM when hydrating. It seems unnecessary in the majority of cases. Though I could see it being useful in development and testing. This would be a breaking change, but maybe could be added with an option and the old hydration method could be deprecated and eventually removed.
The text was updated successfully, but these errors were encountered:
There was another bug, so the performance improvement was reverted. I'm going to leave this closed as a duplicate of #4308 and we can track getting the performance improvement reimplemented in that issue
There are a number of open requests for more efficient hydration. Most notably #4308, but also #4297, #2152, #4444, and others. However, they all seem to still be doing far more work than I think is necessary.
The React
hydrate
docs say:This is what I would intuitively think hydration should do. I.e. attach event listeners and nothing more. This would be much more efficient at runtime as well as resulting in smaller bundles.
I'm not sure if there's a reason why SvelteJS today does a diff operation that compares the initial DOM to expected DOM when hydrating. It seems unnecessary in the majority of cases. Though I could see it being useful in development and testing. This would be a breaking change, but maybe could be added with an option and the old hydration method could be deprecated and eventually removed.
The text was updated successfully, but these errors were encountered: