nerv icon indicating copy to clipboard operation
nerv copied to clipboard

Hydration Removing All Children

Open thysultan opened this issue 7 years ago • 2 comments

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.

thysultan avatar Jan 11 '18 00:01 thysultan

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.

yuche avatar Jan 11 '18 12:01 yuche

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.

dzek69 avatar Jan 16 '18 16:01 dzek69