Skip to content

Commit

Permalink
Remove shouldDeprioritizeSubtree from host config (#19124)
Browse files Browse the repository at this point in the history
No longer being used.
  • Loading branch information
acdlite committed Jun 12, 2020
1 parent 8f05f2b commit 103ed08
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 68 deletions.
4 changes: 0 additions & 4 deletions packages/react-art/src/ReactARTHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,6 @@ export function resetTextContent(domElement) {
// Noop
}

export function shouldDeprioritizeSubtree(type, props) {
return false;
}

export function getRootHostContext() {
return NO_CONTEXT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
5 changes: 1 addition & 4 deletions packages/react-dom/src/__tests__/ReactUpdates-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 0 additions & 6 deletions packages/react-dom/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-native-renderer/src/ReactFabricHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-native-renderer/src/ReactNativeHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions packages/react-noop-renderer/src/createReactNoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions packages/react-refresh/src/__tests__/ReactFresh-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 0 additions & 4 deletions packages/react-test-renderer/src/ReactTestHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 103ed08

Please sign in to comment.