Move Hydration Warnings from the DOM Config into the Fiber reconciliation (#28476)

Stacked on #28458.

This doesn't actually really change the messages yet, it's just a
refactor.

Hydration warnings can be presented either as HTML or React JSX format.
If presented as HTML it makes more sense to make that a DOM specific
concept, however, I think it's actually better to present it in terms of
React JSX.

Most of the time the errors aren't going to be something messing with
them at the HTML/HTTP layer. It's because the JS code does something
different. Most of the time you're working in just React. People don't
necessarily even know what the HTML form of it looks like. So this takes
the approach that the warnings are presented in React JSX in their rich
object form.

Therefore, I'm moving the approach to yield diff data to the reconciler
but it's the reconciler that's actually printing all the warnings.
This commit is contained in:
Sebastian Markbåge
2024-03-26 16:04:18 -07:00
committed by GitHub
parent bb66aa3cef
commit 4b8dfd6215
17 changed files with 609 additions and 584 deletions

View File

@@ -32,7 +32,7 @@ module.exports = function shouldIgnoreConsoleError(
if (
TODO_ignoreHydrationErrors &&
format.indexOf(
'An error occurred during hydration. The server HTML was replaced with client content in'
'An error occurred during hydration. The server HTML was replaced with client content'
) !== -1
) {
// This also gets logged by onRecoverableError, so we can ignore it.