Skip to content

Commit c178d6f

Browse files
committed
[Flight] Delete Server Context (#28225)
Server Context was never documented, and has been deprecated in #27424. This PR removes it completely, including the implementation code. Notably, `useContext` is removed from the shared subset, so importing it from a React Server environment would now should be a build error in environments that are able to enforce that. DiffTrain build for [4728548](4728548)
1 parent b505fe3 commit c178d6f

40 files changed

+294
-1210
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
95ec128399a8b34884cc6bd90a041e03ce5c1844
1+
472854820bfd0058dfc85524051171c7b7c998c1

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-classic-609987b0";
27+
var ReactVersion = "18.3.0-www-classic-82bfc644";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -2411,10 +2411,7 @@ if (__DEV__) {
24112411
_threadCount: 0,
24122412
// These are circular
24132413
Provider: null,
2414-
Consumer: null,
2415-
// Add these to use same hidden class in VM as ServerContext
2416-
_defaultValue: null,
2417-
_globalName: null
2414+
Consumer: null
24182415
};
24192416
context.Provider = {
24202417
$$typeof: REACT_PROVIDER_TYPE,

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ if (__DEV__) {
2424
) {
2525
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
2626
}
27-
var ReactVersion = "18.3.0-www-modern-9aca347c";
27+
var ReactVersion = "18.3.0-www-modern-00e8e94b";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -2376,10 +2376,7 @@ if (__DEV__) {
23762376
_threadCount: 0,
23772377
// These are circular
23782378
Provider: null,
2379-
Consumer: null,
2380-
// Add these to use same hidden class in VM as ServerContext
2381-
_defaultValue: null,
2382-
_globalName: null
2379+
Consumer: null
23832380
};
23842381
context.Provider = {
23852382
$$typeof: REACT_PROVIDER_TYPE,

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,7 @@ exports.createContext = function (defaultValue) {
411411
_currentValue2: defaultValue,
412412
_threadCount: 0,
413413
Provider: null,
414-
Consumer: null,
415-
_defaultValue: null,
416-
_globalName: null
414+
Consumer: null
417415
};
418416
defaultValue.Provider = {
419417
$$typeof: REACT_PROVIDER_TYPE,
@@ -572,4 +570,4 @@ exports.useSyncExternalStore = function (
572570
exports.useTransition = function () {
573571
return ReactCurrentDispatcher.current.useTransition();
574572
};
575-
exports.version = "18.3.0-www-classic-416dbb8d";
573+
exports.version = "18.3.0-www-classic-838f52b1";

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ exports.createContext = function (defaultValue) {
378378
_currentValue2: defaultValue,
379379
_threadCount: 0,
380380
Provider: null,
381-
Consumer: null,
382-
_defaultValue: null,
383-
_globalName: null
381+
Consumer: null
384382
};
385383
defaultValue.Provider = {
386384
$$typeof: REACT_PROVIDER_TYPE,
@@ -564,4 +562,4 @@ exports.useSyncExternalStore = function (
564562
exports.useTransition = function () {
565563
return ReactCurrentDispatcher.current.useTransition();
566564
};
567-
exports.version = "18.3.0-www-modern-b506e46f";
565+
exports.version = "18.3.0-www-modern-ec0970fd";

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ exports.createContext = function (defaultValue) {
415415
_currentValue2: defaultValue,
416416
_threadCount: 0,
417417
Provider: null,
418-
Consumer: null,
419-
_defaultValue: null,
420-
_globalName: null
418+
Consumer: null
421419
};
422420
defaultValue.Provider = {
423421
$$typeof: REACT_PROVIDER_TYPE,
@@ -576,7 +574,7 @@ exports.useSyncExternalStore = function (
576574
exports.useTransition = function () {
577575
return ReactCurrentDispatcher.current.useTransition();
578576
};
579-
exports.version = "18.3.0-www-classic-f4afa597";
577+
exports.version = "18.3.0-www-classic-ca403e34";
580578
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
581579
"function" ===
582580
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,7 @@ exports.createContext = function (defaultValue) {
382382
_currentValue2: defaultValue,
383383
_threadCount: 0,
384384
Provider: null,
385-
Consumer: null,
386-
_defaultValue: null,
387-
_globalName: null
385+
Consumer: null
388386
};
389387
defaultValue.Provider = {
390388
$$typeof: REACT_PROVIDER_TYPE,
@@ -568,7 +566,7 @@ exports.useSyncExternalStore = function (
568566
exports.useTransition = function () {
569567
return ReactCurrentDispatcher.current.useTransition();
570568
};
571-
exports.version = "18.3.0-www-modern-41ffe01a";
569+
exports.version = "18.3.0-www-modern-aeab456d";
572570
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
573571
"function" ===
574572
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-classic-e82d96aa";
69+
var ReactVersion = "18.3.0-www-classic-14b2377a";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -237,7 +237,6 @@ if (__DEV__) {
237237
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
238238
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
239239
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
240-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
241240
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
242241
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
243242
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
@@ -4059,9 +4058,7 @@ if (__DEV__) {
40594058
_currentValue2: null,
40604059
_threadCount: 0,
40614060
Provider: null,
4062-
Consumer: null,
4063-
_defaultValue: null,
4064-
_globalName: null
4061+
Consumer: null
40654062
};
40664063

40674064
function requiredContext(c) {
@@ -6928,10 +6925,7 @@ if (__DEV__) {
69286925
return createChild(returnFiber, unwrapThenable(thenable), lanes);
69296926
}
69306927

6931-
if (
6932-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
6933-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
6934-
) {
6928+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
69356929
var context = newChild;
69366930
return createChild(
69376931
returnFiber,
@@ -7015,10 +7009,7 @@ if (__DEV__) {
70157009
);
70167010
}
70177011

7018-
if (
7019-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
7020-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
7021-
) {
7012+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
70227013
var context = newChild;
70237014
return updateSlot(
70247015
returnFiber,
@@ -7119,10 +7110,7 @@ if (__DEV__) {
71197110
);
71207111
}
71217112

7122-
if (
7123-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
7124-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
7125-
) {
7113+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
71267114
var context = newChild;
71277115
return updateFromMap(
71287116
existingChildren,
@@ -7829,10 +7817,7 @@ if (__DEV__) {
78297817
);
78307818
}
78317819

7832-
if (
7833-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
7834-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
7835-
) {
7820+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
78367821
var context = newChild;
78377822
return reconcileChildFibersImpl(
78387823
returnFiber,
@@ -8996,10 +8981,7 @@ if (__DEV__) {
89968981
// This is a thenable.
89978982
var thenable = usable;
89988983
return useThenable(thenable);
8999-
} else if (
9000-
usable.$$typeof === REACT_CONTEXT_TYPE ||
9001-
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
9002-
) {
8984+
} else if (usable.$$typeof === REACT_CONTEXT_TYPE) {
90038985
var context = usable;
90048986
return readContext(context);
90058987
}
@@ -18273,9 +18255,7 @@ if (__DEV__) {
1827318255
var currentValue = valueCursor.current;
1827418256

1827518257
{
18276-
{
18277-
context._currentValue2 = currentValue;
18278-
}
18258+
context._currentValue2 = currentValue;
1827918259

1828018260
{
1828118261
var currentRenderer2 = renderer2CursorDEV.current;
@@ -18922,9 +18902,7 @@ if (__DEV__) {
1892218902
// We'll initialize these at the root.
1892318903
_currentValue: null,
1892418904
_currentValue2: null,
18925-
_threadCount: 0,
18926-
_defaultValue: null,
18927-
_globalName: null
18905+
_threadCount: 0
1892818906
};
1892918907

1893018908
{

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

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (__DEV__) {
6666
return self;
6767
}
6868

69-
var ReactVersion = "18.3.0-www-modern-f1f6b170";
69+
var ReactVersion = "18.3.0-www-modern-d7f69305";
7070

7171
var LegacyRoot = 0;
7272
var ConcurrentRoot = 1;
@@ -237,7 +237,6 @@ if (__DEV__) {
237237
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
238238
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
239239
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
240-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
241240
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
242241
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
243242
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
@@ -3809,9 +3808,7 @@ if (__DEV__) {
38093808
_currentValue2: null,
38103809
_threadCount: 0,
38113810
Provider: null,
3812-
Consumer: null,
3813-
_defaultValue: null,
3814-
_globalName: null
3811+
Consumer: null
38153812
};
38163813

38173814
function requiredContext(c) {
@@ -6678,10 +6675,7 @@ if (__DEV__) {
66786675
return createChild(returnFiber, unwrapThenable(thenable), lanes);
66796676
}
66806677

6681-
if (
6682-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
6683-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
6684-
) {
6678+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
66856679
var context = newChild;
66866680
return createChild(
66876681
returnFiber,
@@ -6765,10 +6759,7 @@ if (__DEV__) {
67656759
);
67666760
}
67676761

6768-
if (
6769-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
6770-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
6771-
) {
6762+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
67726763
var context = newChild;
67736764
return updateSlot(
67746765
returnFiber,
@@ -6869,10 +6860,7 @@ if (__DEV__) {
68696860
);
68706861
}
68716862

6872-
if (
6873-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
6874-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
6875-
) {
6863+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
68766864
var context = newChild;
68776865
return updateFromMap(
68786866
existingChildren,
@@ -7579,10 +7567,7 @@ if (__DEV__) {
75797567
);
75807568
}
75817569

7582-
if (
7583-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
7584-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
7585-
) {
7570+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
75867571
var context = newChild;
75877572
return reconcileChildFibersImpl(
75887573
returnFiber,
@@ -8746,10 +8731,7 @@ if (__DEV__) {
87468731
// This is a thenable.
87478732
var thenable = usable;
87488733
return useThenable(thenable);
8749-
} else if (
8750-
usable.$$typeof === REACT_CONTEXT_TYPE ||
8751-
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
8752-
) {
8734+
} else if (usable.$$typeof === REACT_CONTEXT_TYPE) {
87538735
var context = usable;
87548736
return readContext(context);
87558737
}
@@ -17946,9 +17928,7 @@ if (__DEV__) {
1794617928
var currentValue = valueCursor.current;
1794717929

1794817930
{
17949-
{
17950-
context._currentValue2 = currentValue;
17951-
}
17931+
context._currentValue2 = currentValue;
1795217932

1795317933
{
1795417934
var currentRenderer2 = renderer2CursorDEV.current;
@@ -18595,9 +18575,7 @@ if (__DEV__) {
1859518575
// We'll initialize these at the root.
1859618576
_currentValue: null,
1859718577
_currentValue2: null,
18598-
_threadCount: 0,
18599-
_defaultValue: null,
18600-
_globalName: null
18578+
_threadCount: 0
1860118579
};
1860218580

1860318581
{

0 commit comments

Comments
 (0)