Skip to content

Commit 1c19e01

Browse files
committed
Turn on enableRenderableContext for www (#28438)
We can land for www now DiffTrain build for [6c3b8db](6c3b8db)
1 parent d303b62 commit 1c19e01

36 files changed

+2702
-3733
lines changed

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

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ if (__DEV__) {
109109

110110
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
111111
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
112-
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
113112
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
114113
// On WWW, false is used for a new modern build.
114+
var enableRenderableContext = true;
115115

116116
function getWrappedName(outerType, innerType, wrapperName) {
117117
var displayName = outerType.displayName;
@@ -193,30 +193,21 @@ if (__DEV__) {
193193
}
194194

195195
switch (type.$$typeof) {
196-
case REACT_PROVIDER_TYPE:
197-
if (enableRenderableContext) {
198-
return null;
199-
} else {
200-
var provider = type;
201-
return getContextName(provider._context) + ".Provider";
202-
}
196+
case REACT_PROVIDER_TYPE: {
197+
return null;
198+
}
203199

204200
case REACT_CONTEXT_TYPE:
205201
var context = type;
206202

207-
if (enableRenderableContext) {
203+
{
208204
return getContextName(context) + ".Provider";
209-
} else {
210-
return getContextName(context) + ".Consumer";
211205
}
212206

213-
case REACT_CONSUMER_TYPE:
214-
if (enableRenderableContext) {
215-
var consumer = type;
216-
return getContextName(consumer._context) + ".Consumer";
217-
} else {
218-
return null;
219-
}
207+
case REACT_CONSUMER_TYPE: {
208+
var consumer = type;
209+
return getContextName(consumer._context) + ".Consumer";
210+
}
220211

221212
case REACT_FORWARD_REF_TYPE:
222213
return getWrappedName(type, type.render, "ForwardRef");
@@ -356,8 +347,8 @@ if (__DEV__) {
356347
type.$$typeof === REACT_LAZY_TYPE ||
357348
type.$$typeof === REACT_MEMO_TYPE ||
358349
type.$$typeof === REACT_CONTEXT_TYPE ||
359-
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_TYPE) ||
360-
(enableRenderableContext && type.$$typeof === REACT_CONSUMER_TYPE) ||
350+
!enableRenderableContext ||
351+
type.$$typeof === REACT_CONSUMER_TYPE ||
361352
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
362353
// types supported by any Flight configuration anywhere since
363354
// we don't know which Flight build this will end up being used

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

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ if (__DEV__) {
109109

110110
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
111111
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
112-
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
113112
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
114113
// On WWW, true is used for a new modern build.
114+
var enableRenderableContext = true;
115115

116116
function getWrappedName(outerType, innerType, wrapperName) {
117117
var displayName = outerType.displayName;
@@ -193,30 +193,21 @@ if (__DEV__) {
193193
}
194194

195195
switch (type.$$typeof) {
196-
case REACT_PROVIDER_TYPE:
197-
if (enableRenderableContext) {
198-
return null;
199-
} else {
200-
var provider = type;
201-
return getContextName(provider._context) + ".Provider";
202-
}
196+
case REACT_PROVIDER_TYPE: {
197+
return null;
198+
}
203199

204200
case REACT_CONTEXT_TYPE:
205201
var context = type;
206202

207-
if (enableRenderableContext) {
203+
{
208204
return getContextName(context) + ".Provider";
209-
} else {
210-
return getContextName(context) + ".Consumer";
211205
}
212206

213-
case REACT_CONSUMER_TYPE:
214-
if (enableRenderableContext) {
215-
var consumer = type;
216-
return getContextName(consumer._context) + ".Consumer";
217-
} else {
218-
return null;
219-
}
207+
case REACT_CONSUMER_TYPE: {
208+
var consumer = type;
209+
return getContextName(consumer._context) + ".Consumer";
210+
}
220211

221212
case REACT_FORWARD_REF_TYPE:
222213
return getWrappedName(type, type.render, "ForwardRef");
@@ -356,8 +347,8 @@ if (__DEV__) {
356347
type.$$typeof === REACT_LAZY_TYPE ||
357348
type.$$typeof === REACT_MEMO_TYPE ||
358349
type.$$typeof === REACT_CONTEXT_TYPE ||
359-
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_TYPE) ||
360-
(enableRenderableContext && type.$$typeof === REACT_CONSUMER_TYPE) ||
350+
!enableRenderableContext ||
351+
type.$$typeof === REACT_CONSUMER_TYPE ||
361352
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
362353
// types supported by any Flight configuration anywhere since
363354
// we don't know which Flight build this will end up being used

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
239d06e2b8b0f2dabd6bc154e5f24d594ac5840d
1+
6c3b8dbfed6f879440f484bd0bf801fac67ec684

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

Lines changed: 13 additions & 80 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-aa607e2a";
27+
var ReactVersion = "18.3.0-www-classic-c6726149";
2828

2929
// ATTENTION
3030
// When adding new symbols to this file,
@@ -475,9 +475,9 @@ if (__DEV__) {
475475

476476
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
477477
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
478-
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
479478
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
480479
// On WWW, false is used for a new modern build.
480+
var enableRenderableContext = true;
481481

482482
function getWrappedName(outerType, innerType, wrapperName) {
483483
var displayName = outerType.displayName;
@@ -559,30 +559,21 @@ if (__DEV__) {
559559
}
560560

561561
switch (type.$$typeof) {
562-
case REACT_PROVIDER_TYPE:
563-
if (enableRenderableContext) {
564-
return null;
565-
} else {
566-
var provider = type;
567-
return getContextName(provider._context) + ".Provider";
568-
}
562+
case REACT_PROVIDER_TYPE: {
563+
return null;
564+
}
569565

570566
case REACT_CONTEXT_TYPE:
571567
var context = type;
572568

573-
if (enableRenderableContext) {
569+
{
574570
return getContextName(context) + ".Provider";
575-
} else {
576-
return getContextName(context) + ".Consumer";
577571
}
578572

579-
case REACT_CONSUMER_TYPE:
580-
if (enableRenderableContext) {
581-
var consumer = type;
582-
return getContextName(consumer._context) + ".Consumer";
583-
} else {
584-
return null;
585-
}
573+
case REACT_CONSUMER_TYPE: {
574+
var consumer = type;
575+
return getContextName(consumer._context) + ".Consumer";
576+
}
586577

587578
case REACT_FORWARD_REF_TYPE:
588579
return getWrappedName(type, type.render, "ForwardRef");
@@ -731,8 +722,8 @@ if (__DEV__) {
731722
type.$$typeof === REACT_LAZY_TYPE ||
732723
type.$$typeof === REACT_MEMO_TYPE ||
733724
type.$$typeof === REACT_CONTEXT_TYPE ||
734-
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_TYPE) ||
735-
(enableRenderableContext && type.$$typeof === REACT_CONSUMER_TYPE) ||
725+
!enableRenderableContext ||
726+
type.$$typeof === REACT_CONSUMER_TYPE ||
736727
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
737728
// types supported by any Flight configuration anywhere since
738729
// we don't know which Flight build this will end up being used
@@ -2640,70 +2631,12 @@ if (__DEV__) {
26402631
Consumer: null
26412632
};
26422633

2643-
if (enableRenderableContext) {
2634+
{
26442635
context.Provider = context;
26452636
context.Consumer = {
26462637
$$typeof: REACT_CONSUMER_TYPE,
26472638
_context: context
26482639
};
2649-
} else {
2650-
context.Provider = {
2651-
$$typeof: REACT_PROVIDER_TYPE,
2652-
_context: context
2653-
};
2654-
2655-
{
2656-
var Consumer = {
2657-
$$typeof: REACT_CONTEXT_TYPE,
2658-
_context: context
2659-
};
2660-
Object.defineProperties(Consumer, {
2661-
Provider: {
2662-
get: function () {
2663-
return context.Provider;
2664-
},
2665-
set: function (_Provider) {
2666-
context.Provider = _Provider;
2667-
}
2668-
},
2669-
_currentValue: {
2670-
get: function () {
2671-
return context._currentValue;
2672-
},
2673-
set: function (_currentValue) {
2674-
context._currentValue = _currentValue;
2675-
}
2676-
},
2677-
_currentValue2: {
2678-
get: function () {
2679-
return context._currentValue2;
2680-
},
2681-
set: function (_currentValue2) {
2682-
context._currentValue2 = _currentValue2;
2683-
}
2684-
},
2685-
_threadCount: {
2686-
get: function () {
2687-
return context._threadCount;
2688-
},
2689-
set: function (_threadCount) {
2690-
context._threadCount = _threadCount;
2691-
}
2692-
},
2693-
Consumer: {
2694-
get: function () {
2695-
return context.Consumer;
2696-
}
2697-
},
2698-
displayName: {
2699-
get: function () {
2700-
return context.displayName;
2701-
},
2702-
set: function (displayName) {}
2703-
}
2704-
});
2705-
context.Consumer = Consumer;
2706-
}
27072640
}
27082641

27092642
{

0 commit comments

Comments
 (0)