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

Cleanup enableFloat flag #28613

Merged
merged 1 commit into from
Mar 22, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {

import {getParentSuspenseInstance} from './ReactFiberConfigDOM';

import {enableScopeAPI, enableFloat} from 'shared/ReactFeatureFlags';
import {enableScopeAPI} from 'shared/ReactFeatureFlags';

const randomKey = Math.random().toString(36).slice(2);
const internalInstanceKey = '__reactFiber$' + randomKey;
Expand Down Expand Up @@ -175,7 +175,7 @@ export function getInstanceFromNode(node: Node): Fiber | null {
tag === HostComponent ||
tag === HostText ||
tag === SuspenseComponent ||
(enableFloat ? tag === HostHoistable : false) ||
tag === HostHoistable ||
tag === HostSingleton ||
tag === HostRoot
) {
Expand All @@ -195,7 +195,7 @@ export function getNodeFromInstance(inst: Fiber): Instance | TextInstance {
const tag = inst.tag;
if (
tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
tag === HostHoistable ||
tag === HostSingleton ||
tag === HostText
) {
Expand Down
22 changes: 0 additions & 22 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ import {
enableBigIntSupport,
enableCreateEventHandleAPI,
enableScopeAPI,
enableFloat,
enableTrustedTypesIntegration,
enableFormActions,
enableAsyncActions,
Expand Down Expand Up @@ -2161,25 +2160,16 @@ function preconnectAs(
}

function prefetchDNS(href: string) {
if (!enableFloat) {
return;
}
previousDispatcher.prefetchDNS(href);
preconnectAs('dns-prefetch', href, null);
}

function preconnect(href: string, crossOrigin?: ?CrossOriginEnum) {
if (!enableFloat) {
return;
}
previousDispatcher.preconnect(href, crossOrigin);
preconnectAs('preconnect', href, crossOrigin);
}

function preload(href: string, as: string, options?: ?PreloadImplOptions) {
if (!enableFloat) {
return;
}
previousDispatcher.preload(href, as, options);
const ownerDocument = getGlobalDocument();
if (ownerDocument && href && as) {
Expand Down Expand Up @@ -2258,9 +2248,6 @@ function preload(href: string, as: string, options?: ?PreloadImplOptions) {
}

function preloadModule(href: string, options?: ?PreloadModuleImplOptions) {
if (!enableFloat) {
return;
}
previousDispatcher.preloadModule(href, options);
const ownerDocument = getGlobalDocument();
if (ownerDocument && href) {
Expand Down Expand Up @@ -2322,9 +2309,6 @@ function preinitStyle(
precedence: ?string,
options?: ?PreinitStyleOptions,
) {
if (!enableFloat) {
return;
}
previousDispatcher.preinitStyle(href, precedence, options);

const ownerDocument = getGlobalDocument();
Expand Down Expand Up @@ -2399,9 +2383,6 @@ function preinitStyle(
}

function preinitScript(src: string, options?: ?PreinitScriptOptions) {
if (!enableFloat) {
return;
}
previousDispatcher.preinitScript(src, options);

const ownerDocument = getGlobalDocument();
Expand Down Expand Up @@ -2458,9 +2439,6 @@ function preinitModuleScript(
src: string,
options?: ?PreinitModuleScriptOptions,
) {
if (!enableFloat) {
return;
}
previousDispatcher.preinitModuleScript(src, options);

const ownerDocument = getGlobalDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import {
enableLegacyFBSupport,
enableCreateEventHandleAPI,
enableScopeAPI,
enableFloat,
enableFormActions,
} from 'shared/ReactFeatureFlags';
import {createEventListenerWrapperWithPriority} from './ReactDOMEventListener';
Expand Down Expand Up @@ -647,7 +646,7 @@ export function dispatchEventForPluginEventSystem(
if (
parentTag === HostComponent ||
parentTag === HostText ||
(enableFloat ? parentTag === HostHoistable : false) ||
parentTag === HostHoistable ||
parentTag === HostSingleton
) {
node = ancestorInst = parentNode;
Expand Down Expand Up @@ -705,7 +704,7 @@ export function accumulateSinglePhaseListeners(
// Handle listeners that are on HostComponents (i.e. <div>)
if (
(tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
tag === HostHoistable ||
tag === HostSingleton) &&
stateNode !== null
) {
Expand Down Expand Up @@ -819,7 +818,7 @@ export function accumulateTwoPhaseListeners(
// Handle listeners that are on HostComponents (i.e. <div>)
if (
(tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
tag === HostHoistable ||
tag === HostSingleton) &&
stateNode !== null
) {
Expand Down Expand Up @@ -922,7 +921,7 @@ function accumulateEnterLeaveListenersForEvent(
}
if (
(tag === HostComponent ||
(enableFloat ? tag === HostHoistable : false) ||
tag === HostHoistable ||
tag === HostSingleton) &&
stateNode !== null
) {
Expand Down
Loading