Remove shouldDeprioritizeSubtree from host config (#19124)

No longer being used.
This commit is contained in:
Andrew Clark 2020-06-12 12:57:20 -07:00 committed by GitHub
parent 8f05f2bd6d
commit 103ed08c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 10 additions and 68 deletions

View File

@ -323,10 +323,6 @@ export function resetTextContent(domElement) {
// Noop
}
export function shouldDeprioritizeSubtree(type, props) {
return false;
}
export function getRootHostContext() {
return NO_CONTEXT;
}

View File

@ -91,10 +91,7 @@ describe('ReactDOMServerPartialHydration', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -29,10 +29,7 @@ describe('ReactUpdates', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -371,12 +371,6 @@ export function shouldSetTextContent(type: string, props: Props): boolean {
);
}
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
// This is obnoxiously specific so that nobody uses it, but we can still opt
// in via an infra-level userspace abstraction.
return props.hidden === 'unstable-do-not-use-legacy-hidden';
}
export function createTextInstance(
text: string,
rootContainerInstance: Container,

View File

@ -329,10 +329,6 @@ export function resetAfterCommit(containerInfo: Container): void {
// Noop
}
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
return false;
}
export function shouldSetTextContent(type: string, props: Props): boolean {
// TODO (bvaughn) Revisit this decision.
// Always returning false simplifies the createInstance() implementation,

View File

@ -248,10 +248,6 @@ export const scheduleTimeout = setTimeout;
export const cancelTimeout = clearTimeout;
export const noTimeout = -1;
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
return false;
}
export function shouldSetTextContent(type: string, props: Props): boolean {
// TODO (bvaughn) Revisit this decision.
// Always returning false simplifies the createInstance() implementation,

View File

@ -335,10 +335,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
shouldSetTextContent,
shouldDeprioritizeSubtree(type: string, props: Props): boolean {
return !!props.hidden;
},
createTextInstance(
text: string,
rootContainerInstance: Container,

View File

@ -28,10 +28,7 @@ describe('ReactIncremental', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -49,10 +49,7 @@ describe('ReactIncrementalErrorHandling', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -42,10 +42,7 @@ describe('ReactIncrementalSideEffects', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -46,10 +46,7 @@ describe('ReactNewContext', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -57,10 +57,7 @@ describe('ReactSchedulerIntegration', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -144,10 +144,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -51,8 +51,6 @@ export const appendInitialChild = $$$hostConfig.appendInitialChild;
export const finalizeInitialChildren = $$$hostConfig.finalizeInitialChildren;
export const prepareUpdate = $$$hostConfig.prepareUpdate;
export const shouldSetTextContent = $$$hostConfig.shouldSetTextContent;
export const shouldDeprioritizeSubtree =
$$$hostConfig.shouldDeprioritizeSubtree;
export const createTextInstance = $$$hostConfig.createTextInstance;
export const scheduleTimeout = $$$hostConfig.scheduleTimeout;
export const cancelTimeout = $$$hostConfig.cancelTimeout;

View File

@ -79,10 +79,7 @@ describe('ReactFresh', () => {
// once the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}

View File

@ -218,10 +218,6 @@ export function shouldSetTextContent(type: string, props: Props): boolean {
return false;
}
export function shouldDeprioritizeSubtree(type: string, props: Props): boolean {
return false;
}
export function createTextInstance(
text: string,
rootContainerInstance: Container,

View File

@ -59,10 +59,7 @@ function loadModules() {
// the extra div wrapper is no longer neccessary.
function LegacyHiddenDiv({children, mode}) {
return (
<div
hidden={
mode === 'hidden' ? 'unstable-do-not-use-legacy-hidden' : undefined
}>
<div hidden={mode === 'hidden'}>
<React.unstable_LegacyHidden
mode={mode === 'hidden' ? 'unstable-defer-without-hiding' : mode}>
{children}