Remove breaking formatting in HTML template

Repository details (talkie)
Project page
talkie
Project log category
(588 entries)
Repository
@joelpurra/talkie
Owner
@joelpurra
Contributors
Contributors on Github
Project status
⏲️ This project has had recent commits.
📂 This project is open.
🌠 This project is popular.
Repository activity period
🗓
Commits
630 commits
Stars
69 stars
Commit details (96db94a8)
Author
Authored at
Committer
Joel Purra
Committed at

Commit message

Remove breaking formatting in HTML template

  • During "server-side" prerendering, the HTML templates are populated with HTML and JSON state from the initial rendering pass.
  • During development, automatic HTML formatting in Visual Studio Code has inserted extra whitespace/newlines to the react-root and __PRERENDERED_STATE__ elements.
  • This extra whitespace yields warnings in React.js (in development mode), as the mismatch means client-side rehydration is not perfect.
  • For performance reasons, it's better to have a perfect match between HTML/state of both the server and client.
  • Code formatting tooling and editors may change, so be mindful of future changes.

See

Raw text
Remove breaking formatting in HTML template

- During "server-side" prerendering, the HTML templates are populated with HTML and JSON state from the initial rendering pass.
- During development, automatic HTML formatting in Visual Studio Code has inserted extra whitespace/newlines to the `react-root` and `__PRERENDERED_STATE__` elements.
- This extra whitespace yields warnings in React.js (in development mode), as the mismatch means client-side rehydration is not perfect.
- For performance reasons, it's better to have a perfect match between HTML/state of both the server and client.
- Code formatting tooling and editors may change, so be mindful of future changes.

See

- https://reactjs.org/docs/react-dom.html#hydrate

Changed files (2)

Path Additions Deletions
code/packages/options-renderer/src/options.template.html +2 -6
code/packages/popup-renderer/src/popup.template.html +2 -6

Commit categories (3)