From 0f81c6bf798bd9bb46cee4534dab64afebb9df56 Mon Sep 17 00:00:00 2001 From: jackpope Date: Thu, 7 Dec 2023 15:31:34 +0000 Subject: [PATCH] Add stable concurrent option to react-test-renderer (#27804) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Concurrent rendering has been the default since React 18 release. ReactTestRenderer requires passing `{unstable_isConcurrent: true}` to match this behavior, which means by default tests written with RTR use a different rendering method than the code they test. Eventually, RTR should only use ConcurrentRoot. As a first step, let's add a version of the concurrent option that isn't marked unstable. Next we will follow up with removing the unstable option when it is safe to merge. ## How did you test this change? `yarn test packages/react-test-renderer/src/__tests__/ReactTestRendererAsync-test.js` DiffTrain build for [b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9](https://github.com/facebook/react/commit/b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- compiled/facebook-www/ReactTestRenderer-dev.classic.js | 7 +++++-- compiled/facebook-www/ReactTestRenderer-dev.modern.js | 7 +++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index aad8232ecf..60451fa0b9 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -640ccebb7d9669f1efbd20e86f6f84086c3d698d +b36ae8d7aab94dae285d9d6a1c5f004e6fc19fc9 diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index 3eb553a135..720b88a53a 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -587,4 +587,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactCurrentDispatcher.current.useTransition(); }; -exports.version = "18.3.0-www-classic-2869b479"; +exports.version = "18.3.0-www-classic-786e33e5"; diff --git a/compiled/facebook-www/ReactTestRenderer-dev.classic.js b/compiled/facebook-www/ReactTestRenderer-dev.classic.js index 18c784e7df..3222dd0334 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.classic.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.classic.js @@ -25929,7 +25929,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-classic-2869b479"; + var ReactVersion = "18.3.0-www-classic-786e33e5"; // Might add PROFILE later. @@ -26833,7 +26833,10 @@ if (__DEV__) { createNodeMock = options.createNodeMock; } - if (options.unstable_isConcurrent === true) { + if ( + options.unstable_isConcurrent === true || + options.isConcurrent === true + ) { isConcurrent = true; } diff --git a/compiled/facebook-www/ReactTestRenderer-dev.modern.js b/compiled/facebook-www/ReactTestRenderer-dev.modern.js index 113c05a5e4..16b5b84ccf 100644 --- a/compiled/facebook-www/ReactTestRenderer-dev.modern.js +++ b/compiled/facebook-www/ReactTestRenderer-dev.modern.js @@ -25929,7 +25929,7 @@ if (__DEV__) { return root; } - var ReactVersion = "18.3.0-www-modern-113f1bd1"; + var ReactVersion = "18.3.0-www-modern-a95f6e9d"; // Might add PROFILE later. @@ -26833,7 +26833,10 @@ if (__DEV__) { createNodeMock = options.createNodeMock; } - if (options.unstable_isConcurrent === true) { + if ( + options.unstable_isConcurrent === true || + options.isConcurrent === true + ) { isConcurrent = true; }