Skip to content

Commit affeba5

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 commit 4728548.
1 parent fc7d1d5 commit affeba5

File tree

16 files changed

+96
-277
lines changed

16 files changed

+96
-277
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-dev.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<36f762822297bdf88d7c307324df43cc>>
10+
* @generated SignedSource<<2841ecb119b8ac2f90b4a6b1a9610f4a>>
1111
*/
1212

1313
"use strict";
@@ -27,7 +27,6 @@ if (__DEV__) {
2727
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
2828
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
2929
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
30-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
3130
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
3231
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
3332
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
@@ -104,7 +103,6 @@ if (__DEV__) {
104103
var $$typeofType = type && type.$$typeof;
105104

106105
switch ($$typeofType) {
107-
case REACT_SERVER_CONTEXT_TYPE:
108106
case REACT_CONTEXT_TYPE:
109107
case REACT_FORWARD_REF_TYPE:
110108
case REACT_LAZY_TYPE:

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-prod.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<41457e58875ca2b4348c205786f8a603>>
10+
* @generated SignedSource<<0785b258643804110befe2a444659c39>>
1111
*/
1212

1313
"use strict";
@@ -18,7 +18,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
1818
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1919
REACT_PROVIDER_TYPE = Symbol.for("react.provider"),
2020
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
21-
REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"),
2221
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
2322
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
2423
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
@@ -42,7 +41,6 @@ function typeOf(object) {
4241
return object;
4342
default:
4443
switch (((object = object && object.$$typeof), object)) {
45-
case REACT_SERVER_CONTEXT_TYPE:
4644
case REACT_CONTEXT_TYPE:
4745
case REACT_FORWARD_REF_TYPE:
4846
case REACT_LAZY_TYPE:

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-is/cjs/ReactIs-profiling.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<41457e58875ca2b4348c205786f8a603>>
10+
* @generated SignedSource<<0785b258643804110befe2a444659c39>>
1111
*/
1212

1313
"use strict";
@@ -18,7 +18,6 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
1818
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
1919
REACT_PROVIDER_TYPE = Symbol.for("react.provider"),
2020
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
21-
REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"),
2221
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
2322
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
2423
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
@@ -42,7 +41,6 @@ function typeOf(object) {
4241
return object;
4342
default:
4443
switch (((object = object && object.$$typeof), object)) {
45-
case REACT_SERVER_CONTEXT_TYPE:
4644
case REACT_CONTEXT_TYPE:
4745
case REACT_FORWARD_REF_TYPE:
4846
case REACT_LAZY_TYPE:

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<fdc597b6fd2e169218abbcc3fbb6bc8c>>
10+
* @generated SignedSource<<3a64021116badb6467add62a13ee5411>>
1111
*/
1212

1313
"use strict";
@@ -191,7 +191,6 @@ if (__DEV__) {
191191
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
192192
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
193193
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
194-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
195194
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
196195
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
197196
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
@@ -2705,9 +2704,7 @@ if (__DEV__) {
27052704
_currentValue2: null,
27062705
_threadCount: 0,
27072706
Provider: null,
2708-
Consumer: null,
2709-
_defaultValue: null,
2710-
_globalName: null
2707+
Consumer: null
27112708
};
27122709

27132710
function requiredContext(c) {
@@ -5541,10 +5538,7 @@ if (__DEV__) {
55415538
return createChild(returnFiber, unwrapThenable(thenable), lanes);
55425539
}
55435540

5544-
if (
5545-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
5546-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
5547-
) {
5541+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
55485542
var context = newChild;
55495543
return createChild(
55505544
returnFiber,
@@ -5628,10 +5622,7 @@ if (__DEV__) {
56285622
);
56295623
}
56305624

5631-
if (
5632-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
5633-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
5634-
) {
5625+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
56355626
var context = newChild;
56365627
return updateSlot(
56375628
returnFiber,
@@ -5732,10 +5723,7 @@ if (__DEV__) {
57325723
);
57335724
}
57345725

5735-
if (
5736-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
5737-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
5738-
) {
5726+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
57395727
var context = newChild;
57405728
return updateFromMap(
57415729
existingChildren,
@@ -6442,10 +6430,7 @@ if (__DEV__) {
64426430
);
64436431
}
64446432

6445-
if (
6446-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
6447-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
6448-
) {
6433+
if (newChild.$$typeof === REACT_CONTEXT_TYPE) {
64496434
var context = newChild;
64506435
return reconcileChildFibersImpl(
64516436
returnFiber,
@@ -7537,10 +7522,7 @@ if (__DEV__) {
75377522
// This is a thenable.
75387523
var thenable = usable;
75397524
return useThenable(thenable);
7540-
} else if (
7541-
usable.$$typeof === REACT_CONTEXT_TYPE ||
7542-
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
7543-
) {
7525+
} else if (usable.$$typeof === REACT_CONTEXT_TYPE) {
75447526
var context = usable;
75457527
return readContext(context);
75467528
}
@@ -15920,9 +15902,7 @@ if (__DEV__) {
1592015902
var currentValue = valueCursor.current;
1592115903

1592215904
{
15923-
{
15924-
context._currentValue2 = currentValue;
15925-
}
15905+
context._currentValue2 = currentValue;
1592615906

1592715907
{
1592815908
var currentRenderer2 = renderer2CursorDEV.current;
@@ -16237,9 +16217,7 @@ if (__DEV__) {
1623716217
// We'll initialize these at the root.
1623816218
_currentValue: null,
1623916219
_currentValue2: null,
16240-
_threadCount: 0,
16241-
_defaultValue: null,
16242-
_globalName: null
16220+
_threadCount: 0
1624316221
};
1624416222

1624516223
{
@@ -25622,7 +25600,7 @@ if (__DEV__) {
2562225600
return root;
2562325601
}
2562425602

25625-
var ReactVersion = "18.3.0-canary-95ec12839-20240205";
25603+
var ReactVersion = "18.3.0-canary-472854820-20240205";
2562625604

2562725605
// Might add PROFILE later.
2562825606

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<0830f708091bdd48ea8c30383eaa2377>>
10+
* @generated SignedSource<<44ff806ec3569d53375d403127ca45fb>>
1111
*/
1212

1313
"use strict";
@@ -38,7 +38,6 @@ var assign = Object.assign,
3838
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
3939
REACT_PROVIDER_TYPE = Symbol.for("react.provider"),
4040
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
41-
REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"),
4241
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
4342
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
4443
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
@@ -678,9 +677,7 @@ var objectIs = "function" === typeof Object.is ? Object.is : is,
678677
_currentValue2: null,
679678
_threadCount: 0,
680679
Provider: null,
681-
Consumer: null,
682-
_defaultValue: null,
683-
_globalName: null
680+
Consumer: null
684681
};
685682
function pushHostContainer(fiber, nextRootInstance) {
686683
push(rootInstanceStackCursor, nextRootInstance);
@@ -1696,10 +1693,7 @@ function createChildReconciler(shouldTrackSideEffects) {
16961693
);
16971694
if ("function" === typeof newChild.then)
16981695
return createChild(returnFiber, unwrapThenable(newChild), lanes);
1699-
if (
1700-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
1701-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
1702-
)
1696+
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
17031697
return createChild(
17041698
returnFiber,
17051699
readContextDuringReconcilation(returnFiber, newChild, lanes),
@@ -1745,10 +1739,7 @@ function createChildReconciler(shouldTrackSideEffects) {
17451739
unwrapThenable(newChild),
17461740
lanes
17471741
);
1748-
if (
1749-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
1750-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
1751-
)
1742+
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
17521743
return updateSlot(
17531744
returnFiber,
17541745
oldFiber,
@@ -1815,10 +1806,7 @@ function createChildReconciler(shouldTrackSideEffects) {
18151806
unwrapThenable(newChild),
18161807
lanes
18171808
);
1818-
if (
1819-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
1820-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
1821-
)
1809+
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
18221810
return updateFromMap(
18231811
existingChildren,
18241812
returnFiber,
@@ -2150,10 +2138,7 @@ function createChildReconciler(shouldTrackSideEffects) {
21502138
unwrapThenable(newChild),
21512139
lanes
21522140
);
2153-
if (
2154-
newChild.$$typeof === REACT_CONTEXT_TYPE ||
2155-
newChild.$$typeof === REACT_SERVER_CONTEXT_TYPE
2156-
)
2141+
if (newChild.$$typeof === REACT_CONTEXT_TYPE)
21572142
return reconcileChildFibersImpl(
21582143
returnFiber,
21592144
currentFirstChild,
@@ -2459,11 +2444,7 @@ function useThenable(thenable) {
24592444
function use(usable) {
24602445
if (null !== usable && "object" === typeof usable) {
24612446
if ("function" === typeof usable.then) return useThenable(usable);
2462-
if (
2463-
usable.$$typeof === REACT_CONTEXT_TYPE ||
2464-
usable.$$typeof === REACT_SERVER_CONTEXT_TYPE
2465-
)
2466-
return readContext(usable);
2447+
if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable);
24672448
}
24682449
throw Error("An unsupported type was passed to use(): " + String(usable));
24692450
}
@@ -5049,9 +5030,7 @@ var AbortControllerLocal =
50495030
Provider: null,
50505031
_currentValue: null,
50515032
_currentValue2: null,
5052-
_threadCount: 0,
5053-
_defaultValue: null,
5054-
_globalName: null
5033+
_threadCount: 0
50555034
};
50565035
function createCache() {
50575036
return {
@@ -9171,7 +9150,7 @@ var devToolsConfig$jscomp$inline_1012 = {
91719150
throw Error("TestRenderer does not support findFiberByHostInstance()");
91729151
},
91739152
bundleType: 0,
9174-
version: "18.3.0-canary-95ec12839-20240205",
9153+
version: "18.3.0-canary-472854820-20240205",
91759154
rendererPackageName: "react-test-renderer"
91769155
};
91779156
var internals$jscomp$inline_1190 = {
@@ -9202,7 +9181,7 @@ var internals$jscomp$inline_1190 = {
92029181
scheduleRoot: null,
92039182
setRefreshHandler: null,
92049183
getCurrentFiber: null,
9205-
reconcilerVersion: "18.3.0-canary-95ec12839-20240205"
9184+
reconcilerVersion: "18.3.0-canary-472854820-20240205"
92069185
};
92079186
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
92089187
var hook$jscomp$inline_1191 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

0 commit comments

Comments
 (0)