Skip to content

Commit 94683ff

Browse files
committed
[Flight] Allow a Server Reference to be registered twice (#28343)
It's possible for the same function instance to appear more than once in the same graph or even the same file. Currently this errors on trying to reconfigure the property but it really doesn't matter which one wins. First or last. Regardless there will be an entry point generated that can get them. DiffTrain build for [9444c51](9444c51)
1 parent 43967e7 commit 94683ff

9 files changed

+77
-9
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c1fd2a91b1042c137d750be85e5998f699a54d2a
1+
9444c51c7e44936c24e1f44db905cfd45c51cff3

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactCurrentDispatcher.current.useTransition();
612612
};
613-
exports.version = "18.3.0-www-modern-a12e20fd";
613+
exports.version = "18.3.0-www-modern-f4161761";

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-classic-d7b5bc9a";
22+
var ReactVersion = "18.3.0-www-classic-a730f95d";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -171,6 +171,10 @@ if (__DEV__) {
171171
return "[...]";
172172
}
173173

174+
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
175+
return describeClientReference();
176+
}
177+
174178
var name = objectName(value);
175179

176180
if (name === "Object") {
@@ -181,6 +185,10 @@ if (__DEV__) {
181185
}
182186

183187
case "function":
188+
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
189+
return describeClientReference();
190+
}
191+
184192
return "function";
185193

186194
default:
@@ -226,6 +234,12 @@ if (__DEV__) {
226234
return "";
227235
}
228236

