Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shouldDeprioritizeSubtree from host config #19124

Merged
merged 1 commit into from Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions packages/react-art/src/ReactARTHostConfig.js
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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