Skip to content

Commit

Permalink
Fork legacy-events folder into react-dom and react-native (#19228)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Jul 1, 2020
1 parent cd0275d commit e3f4eb7
Show file tree
Hide file tree
Showing 76 changed files with 2,422 additions and 107 deletions.
5 changes: 0 additions & 5 deletions packages/legacy-events/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOM.js
Expand Up @@ -42,7 +42,7 @@ import {canUseDOM} from 'shared/ExecutionEnvironment';
import {
eventNameDispatchConfigs,
injectEventPluginsByName,
} from 'legacy-events/EventPluginRegistry';
} from '../legacy-events/EventPluginRegistry';
import ReactVersion from 'shared/ReactVersion';
import invariant from 'shared/invariant';
import {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOMClientInjection.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import {setComponentTree} from 'legacy-events/EventPluginUtils';
import {setComponentTree} from '../legacy-events/EventPluginUtils';

import {
getFiberCurrentPropsFromNode,
Expand All @@ -29,7 +29,7 @@ import {
injectEventPluginOrder,
injectEventPluginsByName,
injectEventPlugins,
} from 'legacy-events/EventPluginRegistry';
} from '../legacy-events/EventPluginRegistry';
import {enableModernEventSystem} from 'shared/ReactFeatureFlags';

if (enableModernEventSystem) {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMComponent.js
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import {registrationNameModules} from 'legacy-events/EventPluginRegistry';
import {registrationNameModules} from '../legacy-events/EventPluginRegistry';
import {canUseDOM} from 'shared/ExecutionEnvironment';
import invariant from 'shared/invariant';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMComponentTree.js
Expand Up @@ -17,7 +17,7 @@ import type {
SuspenseInstance,
Props,
} from './ReactDOMHostConfig';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';

import {
HostComponent,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMEventHandle.js
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
import type {EventPriority, ReactScopeInstance} from 'shared/ReactTypes';
import type {
ReactDOMEventHandle,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOMHostConfig.js
Expand Up @@ -7,7 +7,7 @@
* @flow
*/

import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
import type {TopLevelType} from '../legacy-events/TopLevelEventTypes';
import type {Fiber, FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {
BoundingRect,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/DOMEventProperties.js
Expand Up @@ -11,11 +11,11 @@ import type {EventPriority} from 'shared/ReactTypes';
import type {
TopLevelType,
DOMTopLevelEventType,
} from 'legacy-events/TopLevelEventTypes';
} from '../legacy-events/TopLevelEventTypes';
import type {
DispatchConfig,
CustomDispatchConfig,
} from 'legacy-events/ReactSyntheticEventType';
} from '../legacy-events/ReactSyntheticEventType';

import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes';
import {
Expand Down
20 changes: 10 additions & 10 deletions packages/react-dom/src/events/DOMLegacyEventPluginSystem.js
Expand Up @@ -7,26 +7,26 @@
* @flow
*/

import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
import type {ElementListenerMap} from '../client/ReactDOMComponentTree';
import type {EventSystemFlags} from './EventSystemFlags';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {LegacyPluginModule} from 'legacy-events/PluginModuleType';
import type {ReactSyntheticEvent} from 'legacy-events/ReactSyntheticEventType';
import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
import forEachAccumulated from 'legacy-events/forEachAccumulated';
import type {LegacyPluginModule} from '../legacy-events/PluginModuleType';
import type {ReactSyntheticEvent} from '../legacy-events/ReactSyntheticEventType';
import type {TopLevelType} from '../legacy-events/TopLevelEventTypes';
import forEachAccumulated from '../legacy-events/forEachAccumulated';

import {
HostRoot,
HostComponent,
HostText,
} from 'react-reconciler/src/ReactWorkTags';
import {IS_FIRST_ANCESTOR, PLUGIN_EVENT_SYSTEM} from './EventSystemFlags';
import {runEventsInBatch} from 'legacy-events/EventBatching';
import {plugins} from 'legacy-events/EventPluginRegistry';
import accumulateInto from 'legacy-events/accumulateInto';
import {registrationNameDependencies} from 'legacy-events/EventPluginRegistry';
import {runEventsInBatch} from '../legacy-events/EventBatching';
import {plugins} from '../legacy-events/EventPluginRegistry';
import accumulateInto from '../legacy-events/accumulateInto';
import {registrationNameDependencies} from '../legacy-events/EventPluginRegistry';

import getEventTarget from './getEventTarget';
import {
Expand Down
12 changes: 6 additions & 6 deletions packages/react-dom/src/events/DOMModernPluginEventSystem.js
Expand Up @@ -7,8 +7,8 @@
* @flow
*/

import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
import type {
ElementListenerMap,
ElementListenerMapEntry,
Expand All @@ -22,14 +22,14 @@ import type {
DispatchQueueItem,
DispatchQueueItemPhase,
DispatchQueueItemPhaseEntry,
} from 'legacy-events/PluginModuleType';
} from '../legacy-events/PluginModuleType';
import type {
ReactSyntheticEvent,
CustomDispatchConfig,
} from 'legacy-events/ReactSyntheticEventType';
} from '../legacy-events/ReactSyntheticEventType';

import {registrationNameDependencies} from 'legacy-events/EventPluginRegistry';
import {plugins} from 'legacy-events/EventPluginRegistry';
import {registrationNameDependencies} from '../legacy-events/EventPluginRegistry';
import {plugins} from '../legacy-events/EventPluginRegistry';
import {
PLUGIN_EVENT_SYSTEM,
LEGACY_FB_SUPPORT,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/DOMTopLevelEventTypes.js
Expand Up @@ -7,12 +7,12 @@
* @flow
*/

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

import {
unsafeCastStringToDOMTopLevelType,
unsafeCastDOMTopLevelTypeToString,
} from 'legacy-events/TopLevelEventTypes';
} from '../legacy-events/TopLevelEventTypes';
import getVendorPrefixedEventName from './getVendorPrefixedEventName';

/**
Expand Down
Expand Up @@ -12,7 +12,7 @@ import {
PASSIVE_NOT_SUPPORTED,
RESPONDER_EVENT_SYSTEM,
} from './EventSystemFlags';
import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
import {
HostComponent,
ScopeComponent,
Expand All @@ -25,7 +25,7 @@ import type {
ReactDOMResponderContext,
ReactDOMResponderEvent,
} from '../shared/ReactDOMTypes';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
import {
batchedEventUpdates,
discreteUpdates,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/ReactDOMEventListener.js
Expand Up @@ -7,11 +7,11 @@
* @flow
*/

import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
import type {EventPriority} from 'shared/ReactTypes';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';

// Intentionally not named imports because Rollup would use dynamic dispatch for
// CommonJS interop named imports.
Expand Down
6 changes: 3 additions & 3 deletions packages/react-dom/src/events/ReactDOMEventReplaying.js
Expand Up @@ -7,9 +7,9 @@
* @flow
*/

import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';
import type {Container, SuspenseInstance} from '../client/ReactDOMHostConfig';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';
import type {ElementListenerMap} from '../client/ReactDOMComponentTree';
import type {EventSystemFlags} from './EventSystemFlags';
import type {FiberRoot} from 'react-reconciler/src/ReactInternalTypes';
Expand All @@ -36,7 +36,7 @@ import {
getClosestInstanceFromNode,
getEventListenerMap,
} from '../client/ReactDOMComponentTree';
import {unsafeCastDOMTopLevelTypeToString} from 'legacy-events/TopLevelEventTypes';
import {unsafeCastDOMTopLevelTypeToString} from '../legacy-events/TopLevelEventTypes';
import {HostRoot, SuspenseComponent} from 'react-reconciler/src/ReactWorkTags';

let attemptSynchronousHydration: (fiber: Object) => void;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticAnimationEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

/**
* @interface Event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticClipboardEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

/**
* @interface Event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticCompositionEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

/**
* @interface Event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticInputEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

/**
* @interface Event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticTransitionEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

/**
* @interface Event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticUIEvent.js
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../legacy-events/SyntheticEvent';

const SyntheticUIEvent = SyntheticEvent.extend({
view: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/getEventModifierState.js
Expand Up @@ -12,7 +12,7 @@
* @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
*/

import type {AnyNativeEvent} from 'legacy-events/PluginModuleType';
import type {AnyNativeEvent} from '../legacy-events/PluginModuleType';

const modifierKeyToProp = {
Alt: 'altKey',
Expand Down
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
import type {TopLevelType} from '../../legacy-events/TopLevelEventTypes';

import {canUseDOM} from 'shared/ExecutionEnvironment';

Expand Down
Expand Up @@ -5,8 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/

import {runEventsInBatch} from 'legacy-events/EventBatching';
import SyntheticEvent from 'legacy-events/SyntheticEvent';
import {runEventsInBatch} from '../../legacy-events/EventBatching';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';
import isTextInputElement from '../isTextInputElement';
import {canUseDOM} from 'shared/ExecutionEnvironment';

Expand Down
Expand Up @@ -6,7 +6,7 @@
*/

import {canUseDOM} from 'shared/ExecutionEnvironment';
import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';
import isTextInputElement from '../isTextInputElement';
import shallowEqual from 'shared/shallowEqual';

Expand All @@ -30,7 +30,7 @@ import {hasSelectionCapabilities} from '../../client/ReactInputSelection';
import {DOCUMENT_NODE} from '../../shared/HTMLNodeType';
import {accumulateTwoPhaseDispatches} from '../DOMLegacyEventPluginSystem';

import {registrationNameDependencies} from 'legacy-events/EventPluginRegistry';
import {registrationNameDependencies} from '../../legacy-events/EventPluginRegistry';

const skipSelectionChangeEvent =
canUseDOM && 'documentMode' in document && document.documentMode <= 11;
Expand Down
Expand Up @@ -10,12 +10,12 @@
import type {
TopLevelType,
DOMTopLevelEventType,
} from 'legacy-events/TopLevelEventTypes';
import type {ReactSyntheticEvent} from 'legacy-events/ReactSyntheticEventType';
} from '../../legacy-events/TopLevelEventTypes';
import type {ReactSyntheticEvent} from '../../legacy-events/ReactSyntheticEventType';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {LegacyPluginModule} from 'legacy-events/PluginModuleType';
import type {LegacyPluginModule} from '../../legacy-events/PluginModuleType';

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';

import * as DOMTopLevelEventTypes from '../DOMTopLevelEventTypes';
import {
Expand Down
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import type {TopLevelType} from 'legacy-events/TopLevelEventTypes';
import type {TopLevelType} from '../../legacy-events/TopLevelEventTypes';

import {canUseDOM} from 'shared/ExecutionEnvironment';

Expand Down
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';
import isTextInputElement from '../isTextInputElement';
import {canUseDOM} from 'shared/ExecutionEnvironment';

Expand Down
Expand Up @@ -6,7 +6,7 @@
*/

import {canUseDOM} from 'shared/ExecutionEnvironment';
import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';
import isTextInputElement from '../isTextInputElement';
import shallowEqual from 'shared/shallowEqual';

Expand Down
Expand Up @@ -10,15 +10,15 @@
import type {
TopLevelType,
DOMTopLevelEventType,
} from 'legacy-events/TopLevelEventTypes';
} from '../../legacy-events/TopLevelEventTypes';
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
import type {
ModernPluginModule,
DispatchQueue,
} from 'legacy-events/PluginModuleType';
} from '../../legacy-events/PluginModuleType';
import type {EventSystemFlags} from '../EventSystemFlags';

import SyntheticEvent from 'legacy-events/SyntheticEvent';
import SyntheticEvent from '../../legacy-events/SyntheticEvent';

import * as DOMTopLevelEventTypes from '../DOMTopLevelEventTypes';
import {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/react-dom/src/shared/ReactDOMTypes.js
Expand Up @@ -14,7 +14,7 @@ import type {
EventPriority,
ReactScopeInstance,
} from 'shared/ReactTypes';
import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes';
import type {DOMTopLevelEventType} from '../legacy-events/TopLevelEventTypes';

type AnyNativeEvent = Event | KeyboardEvent | MouseEvent | Touch;

Expand Down
Expand Up @@ -8,7 +8,7 @@
import {
registrationNameModules,
possibleRegistrationNames,
} from 'legacy-events/EventPluginRegistry';
} from '../legacy-events/EventPluginRegistry';

import {
ATTRIBUTE_NAME_CHAR,
Expand Down

0 comments on commit e3f4eb7

Please sign in to comment.