From b55d31955982851284bb437a5187a6c56e366539 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Mon, 10 Apr 2023 14:58:44 -0700 Subject: [PATCH] =?UTF-8?q?Rename=20HostConfig=20files=20to=20FiberConfig?= =?UTF-8?q?=20to=20clarify=20they=20are=20configs=20fo=E2=80=A6=20(#26592)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit part of https://github.com/facebook/react/pull/26571 merging separately to improve tracking of files renames in git Rename HostConfig files to FiberConfig to clarify they are configs for Fiber and not Fizz/Flight. This better conforms to the naming used in Flight and now Fizz of `ReactFlightServerConfig` and `ReactFizzConfig` --- ...eactARTHostConfig.js => ReactFiberConfigART.js} | 14 +++++++------- .../src/client/ReactDOMComponentTree.js | 4 ++-- ...eactDOMHostConfig.js => ReactFiberConfigDOM.js} | 2 +- .../src/events/ReactDOMEventListener.js | 2 +- .../src/events/ReactDOMEventReplaying.js | 2 +- .../react-dom-bindings/src/events/getListener.js | 2 +- .../src/events/plugins/ChangeEventPlugin.js | 2 +- .../ReactDOMFizzInstructionSetShared.js | 2 +- packages/react-dom/src/client/ReactDOM.js | 2 +- packages/react-dom/src/client/ReactDOMLegacy.js | 4 ++-- packages/react-dom/src/client/ReactDOMRoot.js | 2 +- packages/react-native-renderer/src/ReactFabric.js | 2 +- .../src/ReactFabricComponentTree.js | 4 ++-- .../src/ReactFabricEventEmitter.js | 2 +- ...bricHostConfig.js => ReactFiberConfigFabric.js} | 14 +++++++------- ...tiveHostConfig.js => ReactFiberConfigNative.js} | 14 +++++++------- .../src/ReactNativeFiberHostComponent.js | 2 +- packages/react-reconciler/README.md | 14 +++++++------- packages/react-reconciler/src/ReactFiber.js | 4 ++-- packages/react-reconciler/src/ReactFiberAct.js | 2 +- .../react-reconciler/src/ReactFiberBeginWork.js | 4 ++-- .../react-reconciler/src/ReactFiberCommitWork.js | 4 ++-- .../react-reconciler/src/ReactFiberCompleteWork.js | 4 ++-- ...ReactFiberHostConfig.js => ReactFiberConfig.js} | 0 ...ation.js => ReactFiberConfigWithNoHydration.js} | 0 ...asks.js => ReactFiberConfigWithNoMicrotasks.js} | 0 ...tation.js => ReactFiberConfigWithNoMutation.js} | 0 ...nce.js => ReactFiberConfigWithNoPersistence.js} | 0 ...urces.js => ReactFiberConfigWithNoResources.js} | 0 ...NoScopes.js => ReactFiberConfigWithNoScopes.js} | 0 ...tons.js => ReactFiberConfigWithNoSingletons.js} | 0 ...s.js => ReactFiberConfigWithNoTestSelectors.js} | 0 .../react-reconciler/src/ReactFiberHostContext.js | 4 ++-- .../react-reconciler/src/ReactFiberHotReloading.js | 4 ++-- .../src/ReactFiberHydrationContext.js | 4 ++-- .../react-reconciler/src/ReactFiberNewContext.js | 2 +- .../react-reconciler/src/ReactFiberReconciler.js | 4 ++-- packages/react-reconciler/src/ReactFiberRoot.js | 4 ++-- .../src/ReactFiberRootScheduler.js | 2 +- packages/react-reconciler/src/ReactFiberScope.js | 2 +- .../src/ReactFiberSuspenseComponent.js | 4 ++-- .../react-reconciler/src/ReactFiberTransition.js | 2 +- .../src/ReactFiberTreeReflection.js | 2 +- .../react-reconciler/src/ReactFiberWorkLoop.js | 2 +- .../react-reconciler/src/ReactInternalTypes.js | 2 +- .../react-reconciler/src/ReactMutableSource.js | 2 +- .../react-reconciler/src/ReactPostPaintCallback.js | 2 +- .../react-reconciler/src/ReactTestSelectors.js | 4 ++-- ...erHostConfig.art.js => ReactFiberConfig.art.js} | 2 +- ...Config.custom.js => ReactFiberConfig.custom.js} | 0 .../src/forks/ReactFiberConfig.dom-browser.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-bun.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-edge-webpack.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-legacy.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-node-webpack.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-node.js | 10 ++++++++++ .../src/forks/ReactFiberConfig.dom-relay.js | 10 ++++++++++ ...ig.dom-legacy.js => ReactFiberConfig.fabric.js} | 2 +- ...browser.js => ReactFiberConfig.native-relay.js} | 2 +- ...onfig.dom-bun.js => ReactFiberConfig.native.js} | 2 +- ...om-edge-webpack.js => ReactFiberConfig.test.js} | 2 +- .../forks/ReactFiberHostConfig.dom-node-webpack.js | 10 ---------- .../src/forks/ReactFiberHostConfig.dom-node.js | 10 ---------- .../src/forks/ReactFiberHostConfig.dom-relay.js | 10 ---------- .../src/forks/ReactFiberHostConfig.fabric.js | 10 ---------- .../src/forks/ReactFiberHostConfig.native-relay.js | 10 ---------- .../src/forks/ReactFiberHostConfig.native.js | 10 ---------- .../src/forks/ReactFiberHostConfig.test.js | 10 ---------- packages/react-refresh/src/ReactFreshRuntime.js | 2 +- ...stHostConfig.js => ReactFiberConfigTestHost.js} | 12 ++++++------ .../react-test-renderer/src/ReactTestRenderer.js | 4 ++-- scripts/flow/createFlowConfigs.js | 2 +- scripts/jest/setupHostConfigs.js | 4 ++-- scripts/rollup/forks.js | 6 +++--- 74 files changed, 167 insertions(+), 167 deletions(-) rename packages/react-art/src/{ReactARTHostConfig.js => ReactFiberConfigART.js} (95%) rename packages/react-dom-bindings/src/client/{ReactDOMHostConfig.js => ReactFiberConfigDOM.js} (99%) rename packages/react-native-renderer/src/{ReactFabricHostConfig.js => ReactFiberConfigFabric.js} (96%) rename packages/react-native-renderer/src/{ReactNativeHostConfig.js => ReactFiberConfigNative.js} (96%) rename packages/react-reconciler/src/{ReactFiberHostConfig.js => ReactFiberConfig.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoHydration.js => ReactFiberConfigWithNoHydration.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoMicrotasks.js => ReactFiberConfigWithNoMicrotasks.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoMutation.js => ReactFiberConfigWithNoMutation.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoPersistence.js => ReactFiberConfigWithNoPersistence.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoResources.js => ReactFiberConfigWithNoResources.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoScopes.js => ReactFiberConfigWithNoScopes.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoSingletons.js => ReactFiberConfigWithNoSingletons.js} (100%) rename packages/react-reconciler/src/{ReactFiberHostConfigWithNoTestSelectors.js => ReactFiberConfigWithNoTestSelectors.js} (100%) rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.art.js => ReactFiberConfig.art.js} (80%) rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.custom.js => ReactFiberConfig.custom.js} (100%) create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-browser.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-bun.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-edge-webpack.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-legacy.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-node-webpack.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-node.js create mode 100644 packages/react-reconciler/src/forks/ReactFiberConfig.dom-relay.js rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.dom-legacy.js => ReactFiberConfig.fabric.js} (76%) rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.dom-browser.js => ReactFiberConfig.native-relay.js} (76%) rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.dom-bun.js => ReactFiberConfig.native.js} (76%) rename packages/react-reconciler/src/forks/{ReactFiberHostConfig.dom-edge-webpack.js => ReactFiberConfig.test.js} (76%) delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node-webpack.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.fabric.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.native-relay.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.native.js delete mode 100644 packages/react-reconciler/src/forks/ReactFiberHostConfig.test.js rename packages/react-test-renderer/src/{ReactTestHostConfig.js => ReactFiberConfigTestHost.js} (94%) diff --git a/packages/react-art/src/ReactARTHostConfig.js b/packages/react-art/src/ReactFiberConfigART.js similarity index 95% rename from packages/react-art/src/ReactARTHostConfig.js rename to packages/react-art/src/ReactFiberConfigART.js index 97a6b421b9f0f..591072cec84e8 100644 --- a/packages/react-art/src/ReactARTHostConfig.js +++ b/packages/react-art/src/ReactFiberConfigART.js @@ -238,13 +238,13 @@ function applyTextProps(instance, props, prevProps = {}) { } } -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 * 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 function appendInitialChild(parentInstance, child) { if (typeof child === 'string') { diff --git a/packages/react-dom-bindings/src/client/ReactDOMComponentTree.js b/packages/react-dom-bindings/src/client/ReactDOMComponentTree.js index 3f8044ac9fb82..839f346c9d88f 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMComponentTree.js +++ b/packages/react-dom-bindings/src/client/ReactDOMComponentTree.js @@ -21,7 +21,7 @@ import type { Props, HoistableRoot, RootResources, -} from './ReactDOMHostConfig'; +} from './ReactFiberConfigDOM'; import { HostComponent, @@ -32,7 +32,7 @@ import { SuspenseComponent, } from 'react-reconciler/src/ReactWorkTags'; -import {getParentSuspenseInstance} from './ReactDOMHostConfig'; +import {getParentSuspenseInstance} from './ReactFiberConfigDOM'; import { enableScopeAPI, diff --git a/packages/react-dom-bindings/src/client/ReactDOMHostConfig.js b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js similarity index 99% rename from packages/react-dom-bindings/src/client/ReactDOMHostConfig.js rename to packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js index 48b1f41b85fc7..8dd5252609d54 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMHostConfig.js +++ b/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js @@ -179,7 +179,7 @@ const STYLE = 'style'; let eventsEnabled: ?boolean = null; let selectionInformation: null | SelectionInformation = null; -export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence'; +export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence'; function getOwnerDocumentFromRootContainer( rootContainerElement: Element | Document | DocumentFragment, diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js index d10e8fccfbece..70cec7fa0e608 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventListener.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js @@ -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/ReactDOMHostConfig'; +import type {Container, SuspenseInstance} from '../client/ReactFiberConfigDOM'; import type {DOMEventName} from '../events/DOMEventNames'; import { diff --git a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js index 48c9884c42878..59fc3a8a61811 100644 --- a/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js +++ b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js @@ -8,7 +8,7 @@ */ import type {AnyNativeEvent} from '../events/PluginModuleType'; -import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig'; +import type {Container, SuspenseInstance} from '../client/ReactFiberConfigDOM'; import type {DOMEventName} from '../events/DOMEventNames'; import type {EventSystemFlags} from './EventSystemFlags'; import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes'; diff --git a/packages/react-dom-bindings/src/events/getListener.js b/packages/react-dom-bindings/src/events/getListener.js index 2cdb8cfdfbee7..68ab23e219475 100644 --- a/packages/react-dom-bindings/src/events/getListener.js +++ b/packages/react-dom-bindings/src/events/getListener.js @@ -7,7 +7,7 @@ */ import type {Fiber} from 'react-reconciler/src/ReactInternalTypes'; -import type {Props} from '../client/ReactDOMHostConfig'; +import type {Props} from '../client/ReactFiberConfigDOM'; import {getFiberCurrentPropsFromNode} from '../client/ReactDOMComponentTree'; diff --git a/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js index fddc501013519..ff478e4a6b5d5 100644 --- a/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js +++ b/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js @@ -6,7 +6,7 @@ * * @flow */ -import type {TextInstance, Instance} from '../../client/ReactDOMHostConfig'; +import type {TextInstance, Instance} from '../../client/ReactFiberConfigDOM'; import type {AnyNativeEvent} from '../PluginModuleType'; import type {DOMEventName} from '../DOMEventNames'; import type {DispatchQueue} from '../DOMPluginEventSystem'; diff --git a/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js b/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js index e439a87a96140..6058eddaad7eb 100644 --- a/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js +++ b/packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js @@ -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 ReactDOMHostConfig. + // This is similar to clearSuspenseBoundary in ReactFiberConfigDOM. // 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; diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index ef5d3234190ec..d6ef4261246de 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -11,7 +11,7 @@ import type {ReactNodeList} from 'shared/ReactTypes'; import type { Container, PublicInstance, -} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +} from 'react-dom-bindings/src/client/ReactFiberConfigDOM'; import type { RootType, HydrateRootOptions, diff --git a/packages/react-dom/src/client/ReactDOMLegacy.js b/packages/react-dom/src/client/ReactDOMLegacy.js index 1973e97ada52a..b8b1fc43239a9 100644 --- a/packages/react-dom/src/client/ReactDOMLegacy.js +++ b/packages/react-dom/src/client/ReactDOMLegacy.js @@ -10,11 +10,11 @@ import type { Container, PublicInstance, -} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +} from 'react-dom-bindings/src/client/ReactFiberConfigDOM'; import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes'; import type {ReactNodeList} from 'shared/ReactTypes'; -import {clearContainer} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +import {clearContainer} from 'react-dom-bindings/src/client/ReactFiberConfigDOM'; import { getInstanceFromNode, isContainerMarkedAsRoot, diff --git a/packages/react-dom/src/client/ReactDOMRoot.js b/packages/react-dom/src/client/ReactDOMRoot.js index 96d32f8622204..b0f53ccdf06f8 100644 --- a/packages/react-dom/src/client/ReactDOMRoot.js +++ b/packages/react-dom/src/client/ReactDOMRoot.js @@ -15,7 +15,7 @@ import type { import ReactDOMSharedInternals from '../ReactDOMSharedInternals'; const {Dispatcher} = ReactDOMSharedInternals; -import {ReactDOMClientDispatcher} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +import {ReactDOMClientDispatcher} from 'react-dom-bindings/src/client/ReactFiberConfigDOM'; import {queueExplicitHydrationTarget} from 'react-dom-bindings/src/events/ReactDOMEventReplaying'; import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols'; import { diff --git a/packages/react-native-renderer/src/ReactFabric.js b/packages/react-native-renderer/src/ReactFabric.js index d918779140dd7..36be493520a2d 100644 --- a/packages/react-native-renderer/src/ReactFabric.js +++ b/packages/react-native-renderer/src/ReactFabric.js @@ -40,7 +40,7 @@ import { sendAccessibilityEvent, getNodeFromInternalInstanceHandle, } from './ReactNativePublicCompat'; -import {getPublicInstanceFromInternalInstanceHandle} from './ReactFabricHostConfig'; +import {getPublicInstanceFromInternalInstanceHandle} from './ReactFiberConfigFabric'; // $FlowFixMe[missing-local-annot] function onRecoverableError(error) { diff --git a/packages/react-native-renderer/src/ReactFabricComponentTree.js b/packages/react-native-renderer/src/ReactFabricComponentTree.js index c295c42ed102b..f36e742a45aba 100644 --- a/packages/react-native-renderer/src/ReactFabricComponentTree.js +++ b/packages/react-native-renderer/src/ReactFabricComponentTree.js @@ -12,9 +12,9 @@ import type { Instance, Props, TextInstance, -} from './ReactFabricHostConfig'; +} from './ReactFiberConfigFabric'; import type {Fiber} from 'react-reconciler/src/ReactInternalTypes'; -import {getPublicInstance} from './ReactFabricHostConfig'; +import {getPublicInstance} from './ReactFiberConfigFabric'; // `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 diff --git a/packages/react-native-renderer/src/ReactFabricEventEmitter.js b/packages/react-native-renderer/src/ReactFabricEventEmitter.js index b7d545aa114f8..a0b8eb98b4867 100644 --- a/packages/react-native-renderer/src/ReactFabricEventEmitter.js +++ b/packages/react-native-renderer/src/ReactFabricEventEmitter.js @@ -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 './ReactFabricHostConfig'; +import {getPublicInstance} from './ReactFiberConfigFabric'; export {getListener, registrationNameModules as registrationNames}; diff --git a/packages/react-native-renderer/src/ReactFabricHostConfig.js b/packages/react-native-renderer/src/ReactFiberConfigFabric.js similarity index 96% rename from packages/react-native-renderer/src/ReactFabricHostConfig.js rename to packages/react-native-renderer/src/ReactFiberConfigFabric.js index 72109ca7c3ec1..03ab9b6febe39 100644 --- a/packages/react-native-renderer/src/ReactFabricHostConfig.js +++ b/packages/react-native-renderer/src/ReactFiberConfigFabric.js @@ -108,13 +108,13 @@ if (registerEventHandler) { registerEventHandler(dispatchEvent); } -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 * 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 function appendInitialChild( parentInstance: Instance, diff --git a/packages/react-native-renderer/src/ReactNativeHostConfig.js b/packages/react-native-renderer/src/ReactFiberConfigNative.js similarity index 96% rename from packages/react-native-renderer/src/ReactNativeHostConfig.js rename to packages/react-native-renderer/src/ReactFiberConfigNative.js index aeed0c01c069c..b218a1f77c234 100644 --- a/packages/react-native-renderer/src/ReactNativeHostConfig.js +++ b/packages/react-native-renderer/src/ReactFiberConfigNative.js @@ -84,13 +84,13 @@ function recursivelyUncacheFiberNode(node: Instance | TextInstance) { } } -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 * 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 function appendInitialChild( parentInstance: Instance, diff --git a/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js b/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js index 3db5948c4eb0d..8294e0e6f07cd 100644 --- a/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js +++ b/packages/react-native-renderer/src/ReactNativeFiberHostComponent.js @@ -16,7 +16,7 @@ import type { INativeMethods, ViewConfig, } from './ReactNativeTypes'; -import type {Instance} from './ReactNativeHostConfig'; +import type {Instance} from './ReactFiberConfigNative'; // Modules provided by RN: import { diff --git a/packages/react-reconciler/README.md b/packages/react-reconciler/README.md index 2aeb36fbd6caf..546e44258378f 100644 --- a/packages/react-reconciler/README.md +++ b/packages/react-reconciler/README.md @@ -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/ReactFiberHostConfig.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/ReactFiberConfig.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/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) +* [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) If these links break please file an issue and we’ll 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 we’ll 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 `ReactDOMHostConfig.js` for a reference implementation. +You can consult the `getCurrentEventPriority()` implementation in `ReactFiberConfigDOM.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/ReactFiberHostConfig.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/ReactFiberConfig.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/ReactFiberHostConfig.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/ReactFiberConfig.custom.js). File an issue if you need help. diff --git a/packages/react-reconciler/src/ReactFiber.js b/packages/react-reconciler/src/ReactFiber.js index e362e984ce16d..7eefefa1c4d14 100644 --- a/packages/react-reconciler/src/ReactFiber.js +++ b/packages/react-reconciler/src/ReactFiber.js @@ -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 './ReactFiberHostConfig'; +import type {SuspenseInstance} from './ReactFiberConfig'; import type { OffscreenProps, OffscreenInstance, @@ -26,7 +26,7 @@ import { supportsSingletons, isHostHoistableType, isHostSingletonType, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import { createRootStrictEffectsByDefault, enableCache, diff --git a/packages/react-reconciler/src/ReactFiberAct.js b/packages/react-reconciler/src/ReactFiberAct.js index 57848f03a1e6a..117a7fc05196b 100644 --- a/packages/react-reconciler/src/ReactFiberAct.js +++ b/packages/react-reconciler/src/ReactFiberAct.js @@ -11,7 +11,7 @@ import type {Fiber} from './ReactFiber'; import ReactSharedInternals from 'shared/ReactSharedInternals'; -import {warnsIfNotActing} from './ReactFiberHostConfig'; +import {warnsIfNotActing} from './ReactFiberConfig'; const {ReactCurrentActQueue} = ReactSharedInternals; diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 5a53ea848b62c..7b5b2f72b1e0c 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -168,8 +168,8 @@ import { isPrimaryRenderer, getResource, createHoistableInstance, -} from './ReactFiberHostConfig'; -import type {SuspenseInstance} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; +import type {SuspenseInstance} from './ReactFiberConfig'; import {shouldError, shouldSuspend} from './ReactFiberReconciler'; import { pushHostContext, diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.js b/packages/react-reconciler/src/ReactFiberCommitWork.js index 4234732bc7a72..3aca03988f6cd 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.js @@ -15,7 +15,7 @@ import type { ChildSet, UpdatePayload, HoistableRoot, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; 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 './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import { captureCommitPhaseError, resolveRetryWakeable, diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.js b/packages/react-reconciler/src/ReactFiberCompleteWork.js index a057cc29b6e7b..ba5f92944e029 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.js @@ -18,7 +18,7 @@ import type { Container, ChildSet, Resource, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import type { SuspenseState, SuspenseListRenderState, @@ -115,7 +115,7 @@ import { mayResourceSuspendCommit, preloadInstance, preloadResource, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import { getRootHostContainer, popHostContext, diff --git a/packages/react-reconciler/src/ReactFiberHostConfig.js b/packages/react-reconciler/src/ReactFiberConfig.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfig.js rename to packages/react-reconciler/src/ReactFiberConfig.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoHydration.js b/packages/react-reconciler/src/ReactFiberConfigWithNoHydration.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoHydration.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoHydration.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks.js b/packages/react-reconciler/src/ReactFiberConfigWithNoMicrotasks.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoMicrotasks.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoMutation.js b/packages/react-reconciler/src/ReactFiberConfigWithNoMutation.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoMutation.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoMutation.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoPersistence.js b/packages/react-reconciler/src/ReactFiberConfigWithNoPersistence.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoPersistence.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoPersistence.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoResources.js b/packages/react-reconciler/src/ReactFiberConfigWithNoResources.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoResources.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoResources.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoScopes.js b/packages/react-reconciler/src/ReactFiberConfigWithNoScopes.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoScopes.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoScopes.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoSingletons.js b/packages/react-reconciler/src/ReactFiberConfigWithNoSingletons.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoSingletons.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoSingletons.js diff --git a/packages/react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors.js b/packages/react-reconciler/src/ReactFiberConfigWithNoTestSelectors.js similarity index 100% rename from packages/react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors.js rename to packages/react-reconciler/src/ReactFiberConfigWithNoTestSelectors.js diff --git a/packages/react-reconciler/src/ReactFiberHostContext.js b/packages/react-reconciler/src/ReactFiberHostContext.js index 539dedbbd1c8b..c5733b24543d2 100644 --- a/packages/react-reconciler/src/ReactFiberHostContext.js +++ b/packages/react-reconciler/src/ReactFiberHostContext.js @@ -9,9 +9,9 @@ import type {Fiber} from './ReactInternalTypes'; import type {StackCursor} from './ReactFiberStack'; -import type {Container, HostContext} from './ReactFiberHostConfig'; +import type {Container, HostContext} from './ReactFiberConfig'; -import {getChildHostContext, getRootHostContext} from './ReactFiberHostConfig'; +import {getChildHostContext, getRootHostContext} from './ReactFiberConfig'; import {createCursor, push, pop} from './ReactFiberStack'; const contextStackCursor: StackCursor = createCursor(null); diff --git a/packages/react-reconciler/src/ReactFiberHotReloading.js b/packages/react-reconciler/src/ReactFiberHotReloading.js index e4b1561896c31..ffb3ae8a0ee1b 100644 --- a/packages/react-reconciler/src/ReactFiberHotReloading.js +++ b/packages/react-reconciler/src/ReactFiberHotReloading.js @@ -11,7 +11,7 @@ import type {ReactElement} from 'shared/ReactElementType'; import type {Fiber, FiberRoot} from './ReactInternalTypes'; -import type {Instance} from './ReactFiberHostConfig'; +import type {Instance} from './ReactFiberConfig'; 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 './ReactFiberHostConfig'; +import {supportsSingletons} from './ReactFiberConfig'; export type Family = { current: any, diff --git a/packages/react-reconciler/src/ReactFiberHydrationContext.js b/packages/react-reconciler/src/ReactFiberHydrationContext.js index 351fa122929c7..a7b0cfdbf2b64 100644 --- a/packages/react-reconciler/src/ReactFiberHydrationContext.js +++ b/packages/react-reconciler/src/ReactFiberHydrationContext.js @@ -16,7 +16,7 @@ import type { SuspenseInstance, Container, HostContext, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import type {SuspenseState} from './ReactFiberSuspenseComponent'; import type {TreeContext} from './ReactFiberTreeContext'; import type {CapturedValue} from './ReactCapturedValue'; @@ -81,7 +81,7 @@ import { canHydrateSuspenseInstance, isHydratableType, isHydratableText, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import {OffscreenLane} from './ReactFiberLane'; import { getSuspendedTreeContext, diff --git a/packages/react-reconciler/src/ReactFiberNewContext.js b/packages/react-reconciler/src/ReactFiberNewContext.js index 9987d8fd6ad3a..003022a9c6265 100644 --- a/packages/react-reconciler/src/ReactFiberNewContext.js +++ b/packages/react-reconciler/src/ReactFiberNewContext.js @@ -17,7 +17,7 @@ import type {StackCursor} from './ReactFiberStack'; import type {Lanes} from './ReactFiberLane'; import type {SharedQueue} from './ReactFiberClassUpdateQueue'; -import {isPrimaryRenderer} from './ReactFiberHostConfig'; +import {isPrimaryRenderer} from './ReactFiberConfig'; import {createCursor, push, pop} from './ReactFiberStack'; import { ContextProvider, diff --git a/packages/react-reconciler/src/ReactFiberReconciler.js b/packages/react-reconciler/src/ReactFiberReconciler.js index 2b69b09edbff4..5ac1ecaa4ea74 100644 --- a/packages/react-reconciler/src/ReactFiberReconciler.js +++ b/packages/react-reconciler/src/ReactFiberReconciler.js @@ -20,7 +20,7 @@ import type { Container, PublicInstance, RendererInspectionConfig, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; 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 './ReactFiberHostConfig'; +import {getPublicInstance} from './ReactFiberConfig'; import { findCurrentUnmaskedContext, processChildContext, diff --git a/packages/react-reconciler/src/ReactFiberRoot.js b/packages/react-reconciler/src/ReactFiberRoot.js index 2733d0ccf3515..35daaf7c10dc4 100644 --- a/packages/react-reconciler/src/ReactFiberRoot.js +++ b/packages/react-reconciler/src/ReactFiberRoot.js @@ -15,9 +15,9 @@ import type { } from './ReactInternalTypes'; import type {RootTag} from './ReactRootTags'; import type {Cache} from './ReactFiberCacheComponent'; -import type {Container} from './ReactFiberHostConfig'; +import type {Container} from './ReactFiberConfig'; -import {noTimeout, supportsHydration} from './ReactFiberHostConfig'; +import {noTimeout, supportsHydration} from './ReactFiberConfig'; import {createHostRootFiber} from './ReactFiber'; import { NoLane, diff --git a/packages/react-reconciler/src/ReactFiberRootScheduler.js b/packages/react-reconciler/src/ReactFiberRootScheduler.js index db60ab8be5360..7206579745871 100644 --- a/packages/react-reconciler/src/ReactFiberRootScheduler.js +++ b/packages/react-reconciler/src/ReactFiberRootScheduler.js @@ -49,7 +49,7 @@ import { IdleEventPriority, lanesToEventPriority, } from './ReactEventPriorities'; -import {supportsMicrotasks, scheduleMicrotask} from './ReactFiberHostConfig'; +import {supportsMicrotasks, scheduleMicrotask} from './ReactFiberConfig'; import ReactSharedInternals from 'shared/ReactSharedInternals'; const {ReactCurrentActQueue} = ReactSharedInternals; diff --git a/packages/react-reconciler/src/ReactFiberScope.js b/packages/react-reconciler/src/ReactFiberScope.js index c663f4a1c537f..a95518aacb31c 100644 --- a/packages/react-reconciler/src/ReactFiberScope.js +++ b/packages/react-reconciler/src/ReactFiberScope.js @@ -18,7 +18,7 @@ import { getPublicInstance, getInstanceFromNode, getInstanceFromScope, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import {isFiberSuspenseAndTimedOut} from './ReactFiberTreeReflection'; import {HostComponent, ScopeComponent, ContextProvider} from './ReactWorkTags'; diff --git a/packages/react-reconciler/src/ReactFiberSuspenseComponent.js b/packages/react-reconciler/src/ReactFiberSuspenseComponent.js index e248ad0719bd7..1f558a44903e2 100644 --- a/packages/react-reconciler/src/ReactFiberSuspenseComponent.js +++ b/packages/react-reconciler/src/ReactFiberSuspenseComponent.js @@ -9,7 +9,7 @@ import type {ReactNodeList, Wakeable} from 'shared/ReactTypes'; import type {Fiber} from './ReactInternalTypes'; -import type {SuspenseInstance} from './ReactFiberHostConfig'; +import type {SuspenseInstance} from './ReactFiberConfig'; import type {Lane} from './ReactFiberLane'; import type {TreeContext} from './ReactFiberTreeContext'; @@ -18,7 +18,7 @@ import {NoFlags, DidCapture} from './ReactFiberFlags'; import { isSuspenseInstancePending, isSuspenseInstanceFallback, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; export type SuspenseProps = { children?: ReactNodeList, diff --git a/packages/react-reconciler/src/ReactFiberTransition.js b/packages/react-reconciler/src/ReactFiberTransition.js index 05cb89991ed7e..a148375a6708e 100644 --- a/packages/react-reconciler/src/ReactFiberTransition.js +++ b/packages/react-reconciler/src/ReactFiberTransition.js @@ -13,7 +13,7 @@ import type {Cache, SpawnedCachePool} from './ReactFiberCacheComponent'; import type {Transition} from './ReactFiberTracingMarkerComponent'; import {enableCache, enableTransitionTracing} from 'shared/ReactFeatureFlags'; -import {isPrimaryRenderer} from './ReactFiberHostConfig'; +import {isPrimaryRenderer} from './ReactFiberConfig'; import {createCursor, push, pop} from './ReactFiberStack'; import { getWorkInProgressRoot, diff --git a/packages/react-reconciler/src/ReactFiberTreeReflection.js b/packages/react-reconciler/src/ReactFiberTreeReflection.js index 6be4e0b2c0807..8828017eee8d3 100644 --- a/packages/react-reconciler/src/ReactFiberTreeReflection.js +++ b/packages/react-reconciler/src/ReactFiberTreeReflection.js @@ -8,7 +8,7 @@ */ import type {Fiber} from './ReactInternalTypes'; -import type {Container, SuspenseInstance} from './ReactFiberHostConfig'; +import type {Container, SuspenseInstance} from './ReactFiberConfig'; import type {SuspenseState} from './ReactFiberSuspenseComponent'; import {get as getInstance} from 'shared/ReactInstanceMap'; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 401defb280fe4..94af7e44d59e1 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -77,7 +77,7 @@ import { startSuspendingCommit, waitForCommitToBeReady, preloadInstance, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import { createWorkInProgress, diff --git a/packages/react-reconciler/src/ReactInternalTypes.js b/packages/react-reconciler/src/ReactInternalTypes.js index ae1e75bfe9467..c7264083172f0 100644 --- a/packages/react-reconciler/src/ReactInternalTypes.js +++ b/packages/react-reconciler/src/ReactInternalTypes.js @@ -29,7 +29,7 @@ import type { TimeoutHandle, NoTimeout, SuspenseInstance, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; import type {Cache} from './ReactFiberCacheComponent'; import type { TracingMarkerInstance, diff --git a/packages/react-reconciler/src/ReactMutableSource.js b/packages/react-reconciler/src/ReactMutableSource.js index 218e2171a9c15..b5f1bd197b786 100644 --- a/packages/react-reconciler/src/ReactMutableSource.js +++ b/packages/react-reconciler/src/ReactMutableSource.js @@ -10,7 +10,7 @@ import type {MutableSource, MutableSourceVersion} from 'shared/ReactTypes'; import type {FiberRoot} from './ReactInternalTypes'; -import {isPrimaryRenderer} from './ReactFiberHostConfig'; +import {isPrimaryRenderer} from './ReactFiberConfig'; // Work in progress version numbers only apply to a single render, // and should be reset before starting a new render. diff --git a/packages/react-reconciler/src/ReactPostPaintCallback.js b/packages/react-reconciler/src/ReactPostPaintCallback.js index 419f4514e30f3..76c56e90c3f08 100644 --- a/packages/react-reconciler/src/ReactPostPaintCallback.js +++ b/packages/react-reconciler/src/ReactPostPaintCallback.js @@ -6,7 +6,7 @@ * * @flow */ -import {requestPostPaintCallback} from './ReactFiberHostConfig'; +import {requestPostPaintCallback} from './ReactFiberConfig'; let postPaintCallbackScheduled = false; let callbacks: Array void)> = []; diff --git a/packages/react-reconciler/src/ReactTestSelectors.js b/packages/react-reconciler/src/ReactTestSelectors.js index 0e83c65eb1dbc..34f0529f8cdeb 100644 --- a/packages/react-reconciler/src/ReactTestSelectors.js +++ b/packages/react-reconciler/src/ReactTestSelectors.js @@ -8,7 +8,7 @@ */ import type {Fiber} from 'react-reconciler/src/ReactInternalTypes'; -import type {Instance} from './ReactFiberHostConfig'; +import type {Instance} from './ReactFiberConfig'; import { HostComponent, @@ -27,7 +27,7 @@ import { setFocusIfFocusable, setupIntersectionObserver, supportsTestSelectors, -} from './ReactFiberHostConfig'; +} from './ReactFiberConfig'; let COMPONENT_TYPE: symbol | number = 0b000; let HAS_PSEUDO_CLASS_TYPE: symbol | number = 0b001; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.art.js b/packages/react-reconciler/src/forks/ReactFiberConfig.art.js similarity index 80% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.art.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.art.js index da28b3729db7f..867ca996ec5af 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.art.js +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.art.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-art/src/ReactARTHostConfig'; +export * from 'react-art/src/ReactFiberConfigART'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js b/packages/react-reconciler/src/forks/ReactFiberConfig.custom.js similarity index 100% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.custom.js diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-browser.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-browser.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-browser.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-bun.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-bun.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-bun.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-edge-webpack.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-edge-webpack.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-edge-webpack.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-legacy.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-legacy.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-legacy.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node-webpack.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node-webpack.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node-webpack.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-node.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberConfig.dom-relay.js b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-relay.js new file mode 100644 index 0000000000000..4932b1a787bb9 --- /dev/null +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.dom-relay.js @@ -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/ReactFiberConfigDOM'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js b/packages/react-reconciler/src/forks/ReactFiberConfig.fabric.js similarity index 76% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.fabric.js index aae45be9aae50..f1787a68e845b 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.fabric.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +export * from 'react-native-renderer/src/ReactFiberConfigFabric'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js b/packages/react-reconciler/src/forks/ReactFiberConfig.native-relay.js similarity index 76% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.native-relay.js index aae45be9aae50..f1787a68e845b 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.native-relay.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +export * from 'react-native-renderer/src/ReactFiberConfigFabric'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-bun.js b/packages/react-reconciler/src/forks/ReactFiberConfig.native.js similarity index 76% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-bun.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.native.js index aae45be9aae50..3f8a28688b716 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-bun.js +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.native.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +export * from 'react-native-renderer/src/ReactFiberConfigNative'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-edge-webpack.js b/packages/react-reconciler/src/forks/ReactFiberConfig.test.js similarity index 76% rename from packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-edge-webpack.js rename to packages/react-reconciler/src/forks/ReactFiberConfig.test.js index aae45be9aae50..85020417c2c7d 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-edge-webpack.js +++ b/packages/react-reconciler/src/forks/ReactFiberConfig.test.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; +export * from 'react-test-renderer/src/ReactFiberConfigTestHost'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node-webpack.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node-webpack.js deleted file mode 100644 index aae45be9aae50..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node-webpack.js +++ /dev/null @@ -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/ReactDOMHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node.js deleted file mode 100644 index aae45be9aae50..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-node.js +++ /dev/null @@ -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/ReactDOMHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js deleted file mode 100644 index aae45be9aae50..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js +++ /dev/null @@ -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/ReactDOMHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.fabric.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.fabric.js deleted file mode 100644 index ff3aa4d230c6b..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.fabric.js +++ /dev/null @@ -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-native-renderer/src/ReactFabricHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.native-relay.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.native-relay.js deleted file mode 100644 index ff3aa4d230c6b..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.native-relay.js +++ /dev/null @@ -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-native-renderer/src/ReactFabricHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.native.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.native.js deleted file mode 100644 index ac4c2512bf4eb..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.native.js +++ /dev/null @@ -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-native-renderer/src/ReactNativeHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.test.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.test.js deleted file mode 100644 index d2d908ef542b5..0000000000000 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.test.js +++ /dev/null @@ -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-test-renderer/src/ReactTestHostConfig'; diff --git a/packages/react-refresh/src/ReactFreshRuntime.js b/packages/react-refresh/src/ReactFreshRuntime.js index c9706041ce1ff..83650e1badc39 100644 --- a/packages/react-refresh/src/ReactFreshRuntime.js +++ b/packages/react-refresh/src/ReactFreshRuntime.js @@ -7,7 +7,7 @@ * @flow */ -import type {Instance} from 'react-reconciler/src/ReactFiberHostConfig'; +import type {Instance} from 'react-reconciler/src/ReactFiberConfig'; import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes'; import type { Family, diff --git a/packages/react-test-renderer/src/ReactTestHostConfig.js b/packages/react-test-renderer/src/ReactFiberConfigTestHost.js similarity index 94% rename from packages/react-test-renderer/src/ReactTestHostConfig.js rename to packages/react-test-renderer/src/ReactFiberConfigTestHost.js index e306f9e1a0b03..2d6c087c81f9c 100644 --- a/packages/react-test-renderer/src/ReactTestHostConfig.js +++ b/packages/react-test-renderer/src/ReactFiberConfigTestHost.js @@ -42,12 +42,12 @@ export type EventResponder = any; export type RendererInspectionConfig = $ReadOnly<{}>; -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'; +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'; const NO_CONTEXT = {}; const UPDATE_SIGNAL = {}; diff --git a/packages/react-test-renderer/src/ReactTestRenderer.js b/packages/react-test-renderer/src/ReactTestRenderer.js index 2080c287a86f5..26e6d154f32fc 100644 --- a/packages/react-test-renderer/src/ReactTestRenderer.js +++ b/packages/react-test-renderer/src/ReactTestRenderer.js @@ -12,7 +12,7 @@ import type { PublicInstance, Instance, TextInstance, -} from './ReactTestHostConfig'; +} from './ReactFiberConfigTestHost'; 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 './ReactTestHostConfig'; +import {getPublicInstance} from './ReactFiberConfigTestHost'; import {ConcurrentRoot, LegacyRoot} from 'react-reconciler/src/ReactRootTags'; import {allowConcurrentByDefault} from 'shared/ReactFeatureFlags'; diff --git a/scripts/flow/createFlowConfigs.js b/scripts/flow/createFlowConfigs.js index 0193f323dc1f9..4b832be83cb42 100644 --- a/scripts/flow/createFlowConfigs.js +++ b/scripts/flow/createFlowConfigs.js @@ -51,7 +51,7 @@ function writeConfig(renderer, rendererInfo, isServerSupported) { .replace( '%REACT_RENDERER_FLOW_OPTIONS%', ` -module.name_mapper='ReactFiberHostConfig$$' -> 'forks/ReactFiberHostConfig.${renderer}' +module.name_mapper='ReactFiberConfig$$' -> 'forks/ReactFiberConfig.${renderer}' module.name_mapper='ReactServerStreamConfig$$' -> 'forks/ReactServerStreamConfig.${serverRenderer}' module.name_mapper='ReactFizzConfig$$' -> 'forks/ReactFizzConfig.${serverRenderer}' module.name_mapper='ReactFlightServerConfig$$' -> 'forks/ReactFlightServerConfig.${serverRenderer}' diff --git a/scripts/jest/setupHostConfigs.js b/scripts/jest/setupHostConfigs.js index ae19851df93e7..2ed0fe91a8828 100644 --- a/scripts/jest/setupHostConfigs.js +++ b/scripts/jest/setupHostConfigs.js @@ -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/ReactFiberHostConfig'; +const shimHostConfigPath = 'react-reconciler/src/ReactFiberConfig'; jest.mock('react-reconciler', () => { return config => { jest.mock(shimHostConfigPath, () => config); @@ -104,7 +104,7 @@ jest.mock('react-client/flight', () => { }); const configPaths = [ - 'react-reconciler/src/ReactFiberHostConfig', + 'react-reconciler/src/ReactFiberConfig', 'react-client/src/ReactFlightClientConfig', 'react-server/src/ReactServerStreamConfig', 'react-server/src/ReactFizzConfig', diff --git a/scripts/rollup/forks.js b/scripts/rollup/forks.js index 5f6c984604266..d51e784f68378 100644 --- a/scripts/rollup/forks.js +++ b/scripts/rollup/forks.js @@ -246,7 +246,7 @@ const forks = Object.freeze({ } }, - './packages/react-reconciler/src/ReactFiberHostConfig.js': ( + './packages/react-reconciler/src/ReactFiberConfig.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/ReactFiberHostConfig.${rendererInfo.shortName}.js`; + return `./packages/react-reconciler/src/forks/ReactFiberConfig.${rendererInfo.shortName}.js`; } } throw new Error( - 'Expected ReactFiberHostConfig to always be replaced with a shim, but ' + + 'Expected ReactFiberConfig 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?' );