Skip to content

Commit 21f1398

Browse files
committed
Unrevert "Support writing to this.refs from userspace" (#28879)
Reverts #28877 We found the cause of the regression and should be able to land this again. DiffTrain build for [b039be6](b039be6)
1 parent fe8c683 commit 21f1398

17 files changed

+115
-63
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6f6e375fce9d0700434f863f70f0e2e5ea180426
1+
b039be627dd7403d7d2f63a48c8d263d955ce456

compiled/facebook-www/React-dev.classic.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (
2525
) {
2626
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2727
}
28-
var ReactVersion = '19.0.0-www-classic-e47f6d99';
28+
var ReactVersion = '19.0.0-www-classic-44c604a7';
2929

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

218218
var assign = Object.assign;
219219

220-
var emptyObject = {};
221-
222-
{
223-
Object.freeze(emptyObject);
224-
}
225220
/**
226221
* Base class helpers for the updating state of a component.
227222
*/
228223

229-
230224
function Component(props, context, updater) {
231225
this.props = props;
232-
this.context = context; // If a component has string refs, we will assign a different object later.
233-
234-
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
226+
this.context = context;
227+
this.refs = {}; // We initialize the default updater but the real one gets injected by the
235228
// renderer.
236229

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

334-
this.refs = emptyObject;
327+
this.refs = {};
335328
this.updater = updater || ReactNoopUpdateQueue;
336329
}
337330

compiled/facebook-www/React-dev.modern.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if (
2525
) {
2626
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2727
}
28-
var ReactVersion = '19.0.0-www-modern-3c57619e';
28+
var ReactVersion = '19.0.0-www-modern-5387e24a';
2929

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

218218
var assign = Object.assign;
219219

220-
var emptyObject = {};
221-
222-
{
223-
Object.freeze(emptyObject);
224-
}
225220
/**
226221
* Base class helpers for the updating state of a component.
227222
*/
228223

229-
230224
function Component(props, context, updater) {
231225
this.props = props;
232-
this.context = context; // If a component has string refs, we will assign a different object later.
233-
234-
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
226+
this.context = context;
227+
this.refs = {}; // We initialize the default updater but the real one gets injected by the
235228
// renderer.
236229

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

334-
this.refs = emptyObject;
327+
this.refs = {};
335328
this.updater = updater || ReactNoopUpdateQueue;
336329
}
337330

compiled/facebook-www/React-prod.classic.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ var ReactNoopUpdateQueue = {
5151
enqueueReplaceState: function () {},
5252
enqueueSetState: function () {}
5353
},
54-
assign = Object.assign,
55-
emptyObject = {};
54+
assign = Object.assign;
5655
function Component(props, context, updater) {
5756
this.props = props;
5857
this.context = context;
59-
this.refs = emptyObject;
58+
this.refs = {};
6059
this.updater = updater || ReactNoopUpdateQueue;
6160
}
6261
Component.prototype.isReactComponent = {};
@@ -79,7 +78,7 @@ ComponentDummy.prototype = Component.prototype;
7978
function PureComponent(props, context, updater) {
8079
this.props = props;
8180
this.context = context;
82-
this.refs = emptyObject;
81+
this.refs = {};
8382
this.updater = updater || ReactNoopUpdateQueue;
8483
}
8584
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -695,4 +694,4 @@ exports.useSyncExternalStore = function (
695694
exports.useTransition = function () {
696695
return ReactSharedInternals.H.useTransition();
697696
};
698-
exports.version = "19.0.0-www-classic-4c7400c8";
697+
exports.version = "19.0.0-www-classic-27c5ecd9";

compiled/facebook-www/React-prod.modern.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ var ReactNoopUpdateQueue = {
5151
enqueueReplaceState: function () {},
5252
enqueueSetState: function () {}
5353
},
54-
assign = Object.assign,
55-
emptyObject = {};
54+
assign = Object.assign;
5655
function Component(props, context, updater) {
5756
this.props = props;
5857
this.context = context;
59-
this.refs = emptyObject;
58+
this.refs = {};
6059
this.updater = updater || ReactNoopUpdateQueue;
6160
}
6261
Component.prototype.isReactComponent = {};
@@ -79,7 +78,7 @@ ComponentDummy.prototype = Component.prototype;
7978
function PureComponent(props, context, updater) {
8079
this.props = props;
8180
this.context = context;
82-
this.refs = emptyObject;
81+
this.refs = {};
8382
this.updater = updater || ReactNoopUpdateQueue;
8483
}
8584
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -695,4 +694,4 @@ exports.useSyncExternalStore = function (
695694
exports.useTransition = function () {
696695
return ReactSharedInternals.H.useTransition();
697696
};
698-
exports.version = "19.0.0-www-modern-4c7400c8";
697+
exports.version = "19.0.0-www-modern-27c5ecd9";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ var ReactNoopUpdateQueue = {
5555
enqueueReplaceState: function () {},
5656
enqueueSetState: function () {}
5757
},
58-
assign = Object.assign,
59-
emptyObject = {};
58+
assign = Object.assign;
6059
function Component(props, context, updater) {
6160
this.props = props;
6261
this.context = context;
63-
this.refs = emptyObject;
62+
this.refs = {};
6463
this.updater = updater || ReactNoopUpdateQueue;
6564
}
6665
Component.prototype.isReactComponent = {};
@@ -83,7 +82,7 @@ ComponentDummy.prototype = Component.prototype;
8382
function PureComponent(props, context, updater) {
8483
this.props = props;
8584
this.context = context;
86-
this.refs = emptyObject;
85+
this.refs = {};
8786
this.updater = updater || ReactNoopUpdateQueue;
8887
}
8988
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -699,7 +698,7 @@ exports.useSyncExternalStore = function (
699698
exports.useTransition = function () {
700699
return ReactSharedInternals.H.useTransition();
701700
};
702-
exports.version = "19.0.0-www-classic-d5860266";
701+
exports.version = "19.0.0-www-classic-6fc95490";
703702
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
704703
"function" ===
705704
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,11 @@ var ReactNoopUpdateQueue = {
5555
enqueueReplaceState: function () {},
5656
enqueueSetState: function () {}
5757
},
58-
assign = Object.assign,
59-
emptyObject = {};
58+
assign = Object.assign;
6059
function Component(props, context, updater) {
6160
this.props = props;
6261
this.context = context;
63-
this.refs = emptyObject;
62+
this.refs = {};
6463
this.updater = updater || ReactNoopUpdateQueue;
6564
}
6665
Component.prototype.isReactComponent = {};
@@ -83,7 +82,7 @@ ComponentDummy.prototype = Component.prototype;
8382
function PureComponent(props, context, updater) {
8483
this.props = props;
8584
this.context = context;
86-
this.refs = emptyObject;
85+
this.refs = {};
8786
this.updater = updater || ReactNoopUpdateQueue;
8887
}
8988
var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());
@@ -699,7 +698,7 @@ exports.useSyncExternalStore = function (
699698
exports.useTransition = function () {
700699
return ReactSharedInternals.H.useTransition();
701700
};
702-
exports.version = "19.0.0-www-modern-d5860266";
701+
exports.version = "19.0.0-www-modern-6fc95490";
703702
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
704703
"function" ===
705704
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function _assertThisInitialized(self) {
6363
return self;
6464
}
6565

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

6868
var LegacyRoot = 0;
6969
var ConcurrentRoot = 1;
@@ -12027,7 +12027,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1202712027
var instance = workInProgress.stateNode;
1202812028
instance.props = newProps;
1202912029
instance.state = workInProgress.memoizedState;
12030-
instance.refs = {};
12030+
12031+
{
12032+
// When string refs are used in create-react-class legacy components,
12033+
// we need to make refs writable unless we patch all such copies of the
12034+
// class code that sets to a frozen emptyObject.
12035+
instance.refs = {};
12036+
}
12037+
1203112038
initializeUpdateQueue(workInProgress);
1203212039
var contextType = ctor.contextType;
1203312040

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function _assertThisInitialized(self) {
6363
return self;
6464
}
6565

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

6868
var LegacyRoot = 0;
6969
var ConcurrentRoot = 1;
@@ -11799,7 +11799,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1179911799
var instance = workInProgress.stateNode;
1180011800
instance.props = newProps;
1180111801
instance.state = workInProgress.memoizedState;
11802-
instance.refs = {};
11802+
11803+
{
11804+
// When string refs are used in create-react-class legacy components,
11805+
// we need to make refs writable unless we patch all such copies of the
11806+
// class code that sets to a frozen emptyObject.
11807+
instance.refs = {};
11808+
}
11809+
1180311810
initializeUpdateQueue(workInProgress);
1180411811
var contextType = ctor.contextType;
1180511812

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15827,7 +15827,14 @@ function mountClassInstance(workInProgress, ctor, newProps, renderLanes) {
1582715827
var instance = workInProgress.stateNode;
1582815828
instance.props = newProps;
1582915829
instance.state = workInProgress.memoizedState;
15830-
instance.refs = {};
15830+
15831+
{
15832+
// When string refs are used in create-react-class legacy components,
15833+
// we need to make refs writable unless we patch all such copies of the
15834+
// class code that sets to a frozen emptyObject.
15835+
instance.refs = {};
15836+
}
15837+
1583115838
initializeUpdateQueue(workInProgress);
1583215839
var contextType = ctor.contextType;
1583315840

@@ -30831,7 +30838,7 @@ identifierPrefix, onUncaughtError, onCaughtError, onRecoverableError, transition
3083130838
return root;
3083230839
}
3083330840

30834-
var ReactVersion = '19.0.0-www-classic-318e6766';
30841+
var ReactVersion = '19.0.0-www-classic-6d6c2bc1';
3083530842

3083630843
function createPortal$1(children, containerInfo, // TODO: figure out the API for cross-renderer implementation.
3083730844
implementation) {

0 commit comments

Comments
 (0)