Skip to content

Commit

Permalink
[RTR] Add usage warning behind flag (#27903)
Browse files Browse the repository at this point in the history
## Summary

Moving towards deprecation of ReactTestRenderer. Log a warning on each
render so we can remove the exports in a future major version.

We can enable this flag in web RTR without disrupting RN tests by
flipping the flag in
`packages/shared/forks/ReactFeatureFlags.test-renderer.js`

## How did you test this change?

`yarn test
packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js`

DiffTrain build for commit 66c8346.
  • Loading branch information
jackpope committed Feb 23, 2024
1 parent 6fb4d0d commit 86ff191
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25707,7 +25707,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-98b8359f6-20240223";
var ReactVersion = "18.3.0-canary-66c834640-20240223";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1014 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-98b8359f6-20240223",
version: "18.3.0-canary-66c834640-20240223",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1195 = {
Expand Down Expand Up @@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1195 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-98b8359f6-20240223"
reconcilerVersion: "18.3.0-canary-66c834640-20240223"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1056 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-98b8359f6-20240223",
version: "18.3.0-canary-66c834640-20240223",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1236 = {
Expand Down Expand Up @@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1236 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-98b8359f6-20240223"
reconcilerVersion: "18.3.0-canary-66c834640-20240223"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<9822eaee5afe3b1d507e431443913bd4>>
* @generated SignedSource<<0ecfa00d9e6316d213c0fcd6bd2fed34>>
*/

"use strict";
Expand All @@ -26,7 +26,7 @@ if (__DEV__) {
}
var dynamicFlags = require("ReactNativeInternalFeatureFlags");

var ReactVersion = "18.3.0-canary-98b8359f6-20240223";
var ReactVersion = "18.3.0-canary-66c834640-20240223";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -577,7 +577,7 @@ if (__DEV__) {
var enableTransitionTracing = false;
// because JSX is an extremely hot path.

var enableRefAsProp = false; // Flow magic to verify the exports of this file match the original version.
var enableRefAsProp = false;

function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,4 +600,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-98b8359f6-20240223";
exports.version = "18.3.0-canary-66c834640-20240223";
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-98b8359f6-20240223";
exports.version = "18.3.0-canary-66c834640-20240223";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
98b8359f656ef714cc44828d7bfd2409ca16b9b3
66c8346401d271588e4c400921c5dab5478fc623

0 comments on commit 86ff191

Please sign in to comment.