diff --git a/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js index 8234f6144e6d0..6f1acf879a1cb 100644 --- a/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js +++ b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js @@ -404,11 +404,10 @@ describe('ResponderEventPlugin', () => { beforeEach(() => { jest.resetModules(); - const ReactDOMUnstableNativeDependencies = require('react-dom/unstable-native-dependencies'); EventBatching = require('legacy-events/EventBatching'); EventPluginUtils = require('legacy-events/EventPluginUtils'); - ResponderEventPlugin = - ReactDOMUnstableNativeDependencies.ResponderEventPlugin; + ResponderEventPlugin = require('legacy-events/ResponderEventPlugin') + .default; deleteAllListeners(GRANDPARENT_INST); deleteAllListeners(PARENT_INST); diff --git a/packages/react-dom/npm/unstable-native-dependencies.js b/packages/react-dom/npm/unstable-native-dependencies.js deleted file mode 100644 index 6a498a3686e6a..0000000000000 --- a/packages/react-dom/npm/unstable-native-dependencies.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -if (process.env.NODE_ENV === 'production') { - module.exports = require('./cjs/react-dom-unstable-native-dependencies.production.min.js'); -} else { - module.exports = require('./cjs/react-dom-unstable-native-dependencies.development.js'); -} diff --git a/packages/react-dom/package.json b/packages/react-dom/package.json index 1fb6e427947e5..a251967e3c63d 100644 --- a/packages/react-dom/package.json +++ b/packages/react-dom/package.json @@ -38,7 +38,6 @@ "unstable-fizz.js", "unstable-fizz.browser.js", "unstable-fizz.node.js", - "unstable-native-dependencies.js", "cjs/", "umd/" ], diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index 5de914e345134..6f54abb6e81dc 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -172,8 +172,8 @@ function unstable_createPortal( } const Internals = { - // Keep in sync with ReactDOMUnstableNativeDependencies.js - // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification. + // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js. + // This is an array for better minification. Events: [ getInstanceFromNode, getNodeFromInstance, diff --git a/packages/react-dom/src/test-utils/ReactTestUtils.js b/packages/react-dom/src/test-utils/ReactTestUtils.js index 2348a047ba9fd..9cce946759030 100644 --- a/packages/react-dom/src/test-utils/ReactTestUtils.js +++ b/packages/react-dom/src/test-utils/ReactTestUtils.js @@ -25,8 +25,7 @@ import accumulateInto from 'legacy-events/accumulateInto'; import {enableModernEventSystem} from 'shared/ReactFeatureFlags'; const {findDOMNode} = ReactDOM; -// Keep in sync with ReactDOMUnstableNativeDependencies.js -// ReactDOM.js, and ReactTestUtilsAct.js: +// Keep in sync with ReactDOM.js, and ReactTestUtilsAct.js: const [ getInstanceFromNode, /* eslint-disable no-unused-vars */ diff --git a/packages/react-dom/src/test-utils/ReactTestUtilsAct.js b/packages/react-dom/src/test-utils/ReactTestUtilsAct.js index c1bab1c869c3e..3061bf2b5e7e8 100644 --- a/packages/react-dom/src/test-utils/ReactTestUtilsAct.js +++ b/packages/react-dom/src/test-utils/ReactTestUtilsAct.js @@ -14,8 +14,7 @@ import ReactSharedInternals from 'shared/ReactSharedInternals'; import enqueueTask from 'shared/enqueueTask'; import * as Scheduler from 'scheduler'; -// Keep in sync with ReactDOMUnstableNativeDependencies.js -// ReactDOM.js, and ReactTestUtils.js: +// Keep in sync with ReactDOM.js, and ReactTestUtils.js: const [ /* eslint-disable no-unused-vars */ getInstanceFromNode, diff --git a/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js b/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js deleted file mode 100644 index 622819940bd28..0000000000000 --- a/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js +++ /dev/null @@ -1,32 +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. - */ - -import * as ReactDOM from 'react-dom'; -import {setComponentTree} from 'legacy-events/EventPluginUtils'; -import ResponderEventPlugin from 'legacy-events/ResponderEventPlugin'; -import ResponderTouchHistoryStore from 'legacy-events/ResponderTouchHistoryStore'; - -// Inject react-dom's ComponentTree into this module. -// Keep in sync with ReactDOM.js, ReactTestUtils.js, and ReactTestUtilsAct.js: -const [ - getInstanceFromNode, - getNodeFromInstance, - getFiberCurrentPropsFromNode, - injectEventPluginsByName, -] = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events; - -setComponentTree( - getFiberCurrentPropsFromNode, - getInstanceFromNode, - getNodeFromInstance, -); - -export { - ResponderEventPlugin, - ResponderTouchHistoryStore, - injectEventPluginsByName, -}; diff --git a/packages/react-dom/unstable-native-dependencies.js b/packages/react-dom/unstable-native-dependencies.js deleted file mode 100644 index ec502fb890690..0000000000000 --- a/packages/react-dom/unstable-native-dependencies.js +++ /dev/null @@ -1,10 +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 - */ - -export * from './src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies'; diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js index ef87db971cf23..8c87b1fd81af5 100644 --- a/scripts/rollup/bundles.js +++ b/scripts/rollup/bundles.js @@ -155,15 +155,6 @@ const bundles = [ externals: ['react'], }, - /* React DOM internals required for react-native-web (e.g., to shim native events from react-dom) */ - { - bundleTypes: [UMD_DEV, UMD_PROD, NODE_DEV, NODE_PROD], - moduleType: RENDERER_UTILS, - entry: 'react-dom/unstable-native-dependencies', - global: 'ReactDOMUnstableNativeDependencies', - externals: ['react', 'react-dom'], - }, - /******* React DOM Server *******/ { bundleTypes: [