-
Notifications
You must be signed in to change notification settings - Fork 46.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove progressed work #10008
Remove progressed work #10008
Conversation
276c65a
to
4e2f445
Compare
src/renderers/noop/ReactNoopEntry.js
Outdated
@@ -430,10 +430,10 @@ var ReactNoop = { | |||
if (fiber.updateQueue) { | |||
logUpdateQueue(fiber.updateQueue, depth); | |||
} | |||
const childInProgress = fiber.progressedChild; | |||
const childInProgress = fiber.child; | |||
if (childInProgress && childInProgress !== fiber.child) { |
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 branch is now always dead. Might be better to just comment it out so we know what it is supposed to do.
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.
Fixed
4e2f445
to
9713bd4
Compare
child = child.sibling; | ||
} | ||
return null; | ||
} |
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.
I'm having a hard time convincing myself this isn't needed anymore.
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.
I think it's not needed because we handle this during priority reset, here: https://github.com/acdlite/react/blob/9713bd40a6e4eb406b6f66b8a55c4bbd662d5ae3/src/renderers/shared/fiber/ReactFiberScheduler.js#L558-L564
@@ -580,7 +583,8 @@ module.exports = function( | |||
oldProps === newProps && | |||
oldState === newState && | |||
!hasContextChanged() && | |||
!(updateQueue !== null && updateQueue.hasForceUpdate) | |||
!(workInProgress.updateQueue !== null && |
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.
So this is re-reading the updateQueue, is that the purpose? Why this change?
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.
beginUpdateQueue
sometimes clones workInProgress.updateQueue
, so we need to point to the latest version.
@@ -280,7 +280,7 @@ describe('ReactDebugFiberPerf', () => { | |||
expect(getFlameChart()).toMatchSnapshot(); | |||
}); | |||
|
|||
it('measures deprioritized work', () => { | |||
xit('measures deprioritized work', () => { |
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.
Can we re-enable this?
render() { | ||
ops.push('Bar'); | ||
return <span prop={this.state.active ? 'X' : this.props.idx} />; | ||
xit( |
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 one is similar. We might be able to just change the test a bit?
bff5bdc
to
19eca82
Compare
@sebmarkbage Re-enabled those tests |
@@ -382,7 +382,7 @@ describe('ReactDebugFiberPerf', () => { | |||
expect(getFlameChart()).toMatchSnapshot(); | |||
}); | |||
|
|||
it('deduplicates lifecycle names during commit to reduce overhead', () => { | |||
xit('deduplicates lifecycle names during commit to reduce overhead', () => { |
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.
Why do we need to disable this? I don't think it tests specifically progressed work.
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.
Ok, let's try it. :)
19eca82
to
4b9775e
Compare
Neglected to fix this earlier because these tests were ignored.
The current implementation of resuming work is buggy. The underlying model is also flawed. Rather than attempt to fix a flawed model, we'll scrap the feature entirely and add it back later.
When we create a new work-in-progress, the existing pending props are no longer valid.
Now that we've removed the buggy implementation of resuming work, the fuzz tester passes consistently.
When an error in thrown in the begin phase, we begin work on the error boundary a second time to unmount the children. This is a special case of "resuming" work that we need to account for. The children are set to the current children so that we can delete them.
it -> xit The diff looks messier than it actually is because of Prettier.
To make sure we don't reset the priority of a down-prioritized fiber, we compare the priority we're currently rendering at to the fiber's work priority. If the work priority is lower, then we know not to reset the work priority.
4b9775e
to
f9af9aa
Compare
This fixes a snapshot test regression introduced by facebook#10008. I had noticed this change and believe the new behavior was correct, but upon further investigation I was wrong. This reverts the snapshot test and fixes it accordingly.
This fixes a snapshot test regression introduced by facebook#10008. I had noticed this change and believe the new behavior was correct, but upon further investigation I was wrong. This reverts the snapshot test and fixes it accordingly.
This fixes a snapshot test regression introduced by #10008. I had noticed this change and believe the new behavior was correct, but upon further investigation I was wrong. This reverts the snapshot test and fixes it accordingly.
The current implementation of resuming work is buggy. The underlying model is also flawed. Rather than attempt to fix a flawed model, we'll scrap the feature entirely and add it back later.
The triangle fuzz tester is now passing. By keeping this test green, we should have greater confidence that changes do not introduce regressions.
See #8830 for the larger plan.