ReactDOM: remove unstable-native-dependencies bundle (#18483)
This is only used by react-native-web and will be replaced by a user-space implementation. See: https://github.com/necolas/react-native-web/issues/1568
Nicolas Gallagher committed
Apr 18, 2020 at 15:40 UTC
96203240d3de3c290f3d6013a8cbcc7b38dc1740
9 files changed
+6
-68
packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js
+2
-3
@@ -404,11 +404,10 @@ describe('ResponderEventPlugin', () => {
404
beforeEach(() => {
405
jest.resetModules();
406
407
- const ReactDOMUnstableNativeDependencies = require('react-dom/unstable-native-dependencies');
407
EventBatching = require('legacy-events/EventBatching');
408
EventPluginUtils = require('legacy-events/EventPluginUtils');
410
- ResponderEventPlugin =
411
- ReactDOMUnstableNativeDependencies.ResponderEventPlugin;
409
+ ResponderEventPlugin = require('legacy-events/ResponderEventPlugin')
410
+ .default;
411
412
deleteAllListeners(GRANDPARENT_INST);
413
deleteAllListeners(PARENT_INST);
packages/react-dom/npm/unstable-native-dependencies.js
deleted
-7
@@ -1,7 +0,0 @@
1
-'use strict';
2
-
3
-if (process.env.NODE_ENV === 'production') {
4
- module.exports = require('./cjs/react-dom-unstable-native-dependencies.production.min.js');
5
-} else {
6
- module.exports = require('./cjs/react-dom-unstable-native-dependencies.development.js');
7
-}
packages/react-dom/package.json
-1
@@ -38,7 +38,6 @@
38
"unstable-fizz.js",
39
"unstable-fizz.browser.js",
40
"unstable-fizz.node.js",
41
- "unstable-native-dependencies.js",
41
"cjs/",
42
"umd/"
43
],
packages/react-dom/src/client/ReactDOM.js
+2
-2
@@ -171,8 +171,8 @@ function unstable_createPortal(
171
}
172
173
const Internals = {
174
- // Keep in sync with ReactDOMUnstableNativeDependencies.js
175
- // ReactTestUtils.js, and ReactTestUtilsAct.js. This is an array for better minification.
174
+ // Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.
175
+ // This is an array for better minification.
176
Events: [
177
getInstanceFromNode,
178
getNodeFromInstance,
packages/react-dom/src/test-utils/ReactTestUtils.js
+1
-2
@@ -29,8 +29,7 @@ import {
29
} from 'shared/ReactErrorUtils';
30
31
const {findDOMNode} = ReactDOM;
32
-// Keep in sync with ReactDOMUnstableNativeDependencies.js
33
-// ReactDOM.js, and ReactTestUtilsAct.js:
32
+// Keep in sync with ReactDOM.js, and ReactTestUtilsAct.js:
33
const [
34
getInstanceFromNode,
35
/* eslint-disable no-unused-vars */
packages/react-dom/src/test-utils/ReactTestUtilsAct.js
+1
-2
@@ -14,8 +14,7 @@ import ReactSharedInternals from 'shared/ReactSharedInternals';
14
import enqueueTask from 'shared/enqueueTask';
15
import * as Scheduler from 'scheduler';
16
17
-// Keep in sync with ReactDOMUnstableNativeDependencies.js
18
-// ReactDOM.js, and ReactTestUtils.js:
17
+// Keep in sync with ReactDOM.js, and ReactTestUtils.js:
18
const [
19
/* eslint-disable no-unused-vars */
20
getInstanceFromNode,
packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js
deleted
-32
@@ -1,32 +0,0 @@
1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-import * as ReactDOM from 'react-dom';
9
-import {setComponentTree} from 'legacy-events/EventPluginUtils';
10
-import ResponderEventPlugin from 'legacy-events/ResponderEventPlugin';
11
-import ResponderTouchHistoryStore from 'legacy-events/ResponderTouchHistoryStore';
12
-
13
-// Inject react-dom's ComponentTree into this module.
14
-// Keep in sync with ReactDOM.js, ReactTestUtils.js, and ReactTestUtilsAct.js:
15
-const [
16
- getInstanceFromNode,
17
- getNodeFromInstance,
18
- getFiberCurrentPropsFromNode,
19
- injectEventPluginsByName,
20
-] = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;
21
-
22
-setComponentTree(
23
- getFiberCurrentPropsFromNode,
24
- getInstanceFromNode,
25
- getNodeFromInstance,
26
-);
27
-
28
-export {
29
- ResponderEventPlugin,
30
- ResponderTouchHistoryStore,
31
- injectEventPluginsByName,
32
-};
packages/react-dom/unstable-native-dependencies.js
deleted
-10
@@ -1,10 +0,0 @@
1
-/**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- * @flow
8
- */
9
-
10
-export * from './src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies';
scripts/rollup/bundles.js
-9
@@ -155,15 +155,6 @@ const bundles = [
155
externals: ['react'],
156
},
157
158
- /* React DOM internals required for react-native-web (e.g., to shim native events from react-dom) */
159
- {
160
- bundleTypes: [UMD_DEV, UMD_PROD, NODE_DEV, NODE_PROD],
161
- moduleType: RENDERER_UTILS,
162
- entry: 'react-dom/unstable-native-dependencies',
163
- global: 'ReactDOMUnstableNativeDependencies',
164
- externals: ['react', 'react-dom'],
165
- },
166
-
158
/******* React DOM Server *******/
159
{
160
bundleTypes: [