Skip to content

Commit

Permalink
Fix mistaken "react-server" condition (#28835)
Browse files Browse the repository at this point in the history
This is a Fizz server.

DiffTrain build for [ed40236](ed40236)
  • Loading branch information
kassens committed Apr 15, 2024
1 parent 83a7b45 commit 5f5d13f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 36 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c8a035036d0f257c514b3628e927dd9dd26e5a09
ed4023603632787db6416bee8e85e68d98ad29bd
36 changes: 14 additions & 22 deletions compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -2345,16 +2345,8 @@ if (__DEV__) {
: 'something with type "' + typeof thing + '"';
}

var ReactSharedInternalsServer = // $FlowFixMe: It's defined in the one we resolve to.
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

if (!ReactSharedInternalsServer) {
throw new Error(
'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."
);
}
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;

var ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
Expand Down Expand Up @@ -10747,10 +10739,10 @@ if (__DEV__) {
var previousDispatcher = null;

{
previousDispatcher = ReactSharedInternalsServer.H; // Set the dispatcher in DEV because this might be call in the render function
previousDispatcher = ReactSharedInternals.H; // Set the dispatcher in DEV because this might be call in the render function
// for warnings.

ReactSharedInternalsServer.H = null;
ReactSharedInternals.H = null;
disableLogs();
}
/**
Expand Down Expand Up @@ -10943,7 +10935,7 @@ if (__DEV__) {
reentry = false;

{
ReactSharedInternalsServer.H = previousDispatcher;
ReactSharedInternals.H = previousDispatcher;
reenableLogs();
}

Expand Down Expand Up @@ -13791,22 +13783,22 @@ if (__DEV__) {
}

var prevContext = getActiveContext();
var prevDispatcher = ReactSharedInternalsServer.H;
ReactSharedInternalsServer.H = HooksDispatcher;
var prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = null;

{
prevCacheDispatcher = ReactSharedInternalsServer.C;
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
}

var prevRequest = currentRequest;
currentRequest = request;
var prevGetCurrentStackImpl = null;

{
prevGetCurrentStackImpl = ReactSharedInternalsServer.getCurrentStack;
ReactSharedInternalsServer.getCurrentStack = getCurrentStackInDEV;
prevGetCurrentStackImpl = ReactSharedInternals.getCurrentStack;
ReactSharedInternals.getCurrentStack = getCurrentStackInDEV;
}

var prevResumableState = currentResumableState;
Expand All @@ -13832,14 +13824,14 @@ if (__DEV__) {
fatalError(request, error);
} finally {
setCurrentResumableState(prevResumableState);
ReactSharedInternalsServer.H = prevDispatcher;
ReactSharedInternals.H = prevDispatcher;

{
ReactSharedInternalsServer.C = prevCacheDispatcher;
ReactSharedInternals.C = prevCacheDispatcher;
}

{
ReactSharedInternalsServer.getCurrentStack = prevGetCurrentStackImpl;
ReactSharedInternals.getCurrentStack = prevGetCurrentStackImpl;
}

if (prevDispatcher === HooksDispatcher) {
Expand Down
22 changes: 9 additions & 13 deletions compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,9 @@ function sanitizeURL(url) {
? "javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')"
: url;
}
var ReactSharedInternalsServer =
React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
if (!ReactSharedInternalsServer)
throw Error(
'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.'
);
var ReactDOMSharedInternals =
var ReactSharedInternals =
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
ReactDOMSharedInternals =
ReactDOM.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
sharedNotPendingObject = {
pending: !1,
Expand Down Expand Up @@ -5271,10 +5267,10 @@ exports.renderNextChunk = function (stream) {
stream = stream.destination;
if (2 !== request.status) {
var prevContext = currentActiveSnapshot,
prevDispatcher = ReactSharedInternalsServer.H;
ReactSharedInternalsServer.H = HooksDispatcher;
var prevCacheDispatcher = ReactSharedInternalsServer.C;
ReactSharedInternalsServer.C = DefaultCacheDispatcher;
prevDispatcher = ReactSharedInternals.H;
ReactSharedInternals.H = HooksDispatcher;
var prevCacheDispatcher = ReactSharedInternals.C;
ReactSharedInternals.C = DefaultCacheDispatcher;
var prevRequest = currentRequest;
currentRequest = request;
var prevResumableState = currentResumableState;
Expand Down Expand Up @@ -5428,8 +5424,8 @@ exports.renderNextChunk = function (stream) {
logRecoverableError(request, error, {}), fatalError(request, error);
} finally {
(currentResumableState = prevResumableState),
(ReactSharedInternalsServer.H = prevDispatcher),
(ReactSharedInternalsServer.C = prevCacheDispatcher),
(ReactSharedInternals.H = prevDispatcher),
(ReactSharedInternals.C = prevCacheDispatcher),
prevDispatcher === HooksDispatcher && switchContext(prevContext),
(currentRequest = prevRequest);
}
Expand Down

0 comments on commit 5f5d13f

Please sign in to comment.