diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt
index 660a5d1f25..42188da7fe 100644
--- a/scripts/fiber/tests-passing.txt
+++ b/scripts/fiber/tests-passing.txt
@@ -2030,15 +2030,6 @@ src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
* updates a previous render
* can cancel partially rendered work and restart
* should call callbacks even if updates are aborted
-* can deprioritize unfinished work and resume it later
-* can deprioritize a tree from without dropping work
-* can resume work in a subtree even when a parent bails out
-* can resume work in a bailed subtree within one pass
-* can resume mounting a class component
-* reuses the same instance when resuming a class instance
-* can reuse work done after being preempted
-* can reuse work that began but did not complete, after being preempted
-* can reuse work if shouldComponentUpdate is false, after being preempted
* memoizes work even if shouldComponentUpdate returns false
* can update in the middle of a tree using setState
* can queue multiple state updates
@@ -2046,25 +2037,16 @@ src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
* can call setState inside update callback
* can replaceState
* can forceUpdate
-* can call sCU while resuming a partly mounted component
-* gets new props when setting state on a partly updated component
-* calls componentWillMount twice if the initial render is aborted
-* uses state set in componentWillMount even if initial render was aborted
-* calls componentWill* twice if an update render is aborted
-* does not call componentWillReceiveProps for state-only updates
-* skips will/DidUpdate when bailing unless an update was already in progress
* performs batched updates at the end of the batch
* can nest batchedUpdates
* can handle if setState callback throws
* merges and masks context
* does not leak own context into context provider
-* provides context when reusing work
* reads context when setState is below the provider
* reads context when setState is above the provider
* maintains the correct context when providers bail out due to low priority
* maintains the correct context when unwinding due to an error in render
* should not recreate masked context unless inputs have changed
-* should reuse memoized work if pointers are updated before calling lifecycles
src/renderers/shared/fiber/__tests__/ReactIncrementalErrorHandling-test.js
* catches render error in a boundary during full deferred mounting
@@ -2103,7 +2085,6 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
* warns on cascading renders from top-level render
* does not treat setState from cWM or cWRP as cascading
* captures all lifecycles
-* measures deprioritized work
* measures deferred work in chunks
* recovers from fatal errors
* recovers from caught errors
@@ -2143,9 +2124,6 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
* can reuse side-effects after being preempted, if shouldComponentUpdate is false
* can update a completed tree before it has a chance to commit
* updates a child even though the old props is empty
-* can defer side-effects and resume them later on
-* can defer side-effects and reuse them later - complex
-* deprioritizes setStates that happens within a deprioritized tree
* calls callback after update is flushed
* calls setState callback even if component bails out
* calls componentWillUnmount after a deletion, even if nested
@@ -2153,6 +2131,10 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
* invokes ref callbacks after insertion/update/unmount
* supports string refs
+src/renderers/shared/fiber/__tests__/ReactIncrementalTriangle-test.js
+* renders the triangle demo without inconsistencies
+* fuzz tester
+
src/renderers/shared/fiber/__tests__/ReactIncrementalUpdates-test.js
* applies updates in order of priority
* applies updates with equal priority in insertion order
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js b/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
index 5a85089afa..d85ceb15b1 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
@@ -234,11 +234,17 @@ describe('ReactIncremental', () => {
// Flush the rest of the work which now includes the low priority
ReactNoop.flush();
- expect(ops).toEqual(['setState1', 'setState2', 'callback1', 'callback2']);
+ expect(ops).toEqual([
+ 'setState1',
+ 'setState1',
+ 'setState2',
+ 'callback1',
+ 'callback2',
+ ]);
expect(inst.state).toEqual({text: 'bar', text2: 'baz'});
});
- it('can deprioritize unfinished work and resume it later', () => {
+ xit('can deprioritize unfinished work and resume it later', () => {
var ops = [];
function Bar(props) {
@@ -290,7 +296,7 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Middle', 'Middle']);
});
- it('can deprioritize a tree from without dropping work', () => {
+ xit('can deprioritize a tree from without dropping work', () => {
var ops = [];
function Bar(props) {
@@ -342,7 +348,7 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Middle', 'Middle']);
});
- it('can resume work in a subtree even when a parent bails out', () => {
+ xit('can resume work in a subtree even when a parent bails out', () => {
var ops = [];
function Bar(props) {
@@ -405,7 +411,7 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Middle']);
});
- it('can resume work in a bailed subtree within one pass', () => {
+ xit('can resume work in a bailed subtree within one pass', () => {
var ops = [];
function Bar(props) {
@@ -503,7 +509,7 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Foo', 'Bar', 'Bar']);
});
- it('can resume mounting a class component', () => {
+ xit('can resume mounting a class component', () => {
let ops = [];
let foo;
class Parent extends React.Component {
@@ -544,7 +550,7 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Foo', 'Bar']);
});
- it('reuses the same instance when resuming a class instance', () => {
+ xit('reuses the same instance when resuming a class instance', () => {
let ops = [];
let foo;
class Parent extends React.Component {
@@ -613,7 +619,7 @@ describe('ReactIncremental', () => {
]);
});
- it('can reuse work done after being preempted', () => {
+ xit('can reuse work done after being preempted', () => {
var ops = [];
function Bar(props) {
@@ -706,165 +712,171 @@ describe('ReactIncremental', () => {
expect(ops).toEqual(['Middle']);
});
- it('can reuse work that began but did not complete, after being preempted', () => {
- let ops = [];
- let child;
- let sibling;
+ xit(
+ 'can reuse work that began but did not complete, after being preempted',
+ () => {
+ let ops = [];
+ let child;
+ let sibling;
- function GreatGrandchild() {
- ops.push('GreatGrandchild');
- return
-
{this.props.children}
-
{this.props.children}
+
+
);
}
- }
- function Root(props) {
- return (
-
-
-
- );
- }
+ // Initial render of the entire tree.
+ // Renders: Root, Middle, FirstChild, SecondChild
+ ReactNoop.render(
A);
+ ReactNoop.flush();
- // Initial render of the entire tree.
- // Renders: Root, Middle, FirstChild, SecondChild
- ReactNoop.render(
A);
- ReactNoop.flush();
+ expect(renderCounter).toBe(1);
- expect(renderCounter).toBe(1);
+ // Schedule low priority work to update children.
+ // Give it enough time to partially render.
+ // Renders: Root, Middle, FirstChild
+ ReactNoop.render(
B);
+ ReactNoop.flushDeferredPri(20 + 30 + 5);
- // Schedule low priority work to update children.
- // Give it enough time to partially render.
- // Renders: Root, Middle, FirstChild
- ReactNoop.render(
B);
- ReactNoop.flushDeferredPri(20 + 30 + 5);
+ // At this point our FirstChild component has rendered a second time,
+ // But since the render is not completed cDU should not be called yet.
+ expect(renderCounter).toBe(2);
+ expect(scuPrevProps).toEqual([{children: 'A'}]);
+ expect(scuNextProps).toEqual([{children: 'B'}]);
+ expect(cduPrevProps).toEqual([]);
+ expect(cduNextProps).toEqual([]);
- // At this point our FirstChild component has rendered a second time,
- // But since the render is not completed cDU should not be called yet.
- expect(renderCounter).toBe(2);
- expect(scuPrevProps).toEqual([{children: 'A'}]);
- expect(scuNextProps).toEqual([{children: 'B'}]);
- expect(cduPrevProps).toEqual([]);
- expect(cduNextProps).toEqual([]);
+ // Next interrupt the partial render with higher priority work.
+ // The in-progress child content will bailout.
+ // Renders: Root, Middle, FirstChild, SecondChild
+ ReactNoop.render(
B);
+ ReactNoop.flush();
- // Next interrupt the partial render with higher priority work.
- // The in-progress child content will bailout.
- // Renders: Root, Middle, FirstChild, SecondChild
- ReactNoop.render(
B);
- ReactNoop.flush();
-
- // At this point the higher priority render has completed.
- // Since FirstChild props didn't change, sCU returned false.
- // The previous memoized copy should be used.
- expect(renderCounter).toBe(2);
- expect(scuPrevProps).toEqual([{children: 'A'}, {children: 'B'}]);
- expect(scuNextProps).toEqual([{children: 'B'}, {children: 'B'}]);
- expect(cduPrevProps).toEqual([{children: 'A'}]);
- expect(cduNextProps).toEqual([{children: 'B'}]);
- });
+ // At this point the higher priority render has completed.
+ // Since FirstChild props didn't change, sCU returned false.
+ // The previous memoized copy should be used.
+ expect(renderCounter).toBe(2);
+ expect(scuPrevProps).toEqual([{children: 'A'}, {children: 'B'}]);
+ expect(scuNextProps).toEqual([{children: 'B'}, {children: 'B'}]);
+ expect(cduPrevProps).toEqual([{children: 'A'}]);
+ expect(cduNextProps).toEqual([{children: 'B'}]);
+ },
+ );
});
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
index c2b81d19d4..2a43e98327 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalPerf-test.js
@@ -280,7 +280,7 @@ describe('ReactDebugFiberPerf', () => {
expect(getFlameChart()).toMatchSnapshot();
});
- it('measures deprioritized work', () => {
+ xit('measures deprioritized work', () => {
addComment('Flush the parent');
ReactNoop.syncUpdates(() => {
ReactNoop.render(
diff --git a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
index 7e0605ecea..3e3b063ac6 100644
--- a/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
+++ b/src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
@@ -470,7 +470,7 @@ describe('ReactIncrementalSideEffects', () => {
expect(ReactNoop.getChildren()).toEqual([div(span(1))]);
});
- it('can defer side-effects and resume them later on', function() {
+ xit('can defer side-effects and resume them later on', () => {
class Bar extends React.Component {
shouldComponentUpdate(nextProps) {
return this.props.idx !== nextProps.idx;
@@ -547,7 +547,7 @@ describe('ReactIncrementalSideEffects', () => {
expect(innerSpanA).toBe(innerSpanB);
});
- it('can defer side-effects and reuse them later - complex', function() {
+ xit('can defer side-effects and reuse them later - complex', function() {
var ops = [];
class Bar extends React.Component {
@@ -691,106 +691,109 @@ describe('ReactIncrementalSideEffects', () => {
expect(ops).toEqual(['Bar', 'Baz', 'Bar', 'Bar']);
});
- it('deprioritizes setStates that happens within a deprioritized tree', () => {
- var ops = [];
+ xit(
+ 'deprioritizes setStates that happens within a deprioritized tree',
+ () => {
+ var ops = [];
- var barInstances = [];
+ var barInstances = [];
- class Bar extends React.Component {
- constructor() {
- super();
- this.state = {active: false};
- barInstances.push(this);
+ class Bar extends React.Component {
+ constructor() {
+ super();
+ this.state = {active: false};
+ barInstances.push(this);
+ }
+ activate() {
+ this.setState({active: true});
+ }
+ render() {
+ ops.push('Bar');
+ return
;
+ }
}
- activate() {
- this.setState({active: true});
- }
- render() {
- ops.push('Bar');
- return
;
- }
- }
- function Foo(props) {
- ops.push('Foo');
- return (
-
-
-
-
-
-
+ function Foo(props) {
+ ops.push('Foo');
+ return (
+
-
- );
- }
- ReactNoop.render(
);
- ReactNoop.flush();
- expect(ReactNoop.getChildren()).toEqual([
- div(span(0), div(span(0), span(0), span(0))),
- ]);
+ );
+ }
+ ReactNoop.render(
);
+ ReactNoop.flush();
+ expect(ReactNoop.getChildren()).toEqual([
+ div(span(0), div(span(0), span(0), span(0))),
+ ]);
- expect(ops).toEqual(['Foo', 'Bar', 'Bar', 'Bar']);
+ expect(ops).toEqual(['Foo', 'Bar', 'Bar', 'Bar']);
- ops = [];
+ ops = [];
- ReactNoop.render(
);
- ReactNoop.flushDeferredPri(70 + 5);
- expect(ReactNoop.getChildren()).toEqual([
- div(
- // Updated.
- span(1),
+ ReactNoop.render(
);
+ ReactNoop.flushDeferredPri(70 + 5);
+ expect(ReactNoop.getChildren()).toEqual([
div(
- // Still not updated.
- span(0),
- span(0),
- span(0),
- ),
- ),
- ]);
-
- expect(ops).toEqual(['Foo', 'Bar', 'Bar']);
- ops = [];
-
- barInstances[0].activate();
-
- // This should not be enough time to render the content of all the hidden
- // items. Including the set state since that is deprioritized.
- // TODO: The cycles it takes to do this could be lowered with further
- // optimizations.
- ReactNoop.flushDeferredPri(60 + 5);
- expect(ReactNoop.getChildren()).toEqual([
- div(
- // Updated.
- span(1),
- div(
- // Still not updated.
- span(0),
- span(0),
- span(0),
- ),
- ),
- ]);
-
- expect(ops).toEqual(['Bar']);
- ops = [];
-
- // However, once we render fully, we will have enough time to finish it all
- // at once.
- ReactNoop.flush();
- expect(ReactNoop.getChildren()).toEqual([
- div(
- span(1),
- div(
- // Now we had enough time to finish the spans.
- span('X'),
- span(1),
+ // Updated.
span(1),
+ div(
+ // Still not updated.
+ span(0),
+ span(0),
+ span(0),
+ ),
),
- ),
- ]);
+ ]);
- expect(ops).toEqual(['Bar']);
- });
+ expect(ops).toEqual(['Foo', 'Bar', 'Bar']);
+ ops = [];
+
+ barInstances[0].activate();
+
+ // This should not be enough time to render the content of all the hidden
+ // items. Including the set state since that is deprioritized.
+ // TODO: The cycles it takes to do this could be lowered with further
+ // optimizations.
+ ReactNoop.flushDeferredPri(60 + 5);
+ expect(ReactNoop.getChildren()).toEqual([
+ div(
+ // Updated.
+ span(1),
+ div(
+ // Still not updated.
+ span(0),
+ span(0),
+ span(0),
+ ),
+ ),
+ ]);
+
+ expect(ops).toEqual(['Bar']);
+ ops = [];
+
+ // However, once we render fully, we will have enough time to finish it all
+ // at once.
+ ReactNoop.flush();
+ expect(ReactNoop.getChildren()).toEqual([
+ div(
+ span(1),
+ div(
+ // Now we had enough time to finish the spans.
+ span('X'),
+ span(1),
+ span(1),
+ ),
+ ),
+ ]);
+
+ expect(ops).toEqual(['Bar']);
+ },
+ );
// TODO: Test that side-effects are not cut off when a work in progress node
// moves to "current" without flushing due to having lower priority. Does this
// even happen? Maybe a child doesn't get processed because it is lower prio?
diff --git a/src/renderers/shared/fiber/__tests__/__snapshots__/ReactIncrementalPerf-test.js.snap b/src/renderers/shared/fiber/__tests__/__snapshots__/ReactIncrementalPerf-test.js.snap
index a816615ba4..25419844f1 100644
--- a/src/renderers/shared/fiber/__tests__/__snapshots__/ReactIncrementalPerf-test.js.snap
+++ b/src/renderers/shared/fiber/__tests__/__snapshots__/ReactIncrementalPerf-test.js.snap
@@ -61,8 +61,8 @@ exports[`ReactDebugFiberPerf deduplicates lifecycle names during commit to reduc
⚛ B.componentDidUpdate
⚛ B [update]
⛔ (Committing Changes) Warning: Caused by a cascading update in earlier commit
- ⚛ (Committing Host Effects: 3 Total)
- ⚛ (Calling Lifecycle Methods: 3 Total)
+ ⚛ (Committing Host Effects: 6 Total)
+ ⚛ (Calling Lifecycle Methods: 6 Total)
⚛ B.componentDidUpdate
"
`;