Revert "Rename HostConfig files to FiberConfig to clarify they are configs fo… (#26592)"

This reverts commit b55d319559.
This commit is contained in:
Jan Kassens
2023-04-17 16:24:26 -04:00
parent 87fb8eaaa2
commit ec8edaf2a0
74 changed files with 167 additions and 167 deletions
@@ -238,13 +238,13 @@ function applyTextProps(instance, props, prevProps = {}) {
}
}
export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberConfigWithNoSingletons';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
export function appendInitialChild(parentInstance, child) {
if (typeof child === 'string') {
@@ -21,7 +21,7 @@ import type {
Props,
HoistableRoot,
RootResources,
} from './ReactFiberConfigDOM';
} from './ReactDOMHostConfig';
import {
HostComponent,
@@ -32,7 +32,7 @@ import {
SuspenseComponent,
} from 'react-reconciler/src/ReactWorkTags';
import {getParentSuspenseInstance} from './ReactFiberConfigDOM';
import {getParentSuspenseInstance} from './ReactDOMHostConfig';
import {
enableScopeAPI,
@@ -179,7 +179,7 @@ const STYLE = 'style';
let eventsEnabled: ?boolean = null;
let selectionInformation: null | SelectionInformation = null;
export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence';
function getOwnerDocumentFromRootContainer(
rootContainerElement: Element | Document | DocumentFragment,
@@ -10,7 +10,7 @@
import type {EventPriority} from 'react-reconciler/src/ReactEventPriorities';
import type {AnyNativeEvent} from '../events/PluginModuleType';
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {Container, SuspenseInstance} from '../client/ReactFiberConfigDOM';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMEventName} from '../events/DOMEventNames';
import {
@@ -8,7 +8,7 @@
*/
import type {AnyNativeEvent} from '../events/PluginModuleType';
import type {Container, SuspenseInstance} from '../client/ReactFiberConfigDOM';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMEventName} from '../events/DOMEventNames';
import type {EventSystemFlags} from './EventSystemFlags';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
+1 -1
View File
@@ -7,7 +7,7 @@
*/
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {Props} from '../client/ReactFiberConfigDOM';
import type {Props} from '../client/ReactDOMHostConfig';
import {getFiberCurrentPropsFromNode} from '../client/ReactDOMComponentTree';
@@ -6,7 +6,7 @@
*
* @flow
*/
import type {TextInstance, Instance} from '../../client/ReactFiberConfigDOM';
import type {TextInstance, Instance} from '../../client/ReactDOMHostConfig';
import type {AnyNativeEvent} from '../PluginModuleType';
import type {DOMEventName} from '../DOMEventNames';
import type {DispatchQueue} from '../DOMPluginEventSystem';
@@ -63,7 +63,7 @@ export function completeBoundary(suspenseBoundaryID, contentID, errorDigest) {
if (!errorDigest) {
// Clear all the existing children. This is complicated because
// there can be embedded Suspense boundaries in the fallback.
// This is similar to clearSuspenseBoundary in ReactFiberConfigDOM.
// This is similar to clearSuspenseBoundary in ReactDOMHostConfig.
// TODO: We could avoid this if we never emitted suspense boundaries in fallback trees.
// They never hydrate anyway. However, currently we support incrementally loading the fallback.
const parentInstance = suspenseNode.parentNode;
+1 -1
View File
@@ -11,7 +11,7 @@ import type {ReactNodeList} from 'shared/ReactTypes';
import type {
Container,
PublicInstance,
} from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
} from 'react-dom-bindings/src/client/ReactDOMHostConfig';
import type {
RootType,
HydrateRootOptions,
+2 -2
View File
@@ -10,11 +10,11 @@
import type {
Container,
PublicInstance,
} from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
} from 'react-dom-bindings/src/client/ReactDOMHostConfig';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {ReactNodeList} from 'shared/ReactTypes';
import {clearContainer} from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
import {clearContainer} from 'react-dom-bindings/src/client/ReactDOMHostConfig';
import {
getInstanceFromNode,
isContainerMarkedAsRoot,
+1 -1
View File
@@ -15,7 +15,7 @@ import type {
import ReactDOMSharedInternals from '../ReactDOMSharedInternals';
const {Dispatcher} = ReactDOMSharedInternals;
import {ReactDOMClientDispatcher} from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
import {ReactDOMClientDispatcher} from 'react-dom-bindings/src/client/ReactDOMHostConfig';
import {queueExplicitHydrationTarget} from 'react-dom-bindings/src/events/ReactDOMEventReplaying';
import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols';
import {
+1 -1
View File
@@ -40,7 +40,7 @@ import {
sendAccessibilityEvent,
getNodeFromInternalInstanceHandle,
} from './ReactNativePublicCompat';
import {getPublicInstanceFromInternalInstanceHandle} from './ReactFiberConfigFabric';
import {getPublicInstanceFromInternalInstanceHandle} from './ReactFabricHostConfig';
// $FlowFixMe[missing-local-annot]
function onRecoverableError(error) {
@@ -12,9 +12,9 @@ import type {
Instance,
Props,
TextInstance,
} from './ReactFiberConfigFabric';
} from './ReactFabricHostConfig';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import {getPublicInstance} from './ReactFiberConfigFabric';
import {getPublicInstance} from './ReactFabricHostConfig';
// `node` is typed incorrectly here. The proper type should be `PublicInstance`.
// This is ok in DOM because they types are interchangeable, but in React Native
@@ -29,7 +29,7 @@ import getListener from './ReactNativeGetListener';
import {runEventsInBatch} from './legacy-events/EventBatching';
import {RawEventEmitter} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
import {getPublicInstance} from './ReactFiberConfigFabric';
import {getPublicInstance} from './ReactFabricHostConfig';
export {getListener, registrationNameModules as registrationNames};
@@ -108,13 +108,13 @@ if (registerEventHandler) {
registerEventHandler(dispatchEvent);
}
export * from 'react-reconciler/src/ReactFiberConfigWithNoMutation';
export * from 'react-reconciler/src/ReactFiberConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberConfigWithNoSingletons';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMutation';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
export function appendInitialChild(
parentInstance: Instance,
@@ -16,7 +16,7 @@ import type {
INativeMethods,
ViewConfig,
} from './ReactNativeTypes';
import type {Instance} from './ReactFiberConfigNative';
import type {Instance} from './ReactNativeHostConfig';
// Modules provided by RN:
import {
@@ -84,13 +84,13 @@ function recursivelyUncacheFiberNode(node: Instance | TextInstance) {
}
}
export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberConfigWithNoSingletons';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoScopes';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
export function appendInitialChild(
parentInstance: Instance,
+7 -7
View File
@@ -51,15 +51,15 @@ const HostConfig = {
* **[Building a simple custom renderer to DOM](https://medium.com/@agent_hunt/hello-world-custom-react-renderer-9a95b7cd04bc)**
* **[Building a simple custom renderer to native](https://medium.com/@agent_hunt/introduction-to-react-native-renderers-aka-react-native-is-the-java-and-react-native-renderers-are-828a0022f433)**
The full list of supported methods [can be found here](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberConfig.custom.js). For their signatures, we recommend looking at specific examples below.
The full list of supported methods [can be found here](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). For their signatures, we recommend looking at specific examples below.
The React repository includes several renderers. Each of them has its own host config.
The examples in the React repository are declared a bit differently than a third-party renderer would be. In particular, the `HostConfig` object mentioned above is never explicitly declared, and instead is a *module* in our code. However, its exports correspond directly to properties on a `HostConfig` object you'd need to declare in your code:
* [React ART](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactFiberConfigART.js)
* [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js)
* [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactFiberConfigNative.js)
* [React ART](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactARTHostConfig.js)
* [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/client/ReactDOMHostConfig.js)
* [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeHostConfig.js)
If these links break please file an issue and well fix them. They intentionally link to the latest versions since the API is still evolving. If you have more questions please file an issue and well try to help!
@@ -240,7 +240,7 @@ The constant you return depends on which event, if any, is being handled right n
* **Other events / No active event:** In all other cases, return `DefaultEventPriority`. This tells React that this event is considered background work, and interactive events will be prioritized over it.
You can consult the `getCurrentEventPriority()` implementation in `ReactFiberConfigDOM.js` for a reference implementation.
You can consult the `getCurrentEventPriority()` implementation in `ReactDOMHostConfig.js` for a reference implementation.
### Mutation Methods
@@ -328,10 +328,10 @@ This method should mutate the `container` root node and remove all children from
### Persistence Methods
If you use the persistent mode instead of the mutation mode, you would still need the "Core Methods". However, instead of the Mutation Methods above you will implement a different set of methods that performs cloning nodes and replacing them at the root level. You can find a list of them in the "Persistence" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberConfig.custom.js). File an issue if you need help.
If you use the persistent mode instead of the mutation mode, you would still need the "Core Methods". However, instead of the Mutation Methods above you will implement a different set of methods that performs cloning nodes and replacing them at the root level. You can find a list of them in the "Persistence" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
### Hydration Methods
You can optionally implement hydration to "attach" to the existing tree during the initial render instead of creating it from scratch. For example, the DOM renderer uses this to attach to an HTML markup.
To support hydration, you need to declare `supportsHydration: true` and then implement the methods in the "Hydration" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberConfig.custom.js). File an issue if you need help.
To support hydration, you need to declare `supportsHydration: true` and then implement the methods in the "Hydration" section [listed in this file](https://github.com/facebook/react/blob/main/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js). File an issue if you need help.
+2 -2
View File
@@ -14,7 +14,7 @@ import type {RootTag} from './ReactRootTags';
import type {WorkTag} from './ReactWorkTags';
import type {TypeOfMode} from './ReactTypeOfMode';
import type {Lanes} from './ReactFiberLane';
import type {SuspenseInstance} from './ReactFiberConfig';
import type {SuspenseInstance} from './ReactFiberHostConfig';
import type {
OffscreenProps,
OffscreenInstance,
@@ -26,7 +26,7 @@ import {
supportsSingletons,
isHostHoistableType,
isHostSingletonType,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {
createRootStrictEffectsByDefault,
enableCache,
+1 -1
View File
@@ -11,7 +11,7 @@ import type {Fiber} from './ReactFiber';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import {warnsIfNotActing} from './ReactFiberConfig';
import {warnsIfNotActing} from './ReactFiberHostConfig';
const {ReactCurrentActQueue} = ReactSharedInternals;
+2 -2
View File
@@ -168,8 +168,8 @@ import {
isPrimaryRenderer,
getResource,
createHoistableInstance,
} from './ReactFiberConfig';
import type {SuspenseInstance} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {SuspenseInstance} from './ReactFiberHostConfig';
import {shouldError, shouldSuspend} from './ReactFiberReconciler';
import {
pushHostContext,
+2 -2
View File
@@ -15,7 +15,7 @@ import type {
ChildSet,
UpdatePayload,
HoistableRoot,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {Fiber, FiberRoot} from './ReactInternalTypes';
import type {Lanes} from './ReactFiberLane';
import {NoTimestamp, SyncLane} from './ReactFiberLane';
@@ -162,7 +162,7 @@ import {
prepareToCommitHoistables,
suspendInstance,
suspendResource,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {
captureCommitPhaseError,
resolveRetryWakeable,
+2 -2
View File
@@ -18,7 +18,7 @@ import type {
Container,
ChildSet,
Resource,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {
SuspenseState,
SuspenseListRenderState,
@@ -115,7 +115,7 @@ import {
mayResourceSuspendCommit,
preloadInstance,
preloadResource,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {
getRootHostContainer,
popHostContext,
+2 -2
View File
@@ -9,9 +9,9 @@
import type {Fiber} from './ReactInternalTypes';
import type {StackCursor} from './ReactFiberStack';
import type {Container, HostContext} from './ReactFiberConfig';
import type {Container, HostContext} from './ReactFiberHostConfig';
import {getChildHostContext, getRootHostContext} from './ReactFiberConfig';
import {getChildHostContext, getRootHostContext} from './ReactFiberHostConfig';
import {createCursor, push, pop} from './ReactFiberStack';
const contextStackCursor: StackCursor<HostContext | null> = createCursor(null);
+2 -2
View File
@@ -11,7 +11,7 @@
import type {ReactElement} from 'shared/ReactElementType';
import type {Fiber, FiberRoot} from './ReactInternalTypes';
import type {Instance} from './ReactFiberConfig';
import type {Instance} from './ReactFiberHostConfig';
import type {ReactNodeList} from 'shared/ReactTypes';
import {enableHostSingletons, enableFloat} from 'shared/ReactFeatureFlags';
@@ -41,7 +41,7 @@ import {
REACT_MEMO_TYPE,
REACT_LAZY_TYPE,
} from 'shared/ReactSymbols';
import {supportsSingletons} from './ReactFiberConfig';
import {supportsSingletons} from './ReactFiberHostConfig';
export type Family = {
current: any,
@@ -16,7 +16,7 @@ import type {
SuspenseInstance,
Container,
HostContext,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {SuspenseState} from './ReactFiberSuspenseComponent';
import type {TreeContext} from './ReactFiberTreeContext';
import type {CapturedValue} from './ReactCapturedValue';
@@ -81,7 +81,7 @@ import {
canHydrateSuspenseInstance,
isHydratableType,
isHydratableText,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {OffscreenLane} from './ReactFiberLane';
import {
getSuspendedTreeContext,
+1 -1
View File
@@ -17,7 +17,7 @@ import type {StackCursor} from './ReactFiberStack';
import type {Lanes} from './ReactFiberLane';
import type {SharedQueue} from './ReactFiberClassUpdateQueue';
import {isPrimaryRenderer} from './ReactFiberConfig';
import {isPrimaryRenderer} from './ReactFiberHostConfig';
import {createCursor, push, pop} from './ReactFiberStack';
import {
ContextProvider,
+2 -2
View File
@@ -20,7 +20,7 @@ import type {
Container,
PublicInstance,
RendererInspectionConfig,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {ReactNodeList} from 'shared/ReactTypes';
import type {Lane} from './ReactFiberLane';
import type {SuspenseState} from './ReactFiberSuspenseComponent';
@@ -41,7 +41,7 @@ import getComponentNameFromFiber from 'react-reconciler/src/getComponentNameFrom
import isArray from 'shared/isArray';
import {enableSchedulingProfiler} from 'shared/ReactFeatureFlags';
import ReactSharedInternals from 'shared/ReactSharedInternals';
import {getPublicInstance} from './ReactFiberConfig';
import {getPublicInstance} from './ReactFiberHostConfig';
import {
findCurrentUnmaskedContext,
processChildContext,
+2 -2
View File
@@ -15,9 +15,9 @@ import type {
} from './ReactInternalTypes';
import type {RootTag} from './ReactRootTags';
import type {Cache} from './ReactFiberCacheComponent';
import type {Container} from './ReactFiberConfig';
import type {Container} from './ReactFiberHostConfig';
import {noTimeout, supportsHydration} from './ReactFiberConfig';
import {noTimeout, supportsHydration} from './ReactFiberHostConfig';
import {createHostRootFiber} from './ReactFiber';
import {
NoLane,
+1 -1
View File
@@ -49,7 +49,7 @@ import {
IdleEventPriority,
lanesToEventPriority,
} from './ReactEventPriorities';
import {supportsMicrotasks, scheduleMicrotask} from './ReactFiberConfig';
import {supportsMicrotasks, scheduleMicrotask} from './ReactFiberHostConfig';
import ReactSharedInternals from 'shared/ReactSharedInternals';
const {ReactCurrentActQueue} = ReactSharedInternals;
+1 -1
View File
@@ -18,7 +18,7 @@ import {
getPublicInstance,
getInstanceFromNode,
getInstanceFromScope,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {isFiberSuspenseAndTimedOut} from './ReactFiberTreeReflection';
import {HostComponent, ScopeComponent, ContextProvider} from './ReactWorkTags';
@@ -9,7 +9,7 @@
import type {ReactNodeList, Wakeable} from 'shared/ReactTypes';
import type {Fiber} from './ReactInternalTypes';
import type {SuspenseInstance} from './ReactFiberConfig';
import type {SuspenseInstance} from './ReactFiberHostConfig';
import type {Lane} from './ReactFiberLane';
import type {TreeContext} from './ReactFiberTreeContext';
@@ -18,7 +18,7 @@ import {NoFlags, DidCapture} from './ReactFiberFlags';
import {
isSuspenseInstancePending,
isSuspenseInstanceFallback,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
export type SuspenseProps = {
children?: ReactNodeList,
+1 -1
View File
@@ -13,7 +13,7 @@ import type {Cache, SpawnedCachePool} from './ReactFiberCacheComponent';
import type {Transition} from './ReactFiberTracingMarkerComponent';
import {enableCache, enableTransitionTracing} from 'shared/ReactFeatureFlags';
import {isPrimaryRenderer} from './ReactFiberConfig';
import {isPrimaryRenderer} from './ReactFiberHostConfig';
import {createCursor, push, pop} from './ReactFiberStack';
import {
getWorkInProgressRoot,
+1 -1
View File
@@ -8,7 +8,7 @@
*/
import type {Fiber} from './ReactInternalTypes';
import type {Container, SuspenseInstance} from './ReactFiberConfig';
import type {Container, SuspenseInstance} from './ReactFiberHostConfig';
import type {SuspenseState} from './ReactFiberSuspenseComponent';
import {get as getInstance} from 'shared/ReactInstanceMap';
+1 -1
View File
@@ -77,7 +77,7 @@ import {
startSuspendingCommit,
waitForCommitToBeReady,
preloadInstance,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import {
createWorkInProgress,
+1 -1
View File
@@ -29,7 +29,7 @@ import type {
TimeoutHandle,
NoTimeout,
SuspenseInstance,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
import type {Cache} from './ReactFiberCacheComponent';
import type {
TracingMarkerInstance,
+1 -1
View File
@@ -10,7 +10,7 @@
import type {MutableSource, MutableSourceVersion} from 'shared/ReactTypes';
import type {FiberRoot} from './ReactInternalTypes';
import {isPrimaryRenderer} from './ReactFiberConfig';
import {isPrimaryRenderer} from './ReactFiberHostConfig';
// Work in progress version numbers only apply to a single render,
// and should be reset before starting a new render.
+1 -1
View File
@@ -6,7 +6,7 @@
*
* @flow
*/
import {requestPostPaintCallback} from './ReactFiberConfig';
import {requestPostPaintCallback} from './ReactFiberHostConfig';
let postPaintCallbackScheduled = false;
let callbacks: Array<any | ((endTime: number) => void)> = [];
+2 -2
View File
@@ -8,7 +8,7 @@
*/
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {Instance} from './ReactFiberConfig';
import type {Instance} from './ReactFiberHostConfig';
import {
HostComponent,
@@ -27,7 +27,7 @@ import {
setFocusIfFocusable,
setupIntersectionObserver,
supportsTestSelectors,
} from './ReactFiberConfig';
} from './ReactFiberHostConfig';
let COMPONENT_TYPE: symbol | number = 0b000;
let HAS_PSEUDO_CLASS_TYPE: symbol | number = 0b001;
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -1,10 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactFiberConfigDOM';
@@ -7,4 +7,4 @@
* @flow
*/
export * from 'react-art/src/ReactFiberConfigART';
export * from 'react-art/src/ReactARTHostConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from 'react-test-renderer/src/ReactFiberConfigTestHost';
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from 'react-native-renderer/src/ReactFiberConfigFabric';
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from 'react-native-renderer/src/ReactFiberConfigFabric';
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -7,4 +7,4 @@
* @flow
*/
export * from 'react-native-renderer/src/ReactFiberConfigNative';
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-dom-bindings/src/client/ReactDOMHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-native-renderer/src/ReactFabricHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-native-renderer/src/ReactFabricHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-native-renderer/src/ReactNativeHostConfig';
@@ -0,0 +1,10 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/
export * from 'react-test-renderer/src/ReactTestHostConfig';
+1 -1
View File
@@ -7,7 +7,7 @@
* @flow
*/
import type {Instance} from 'react-reconciler/src/ReactFiberConfig';
import type {Instance} from 'react-reconciler/src/ReactFiberHostConfig';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {
Family,
@@ -42,12 +42,12 @@ export type EventResponder = any;
export type RendererInspectionConfig = $ReadOnly<{}>;
export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberConfigWithNoSingletons';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
const NO_CONTEXT = {};
const UPDATE_SIGNAL = {};
+2 -2
View File
@@ -12,7 +12,7 @@ import type {
PublicInstance,
Instance,
TextInstance,
} from './ReactFiberConfigTestHost';
} from './ReactTestHostConfig';
import * as React from 'react';
import * as Scheduler from 'scheduler/unstable_mock';
@@ -50,7 +50,7 @@ import getComponentNameFromType from 'shared/getComponentNameFromType';
import ReactVersion from 'shared/ReactVersion';
import {checkPropStringCoercion} from 'shared/CheckStringCoercion';
import {getPublicInstance} from './ReactFiberConfigTestHost';
import {getPublicInstance} from './ReactTestHostConfig';
import {ConcurrentRoot, LegacyRoot} from 'react-reconciler/src/ReactRootTags';
import {allowConcurrentByDefault} from 'shared/ReactFeatureFlags';
+1 -1
View File
@@ -51,7 +51,7 @@ function writeConfig(renderer, rendererInfo, isServerSupported) {
.replace(
'%REACT_RENDERER_FLOW_OPTIONS%',
`
module.name_mapper='ReactFiberConfig$$' -> 'forks/ReactFiberConfig.${renderer}'
module.name_mapper='ReactFiberHostConfig$$' -> 'forks/ReactFiberHostConfig.${renderer}'
module.name_mapper='ReactServerStreamConfig$$' -> 'forks/ReactServerStreamConfig.${serverRenderer}'
module.name_mapper='ReactFizzConfig$$' -> 'forks/ReactFizzConfig.${serverRenderer}'
module.name_mapper='ReactFlightServerConfig$$' -> 'forks/ReactFlightServerConfig.${serverRenderer}'
+2 -2
View File
@@ -60,7 +60,7 @@ jest.mock('react/react.shared-subset', () => {
// When testing the custom renderer code path through `react-reconciler`,
// turn the export into a function, and use the argument as host config.
const shimHostConfigPath = 'react-reconciler/src/ReactFiberConfig';
const shimHostConfigPath = 'react-reconciler/src/ReactFiberHostConfig';
jest.mock('react-reconciler', () => {
return config => {
jest.mock(shimHostConfigPath, () => config);
@@ -104,7 +104,7 @@ jest.mock('react-client/flight', () => {
});
const configPaths = [
'react-reconciler/src/ReactFiberConfig',
'react-reconciler/src/ReactFiberHostConfig',
'react-client/src/ReactFlightClientConfig',
'react-server/src/ReactServerStreamConfig',
'react-server/src/ReactFizzConfig',
+3 -3
View File
@@ -246,7 +246,7 @@ const forks = Object.freeze({
}
},
'./packages/react-reconciler/src/ReactFiberConfig.js': (
'./packages/react-reconciler/src/ReactFiberHostConfig.js': (
bundleType,
entry,
dependencies,
@@ -261,11 +261,11 @@ const forks = Object.freeze({
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (let rendererInfo of inlinedHostConfigs) {
if (rendererInfo.entryPoints.indexOf(entry) !== -1) {
return `./packages/react-reconciler/src/forks/ReactFiberConfig.${rendererInfo.shortName}.js`;
return `./packages/react-reconciler/src/forks/ReactFiberHostConfig.${rendererInfo.shortName}.js`;
}
}
throw new Error(
'Expected ReactFiberConfig to always be replaced with a shim, but ' +
'Expected ReactFiberHostConfig to always be replaced with a shim, but ' +
`found no mention of "${entry}" entry point in ./scripts/shared/inlinedHostConfigs.js. ` +
'Did you mean to add it there to associate it with a specific renderer?'
);