html-minifier causes React to throw reconciliation errors.
The HTML minifier is not aligned with React rendering because it does things such as :
- Stripping whitespaces inside of elements, this is very good but if you don't manually strip the string yourself React will complain since it will render it with the whitespaces on the client.
- Deleting the ; at the end on inline style-tags. Unfortunately, this is React's default behavior to put a ; at the end of inline style tags even if it's not necessary so it causes conflics.
I don't know about other differences between the react rendering and the html-minifier, but we should search for them and make sure it doesn't cause problems in the future.
I guess, the html-minifier should simply not do anything except removing whitespaces between tags.
Indeed, concerning the inlined styles, this should be treated here: https://github.com/facebook/react/blob/master/src/renderers/dom/shared/CSSPropertyOperations.js#L172
Should I put an issue on React or html-minifier ? Not sure which one will listen 😄
I'm doing it right now. I'll reference our issue in FB's repo.
I've also referenced this issue on html-minifier as it should not alter inline styles when minifyCss is set to false.
I will make a commit where I comment the code responsible of making the minification happen for now. So we can keep on iterating the demo without having bugs.
From my understanding, this has been fixed in both react and html-minifier. I will do what is necessary to re-enable html minification in the develop branch and make sure it doesn't cause bugs anymore.