diff --git a/scripts/fiber/tests-failing.txt b/scripts/fiber/tests-failing.txt index c7d39b0e5d5e..992417fe1daa 100644 --- a/scripts/fiber/tests-failing.txt +++ b/scripts/fiber/tests-failing.txt @@ -594,7 +594,6 @@ src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js * should flow updates correctly * should share reconcile transaction across different roots * should queue mount-ready handlers across different roots -* should flush updates in the correct order * should flush updates in the correct order across roots * should queue updates from during mount * calls asap callbacks properly diff --git a/scripts/fiber/tests-passing.txt b/scripts/fiber/tests-passing.txt index 7d6206928b3d..acfb1a67f07a 100644 --- a/scripts/fiber/tests-passing.txt +++ b/scripts/fiber/tests-passing.txt @@ -1139,6 +1139,7 @@ src/renderers/shared/stack/reconciler/__tests__/ReactStatelessComponent-test.js src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js * should not reconcile children passed via props +* should flush updates in the correct order * should queue nested updates * calls componentWillReceiveProps setState callback properly * does not update one component twice in a batch (#2410) diff --git a/src/renderers/shared/stack/reconciler/ReactUpdates.js b/src/renderers/shared/stack/reconciler/ReactUpdates.js index 643b4ea426c5..e1dd560e356c 100644 --- a/src/renderers/shared/stack/reconciler/ReactUpdates.js +++ b/src/renderers/shared/stack/reconciler/ReactUpdates.js @@ -53,21 +53,11 @@ var NESTED_UPDATES = { }, }; -var UPDATE_QUEUEING = { - initialize: function() { - this.callbackQueue.reset(); - }, - close: function() { - this.callbackQueue.notifyAll(); - }, -}; - -var TRANSACTION_WRAPPERS = [NESTED_UPDATES, UPDATE_QUEUEING]; +var TRANSACTION_WRAPPERS = [NESTED_UPDATES]; function ReactUpdatesFlushTransaction() { this.reinitializeTransaction(); this.dirtyComponentsLength = null; - this.callbackQueue = CallbackQueue.getPooled(); this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled( /* useCreateElement */ true ); @@ -83,8 +73,6 @@ Object.assign( destructor: function() { this.dirtyComponentsLength = null; - CallbackQueue.release(this.callbackQueue); - this.callbackQueue = null; ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction); this.reconcileTransaction = null; }, @@ -179,7 +167,7 @@ function runBatchedUpdates(transaction) { if (callbacks) { for (var j = 0; j < callbacks.length; j++) { - transaction.callbackQueue.enqueue( + transaction.reconcileTransaction.getReactMountReady().enqueue( callbacks[j], component.getPublicInstance() ); diff --git a/src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js b/src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js index 044e709b4b38..14cb726e4259 100644 --- a/src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js +++ b/src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js @@ -634,8 +634,8 @@ describe('ReactUpdates', () => { 'Inner-setState-1', 'Inner-render-1-1', 'Inner-didUpdate-1-1', - 'Inner-callback-1', - 'Outer-callback-1', + 'Inner-callback-1', + 'Outer-callback-1', 'Outer-setState-2', 'Outer-render-2', @@ -643,10 +643,10 @@ describe('ReactUpdates', () => { 'Inner-didUpdate-2-1', 'Outer-didUpdate-2', 'Inner-setState-2', - 'Inner-render-2-2', - 'Inner-didUpdate-2-2', + 'Outer-callback-2', + 'Inner-render-2-2', + 'Inner-didUpdate-2-2', 'Inner-callback-2', - 'Outer-callback-2', ]); /* eslint-enable indent */ });