Skip to content

Commit d9d4ad6

Browse files
committed
Updates from inside componentDidMount/Update should have Task priority.
This is only observable in incremental mode.
1 parent a92b830 commit d9d4ad6

File tree

5 files changed

+67
-382
lines changed

5 files changed

+67
-382
lines changed

scripts/fiber/tests-failing.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ src/renderers/art/__tests__/ReactART-test.js
7272
* resolves refs before componentDidMount
7373
* resolves refs before componentDidUpdate
7474

75+
src/renderers/dom/__tests__/ReactDOMProduction-test.js
76+
* should throw with an error code in production
77+
7578
src/renderers/dom/shared/__tests__/CSSPropertyOperations-test.js
7679
* should set style attribute when styles exist
7780
* should warn when using hyphenated style names

scripts/fiber/tests-passing.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,6 @@ src/renderers/dom/__tests__/ReactDOMProduction-test.js
453453
* should use prod React
454454
* should handle a simple flow
455455
* should call lifecycle methods
456-
* should throw with an error code in production
457456

458457
src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
459458
* should render strings as children
@@ -846,18 +845,6 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalScheduling-test.js
846845
* splits deferred work on multiple roots
847846
* works on deferred roots in the order they were scheduled
848847
* handles interleaved deferred and animation work
849-
* performs animation work in animation callback
850-
* schedules deferred work in animation callback
851-
* schedules deferred work and performs animation work in animation callback
852-
* performs animation work and schedules deferred work in animation callback
853-
* performs deferred work in deferred callback if it has time
854-
* schedules deferred work in deferred callback if it runs out of time
855-
* performs animated work in deferred callback if it has time
856-
* performs animated work and deferred work in deferred callback if it has time
857-
* performs deferred and animated work work in deferred callback if it has time
858-
* schedules animated work in deferred callback if it runs out of time
859-
* schedules animated work and deferred work in deferred callback if it runs out of time
860-
* schedules deferred work and animated work in deferred callback if it runs out of time
861848

862849
src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
863850
* can update child nodes of a host instance
@@ -878,6 +865,7 @@ src/renderers/shared/fiber/__tests__/ReactIncrementalSideEffects-test.js
878865
* calls setState callback even if component bails out
879866
* calls componentWillUnmount after a deletion, even if nested
880867
* calls componentDidMount/Update after insertion/update
868+
* schedules sync updates when inside componentDidMount/Update
881869
* invokes ref callbacks after insertion/update/unmount
882870
* supports string refs
883871

src/renderers/shared/fiber/ReactFiberScheduler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,10 @@ module.exports = function<T, P, I, TI, C>(config : HostConfig<T, P, I, TI, C>) {
209209
while (effectfulFiber) {
210210
if (effectfulFiber.effectTag & (Update | Callback)) {
211211
const current = effectfulFiber.alternate;
212+
const previousPriorityContext = priorityContext;
213+
priorityContext = TaskPriority;
212214
commitLifeCycles(current, effectfulFiber);
215+
priorityContext = previousPriorityContext;
213216
}
214217
const next = effectfulFiber.nextEffect;
215218
// Ensure that we clean these up so that we don't accidentally keep them.

0 commit comments

Comments
 (0)