Skip to content
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

Merged
merged 7 commits into from
Jul 1, 2017
Merged

Conversation

acdlite
Copy link
Collaborator

@acdlite acdlite commented Jun 19, 2017

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.

@acdlite acdlite requested a review from sebmarkbage June 19, 2017 23:29
@acdlite acdlite mentioned this pull request Jun 19, 2017
17 tasks
@acdlite acdlite force-pushed the removeprogressedwork branch 2 times, most recently from 276c65a to 4e2f445 Compare June 30, 2017 22:38
@@ -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) {
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

child = child.sibling;
}
return null;
}
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -580,7 +583,8 @@ module.exports = function(
oldProps === newProps &&
oldState === newState &&
!hasContextChanged() &&
!(updateQueue !== null && updateQueue.hasForceUpdate)
!(workInProgress.updateQueue !== null &&
Copy link
Collaborator

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?

Copy link
Collaborator Author

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', () => {
Copy link
Collaborator

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(
Copy link
Collaborator

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?

@acdlite acdlite force-pushed the removeprogressedwork branch 2 times, most recently from bff5bdc to 19eca82 Compare July 1, 2017 00:53
@acdlite
Copy link
Collaborator Author

acdlite commented Jul 1, 2017

@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', () => {
Copy link
Collaborator

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.

Copy link
Collaborator

@sebmarkbage sebmarkbage left a 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. :)

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.
@acdlite acdlite merged commit f9af9aa into facebook:master Jul 1, 2017
acdlite added a commit to acdlite/react that referenced this pull request Jul 7, 2017
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.
acdlite added a commit to acdlite/react that referenced this pull request Jul 7, 2017
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.
acdlite added a commit that referenced this pull request Jul 7, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants