Skip to content

Commit 5f5d13f

Browse files
committed
Fix mistaken "react-server" condition (#28835)
This is a Fizz server. DiffTrain build for [ed40236](ed40236)
1 parent 83a7b45 commit 5f5d13f

File tree

3 files changed

+24
-36
lines changed

3 files changed

+24
-36
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c8a035036d0f257c514b3628e927dd9dd26e5a09
1+
ed4023603632787db6416bee8e85e68d98ad29bd

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

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,16 +2345,8 @@ if (__DEV__) {
23452345
: 'something with type "' + typeof thing + '"';
23462346
}
23472347

2348-
var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
2349-
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
2350-
2351-
if (!ReactSharedInternalsServer) {
2352-
throw new Error(
2353-
'The "react" package in this environment is not configured correctly. ' +
2354-
'The "react-server" condition must be enabled in any environment that ' +
2355-
"runs React Server Components."
2356-
);
2357-
}
2348+
var ReactSharedInternals =
2349+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
23582350

23592351
var ReactDOMSharedInternals =
23602352
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
@@ -10747,10 +10739,10 @@ if (__DEV__) {
1074710739
var previousDispatcher = null;
1074810740

1074910741
{
10750-
previousDispatcher = ReactSharedInternalsServer.H; // Set the dispatcher in DEV because this might be call in the render function
10742+
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
1075110743
// for warnings.
1075210744

10753-
ReactSharedInternalsServer.H = null;
10745+
ReactSharedInternals.H = null;
1075410746
disableLogs();
1075510747
}
1075610748
/**
@@ -10943,7 +10935,7 @@ if (__DEV__) {
1094310935
reentry = false;
1094410936

1094510937
{
10946-
ReactSharedInternalsServer.H = previousDispatcher;
10938+
ReactSharedInternals.H = previousDispatcher;
1094710939
reenableLogs();
1094810940
}
1094910941

@@ -13791,22 +13783,22 @@ if (__DEV__) {
1379113783
}
1379213784

1379313785
var prevContext = getActiveContext();
13794-
var prevDispatcher = ReactSharedInternalsServer.H;
13795-
ReactSharedInternalsServer.H = HooksDispatcher;
13786+
var prevDispatcher = ReactSharedInternals.H;
13787+
ReactSharedInternals.H = HooksDispatcher;
1379613788
var prevCacheDispatcher = null;
1379713789

1379813790
{
13799-
prevCacheDispatcher = ReactSharedInternalsServer.C;
13800-
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
13791+
prevCacheDispatcher = ReactSharedInternals.C;
13792+
ReactSharedInternals.C = DefaultCacheDispatcher;
1380113793
}
1380213794

1380313795
var prevRequest = currentRequest;
1380413796
currentRequest = request;
1380513797
var prevGetCurrentStackImpl = null;
1380613798

1380713799
{
13808-
prevGetCurrentStackImpl = ReactSharedInternalsServer.getCurrentStack;
13809-
ReactSharedInternalsServer.getCurrentStack = getCurrentStackInDEV;
13800+
prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack;
13801+
ReactSharedInternals.getCurrentStack = getCurrentStackInDEV;
1381013802
}
1381113803

1381213804
var prevResumableState = currentResumableState;
@@ -13832,14 +13824,14 @@ if (__DEV__) {
1383213824
fatalError(request, error);
1383313825
} finally {
1383413826
setCurrentResumableState(prevResumableState);
13835-
ReactSharedInternalsServer.H = prevDispatcher;
13827+
ReactSharedInternals.H = prevDispatcher;
1383613828

1383713829
{
13838-
ReactSharedInternalsServer.C = prevCacheDispatcher;
13830+
ReactSharedInternals.C = prevCacheDispatcher;
1383913831
}
1384013832

1384113833
{
13842-
ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStackImpl;
13834+
ReactSharedInternals.getCurrentStack = prevGetCurrentStackImpl;
1384313835
}
1384413836

1384513837
if (prevDispatcher === HooksDispatcher) {

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,9 @@ function sanitizeURL(url) {
278278
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
279279
: url;
280280
}
281-
var ReactSharedInternalsServer =
282-
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
283-
if (!ReactSharedInternalsServer)
284-
throw Error(
285-
'The "react" package in this environment is not configured correctly. The "react-server" condition must be enabled in any environment that runs React Server Components.'
286-
);
287-
var ReactDOMSharedInternals =
281+
var ReactSharedInternals =
282+
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
283+
ReactDOMSharedInternals =
288284
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
289285
sharedNotPendingObject = {
290286
pending: !1,
@@ -5271,10 +5267,10 @@ exports.renderNextChunk = function (stream) {
52715267
stream = stream.destination;
52725268
if (2 !== request.status) {
52735269
var prevContext = currentActiveSnapshot,
5274-
prevDispatcher = ReactSharedInternalsServer.H;
5275-
ReactSharedInternalsServer.H = HooksDispatcher;
5276-
var prevCacheDispatcher = ReactSharedInternalsServer.C;
5277-
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
5270+
prevDispatcher = ReactSharedInternals.H;
5271+
ReactSharedInternals.H = HooksDispatcher;
5272+
var prevCacheDispatcher = ReactSharedInternals.C;
5273+
ReactSharedInternals.C = DefaultCacheDispatcher;
52785274
var prevRequest = currentRequest;
52795275
currentRequest = request;
52805276
var prevResumableState = currentResumableState;
@@ -5428,8 +5424,8 @@ exports.renderNextChunk = function (stream) {
54285424
logRecoverableError(request, error, {}), fatalError(request, error);
54295425
} finally {
54305426
(currentResumableState = prevResumableState),
5431-
(ReactSharedInternalsServer.H = prevDispatcher),
5432-
(ReactSharedInternalsServer.C = prevCacheDispatcher),
5427+
(ReactSharedInternals.H = prevDispatcher),
5428+
(ReactSharedInternals.C = prevCacheDispatcher),
54335429
prevDispatcher === HooksDispatcher && switchContext(prevContext),
54345430
(currentRequest = prevRequest);
54355431
}

0 commit comments

Comments
 (0)