Skip to content

Commit

Permalink
Remove string refs (behind flag) (#28322)
Browse files Browse the repository at this point in the history
Depends on:

- #28398

---

This removes string refs, which has been deprecated in Strict Mode for
seven years.

I've left them behind a flag for Meta, but in open source this fully
removes the feature.

DiffTrain build for commit c979895.
  • Loading branch information
acdlite committed Feb 27, 2024
1 parent ae4690b commit 161ee24
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2e02ad0f633511d087c31638317ef702>>
* @generated SignedSource<<c7f09b0ccfd717d023bd590c0cbfdace>>
*/

"use strict";
Expand Down Expand Up @@ -19037,6 +19037,8 @@ if (__DEV__) {
}
} else {
{
// TODO: We should move these warnings to happen during the render
// phase (markRef).
if (!ref.hasOwnProperty("current")) {
error(
"Unexpected ref object provided for %s. " +
Expand Down Expand Up @@ -25733,7 +25735,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "18.3.0-canary-3bcd2de01-20240227";
var ReactVersion = "18.3.0-canary-c9798954e-20240227";

// 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-3bcd2de01-20240227",
version: "18.3.0-canary-c9798954e-20240227",
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-3bcd2de01-20240227"
reconcilerVersion: "18.3.0-canary-c9798954e-20240227"
};
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-3bcd2de01-20240227",
version: "18.3.0-canary-c9798954e-20240227",
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-3bcd2de01-20240227"
reconcilerVersion: "18.3.0-canary-c9798954e-20240227"
};
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<<5c2ba7284b4fa8017480bbd7751f531d>>
* @generated SignedSource<<9146a80fb942b3dd40fa4ce49aaec9e5>>
*/

"use strict";
Expand Down Expand Up @@ -1164,7 +1164,9 @@ if (__DEV__) {
ref = config.ref;
}

warnIfStringRefCannotBeAutoConverted(config, self);
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
} // Remaining properties are added to a new props object

for (propName in config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d28cb56e803fdd0613a38024515d9d50>>
* @generated SignedSource<<80a0567bc7edf5be863000f879120fd9>>
*/

"use strict";
Expand Down Expand Up @@ -1200,7 +1200,9 @@ if (__DEV__) {
ref = config.ref;
}

warnIfStringRefCannotBeAutoConverted(config, self);
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
} // Remaining properties are added to a new props object

for (propName in config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<11b286062c8512965799ad8e36092d6b>>
* @generated SignedSource<<867e292594b7b59489bd57d16c996264>>
*/

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

var ReactVersion = "18.3.0-canary-3bcd2de01-20240227";
var ReactVersion = "18.3.0-canary-c9798954e-20240227";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -1582,7 +1582,9 @@ if (__DEV__) {
ref = config.ref;
}

warnIfStringRefCannotBeAutoConverted(config, self);
{
warnIfStringRefCannotBeAutoConverted(config, self);
}
} // Remaining properties are added to a new props object

for (propName in config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,4 +598,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-3bcd2de01-20240227";
exports.version = "18.3.0-canary-c9798954e-20240227";
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-3bcd2de01-20240227";
exports.version = "18.3.0-canary-c9798954e-20240227";
"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 @@
3bcd2de01b5716202eabe8faa338f51bdc59ce26
c9798954e26a2354a951cc65607f2901a45bf035
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<36563f58fdb8036d760d09bb1e80c450>>
* @generated SignedSource<<cfbc1c43d4da5c44f22471790ecd61bf>>
*/

"use strict";
Expand Down Expand Up @@ -21790,6 +21790,8 @@ to return true:wantsResponderID| |
}
} else {
{
// TODO: We should move these warnings to happen during the render
// phase (markRef).
if (!ref.hasOwnProperty("current")) {
error(
"Unexpected ref object provided for %s. " +
Expand Down Expand Up @@ -28040,7 +28042,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-49d61be7";
var ReactVersion = "18.3.0-canary-26c89f2f";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<bb8c0cb2abf7c0fc68f3b99c4c5c1b42>>
* @generated SignedSource<<5909dc5990a62864ce33afd4b7d168b4>>
*/

"use strict";
Expand Down Expand Up @@ -21917,6 +21917,8 @@ to return true:wantsResponderID| |
}
} else {
{
// TODO: We should move these warnings to happen during the render
// phase (markRef).
if (!ref.hasOwnProperty("current")) {
error(
"Unexpected ref object provided for %s. " +
Expand Down Expand Up @@ -28480,7 +28482,7 @@ to return true:wantsResponderID| |
return root;
}

var ReactVersion = "18.3.0-canary-a86eeb93";
var ReactVersion = "18.3.0-canary-d516a389";

function createPortal$1(
children,
Expand Down

0 comments on commit 161ee24

Please sign in to comment.