Skip to content

Commit

Permalink
Unrevert "Support writing to this.refs from userspace" (#28879)
Browse files Browse the repository at this point in the history
Reverts #28877

We found the cause of the regression and should be able to land this
again.

DiffTrain build for [b039be6](b039be6)
  • Loading branch information
kassens committed Apr 24, 2024
1 parent fe8c683 commit 21f1398
Show file tree
Hide file tree
Showing 17 changed files with 115 additions and 63 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6f6e375fce9d0700434f863f70f0e2e5ea180426
b039be627dd7403d7d2f63a48c8d263d955ce456
15 changes: 4 additions & 11 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = '19.0.0-www-classic-e47f6d99';
var ReactVersion = '19.0.0-www-classic-44c604a7';

// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require('ReactFeatureFlags');
Expand Down Expand Up @@ -217,21 +217,14 @@ var ReactNoopUpdateQueue = {

var assign = Object.assign;

var emptyObject = {};

{
Object.freeze(emptyObject);
}
/**
* Base class helpers for the updating state of a component.
*/


function Component(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.

this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
this.context = context;
this.refs = {}; // We initialize the default updater but the real one gets injected by the
// renderer.

this.updater = updater || ReactNoopUpdateQueue;
Expand Down Expand Up @@ -331,7 +324,7 @@ function PureComponent(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.

this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}

Expand Down
15 changes: 4 additions & 11 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = '19.0.0-www-modern-3c57619e';
var ReactVersion = '19.0.0-www-modern-5387e24a';

// Re-export dynamic flags from the www version.
var dynamicFeatureFlags = require('ReactFeatureFlags');
Expand Down Expand Up @@ -217,21 +217,14 @@ var ReactNoopUpdateQueue = {

var assign = Object.assign;

var emptyObject = {};

{
Object.freeze(emptyObject);
}
/**
* Base class helpers for the updating state of a component.
*/


function Component(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.

this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
this.context = context;
this.refs = {}; // We initialize the default updater but the real one gets injected by the
// renderer.

this.updater = updater || ReactNoopUpdateQueue;
Expand Down Expand Up @@ -331,7 +324,7 @@ function PureComponent(props, context, updater) {
this.props = props;
this.context = context; // If a component has string refs, we will assign a different object later.

this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}

Expand Down
9 changes: 4 additions & 5 deletions compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ var ReactNoopUpdateQueue = {
enqueueReplaceState: function () {},
enqueueSetState: function () {}
},
assign = Object.assign,
emptyObject = {};
assign = Object.assign;
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Expand All @@ -79,7 +78,7 @@ ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
Expand Down Expand Up @@ -695,4 +694,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-4c7400c8";
exports.version = "19.0.0-www-classic-27c5ecd9";
9 changes: 4 additions & 5 deletions compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ var ReactNoopUpdateQueue = {
enqueueReplaceState: function () {},
enqueueSetState: function () {}
},
assign = Object.assign,
emptyObject = {};
assign = Object.assign;
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Expand All @@ -79,7 +78,7 @@ ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
Expand Down Expand Up @@ -695,4 +694,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-4c7400c8";
exports.version = "19.0.0-www-modern-27c5ecd9";
9 changes: 4 additions & 5 deletions compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ var ReactNoopUpdateQueue = {
enqueueReplaceState: function () {},
enqueueSetState: function () {}
},
assign = Object.assign,
emptyObject = {};
assign = Object.assign;
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Expand All @@ -83,7 +82,7 @@ ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
Expand Down Expand Up @@ -699,7 +698,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-classic-d5860266";
exports.version = "19.0.0-www-classic-6fc95490";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
9 changes: 4 additions & 5 deletions compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ var ReactNoopUpdateQueue = {
enqueueReplaceState: function () {},
enqueueSetState: function () {}
},
assign = Object.assign,
emptyObject = {};
assign = Object.assign;
function Component(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
Component.prototype.isReactComponent = {};
Expand All @@ -83,7 +82,7 @@ ComponentDummy.prototype = Component.prototype;
function PureComponent(props, context, updater) {
this.props = props;
this.context = context;
this.refs = emptyObject;
this.refs = {};
this.updater = updater || ReactNoopUpdateQueue;
}
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
Expand Down Expand Up @@ -699,7 +698,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.0.0-www-modern-d5860266";
exports.version = "19.0.0-www-modern-6fc95490";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = '19.0.0-www-classic-bd72d7f5';
var ReactVersion = '19.0.0-www-classic-82bda7e4';

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -12027,7 +12027,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = '19.0.0-www-modern-03c6d7dd';
var ReactVersion = '19.0.0-www-modern-3ebdca5b';

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -11799,7 +11799,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15827,7 +15827,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down Expand Up @@ -30831,7 +30838,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-www-classic-318e6766';
var ReactVersion = '19.0.0-www-classic-6d6c2bc1';

function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -26530,7 +26530,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down Expand Up @@ -38738,7 +38745,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-www-modern-a883b293';
var ReactVersion = '19.0.0-www-modern-2066293e';

function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactDOMTesting-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15958,7 +15958,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down Expand Up @@ -31387,7 +31394,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-www-classic-416e8d17';
var ReactVersion = '19.0.0-www-classic-678f6022';

function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactDOMTesting-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -26661,7 +26661,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down Expand Up @@ -39426,7 +39433,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-www-modern-3522110c';
var ReactVersion = '19.0.0-www-modern-f7e6f7db';

function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
implementation) {
Expand Down
11 changes: 9 additions & 2 deletions compiled/facebook-www/ReactReconciler-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12761,7 +12761,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
var instance = workInProgress.stateNode;
instance.props = newProps;
instance.state = workInProgress.memoizedState;
instance.refs = {};

{
// When string refs are used in create-react-class legacy components,
// we need to make refs writable unless we patch all such copies of the
// class code that sets to a frozen emptyObject.
instance.refs = {};
}

initializeUpdateQueue(workInProgress);
var contextType = ctor.contextType;

Expand Down Expand Up @@ -28650,7 +28657,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
return root;
}

var ReactVersion = '19.0.0-www-classic-eaa29620';
var ReactVersion = '19.0.0-www-classic-1d546420';

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Loading

0 comments on commit 21f1398

Please sign in to comment.