GeezerVison is showing github.com — Convert ReactCompositeComponentState to createRoot by rickhanlonii · Pull Request #28063 · react/react
Conversation
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Comparing: e1d20fc...290d02b
Critical size changes
Includes critical production bundles, as well as any change greater than 2%:
Significant size changes
Includes any change greater than 0.2%:
Expand to show
Generated by 🚫 dangerJS against 290d02b
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
|
|
|
function LogAfterCommit({children, color}) {
|
|
|
React.useEffect(() => {
|
|
|
Scheduler.log(`commit ${color}`);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced the .render callback with an effect, which adds logs but the more logs are better here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
});
|
|
|
|
|
|
it('should support setting state', () => {
|
|
|
it('should support setting state', async () => {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is so old, it's mostly unchanged since the initial release. Pretty cool that createRoot 10 years later doesn't alter the order of the logs here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
kassens reacted with thumbs up emoji
|
|
'render -- step: 3, extra: false',
|
|
|
'callback -- step: 3, extra: false',
|
|
|
|
|
|
// A second time for the retry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createRoot automatically retries when we error in render.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add this context to the comment on this line
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
);
|
|
|
});
|
|
|
|
|
|
it('Legacy mode should support setState in componentWillUnmount (#18851)', () => {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping this test which catches a behavior specific to .render. Added the test above which shows the error thrown in createRoot when trying to do this. Read the issue for more context.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
'render -- step: 3, extra: false',
|
|
|
'callback -- step: 3, extra: false',
|
|
|
|
|
|
// A second time for the retry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add this context to the comment on this line
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gnoff
added a commit
to gnoff/next.js
that referenced
this pull request
Feb 6, 2024
gnoff
added a commit
to vercel/next.js
that referenced
this pull request
Feb 6, 2024
Reviewers
jackpope
jackpope approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|