Skip to content

Commit 75b6921

Browse files
authored
Remove dead code from modern event system (facebook#19233)
* Remove dead code from modern event system * Remove SSR dependency on EventPluginRegistry
1 parent 9fba65e commit 75b6921

38 files changed

+237
-755
lines changed

packages/react-dom/src/client/ReactDOM.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import type {ReactNodeList} from 'shared/ReactTypes';
1111
import type {Container} from './ReactDOMHostConfig';
1212

1313
import '../shared/checkReact';
14-
import './ReactDOMClientInjection';
1514
import {
1615
findDOMNode,
1716
render,
@@ -39,10 +38,7 @@ import {
3938
} from 'react-reconciler/src/ReactFiberReconciler';
4039
import {createPortal as createPortalImpl} from 'react-reconciler/src/ReactPortal';
4140
import {canUseDOM} from 'shared/ExecutionEnvironment';
42-
import {
43-
eventNameDispatchConfigs,
44-
injectEventPluginsByName,
45-
} from '../legacy-events/EventPluginRegistry';
41+
import {eventNameDispatchConfigs} from '../events/EventPluginRegistry';
4642
import ReactVersion from 'shared/ReactVersion';
4743
import invariant from 'shared/invariant';
4844
import {
@@ -57,7 +53,6 @@ import {
5753
getClosestInstanceFromNode,
5854
} from './ReactDOMComponentTree';
5955
import {restoreControlledState} from './ReactDOMComponent';
60-
import {dispatchEvent} from '../events/ReactDOMEventListener';
6156
import {
6257
setAttemptSynchronousHydration,
6358
setAttemptUserBlockingHydration,
@@ -180,11 +175,9 @@ const Internals = {
180175
getInstanceFromNode,
181176
getNodeFromInstance,
182177
getFiberCurrentPropsFromNode,
183-
injectEventPluginsByName,
184178
eventNameDispatchConfigs,
185179
enqueueStateRestore,
186180
restoreStateIfNeeded,
187-
dispatchEvent,
188181
flushPassiveEffects,
189182
IsThisRendererActing,
190183
],

packages/react-dom/src/client/ReactDOMClientInjection.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/react-dom/src/client/ReactDOMComponent.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
* @flow
88
*/
99

10-
import {registrationNameModules} from '../legacy-events/EventPluginRegistry';
10+
import {
11+
registrationNameModules,
12+
possibleRegistrationNames,
13+
} from '../events/EventPluginRegistry';
1114
import {canUseDOM} from 'shared/ExecutionEnvironment';
1215
import invariant from 'shared/invariant';
1316
import {
@@ -129,7 +132,10 @@ if (__DEV__) {
129132
validatePropertiesInDevelopment = function(type, props) {
130133
validateARIAProperties(type, props);
131134
validateInputProperties(type, props);
132-
validateUnknownProperties(type, props, /* canUseEventSystem */ true);
135+
validateUnknownProperties(type, props, {
136+
registrationNameModules,
137+
possibleRegistrationNames,
138+
});
133139
};
134140

135141
// IE 11 parses & normalizes the style attribute as opposed to other

packages/react-dom/src/client/ReactDOMComponentTree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type {
1717
SuspenseInstance,
1818
Props,
1919
} from './ReactDOMHostConfig';
20-
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
20+
import type {DOMTopLevelEventType} from '../events/TopLevelEventTypes';
2121

2222
import {
2323
HostComponent,

packages/react-dom/src/client/ReactDOMEventHandle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @flow
88
*/
99

10-
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
10+
import type {DOMTopLevelEventType} from '../events/TopLevelEventTypes';
1111
import type {EventPriority, ReactScopeInstance} from 'shared/ReactTypes';
1212
import type {
1313
ReactDOMEventHandle,

packages/react-dom/src/client/ReactDOMHostConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @flow
88
*/
99

10-
import type {TopLevelType} from '../legacy-events/TopLevelEventTypes';
10+
import type {TopLevelType} from '../events/TopLevelEventTypes';
1111
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
1212
import type {
1313
BoundingRect,

packages/react-dom/src/events/DOMEventProperties.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import type {EventPriority} from 'shared/ReactTypes';
1111
import type {
1212
TopLevelType,
1313
DOMTopLevelEventType,
14-
} from '../legacy-events/TopLevelEventTypes';
14+
} from '../events/TopLevelEventTypes';
1515
import type {
1616
DispatchConfig,
1717
CustomDispatchConfig,
18-
} from '../legacy-events/ReactSyntheticEventType';
18+
} from '../events/ReactSyntheticEventType';
1919

2020
import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
2121
import {

packages/react-dom/src/events/DOMModernPluginEventSystem.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* @flow
88
*/
99

10-
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
11-
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
10+
import type {AnyNativeEvent} from '../events/PluginModuleType';
11+
import type {DOMTopLevelEventType} from '../events/TopLevelEventTypes';
1212
import type {
1313
ElementListenerMap,
1414
ElementListenerMapEntry,
@@ -22,14 +22,14 @@ import type {
2222
DispatchQueueItem,
2323
DispatchQueueItemPhase,
2424
DispatchQueueItemPhaseEntry,
25-
} from '../legacy-events/PluginModuleType';
25+
} from '../events/PluginModuleType';
2626
import type {
2727
ReactSyntheticEvent,
2828
CustomDispatchConfig,
29-
} from '../legacy-events/ReactSyntheticEventType';
29+
} from '../events/ReactSyntheticEventType';
3030

31-
import {registrationNameDependencies} from '../legacy-events/EventPluginRegistry';
32-
import {plugins} from '../legacy-events/EventPluginRegistry';
31+
import {registrationNameDependencies} from '../events/EventPluginRegistry';
32+
import {plugins} from '../events/EventPluginRegistry';
3333
import {
3434
PLUGIN_EVENT_SYSTEM,
3535
LEGACY_FB_SUPPORT,

packages/react-dom/src/events/DOMTopLevelEventTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* @flow
88
*/
99

10-
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
10+
import type {DOMTopLevelEventType} from '../events/TopLevelEventTypes';
1111

1212
import {
1313
unsafeCastStringToDOMTopLevelType,
1414
unsafeCastDOMTopLevelTypeToString,
15-
} from '../legacy-events/TopLevelEventTypes';
15+
} from '../events/TopLevelEventTypes';
1616
import getVendorPrefixedEventName from './getVendorPrefixedEventName';
1717

1818
/**

packages/react-dom/src/events/DeprecatedDOMEventResponderSystem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
PASSIVE_NOT_SUPPORTED,
1313
RESPONDER_EVENT_SYSTEM,
1414
} from './EventSystemFlags';
15-
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
15+
import type {AnyNativeEvent} from '../events/PluginModuleType';
1616
import {
1717
HostComponent,
1818
ScopeComponent,
@@ -25,7 +25,7 @@ import type {
2525
ReactDOMResponderContext,
2626
ReactDOMResponderEvent,
2727
} from '../shared/ReactDOMTypes';
28-
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
28+
import type {DOMTopLevelEventType} from '../events/TopLevelEventTypes';
2929
import {
3030
batchedEventUpdates,
3131
discreteUpdates,

0 commit comments

Comments
 (0)