Skip to content

Commit

Permalink
Turn on enableRenderableContext for www (#28438)
Browse files Browse the repository at this point in the history
We can land for www now

DiffTrain build for [6c3b8db](6c3b8db)
  • Loading branch information
rickhanlonii committed Feb 26, 2024
1 parent d303b62 commit 1c19e01
Show file tree
Hide file tree
Showing 36 changed files with 2,702 additions and 3,733 deletions.
31 changes: 11 additions & 20 deletions compiled/facebook-www/JSXDEVRuntime-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ if (__DEV__) {

var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
// On WWW, false is used for a new modern build.
var enableRenderableContext = true;

function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
Expand Down Expand Up @@ -193,30 +193,21 @@ if (__DEV__) {
}

switch (type.$$typeof) {
case REACT_PROVIDER_TYPE:
if (enableRenderableContext) {
return null;
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case REACT_PROVIDER_TYPE: {
return null;
}

case REACT_CONTEXT_TYPE:
var context = type;

if (enableRenderableContext) {
{
return getContextName(context) + ".Provider";
} else {
return getContextName(context) + ".Consumer";
}

case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_CONSUMER_TYPE: {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
}

case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
Expand Down Expand Up @@ -356,8 +347,8 @@ if (__DEV__) {
type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_TYPE) ||
(enableRenderableContext && type.$$typeof === REACT_CONSUMER_TYPE) ||
!enableRenderableContext ||
type.$$typeof === REACT_CONSUMER_TYPE ||
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
Expand Down
31 changes: 11 additions & 20 deletions compiled/facebook-www/JSXDEVRuntime-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ if (__DEV__) {

var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
// On WWW, true is used for a new modern build.
var enableRenderableContext = true;

function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
Expand Down Expand Up @@ -193,30 +193,21 @@ if (__DEV__) {
}

switch (type.$$typeof) {
case REACT_PROVIDER_TYPE:
if (enableRenderableContext) {
return null;
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case REACT_PROVIDER_TYPE: {
return null;
}

case REACT_CONTEXT_TYPE:
var context = type;

if (enableRenderableContext) {
{
return getContextName(context) + ".Provider";
} else {
return getContextName(context) + ".Consumer";
}

case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_CONSUMER_TYPE: {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
}

case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
Expand Down Expand Up @@ -356,8 +347,8 @@ if (__DEV__) {
type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_TYPE) ||
(enableRenderableContext && type.$$typeof === REACT_CONSUMER_TYPE) ||
!enableRenderableContext ||
type.$$typeof === REACT_CONSUMER_TYPE ||
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
239d06e2b8b0f2dabd6bc154e5f24d594ac5840d
6c3b8dbfed6f879440f484bd0bf801fac67ec684
93 changes: 13 additions & 80 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-www-classic-aa607e2a";
var ReactVersion = "18.3.0-www-classic-c6726149";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -475,9 +475,9 @@ if (__DEV__) {

var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
enableRenderableContext = dynamicFeatureFlags.enableRenderableContext,
enableRefAsProp = dynamicFeatureFlags.enableRefAsProp;
// On WWW, false is used for a new modern build.
var enableRenderableContext = true;

function getWrappedName(outerType, innerType, wrapperName) {
var displayName = outerType.displayName;
Expand Down Expand Up @@ -559,30 +559,21 @@ if (__DEV__) {
}

switch (type.$$typeof) {
case REACT_PROVIDER_TYPE:
if (enableRenderableContext) {
return null;
} else {
var provider = type;
return getContextName(provider._context) + ".Provider";
}
case REACT_PROVIDER_TYPE: {
return null;
}

case REACT_CONTEXT_TYPE:
var context = type;

if (enableRenderableContext) {
{
return getContextName(context) + ".Provider";
} else {
return getContextName(context) + ".Consumer";
}

case REACT_CONSUMER_TYPE:
if (enableRenderableContext) {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
} else {
return null;
}
case REACT_CONSUMER_TYPE: {
var consumer = type;
return getContextName(consumer._context) + ".Consumer";
}

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

if (enableRenderableContext) {
{
context.Provider = context;
context.Consumer = {
$$typeof: REACT_CONSUMER_TYPE,
_context: context
};
} else {
context.Provider = {
$$typeof: REACT_PROVIDER_TYPE,
_context: context
};

{
var Consumer = {
$$typeof: REACT_CONTEXT_TYPE,
_context: context
};
Object.defineProperties(Consumer, {
Provider: {
get: function () {
return context.Provider;
},
set: function (_Provider) {
context.Provider = _Provider;
}
},
_currentValue: {
get: function () {
return context._currentValue;
},
set: function (_currentValue) {
context._currentValue = _currentValue;
}
},
_currentValue2: {
get: function () {
return context._currentValue2;
},
set: function (_currentValue2) {
context._currentValue2 = _currentValue2;
}
},
_threadCount: {
get: function () {
return context._threadCount;
},
set: function (_threadCount) {
context._threadCount = _threadCount;
}
},
Consumer: {
get: function () {
return context.Consumer;
}
},
displayName: {
get: function () {
return context.displayName;
},
set: function (displayName) {}
}
});
context.Consumer = Consumer;
}
}

{
Expand Down
Loading

0 comments on commit 1c19e01

Please sign in to comment.