Lucifier129/react-lite

Server side generated HTML is completely rerendered

rsadyhov opened this issue · 2 comments

I found out that there is no benefit of server side rendering with React as React Lite completely removes main node from browser DOM and substitutes it with what is rendered on UI during first page load.

This can be seen during debug of react-lite.common.js on line #1923. Per my understanding this logic is executed all the time after page load and there is no way to omit it.

It's causing troubles for our project as we do have other mechanisms in parallel to React, which are changing the browser DOM. As result our changes our wiped out and we need to rely on React Lite lifecycle, which is causing performance degradation.

It would be great to have similar mechanism which exists in React and compares checks sums of server side generated content and content of UI side rendered virtual DOM. So if they are equal, it will just perform component mounting, but not full rerender.

Sorry about that. It' hard to make react-lite reuse the html rendered by server-side, because react-lite do not support renderToString|renderToStaticMarkup for keeping script size smaller.

This inconsistent behaviour has been mentioned in README, visit different with React

Thank you for the quick response!