Open thysultan opened 6 years ago
In our research clear the children and mount just slightly slower than React way hydration , instead the size of the package will go much bigger. (maybe we are doing it wrong)
Anyway, that's a good feature. but we need more time to figure out how to implementing this with less cost.
It (clearing instead of reusing) may be a performance hit on really big sites I guess. Still - having this as an option would be awesome.
So I would decide if hydrating 30ms faster is worth downloading xx kb of code, because there is a chance that parsing more code (by JS engine) would take additional 10ms and downloading it would take 20ms and I'm saving nothing in result.
The
hydrate
function seems to be removing all children indiscriminately.hydrate.ts#L4-L16
The ReactDOM version of hydrate works by hydrating the existing markup, attempts to attach event listeners to the existing markup and fixes mismatched text content where appropriate.