Skip to content

Commit

Permalink
Remove ReactTestUtils from ReactJSXElementValidator (#28335)
Browse files Browse the repository at this point in the history
DiffTrain build for [e7849b5](e7849b5)
  • Loading branch information
eps1lon committed Feb 27, 2024
1 parent d76cf6b commit b45dfde
Show file tree
Hide file tree
Showing 36 changed files with 3,733 additions and 2,702 deletions.
31 changes: 20 additions & 11 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,21 +193,30 @@ if (__DEV__) {
}

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

case REACT_CONTEXT_TYPE:
var context = type;

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

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

case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
Expand Down Expand Up @@ -347,8 +356,8 @@ if (__DEV__) {
type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
!enableRenderableContext ||
type.$$typeof === REACT_CONSUMER_TYPE ||
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_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: 20 additions & 11 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,21 +193,30 @@ if (__DEV__) {
}

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

case REACT_CONTEXT_TYPE:
var context = type;

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

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

case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
Expand Down Expand Up @@ -347,8 +356,8 @@ if (__DEV__) {
type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
!enableRenderableContext ||
type.$$typeof === REACT_CONSUMER_TYPE ||
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_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 @@
c9798954e26a2354a951cc65607f2901a45bf035
e7849b50bcefc0742ca342d70284d82cfcf990e5
93 changes: 80 additions & 13 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-e2cea41c";
var ReactVersion = "18.3.0-www-classic-7829c2f7";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -401,9 +401,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;

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down Expand Up @@ -559,21 +559,30 @@ if (__DEV__) {
}

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

case REACT_CONTEXT_TYPE:
var context = type;

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

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

case REACT_FORWARD_REF_TYPE:
return getWrappedName(type, type.render, "ForwardRef");
Expand Down Expand Up @@ -722,8 +731,8 @@ if (__DEV__) {
type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
!enableRenderableContext ||
type.$$typeof === REACT_CONSUMER_TYPE ||
(!enableRenderableContext && type.$$typeof === REACT_PROVIDER_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 @@ -2639,12 +2648,70 @@ 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 b45dfde

Please sign in to comment.