237+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
238+
239+
function describeClientReference(ref) {
240+
return "client";
241+
}
242+
229243
function describeObjectForErrorMessage(objectOrArray, expandedName) {
230244
var objKind = objectName(objectOrArray);
231245

@@ -307,6 +321,8 @@ if (__DEV__) {
307321
} else {
308322
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
309323
str = "<" + describeElementType(objectOrArray.type) + "/>";
324+
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
325+
return describeClientReference();
310326
} else if (jsxPropsParents.has(objectOrArray)) {
311327
// Print JSX
312328
var _type = jsxPropsParents.get(objectOrArray);

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-modern-4fe256fb";
22+
var ReactVersion = "18.3.0-www-modern-2b72b29d";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");
@@ -171,6 +171,10 @@ if (__DEV__) {
171171
return "[...]";
172172
}
173173

174+
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
175+
return describeClientReference();
176+
}
177+
174178
var name = objectName(value);
175179

176180
if (name === "Object") {
@@ -181,6 +185,10 @@ if (__DEV__) {
181185
}
182186

183187
case "function":
188+
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
189+
return describeClientReference();
190+
}
191+
184192
return "function";
185193

186194
default:
@@ -226,6 +234,12 @@ if (__DEV__) {
226234
return "";
227235
}
228236

237+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
238+
239+
function describeClientReference(ref) {
240+
return "client";
241+
}
242+
229243
function describeObjectForErrorMessage(objectOrArray, expandedName) {
230244
var objKind = objectName(objectOrArray);
231245

@@ -307,6 +321,8 @@ if (__DEV__) {
307321
} else {
308322
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
309323
str = "<" + describeElementType(objectOrArray.type) + "/>";
324+
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
325+
return describeClientReference();
310326
} else if (jsxPropsParents.has(objectOrArray)) {
311327
// Print JSX
312328
var _type = jsxPropsParents.get(objectOrArray);

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ if (__DEV__) {
169169
return "[...]";
170170
}
171171

172+
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
173+
return describeClientReference();
174+
}
175+
172176
var name = objectName(value);
173177

174178
if (name === "Object") {
@@ -179,6 +183,10 @@ if (__DEV__) {
179183
}
180184

181185
case "function":
186+
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
187+
return describeClientReference();
188+
}
189+
182190
return "function";
183191

184192
default:
@@ -224,6 +232,12 @@ if (__DEV__) {
224232
return "";
225233
}
226234

235+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
236+
237+
function describeClientReference(ref) {
238+
return "client";
239+
}
240+
227241
function describeObjectForErrorMessage(objectOrArray, expandedName) {
228242
var objKind = objectName(objectOrArray);
229243

@@ -305,6 +319,8 @@ if (__DEV__) {
305319
} else {
306320
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
307321
str = "<" + describeElementType(objectOrArray.type) + "/>";
322+
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
323+
return describeClientReference();
308324
} else if (jsxPropsParents.has(objectOrArray)) {
309325
// Print JSX
310326
var _type = jsxPropsParents.get(objectOrArray);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17085,7 +17085,7 @@ Internals.Events = [
1708517085
var devToolsConfig$jscomp$inline_1783 = {
1708617086
findFiberByHostInstance: getClosestInstanceFromNode,
1708717087
bundleType: 0,
17088-
version: "18.3.0-www-modern-39d968b9",
17088+
version: "18.3.0-www-modern-448aa5e1",
1708917089
rendererPackageName: "react-dom"
1709017090
};
1709117091
var internals$jscomp$inline_2154 = {
@@ -17116,7 +17116,7 @@ var internals$jscomp$inline_2154 = {
1711617116
scheduleRoot: null,
1711717117
setRefreshHandler: null,
1711817118
getCurrentFiber: null,
17119-
reconcilerVersion: "18.3.0-www-modern-39d968b9"
17119+
reconcilerVersion: "18.3.0-www-modern-448aa5e1"
1712017120
};
1712117121
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1712217122
var hook$jscomp$inline_2155 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17537,4 +17537,4 @@ exports.useFormState = function (action, initialState, permalink) {
1753717537
exports.useFormStatus = function () {
1753817538
return ReactCurrentDispatcher$2.current.useHostTransitionStatus();
1753917539
};
17540-
exports.version = "18.3.0-www-modern-39d968b9";
17540+
exports.version = "18.3.0-www-modern-448aa5e1";

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@ if (__DEV__) {
829829
return "[...]";
830830
}
831831

832+
if (value !== null && value.$$typeof === CLIENT_REFERENCE_TAG) {
833+
return describeClientReference();
834+
}
835+
832836
var name = objectName(value);
833837

834838
if (name === "Object") {
@@ -839,6 +843,10 @@ if (__DEV__) {
839843
}
840844

841845
case "function":
846+
if (value.$$typeof === CLIENT_REFERENCE_TAG) {
847+
return describeClientReference();
848+
}
849+
842850
return "function";
843851

844852
default:
@@ -884,6 +892,12 @@ if (__DEV__) {
884892
return "";
885893
}
886894

895+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
896+
897+
function describeClientReference(ref) {
898+
return "client";
899+
}
900+
887901
function describeObjectForErrorMessage(objectOrArray, expandedName) {
888902
var objKind = objectName(objectOrArray);
889903

@@ -965,6 +979,8 @@ if (__DEV__) {
965979
} else {
966980
if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE) {
967981
str = "<" + describeElementType(objectOrArray.type) + "/>";
982+
} else if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) {
983+
return describeClientReference();
968984
} else if (jsxPropsParents.has(objectOrArray)) {
969985
// Print JSX
970986
var _type = jsxPropsParents.get(objectOrArray);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,12 @@ function describeValueForErrorMessage(value) {
346346
);
347347
case "object":
348348
if (isArrayImpl(value)) return "[...]";
349+
if (null !== value && value.$$typeof === CLIENT_REFERENCE_TAG)
350+
return "client";
349351
value = objectName(value);
350352
return "Object" === value ? "{...}" : value;
351353
case "function":
352-
return "function";
354+
return value.$$typeof === CLIENT_REFERENCE_TAG ? "client" : "function";
353355
default:
354356
return String(value);
355357
}
@@ -377,6 +379,7 @@ function describeElementType(type) {
377379
}
378380
return "";
379381
}
382+
var CLIENT_REFERENCE_TAG = Symbol.for("react.client.reference");
380383
function describeObjectForErrorMessage(objectOrArray, expandedName) {
381384
var objKind = objectName(objectOrArray);
382385
if ("Object" !== objKind && "Array" !== objKind) return objKind;
@@ -402,6 +405,7 @@ function describeObjectForErrorMessage(objectOrArray, expandedName) {
402405
} else if (objectOrArray.$$typeof === REACT_ELEMENT_TYPE)
403406
str = "<" + describeElementType(objectOrArray.type) + "/>";
404407
else {
408+
if (objectOrArray.$$typeof === CLIENT_REFERENCE_TAG) return "client";
405409
str = "{";
406410
i = Object.keys(objectOrArray);
407411
for (value = 0; value < i.length; value++) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26067,7 +26067,7 @@ if (__DEV__) {
2606726067
return root;
2606826068
}
2606926069

26070-
var ReactVersion = "18.3.0-www-modern-5300fd2b";
26070+
var ReactVersion = "18.3.0-www-modern-f239ff56";
2607126071

2607226072
// Might add PROFILE later.
2607326073

0 commit comments

Comments
 (0)