GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Don't delete trailing mismatches during hydration at the root by sebmarkbage · Pull Request #21021 · react/react Conversation
|
|
Comparing: 1d1e49c...618232e Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| (type !== 'head' && | ||
| type !== 'body' && | ||
| !shouldSetTextContent(type, fiber.memoizedProps)) | ||
| fiber.tag !== HostRoot && |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is the effective change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ); | ||
| // This creates an unfortunate double text case. | ||
| expect(container.textContent).toBe('potatoparsnip'); | ||
| }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit: Looks like this test verifies broken behavior.
I wonder if there's a more explicit way we could write it (e.g. // @gate false and then expect the desired output instead of the unfortunate current output)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yea I'm not sure what would be best way to encode the subtleties here. This is not a "bug" as in it's not an issue with the implementation details that we could fix. It's an intentional behavior that we want to keep whatever else was in there and changing that behavior could be a breaking change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| expect(ref.current).not.toBe(div); | ||
| // Unfortunately, since we don't delete the tail at the root, a duplicate will remain. | ||
| expect(element.innerHTML).toBe( | ||
| '<div>Hello World</div><div>Hello World</div>', |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the difference in observable behavior between these two tests:
Suspense + hydration in legacy mode
Suspense + hydration in legacy mode (at root)
Seems like the significant difference here is that you have a <div> wrapper around the topmost Suspense boundary in your hydrated content. I think that causes us to add an extra node/segment and maybe the result of that is that we also don't clean up the previous <div>Hello World</div> content? Because of the changed fiber.tag !== HostRoot conditional?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This test is a bit weird. There's no suspense boundary comment in the HTML so it doesn't find any matching suspense boundary. If that mismatch is at the root, we just assume that we have to insert the DOM node. We assume that we want to keep what was already there - that didn't match. So we end up with two.
If it's not at the root, we still mismatch and insert a new node but we also remove what was already there.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| const type = fiber.type; | ||
|
|
||
| // If we have any remaining hydratable nodes, we need to delete them now. | ||
| // We only do this deeper than head and body since they tend to have random |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
nit This comment is pretty DOM renderer specific
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Brian Vaughn <[email protected]>
…21021) * Don't delete any trailing nodes in the container during hydration error * Warn when an error during hydration causes us to clear the container * Encode unfortunate case in test * Wrap the root for tests that are applicable to nested cases * Now we can pipe Fizz into a container * Grammatical fix
Summary: This sync includes the following changes: - **[6d3ecb7](react/react@6d3ecb70d )**: Remove unstable_changedBits ([#20953](react/react#20953)) //<Andrew Clark>// - **[754e307](react/react@754e30728 )**: Delete immediateQueueCallbackNode ([#20980](react/react#20980)) //<Andrew Clark>// - **[be5a2e2](react/react@be5a2e231 )**: Land enableSyncMicrotasks ([#20979](react/react#20979)) //<Andrew Clark>// - **[f6bc9c8](react/react@f6bc9c824 )**: [Fizz] Expose maxBoundarySize as an option ([#21029](react/react#21029)) //<Sebastian Markbåge>// - **[154b852](react/react@154b85213 )**: [Fizz] Expose a method to explicitly start writing to a Node stream ([#21028](react/react#21028)) //<Sebastian Markbåge>// - **[cf485e6](react/react@cf485e6f6 )**: [Fizz] Expose a method to abort a pending request ([#21027](react/react#21027)) //<Sebastian Markbåge>// - **[3fb11ee](react/react@3fb11eed9 )**: React Native: Touch Instrumentation Interface ([#21024](react/react#21024)) //<Timothy Yung>// - **[825c302](react/react@825c3021f )**: Don't delete trailing mismatches during hydration at the root ([#21021](react/react#21021)) //<Sebastian Markbåge>// - **[1d1e49c](react/react@1d1e49cfa )**: [Fizz] Assign an ID to the first DOM element in a fallback or insert a dummy (and testing infra) ([#21020](react/react#21020)) //<Sebastian Markbåge>// - **[466b26c](react/react@466b26c92 )**: Store commit durations on HostRoot for DevTools access ([#20983](react/react#20983)) //<Brian Vaughn>// - **[89acfa6](react/react@89acfa639 )**: Fix native event batching in concurrent mode ([#21010](react/react#21010)) //<Ricky>// - **[0203b65](react/react@0203b6567 )**: chore: update react-reconciler README ([#21016](react/react#21016)) //<susiwen8>// Changelog: [General][Changed] - React Native sync for revisions c9f6d0a...6d3ecb7 jest_e2e[run_all_tests] Reviewed By: JoshuaGross, kacieb Differential Revision: D27231625 fbshipit-source-id: 89c0c0662e69044ae8890486a693013bee6005dd
…21021) * Don't delete any trailing nodes in the container during hydration error * Warn when an error during hydration causes us to clear the container * Encode unfortunate case in test * Wrap the root for tests that are applicable to nested cases * Now we can pipe Fizz into a container * Grammatical fix
I originally added this in #21021 but I didn't mention why and I don't quite remember why. Maybe because there were no other message? However at the time the recoverable errors mechanism didn't exist. Today I believe all cases where this happens will trigger another recoverable error. Namely these two: https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L1442-L1446 https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L2962-L2965 Therefore this is just an extra unnecessary log.
I originally added this in #21021 but I didn't mention why and I don't quite remember why. Maybe because there were no other message? However at the time the recoverable errors mechanism didn't exist. Today I believe all cases where this happens will trigger another recoverable error. Namely these two: https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L1442-L1446 https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L2962-L2965 Therefore this is just an extra unnecessary log. DiffTrain build for [323b6e9](323b6e9)
I originally added this in react#21021 but I didn't mention why and I don't quite remember why. Maybe because there were no other message? However at the time the recoverable errors mechanism didn't exist. Today I believe all cases where this happens will trigger another recoverable error. Namely these two: https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L1442-L1446 https://github.com/facebook/react/blob/9f33f699e4f832971dc0f2047129f832655a3b6d/packages/react-reconciler/src/ReactFiberBeginWork.js#L2962-L2965 Therefore this is just an extra unnecessary log.
…21021) * Don't delete any trailing nodes in the container during hydration error * Warn when an error during hydration causes us to clear the container * Encode unfortunate case in test * Wrap the root for tests that are applicable to nested cases * Now we can pipe Fizz into a container * Grammatical fix
…21021) * Don't delete any trailing nodes in the container during hydration error * Warn when an error during hydration causes us to clear the container * Encode unfortunate case in test * Wrap the root for tests that are applicable to nested cases * Now we can pipe Fizz into a container * Grammatical fix
I originally added this in react#21021 but I didn't mention why and I don't quite remember why. Maybe because there were no other message? However at the time the recoverable errors mechanism didn't exist. Today I believe all cases where this happens will trigger another recoverable error. Namely these two: https://github.com/facebook/react/blob/87cd859e92e72ec6e6fe77ac195512fc0e959deb/packages/react-reconciler/src/ReactFiberBeginWork.js#L1442-L1446 https://github.com/facebook/react/blob/87cd859e92e72ec6e6fe77ac195512fc0e959deb/packages/react-reconciler/src/ReactFiberBeginWork.js#L2962-L2965 Therefore this is just an extra unnecessary log.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.