From 0865f99663c372815493689f6b6d540486ad22cb Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Wed, 28 Sep 2022 18:15:36 -0400 Subject: [PATCH] Move react-dom implementation files to react-dom-bindings This lets us share it with react-server-dom-webpack while still having a dependency on react-dom. It also makes somewhat sense from a bundling perspective since react-dom is an external to itself. --- packages/react-dom-bindings/package.json | 23 ++++++++ .../src/client/CSSPropertyOperations.js | 0 .../src/client/CSSShorthandProperty.js | 0 .../src/client/DOMAccessibilityRoles.js | 0 .../src/client/DOMPropertyOperations.js | 0 .../src/client/ReactDOMComponent.js | 0 .../src/client/ReactDOMComponentTree.js | 0 .../src/client/ReactDOMEventHandle.js | 0 .../src/client/ReactDOMHostConfig.js | 0 .../src/client/ReactDOMInput.js | 0 .../src/client/ReactDOMOption.js | 0 .../src/client/ReactDOMSelect.js | 0 .../src/client/ReactDOMSelection.js | 0 .../src/client/ReactDOMTextarea.js | 0 .../src/client/ReactInputSelection.js | 0 .../src/client/ToStringValue.js | 0 .../createMicrosoftUnsafeLocalFunction.js | 0 .../src/client/getActiveElement.js | 0 .../src/client/getNodeForCharacterOffset.js | 0 .../src/client/inputValueTracking.js | 0 .../src/client/setInnerHTML.js | 0 .../src/client/setTextContent.js | 0 .../src/client/validateDOMNesting.js | 0 .../src/events/CurrentReplayingEvent.js | 0 .../src/events/DOMEventNames.js | 0 .../src/events/DOMEventProperties.js | 0 .../src/events/DOMPluginEventSystem.js | 0 .../src/events/EventListener.js | 0 .../src/events/EventRegistry.js | 0 .../src/events/EventSystemFlags.js | 0 .../src/events/FallbackCompositionState.js | 0 .../src/events/PluginModuleType.js | 0 .../src/events/ReactDOMControlledComponent.js | 0 .../src/events/ReactDOMEventListener.js | 0 .../src/events/ReactDOMEventReplaying.js | 0 .../src/events/ReactDOMUpdateBatching.js | 0 .../src/events/ReactSyntheticEventType.js | 0 .../src/events/SyntheticEvent.js | 0 .../src/events/TopLevelEventTypes.js | 0 .../src/events/checkPassiveEvents.js | 0 .../src/events/forks/EventListener-www.js | 0 .../src/events/getEventCharCode.js | 0 .../src/events/getEventTarget.js | 0 .../src/events/getListener.js | 0 .../src/events/getVendorPrefixedEventName.js | 0 .../src/events/isEventSupported.js | 0 .../src/events/isTextInputElement.js | 0 .../events/plugins/BeforeInputEventPlugin.js | 0 .../src/events/plugins/ChangeEventPlugin.js | 0 .../events/plugins/EnterLeaveEventPlugin.js | 0 .../src/events/plugins/SelectEventPlugin.js | 0 .../src/events/plugins/SimpleEventPlugin.js | 0 .../src/server/DOMMarkupOperations.js | 0 .../ReactDOMLegacyServerStreamConfig.js | 0 .../src/server/ReactDOMServerFormatConfig.js | 0 .../ReactDOMServerLegacyFormatConfig.js | 0 .../src/server/escapeTextForBrowser.js | 0 .../server/quoteAttributeValueForBrowser.js | 0 .../src/shared/CSSProperty.js | 0 .../src/shared/DOMNamespaces.js | 0 .../src/shared/DOMProperty.js | 0 .../src/shared/HTMLNodeType.js | 0 .../shared/ReactControlledValuePropTypes.js | 0 .../src/shared/ReactDOMInvalidARIAHook.js | 0 .../shared/ReactDOMNullInputValuePropHook.js | 0 .../src/shared/ReactDOMTypes.js | 0 .../src/shared/ReactDOMUnknownPropertyHook.js | 0 .../src/shared/assertValidProps.js | 0 .../src/shared/dangerousStyleValue.js | 0 .../src/shared/hyphenateStyleName.js | 0 .../src/shared/isCustomComponent.js | 0 .../src/shared/omittedCloseTags.js | 0 .../src/shared/possibleStandardNames.js | 0 .../src/shared/sanitizeURL.js | 0 .../src/shared/validAriaProperties.js | 0 .../src/shared/voidElementTags.js | 0 .../src/shared/warnValidStyle.js | 0 packages/react-dom/index.classic.fb.js | 2 +- .../react-dom/src/ReactDOMSharedInternals.js | 4 +- .../__tests__/InvalidEventListeners-test.js | 2 +- .../ReactDOMSelection-test.internal.js | 2 +- .../src/__tests__/ReactMount-test.js | 2 +- packages/react-dom/src/client/ReactDOM.js | 14 ++--- .../react-dom/src/client/ReactDOMLegacy.js | 8 +-- packages/react-dom/src/client/ReactDOMRoot.js | 8 +-- .../getNodeForCharacterOffset-test.js | 2 +- .../src/server/ReactDOMFizzServerBrowser.js | 4 +- .../src/server/ReactDOMFizzServerNode.js | 4 +- .../src/server/ReactDOMFizzStaticBrowser.js | 4 +- .../src/server/ReactDOMFizzStaticNode.js | 4 +- .../src/server/ReactDOMLegacyServerImpl.js | 2 +- .../server/ReactDOMLegacyServerNodeStream.js | 2 +- .../src/server/ReactThreadIDAllocator.js | 59 ------------------- .../src/test-utils/ReactTestUtils.js | 4 +- .../ResponderEventPlugin-test.internal.js | 2 +- .../forks/ReactFiberHostConfig.dom-browser.js | 2 +- .../forks/ReactFiberHostConfig.dom-legacy.js | 2 +- .../forks/ReactFiberHostConfig.dom-relay.js | 2 +- .../src/forks/ReactFiberHostConfig.dom.js | 2 +- .../react-server-dom-webpack/package.json | 1 + .../ReactServerFormatConfig.dom-browser.js | 2 +- .../ReactServerFormatConfig.dom-legacy.js | 2 +- .../ReactServerFormatConfig.dom-relay.js | 2 +- .../src/forks/ReactServerFormatConfig.dom.js | 2 +- .../ReactServerStreamConfig.dom-legacy.js | 2 +- scripts/shared/inlinedHostConfigs.js | 5 +- 106 files changed, 72 insertions(+), 104 deletions(-) create mode 100644 packages/react-dom-bindings/package.json rename packages/{react-dom => react-dom-bindings}/src/client/CSSPropertyOperations.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/CSSShorthandProperty.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/DOMAccessibilityRoles.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/DOMPropertyOperations.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMComponent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMComponentTree.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMEventHandle.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMHostConfig.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMInput.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMOption.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMSelect.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMSelection.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactDOMTextarea.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ReactInputSelection.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/ToStringValue.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/createMicrosoftUnsafeLocalFunction.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/getActiveElement.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/getNodeForCharacterOffset.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/inputValueTracking.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/setInnerHTML.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/setTextContent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/client/validateDOMNesting.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/CurrentReplayingEvent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/DOMEventNames.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/DOMEventProperties.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/DOMPluginEventSystem.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/EventListener.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/EventRegistry.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/EventSystemFlags.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/FallbackCompositionState.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/PluginModuleType.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/ReactDOMControlledComponent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/ReactDOMEventListener.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/ReactDOMEventReplaying.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/ReactDOMUpdateBatching.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/ReactSyntheticEventType.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/SyntheticEvent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/TopLevelEventTypes.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/checkPassiveEvents.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/forks/EventListener-www.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/getEventCharCode.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/getEventTarget.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/getListener.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/getVendorPrefixedEventName.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/isEventSupported.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/isTextInputElement.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/plugins/BeforeInputEventPlugin.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/plugins/ChangeEventPlugin.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/plugins/EnterLeaveEventPlugin.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/plugins/SelectEventPlugin.js (100%) rename packages/{react-dom => react-dom-bindings}/src/events/plugins/SimpleEventPlugin.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/DOMMarkupOperations.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/ReactDOMLegacyServerStreamConfig.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/ReactDOMServerFormatConfig.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/ReactDOMServerLegacyFormatConfig.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/escapeTextForBrowser.js (100%) rename packages/{react-dom => react-dom-bindings}/src/server/quoteAttributeValueForBrowser.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/CSSProperty.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/DOMNamespaces.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/DOMProperty.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/HTMLNodeType.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/ReactControlledValuePropTypes.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/ReactDOMInvalidARIAHook.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/ReactDOMNullInputValuePropHook.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/ReactDOMTypes.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/ReactDOMUnknownPropertyHook.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/assertValidProps.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/dangerousStyleValue.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/hyphenateStyleName.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/isCustomComponent.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/omittedCloseTags.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/possibleStandardNames.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/sanitizeURL.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/validAriaProperties.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/voidElementTags.js (100%) rename packages/{react-dom => react-dom-bindings}/src/shared/warnValidStyle.js (100%) delete mode 100644 packages/react-dom/src/server/ReactThreadIDAllocator.js diff --git a/packages/react-dom-bindings/package.json b/packages/react-dom-bindings/package.json new file mode 100644 index 0000000000000..18e38263841eb --- /dev/null +++ b/packages/react-dom-bindings/package.json @@ -0,0 +1,23 @@ +{ + "name": "react-dom-bindings", + "description": "React implementation details for react-dom.", + "version": "18.2.0", + "private": true, + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/facebook/react.git", + "directory": "packages/react-dom-bindings" + }, + "keywords": [ + "react" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/facebook/react/issues" + }, + "homepage": "https://reactjs.org/", + "peerDependencies": { + "react": "^18.2.0" + } +} diff --git a/packages/react-dom/src/client/CSSPropertyOperations.js b/packages/react-dom-bindings/src/client/CSSPropertyOperations.js similarity index 100% rename from packages/react-dom/src/client/CSSPropertyOperations.js rename to packages/react-dom-bindings/src/client/CSSPropertyOperations.js diff --git a/packages/react-dom/src/client/CSSShorthandProperty.js b/packages/react-dom-bindings/src/client/CSSShorthandProperty.js similarity index 100% rename from packages/react-dom/src/client/CSSShorthandProperty.js rename to packages/react-dom-bindings/src/client/CSSShorthandProperty.js diff --git a/packages/react-dom/src/client/DOMAccessibilityRoles.js b/packages/react-dom-bindings/src/client/DOMAccessibilityRoles.js similarity index 100% rename from packages/react-dom/src/client/DOMAccessibilityRoles.js rename to packages/react-dom-bindings/src/client/DOMAccessibilityRoles.js diff --git a/packages/react-dom/src/client/DOMPropertyOperations.js b/packages/react-dom-bindings/src/client/DOMPropertyOperations.js similarity index 100% rename from packages/react-dom/src/client/DOMPropertyOperations.js rename to packages/react-dom-bindings/src/client/DOMPropertyOperations.js diff --git a/packages/react-dom/src/client/ReactDOMComponent.js b/packages/react-dom-bindings/src/client/ReactDOMComponent.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMComponent.js rename to packages/react-dom-bindings/src/client/ReactDOMComponent.js diff --git a/packages/react-dom/src/client/ReactDOMComponentTree.js b/packages/react-dom-bindings/src/client/ReactDOMComponentTree.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMComponentTree.js rename to packages/react-dom-bindings/src/client/ReactDOMComponentTree.js diff --git a/packages/react-dom/src/client/ReactDOMEventHandle.js b/packages/react-dom-bindings/src/client/ReactDOMEventHandle.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMEventHandle.js rename to packages/react-dom-bindings/src/client/ReactDOMEventHandle.js diff --git a/packages/react-dom/src/client/ReactDOMHostConfig.js b/packages/react-dom-bindings/src/client/ReactDOMHostConfig.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMHostConfig.js rename to packages/react-dom-bindings/src/client/ReactDOMHostConfig.js diff --git a/packages/react-dom/src/client/ReactDOMInput.js b/packages/react-dom-bindings/src/client/ReactDOMInput.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMInput.js rename to packages/react-dom-bindings/src/client/ReactDOMInput.js diff --git a/packages/react-dom/src/client/ReactDOMOption.js b/packages/react-dom-bindings/src/client/ReactDOMOption.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMOption.js rename to packages/react-dom-bindings/src/client/ReactDOMOption.js diff --git a/packages/react-dom/src/client/ReactDOMSelect.js b/packages/react-dom-bindings/src/client/ReactDOMSelect.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMSelect.js rename to packages/react-dom-bindings/src/client/ReactDOMSelect.js diff --git a/packages/react-dom/src/client/ReactDOMSelection.js b/packages/react-dom-bindings/src/client/ReactDOMSelection.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMSelection.js rename to packages/react-dom-bindings/src/client/ReactDOMSelection.js diff --git a/packages/react-dom/src/client/ReactDOMTextarea.js b/packages/react-dom-bindings/src/client/ReactDOMTextarea.js similarity index 100% rename from packages/react-dom/src/client/ReactDOMTextarea.js rename to packages/react-dom-bindings/src/client/ReactDOMTextarea.js diff --git a/packages/react-dom/src/client/ReactInputSelection.js b/packages/react-dom-bindings/src/client/ReactInputSelection.js similarity index 100% rename from packages/react-dom/src/client/ReactInputSelection.js rename to packages/react-dom-bindings/src/client/ReactInputSelection.js diff --git a/packages/react-dom/src/client/ToStringValue.js b/packages/react-dom-bindings/src/client/ToStringValue.js similarity index 100% rename from packages/react-dom/src/client/ToStringValue.js rename to packages/react-dom-bindings/src/client/ToStringValue.js diff --git a/packages/react-dom/src/client/createMicrosoftUnsafeLocalFunction.js b/packages/react-dom-bindings/src/client/createMicrosoftUnsafeLocalFunction.js similarity index 100% rename from packages/react-dom/src/client/createMicrosoftUnsafeLocalFunction.js rename to packages/react-dom-bindings/src/client/createMicrosoftUnsafeLocalFunction.js diff --git a/packages/react-dom/src/client/getActiveElement.js b/packages/react-dom-bindings/src/client/getActiveElement.js similarity index 100% rename from packages/react-dom/src/client/getActiveElement.js rename to packages/react-dom-bindings/src/client/getActiveElement.js diff --git a/packages/react-dom/src/client/getNodeForCharacterOffset.js b/packages/react-dom-bindings/src/client/getNodeForCharacterOffset.js similarity index 100% rename from packages/react-dom/src/client/getNodeForCharacterOffset.js rename to packages/react-dom-bindings/src/client/getNodeForCharacterOffset.js diff --git a/packages/react-dom/src/client/inputValueTracking.js b/packages/react-dom-bindings/src/client/inputValueTracking.js similarity index 100% rename from packages/react-dom/src/client/inputValueTracking.js rename to packages/react-dom-bindings/src/client/inputValueTracking.js diff --git a/packages/react-dom/src/client/setInnerHTML.js b/packages/react-dom-bindings/src/client/setInnerHTML.js similarity index 100% rename from packages/react-dom/src/client/setInnerHTML.js rename to packages/react-dom-bindings/src/client/setInnerHTML.js diff --git a/packages/react-dom/src/client/setTextContent.js b/packages/react-dom-bindings/src/client/setTextContent.js similarity index 100% rename from packages/react-dom/src/client/setTextContent.js rename to packages/react-dom-bindings/src/client/setTextContent.js diff --git a/packages/react-dom/src/client/validateDOMNesting.js b/packages/react-dom-bindings/src/client/validateDOMNesting.js similarity index 100% rename from packages/react-dom/src/client/validateDOMNesting.js rename to packages/react-dom-bindings/src/client/validateDOMNesting.js diff --git a/packages/react-dom/src/events/CurrentReplayingEvent.js b/packages/react-dom-bindings/src/events/CurrentReplayingEvent.js similarity index 100% rename from packages/react-dom/src/events/CurrentReplayingEvent.js rename to packages/react-dom-bindings/src/events/CurrentReplayingEvent.js diff --git a/packages/react-dom/src/events/DOMEventNames.js b/packages/react-dom-bindings/src/events/DOMEventNames.js similarity index 100% rename from packages/react-dom/src/events/DOMEventNames.js rename to packages/react-dom-bindings/src/events/DOMEventNames.js diff --git a/packages/react-dom/src/events/DOMEventProperties.js b/packages/react-dom-bindings/src/events/DOMEventProperties.js similarity index 100% rename from packages/react-dom/src/events/DOMEventProperties.js rename to packages/react-dom-bindings/src/events/DOMEventProperties.js diff --git a/packages/react-dom/src/events/DOMPluginEventSystem.js b/packages/react-dom-bindings/src/events/DOMPluginEventSystem.js similarity index 100% rename from packages/react-dom/src/events/DOMPluginEventSystem.js rename to packages/react-dom-bindings/src/events/DOMPluginEventSystem.js diff --git a/packages/react-dom/src/events/EventListener.js b/packages/react-dom-bindings/src/events/EventListener.js similarity index 100% rename from packages/react-dom/src/events/EventListener.js rename to packages/react-dom-bindings/src/events/EventListener.js diff --git a/packages/react-dom/src/events/EventRegistry.js b/packages/react-dom-bindings/src/events/EventRegistry.js similarity index 100% rename from packages/react-dom/src/events/EventRegistry.js rename to packages/react-dom-bindings/src/events/EventRegistry.js diff --git a/packages/react-dom/src/events/EventSystemFlags.js b/packages/react-dom-bindings/src/events/EventSystemFlags.js similarity index 100% rename from packages/react-dom/src/events/EventSystemFlags.js rename to packages/react-dom-bindings/src/events/EventSystemFlags.js diff --git a/packages/react-dom/src/events/FallbackCompositionState.js b/packages/react-dom-bindings/src/events/FallbackCompositionState.js similarity index 100% rename from packages/react-dom/src/events/FallbackCompositionState.js rename to packages/react-dom-bindings/src/events/FallbackCompositionState.js diff --git a/packages/react-dom/src/events/PluginModuleType.js b/packages/react-dom-bindings/src/events/PluginModuleType.js similarity index 100% rename from packages/react-dom/src/events/PluginModuleType.js rename to packages/react-dom-bindings/src/events/PluginModuleType.js diff --git a/packages/react-dom/src/events/ReactDOMControlledComponent.js b/packages/react-dom-bindings/src/events/ReactDOMControlledComponent.js similarity index 100% rename from packages/react-dom/src/events/ReactDOMControlledComponent.js rename to packages/react-dom-bindings/src/events/ReactDOMControlledComponent.js diff --git a/packages/react-dom/src/events/ReactDOMEventListener.js b/packages/react-dom-bindings/src/events/ReactDOMEventListener.js similarity index 100% rename from packages/react-dom/src/events/ReactDOMEventListener.js rename to packages/react-dom-bindings/src/events/ReactDOMEventListener.js diff --git a/packages/react-dom/src/events/ReactDOMEventReplaying.js b/packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js similarity index 100% rename from packages/react-dom/src/events/ReactDOMEventReplaying.js rename to packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js diff --git a/packages/react-dom/src/events/ReactDOMUpdateBatching.js b/packages/react-dom-bindings/src/events/ReactDOMUpdateBatching.js similarity index 100% rename from packages/react-dom/src/events/ReactDOMUpdateBatching.js rename to packages/react-dom-bindings/src/events/ReactDOMUpdateBatching.js diff --git a/packages/react-dom/src/events/ReactSyntheticEventType.js b/packages/react-dom-bindings/src/events/ReactSyntheticEventType.js similarity index 100% rename from packages/react-dom/src/events/ReactSyntheticEventType.js rename to packages/react-dom-bindings/src/events/ReactSyntheticEventType.js diff --git a/packages/react-dom/src/events/SyntheticEvent.js b/packages/react-dom-bindings/src/events/SyntheticEvent.js similarity index 100% rename from packages/react-dom/src/events/SyntheticEvent.js rename to packages/react-dom-bindings/src/events/SyntheticEvent.js diff --git a/packages/react-dom/src/events/TopLevelEventTypes.js b/packages/react-dom-bindings/src/events/TopLevelEventTypes.js similarity index 100% rename from packages/react-dom/src/events/TopLevelEventTypes.js rename to packages/react-dom-bindings/src/events/TopLevelEventTypes.js diff --git a/packages/react-dom/src/events/checkPassiveEvents.js b/packages/react-dom-bindings/src/events/checkPassiveEvents.js similarity index 100% rename from packages/react-dom/src/events/checkPassiveEvents.js rename to packages/react-dom-bindings/src/events/checkPassiveEvents.js diff --git a/packages/react-dom/src/events/forks/EventListener-www.js b/packages/react-dom-bindings/src/events/forks/EventListener-www.js similarity index 100% rename from packages/react-dom/src/events/forks/EventListener-www.js rename to packages/react-dom-bindings/src/events/forks/EventListener-www.js diff --git a/packages/react-dom/src/events/getEventCharCode.js b/packages/react-dom-bindings/src/events/getEventCharCode.js similarity index 100% rename from packages/react-dom/src/events/getEventCharCode.js rename to packages/react-dom-bindings/src/events/getEventCharCode.js diff --git a/packages/react-dom/src/events/getEventTarget.js b/packages/react-dom-bindings/src/events/getEventTarget.js similarity index 100% rename from packages/react-dom/src/events/getEventTarget.js rename to packages/react-dom-bindings/src/events/getEventTarget.js diff --git a/packages/react-dom/src/events/getListener.js b/packages/react-dom-bindings/src/events/getListener.js similarity index 100% rename from packages/react-dom/src/events/getListener.js rename to packages/react-dom-bindings/src/events/getListener.js diff --git a/packages/react-dom/src/events/getVendorPrefixedEventName.js b/packages/react-dom-bindings/src/events/getVendorPrefixedEventName.js similarity index 100% rename from packages/react-dom/src/events/getVendorPrefixedEventName.js rename to packages/react-dom-bindings/src/events/getVendorPrefixedEventName.js diff --git a/packages/react-dom/src/events/isEventSupported.js b/packages/react-dom-bindings/src/events/isEventSupported.js similarity index 100% rename from packages/react-dom/src/events/isEventSupported.js rename to packages/react-dom-bindings/src/events/isEventSupported.js diff --git a/packages/react-dom/src/events/isTextInputElement.js b/packages/react-dom-bindings/src/events/isTextInputElement.js similarity index 100% rename from packages/react-dom/src/events/isTextInputElement.js rename to packages/react-dom-bindings/src/events/isTextInputElement.js diff --git a/packages/react-dom/src/events/plugins/BeforeInputEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/BeforeInputEventPlugin.js similarity index 100% rename from packages/react-dom/src/events/plugins/BeforeInputEventPlugin.js rename to packages/react-dom-bindings/src/events/plugins/BeforeInputEventPlugin.js diff --git a/packages/react-dom/src/events/plugins/ChangeEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js similarity index 100% rename from packages/react-dom/src/events/plugins/ChangeEventPlugin.js rename to packages/react-dom-bindings/src/events/plugins/ChangeEventPlugin.js diff --git a/packages/react-dom/src/events/plugins/EnterLeaveEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/EnterLeaveEventPlugin.js similarity index 100% rename from packages/react-dom/src/events/plugins/EnterLeaveEventPlugin.js rename to packages/react-dom-bindings/src/events/plugins/EnterLeaveEventPlugin.js diff --git a/packages/react-dom/src/events/plugins/SelectEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/SelectEventPlugin.js similarity index 100% rename from packages/react-dom/src/events/plugins/SelectEventPlugin.js rename to packages/react-dom-bindings/src/events/plugins/SelectEventPlugin.js diff --git a/packages/react-dom/src/events/plugins/SimpleEventPlugin.js b/packages/react-dom-bindings/src/events/plugins/SimpleEventPlugin.js similarity index 100% rename from packages/react-dom/src/events/plugins/SimpleEventPlugin.js rename to packages/react-dom-bindings/src/events/plugins/SimpleEventPlugin.js diff --git a/packages/react-dom/src/server/DOMMarkupOperations.js b/packages/react-dom-bindings/src/server/DOMMarkupOperations.js similarity index 100% rename from packages/react-dom/src/server/DOMMarkupOperations.js rename to packages/react-dom-bindings/src/server/DOMMarkupOperations.js diff --git a/packages/react-dom/src/server/ReactDOMLegacyServerStreamConfig.js b/packages/react-dom-bindings/src/server/ReactDOMLegacyServerStreamConfig.js similarity index 100% rename from packages/react-dom/src/server/ReactDOMLegacyServerStreamConfig.js rename to packages/react-dom-bindings/src/server/ReactDOMLegacyServerStreamConfig.js diff --git a/packages/react-dom/src/server/ReactDOMServerFormatConfig.js b/packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js similarity index 100% rename from packages/react-dom/src/server/ReactDOMServerFormatConfig.js rename to packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js diff --git a/packages/react-dom/src/server/ReactDOMServerLegacyFormatConfig.js b/packages/react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig.js similarity index 100% rename from packages/react-dom/src/server/ReactDOMServerLegacyFormatConfig.js rename to packages/react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig.js diff --git a/packages/react-dom/src/server/escapeTextForBrowser.js b/packages/react-dom-bindings/src/server/escapeTextForBrowser.js similarity index 100% rename from packages/react-dom/src/server/escapeTextForBrowser.js rename to packages/react-dom-bindings/src/server/escapeTextForBrowser.js diff --git a/packages/react-dom/src/server/quoteAttributeValueForBrowser.js b/packages/react-dom-bindings/src/server/quoteAttributeValueForBrowser.js similarity index 100% rename from packages/react-dom/src/server/quoteAttributeValueForBrowser.js rename to packages/react-dom-bindings/src/server/quoteAttributeValueForBrowser.js diff --git a/packages/react-dom/src/shared/CSSProperty.js b/packages/react-dom-bindings/src/shared/CSSProperty.js similarity index 100% rename from packages/react-dom/src/shared/CSSProperty.js rename to packages/react-dom-bindings/src/shared/CSSProperty.js diff --git a/packages/react-dom/src/shared/DOMNamespaces.js b/packages/react-dom-bindings/src/shared/DOMNamespaces.js similarity index 100% rename from packages/react-dom/src/shared/DOMNamespaces.js rename to packages/react-dom-bindings/src/shared/DOMNamespaces.js diff --git a/packages/react-dom/src/shared/DOMProperty.js b/packages/react-dom-bindings/src/shared/DOMProperty.js similarity index 100% rename from packages/react-dom/src/shared/DOMProperty.js rename to packages/react-dom-bindings/src/shared/DOMProperty.js diff --git a/packages/react-dom/src/shared/HTMLNodeType.js b/packages/react-dom-bindings/src/shared/HTMLNodeType.js similarity index 100% rename from packages/react-dom/src/shared/HTMLNodeType.js rename to packages/react-dom-bindings/src/shared/HTMLNodeType.js diff --git a/packages/react-dom/src/shared/ReactControlledValuePropTypes.js b/packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js similarity index 100% rename from packages/react-dom/src/shared/ReactControlledValuePropTypes.js rename to packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js diff --git a/packages/react-dom/src/shared/ReactDOMInvalidARIAHook.js b/packages/react-dom-bindings/src/shared/ReactDOMInvalidARIAHook.js similarity index 100% rename from packages/react-dom/src/shared/ReactDOMInvalidARIAHook.js rename to packages/react-dom-bindings/src/shared/ReactDOMInvalidARIAHook.js diff --git a/packages/react-dom/src/shared/ReactDOMNullInputValuePropHook.js b/packages/react-dom-bindings/src/shared/ReactDOMNullInputValuePropHook.js similarity index 100% rename from packages/react-dom/src/shared/ReactDOMNullInputValuePropHook.js rename to packages/react-dom-bindings/src/shared/ReactDOMNullInputValuePropHook.js diff --git a/packages/react-dom/src/shared/ReactDOMTypes.js b/packages/react-dom-bindings/src/shared/ReactDOMTypes.js similarity index 100% rename from packages/react-dom/src/shared/ReactDOMTypes.js rename to packages/react-dom-bindings/src/shared/ReactDOMTypes.js diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js similarity index 100% rename from packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js rename to packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js diff --git a/packages/react-dom/src/shared/assertValidProps.js b/packages/react-dom-bindings/src/shared/assertValidProps.js similarity index 100% rename from packages/react-dom/src/shared/assertValidProps.js rename to packages/react-dom-bindings/src/shared/assertValidProps.js diff --git a/packages/react-dom/src/shared/dangerousStyleValue.js b/packages/react-dom-bindings/src/shared/dangerousStyleValue.js similarity index 100% rename from packages/react-dom/src/shared/dangerousStyleValue.js rename to packages/react-dom-bindings/src/shared/dangerousStyleValue.js diff --git a/packages/react-dom/src/shared/hyphenateStyleName.js b/packages/react-dom-bindings/src/shared/hyphenateStyleName.js similarity index 100% rename from packages/react-dom/src/shared/hyphenateStyleName.js rename to packages/react-dom-bindings/src/shared/hyphenateStyleName.js diff --git a/packages/react-dom/src/shared/isCustomComponent.js b/packages/react-dom-bindings/src/shared/isCustomComponent.js similarity index 100% rename from packages/react-dom/src/shared/isCustomComponent.js rename to packages/react-dom-bindings/src/shared/isCustomComponent.js diff --git a/packages/react-dom/src/shared/omittedCloseTags.js b/packages/react-dom-bindings/src/shared/omittedCloseTags.js similarity index 100% rename from packages/react-dom/src/shared/omittedCloseTags.js rename to packages/react-dom-bindings/src/shared/omittedCloseTags.js diff --git a/packages/react-dom/src/shared/possibleStandardNames.js b/packages/react-dom-bindings/src/shared/possibleStandardNames.js similarity index 100% rename from packages/react-dom/src/shared/possibleStandardNames.js rename to packages/react-dom-bindings/src/shared/possibleStandardNames.js diff --git a/packages/react-dom/src/shared/sanitizeURL.js b/packages/react-dom-bindings/src/shared/sanitizeURL.js similarity index 100% rename from packages/react-dom/src/shared/sanitizeURL.js rename to packages/react-dom-bindings/src/shared/sanitizeURL.js diff --git a/packages/react-dom/src/shared/validAriaProperties.js b/packages/react-dom-bindings/src/shared/validAriaProperties.js similarity index 100% rename from packages/react-dom/src/shared/validAriaProperties.js rename to packages/react-dom-bindings/src/shared/validAriaProperties.js diff --git a/packages/react-dom/src/shared/voidElementTags.js b/packages/react-dom-bindings/src/shared/voidElementTags.js similarity index 100% rename from packages/react-dom/src/shared/voidElementTags.js rename to packages/react-dom-bindings/src/shared/voidElementTags.js diff --git a/packages/react-dom/src/shared/warnValidStyle.js b/packages/react-dom-bindings/src/shared/warnValidStyle.js similarity index 100% rename from packages/react-dom/src/shared/warnValidStyle.js rename to packages/react-dom-bindings/src/shared/warnValidStyle.js diff --git a/packages/react-dom/index.classic.fb.js b/packages/react-dom/index.classic.fb.js index fddf873d48b60..95421305609e9 100644 --- a/packages/react-dom/index.classic.fb.js +++ b/packages/react-dom/index.classic.fb.js @@ -7,7 +7,7 @@ * @flow */ -import {isEnabled} from './src/events/ReactDOMEventListener'; +import {isEnabled} from 'react-dom-bindings/src/events/ReactDOMEventListener'; import Internals from './src/ReactDOMSharedInternals'; diff --git a/packages/react-dom/src/ReactDOMSharedInternals.js b/packages/react-dom/src/ReactDOMSharedInternals.js index 6b4525cffca2a..9e678ea2a9604 100644 --- a/packages/react-dom/src/ReactDOMSharedInternals.js +++ b/packages/react-dom/src/ReactDOMSharedInternals.js @@ -11,12 +11,12 @@ import {batchedUpdates} from 'react-reconciler/src/ReactFiberReconciler'; import { enqueueStateRestore, restoreStateIfNeeded, -} from './events/ReactDOMControlledComponent'; +} from 'react-dom-bindings/src/events/ReactDOMControlledComponent'; import { getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, -} from './client/ReactDOMComponentTree'; +} from 'react-dom-bindings/src/client/ReactDOMComponentTree'; const Internals = { usingClientEntryPoint: false, diff --git a/packages/react-dom/src/__tests__/InvalidEventListeners-test.js b/packages/react-dom/src/__tests__/InvalidEventListeners-test.js index 32cecb4640ece..88bb160a513b2 100644 --- a/packages/react-dom/src/__tests__/InvalidEventListeners-test.js +++ b/packages/react-dom/src/__tests__/InvalidEventListeners-test.js @@ -9,7 +9,7 @@ 'use strict'; -jest.mock('../events/isEventSupported'); +jest.mock('react-dom-bindings/src/events/isEventSupported'); describe('InvalidEventListeners', () => { let React; diff --git a/packages/react-dom/src/__tests__/ReactDOMSelection-test.internal.js b/packages/react-dom/src/__tests__/ReactDOMSelection-test.internal.js index d3724c2683cea..28e6873b97d0b 100644 --- a/packages/react-dom/src/__tests__/ReactDOMSelection-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactDOMSelection-test.internal.js @@ -19,7 +19,7 @@ describe('ReactDOMSelection', () => { beforeEach(() => { React = require('react'); ReactDOM = require('react-dom'); - ReactDOMSelection = require('../client/ReactDOMSelection'); + ReactDOMSelection = require('react-dom-bindings/src/client/ReactDOMSelection'); ({getModernOffsetsFromPoints} = ReactDOMSelection); }); diff --git a/packages/react-dom/src/__tests__/ReactMount-test.js b/packages/react-dom/src/__tests__/ReactMount-test.js index 9571905edaf52..b1a56605c659a 100644 --- a/packages/react-dom/src/__tests__/ReactMount-test.js +++ b/packages/react-dom/src/__tests__/ReactMount-test.js @@ -9,7 +9,7 @@ 'use strict'; -const {COMMENT_NODE} = require('../shared/HTMLNodeType'); +const {COMMENT_NODE} = require('react-dom-bindings/src/shared/HTMLNodeType'); let React; let ReactDOM; diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index bfd300f7b4c39..3134f220aa669 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -8,7 +8,7 @@ */ import type {ReactNodeList} from 'shared/ReactTypes'; -import type {Container} from './ReactDOMHostConfig'; +import type {Container} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; import type { RootType, HydrateRootOptions, @@ -27,7 +27,7 @@ import { hydrateRoot as hydrateRootImpl, isValidContainer, } from './ReactDOMRoot'; -import {createEventHandle} from './ReactDOMEventHandle'; +import {createEventHandle} from 'react-dom-bindings/src/client/ReactDOMEventHandle'; import { batchedUpdates, @@ -50,8 +50,8 @@ import {canUseDOM} from 'shared/ExecutionEnvironment'; import ReactVersion from 'shared/ReactVersion'; import {enableNewReconciler} from 'shared/ReactFeatureFlags'; -import {getClosestInstanceFromNode} from './ReactDOMComponentTree'; -import {restoreControlledState} from './ReactDOMComponent'; +import {getClosestInstanceFromNode} from 'react-dom-bindings/src/client/ReactDOMComponentTree'; +import {restoreControlledState} from 'react-dom-bindings/src/client/ReactDOMComponent'; import { setAttemptSynchronousHydration, setAttemptDiscreteHydration, @@ -59,9 +59,9 @@ import { setAttemptHydrationAtCurrentPriority, setGetCurrentUpdatePriority, setAttemptHydrationAtPriority, -} from '../events/ReactDOMEventReplaying'; -import {setBatchingImplementation} from '../events/ReactDOMUpdateBatching'; -import {setRestoreImplementation} from '../events/ReactDOMControlledComponent'; +} from 'react-dom-bindings/src/events/ReactDOMEventReplaying'; +import {setBatchingImplementation} from 'react-dom-bindings/src/events/ReactDOMUpdateBatching'; +import {setRestoreImplementation} from 'react-dom-bindings/src/events/ReactDOMControlledComponent'; import Internals from '../ReactDOMSharedInternals'; setAttemptSynchronousHydration(attemptSynchronousHydration); diff --git a/packages/react-dom/src/client/ReactDOMLegacy.js b/packages/react-dom/src/client/ReactDOMLegacy.js index af0e35e128bd4..7118ba1e871c7 100644 --- a/packages/react-dom/src/client/ReactDOMLegacy.js +++ b/packages/react-dom/src/client/ReactDOMLegacy.js @@ -7,7 +7,7 @@ * @flow */ -import type {Container} from './ReactDOMHostConfig'; +import type {Container} from 'react-dom-bindings/src/client/ReactDOMHostConfig'; import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes'; import type {ReactNodeList} from 'shared/ReactTypes'; @@ -16,14 +16,14 @@ import { isContainerMarkedAsRoot, markContainerAsRoot, unmarkContainerAsRoot, -} from './ReactDOMComponentTree'; -import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem'; +} from 'react-dom-bindings/src/client/ReactDOMComponentTree'; +import {listenToAllSupportedEvents} from 'react-dom-bindings/src/events/DOMPluginEventSystem'; import {isValidContainerLegacy} from './ReactDOMRoot'; import { DOCUMENT_NODE, ELEMENT_NODE, COMMENT_NODE, -} from '../shared/HTMLNodeType'; +} from 'react-dom-bindings/src/shared/HTMLNodeType'; import { createContainer, diff --git a/packages/react-dom/src/client/ReactDOMRoot.js b/packages/react-dom/src/client/ReactDOMRoot.js index 9fbed21bd1767..cea9be01a3a19 100644 --- a/packages/react-dom/src/client/ReactDOMRoot.js +++ b/packages/react-dom/src/client/ReactDOMRoot.js @@ -13,7 +13,7 @@ import type { TransitionTracingCallbacks, } from 'react-reconciler/src/ReactInternalTypes'; -import {queueExplicitHydrationTarget} from '../events/ReactDOMEventReplaying'; +import {queueExplicitHydrationTarget} from 'react-dom-bindings/src/events/ReactDOMEventReplaying'; import {REACT_ELEMENT_TYPE} from 'shared/ReactSymbols'; import {enableFloat} from 'shared/ReactFeatureFlags'; @@ -51,14 +51,14 @@ import { isContainerMarkedAsRoot, markContainerAsRoot, unmarkContainerAsRoot, -} from './ReactDOMComponentTree'; -import {listenToAllSupportedEvents} from '../events/DOMPluginEventSystem'; +} from 'react-dom-bindings/src/client/ReactDOMComponentTree'; +import {listenToAllSupportedEvents} from 'react-dom-bindings/src/events/DOMPluginEventSystem'; import { ELEMENT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE, -} from '../shared/HTMLNodeType'; +} from 'react-dom-bindings/src/shared/HTMLNodeType'; import { createContainer, diff --git a/packages/react-dom/src/client/__tests__/getNodeForCharacterOffset-test.js b/packages/react-dom/src/client/__tests__/getNodeForCharacterOffset-test.js index bdfbb8f71bf9c..9ff72f891044d 100644 --- a/packages/react-dom/src/client/__tests__/getNodeForCharacterOffset-test.js +++ b/packages/react-dom/src/client/__tests__/getNodeForCharacterOffset-test.js @@ -10,7 +10,7 @@ 'use strict'; // TODO: can we express this test with only public API? -const getNodeForCharacterOffset = require('../getNodeForCharacterOffset') +const getNodeForCharacterOffset = require('react-dom-bindings/src/client/getNodeForCharacterOffset') .default; // Create node from HTML string diff --git a/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js b/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js index 758f35058aaa0..c9cf4b81b5301 100644 --- a/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js +++ b/packages/react-dom/src/server/ReactDOMFizzServerBrowser.js @@ -8,7 +8,7 @@ */ import type {ReactNodeList} from 'shared/ReactTypes'; -import type {BootstrapScriptDescriptor} from './ReactDOMServerFormatConfig'; +import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; import ReactVersion from 'shared/ReactVersion'; @@ -22,7 +22,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; type Options = { identifierPrefix?: string, diff --git a/packages/react-dom/src/server/ReactDOMFizzServerNode.js b/packages/react-dom/src/server/ReactDOMFizzServerNode.js index 089d24bf7b277..5280dd50a13a5 100644 --- a/packages/react-dom/src/server/ReactDOMFizzServerNode.js +++ b/packages/react-dom/src/server/ReactDOMFizzServerNode.js @@ -9,7 +9,7 @@ import type {ReactNodeList} from 'shared/ReactTypes'; import type {Writable} from 'stream'; -import type {BootstrapScriptDescriptor} from './ReactDOMServerFormatConfig'; +import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; import type {Destination} from 'react-server/src/ReactServerStreamConfigNode'; import ReactVersion from 'shared/ReactVersion'; @@ -24,7 +24,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; function createDrainHandler(destination: Destination, request) { return () => startFlowing(request, destination); diff --git a/packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js b/packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js index f52901fb320eb..2036b078b760d 100644 --- a/packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js +++ b/packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js @@ -8,7 +8,7 @@ */ import type {ReactNodeList} from 'shared/ReactTypes'; -import type {BootstrapScriptDescriptor} from './ReactDOMServerFormatConfig'; +import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; import ReactVersion from 'shared/ReactVersion'; @@ -22,7 +22,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; type Options = { identifierPrefix?: string, diff --git a/packages/react-dom/src/server/ReactDOMFizzStaticNode.js b/packages/react-dom/src/server/ReactDOMFizzStaticNode.js index ba9b6a1fbba79..74631c3e19f8f 100644 --- a/packages/react-dom/src/server/ReactDOMFizzStaticNode.js +++ b/packages/react-dom/src/server/ReactDOMFizzStaticNode.js @@ -8,7 +8,7 @@ */ import type {ReactNodeList} from 'shared/ReactTypes'; -import type {BootstrapScriptDescriptor} from './ReactDOMServerFormatConfig'; +import type {BootstrapScriptDescriptor} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; import {Writable, Readable} from 'stream'; @@ -24,7 +24,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; type Options = { identifierPrefix?: string, diff --git a/packages/react-dom/src/server/ReactDOMLegacyServerImpl.js b/packages/react-dom/src/server/ReactDOMLegacyServerImpl.js index 504201f3c24ff..0e6d9272a2292 100644 --- a/packages/react-dom/src/server/ReactDOMLegacyServerImpl.js +++ b/packages/react-dom/src/server/ReactDOMLegacyServerImpl.js @@ -21,7 +21,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerLegacyFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig'; type ServerOptions = { identifierPrefix?: string, diff --git a/packages/react-dom/src/server/ReactDOMLegacyServerNodeStream.js b/packages/react-dom/src/server/ReactDOMLegacyServerNodeStream.js index 25b88156e0755..7f759ad34c686 100644 --- a/packages/react-dom/src/server/ReactDOMLegacyServerNodeStream.js +++ b/packages/react-dom/src/server/ReactDOMLegacyServerNodeStream.js @@ -21,7 +21,7 @@ import { import { createResponseState, createRootFormatContext, -} from './ReactDOMServerLegacyFormatConfig'; +} from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig'; import {Readable} from 'stream'; diff --git a/packages/react-dom/src/server/ReactThreadIDAllocator.js b/packages/react-dom/src/server/ReactThreadIDAllocator.js deleted file mode 100644 index fabf9fef98843..0000000000000 --- a/packages/react-dom/src/server/ReactThreadIDAllocator.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - */ - -// Allocates a new index for each request. Tries to stay as compact as possible so that these -// indices can be used to reference a tightly packed array. As opposed to being used in a Map. -// The first allocated index is 1. - -export type ThreadID = number; - -let nextAvailableThreadIDs = new Uint16Array(16); -for (let i = 0; i < 15; i++) { - nextAvailableThreadIDs[i] = i + 1; -} -nextAvailableThreadIDs[15] = 0; - -function growThreadCountAndReturnNextAvailable() { - const oldArray = nextAvailableThreadIDs; - const oldSize = oldArray.length; - const newSize = oldSize * 2; - - if (newSize > 0x10000) { - throw new Error( - 'Maximum number of concurrent React renderers exceeded. ' + - 'This can happen if you are not properly destroying the Readable provided by React. ' + - 'Ensure that you call .destroy() on it if you no longer want to read from it, ' + - 'and did not read to the end. If you use .pipe() this should be automatic.', - ); - } - - const newArray = new Uint16Array(newSize); - newArray.set(oldArray); - nextAvailableThreadIDs = newArray; - nextAvailableThreadIDs[0] = oldSize + 1; - for (let i = oldSize; i < newSize - 1; i++) { - nextAvailableThreadIDs[i] = i + 1; - } - nextAvailableThreadIDs[newSize - 1] = 0; - return oldSize; -} - -export function allocThreadID(): ThreadID { - const nextID = nextAvailableThreadIDs[0]; - if (nextID === 0) { - return growThreadCountAndReturnNextAvailable(); - } - nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID]; - return nextID; -} - -export function freeThreadID(id: ThreadID) { - nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0]; - nextAvailableThreadIDs[0] = id; -} diff --git a/packages/react-dom/src/test-utils/ReactTestUtils.js b/packages/react-dom/src/test-utils/ReactTestUtils.js index 2c89baf398a90..319a2cd589fb8 100644 --- a/packages/react-dom/src/test-utils/ReactTestUtils.js +++ b/packages/react-dom/src/test-utils/ReactTestUtils.js @@ -15,8 +15,8 @@ import { HostComponent, HostText, } from 'react-reconciler/src/ReactWorkTags'; -import {SyntheticEvent} from '../events/SyntheticEvent'; -import {ELEMENT_NODE} from '../shared/HTMLNodeType'; +import {SyntheticEvent} from 'react-dom-bindings/src/events/SyntheticEvent'; +import {ELEMENT_NODE} from 'react-dom-bindings/src/shared/HTMLNodeType'; import { rethrowCaughtError, invokeGuardedCallbackAndCatchFirstError, diff --git a/packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js b/packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js index 6f09626539b01..c088ee1c6ae61 100644 --- a/packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js +++ b/packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js @@ -1382,7 +1382,7 @@ describe('ResponderEventPlugin', () => { const getLowestCommonAncestor = require('react-native-renderer/src/legacy-events/ResponderEventPlugin') .getLowestCommonAncestor; // This works by accident and will likely break in the future. - const ReactDOMComponentTree = require('react-dom/src/client/ReactDOMComponentTree'); + const ReactDOMComponentTree = require('react-dom-bindings/src/client/ReactDOMComponentTree'); class ChildComponent extends React.Component { render() { diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js index d830c8501be27..3b71af0e69171 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js +++ b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-browser.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/client/ReactDOMHostConfig'; +export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js index d830c8501be27..3b71af0e69171 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js +++ b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-legacy.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/client/ReactDOMHostConfig'; +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 index d830c8501be27..3b71af0e69171 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js +++ b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom-relay.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/client/ReactDOMHostConfig'; +export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; diff --git a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom.js b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom.js index d830c8501be27..3b71af0e69171 100644 --- a/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom.js +++ b/packages/react-reconciler/src/forks/ReactFiberHostConfig.dom.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/client/ReactDOMHostConfig'; +export * from 'react-dom-bindings/src/client/ReactDOMHostConfig'; diff --git a/packages/react-server-dom-webpack/package.json b/packages/react-server-dom-webpack/package.json index 45ba3669f90af..a9948e4ccc14a 100644 --- a/packages/react-server-dom-webpack/package.json +++ b/packages/react-server-dom-webpack/package.json @@ -49,6 +49,7 @@ }, "peerDependencies": { "react": "^17.0.0", + "react-dom": "^17.0.0", "webpack": "^5.59.0" }, "dependencies": { diff --git a/packages/react-server/src/forks/ReactServerFormatConfig.dom-browser.js b/packages/react-server/src/forks/ReactServerFormatConfig.dom-browser.js index c6e482efeb60c..9768b5beb6db1 100644 --- a/packages/react-server/src/forks/ReactServerFormatConfig.dom-browser.js +++ b/packages/react-server/src/forks/ReactServerFormatConfig.dom-browser.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/server/ReactDOMServerFormatConfig'; +export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; diff --git a/packages/react-server/src/forks/ReactServerFormatConfig.dom-legacy.js b/packages/react-server/src/forks/ReactServerFormatConfig.dom-legacy.js index acbac5042b62a..a08da8f1ec636 100644 --- a/packages/react-server/src/forks/ReactServerFormatConfig.dom-legacy.js +++ b/packages/react-server/src/forks/ReactServerFormatConfig.dom-legacy.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/server/ReactDOMServerLegacyFormatConfig'; +export * from 'react-dom-bindings/src/server/ReactDOMServerLegacyFormatConfig'; diff --git a/packages/react-server/src/forks/ReactServerFormatConfig.dom-relay.js b/packages/react-server/src/forks/ReactServerFormatConfig.dom-relay.js index c6e482efeb60c..9768b5beb6db1 100644 --- a/packages/react-server/src/forks/ReactServerFormatConfig.dom-relay.js +++ b/packages/react-server/src/forks/ReactServerFormatConfig.dom-relay.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/server/ReactDOMServerFormatConfig'; +export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; diff --git a/packages/react-server/src/forks/ReactServerFormatConfig.dom.js b/packages/react-server/src/forks/ReactServerFormatConfig.dom.js index c6e482efeb60c..9768b5beb6db1 100644 --- a/packages/react-server/src/forks/ReactServerFormatConfig.dom.js +++ b/packages/react-server/src/forks/ReactServerFormatConfig.dom.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/server/ReactDOMServerFormatConfig'; +export * from 'react-dom-bindings/src/server/ReactDOMServerFormatConfig'; diff --git a/packages/react-server/src/forks/ReactServerStreamConfig.dom-legacy.js b/packages/react-server/src/forks/ReactServerStreamConfig.dom-legacy.js index 160efd5a92b23..8ec7ed3f53e4a 100644 --- a/packages/react-server/src/forks/ReactServerStreamConfig.dom-legacy.js +++ b/packages/react-server/src/forks/ReactServerStreamConfig.dom-legacy.js @@ -7,4 +7,4 @@ * @flow */ -export * from 'react-dom/src/server/ReactDOMLegacyServerStreamConfig'; +export * from 'react-dom-bindings/src/server/ReactDOMLegacyServerStreamConfig'; diff --git a/scripts/shared/inlinedHostConfigs.js b/scripts/shared/inlinedHostConfigs.js index 977a1cae2e6b2..9d3cfe9b35517 100644 --- a/scripts/shared/inlinedHostConfigs.js +++ b/scripts/shared/inlinedHostConfigs.js @@ -19,6 +19,7 @@ module.exports = [ ], paths: [ 'react-dom', + 'react-dom-bindings', 'react-dom/client', 'react-dom/server', 'react-dom/server.node', @@ -53,6 +54,7 @@ module.exports = [ ], paths: [ 'react-dom', + 'react-dom-bindings', 'react-dom/client', 'react-dom/server.browser', 'react-dom/static.browser', @@ -80,6 +82,7 @@ module.exports = [ ], paths: [ 'react-dom', + 'react-dom-bindings', 'react-server-dom-webpack', 'react-dom/src/server/ReactDOMLegacyServerImpl.js', // not an entrypoint, but only usable in *Brower and *Node files 'react-dom/src/server/ReactDOMLegacyServerBrowser.js', // react-dom/server.browser @@ -127,7 +130,7 @@ module.exports = [ 'react-server-dom-relay/server', 'react-server-dom-relay/src/ReactDOMServerFB.js', ], - paths: ['react-dom', 'react-server-dom-relay'], + paths: ['react-dom', 'react-dom-bindings', 'react-server-dom-relay'], isFlowTyped: true, isServerSupported: true, },