From b1a03dfdc8e42d075422556553ffe59868150e95 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Wed, 14 Aug 2019 07:32:42 -0700 Subject: [PATCH] Rename legacy "events" package to "legacy-events" (#16388) * Renamed 'events' package to 'legacy-events' * Updated 'events' references to point to 'legacy-events' --- packages/{events => legacy-events}/EventBatching.js | 0 packages/{events => legacy-events}/EventPluginHub.js | 0 .../{events => legacy-events}/EventPluginRegistry.js | 0 .../{events => legacy-events}/EventPluginUtils.js | 0 .../{events => legacy-events}/EventPropagators.js | 0 .../{events => legacy-events}/EventSystemFlags.js | 0 .../{events => legacy-events}/PluginModuleType.js | 0 .../ReactControlledComponent.js | 0 .../ReactGenericBatching.js | 0 .../ReactSyntheticEventType.js | 0 .../ResponderEventPlugin.js | 0 .../ResponderSyntheticEvent.js | 0 .../ResponderTopLevelEventTypes.js | 0 .../ResponderTouchHistoryStore.js | 0 packages/{events => legacy-events}/SyntheticEvent.js | 0 .../{events => legacy-events}/TopLevelEventTypes.js | 0 .../__tests__/EventPluginRegistry-test.internal.js | 2 +- .../__tests__/ResponderEventPlugin-test.internal.js | 4 ++-- .../__tests__/accumulate-test.internal.js | 2 +- .../__tests__/accumulateInto-test.internal.js | 2 +- packages/{events => legacy-events}/accumulate.js | 0 packages/{events => legacy-events}/accumulateInto.js | 0 .../{events => legacy-events}/forEachAccumulated.js | 0 .../forks/ResponderTopLevelEventTypes.dom.js | 0 packages/{events => legacy-events}/package.json | 2 +- .../ReactBrowserEventEmitter-test.internal.js | 4 ++-- packages/react-dom/src/client/ReactDOM.js | 12 ++++++------ .../react-dom/src/client/ReactDOMClientInjection.js | 4 ++-- packages/react-dom/src/client/ReactDOMComponent.js | 4 ++-- .../react-dom/src/events/BeforeInputEventPlugin.js | 4 ++-- packages/react-dom/src/events/ChangeEventPlugin.js | 10 +++++----- .../react-dom/src/events/DOMEventResponderSystem.js | 10 +++++----- .../react-dom/src/events/DOMTopLevelEventTypes.js | 4 ++-- .../react-dom/src/events/EnterLeaveEventPlugin.js | 2 +- .../react-dom/src/events/ReactBrowserEventEmitter.js | 4 ++-- .../react-dom/src/events/ReactDOMEventListener.js | 10 +++++----- packages/react-dom/src/events/SelectEventPlugin.js | 4 ++-- packages/react-dom/src/events/SimpleEventPlugin.js | 10 +++++----- .../react-dom/src/events/SyntheticAnimationEvent.js | 2 +- .../react-dom/src/events/SyntheticClipboardEvent.js | 2 +- .../src/events/SyntheticCompositionEvent.js | 2 +- packages/react-dom/src/events/SyntheticInputEvent.js | 2 +- .../react-dom/src/events/SyntheticTransitionEvent.js | 2 +- packages/react-dom/src/events/SyntheticUIEvent.js | 2 +- .../react-dom/src/events/getEventModifierState.js | 2 +- .../src/shared/ReactDOMUnknownPropertyHook.js | 2 +- packages/react-dom/src/test-utils/ReactTestUtils.js | 4 ++-- .../ReactDOMUnstableNativeDependencies.js | 6 +++--- packages/react-native-renderer/src/ReactFabric.js | 2 +- .../src/ReactFabricEventEmitter.js | 10 +++++----- .../src/ReactFabricEventResponderSystem.js | 2 +- .../src/ReactFabricInjection.js | 4 ++-- .../src/ReactNativeBridgeEventPlugin.js | 8 ++++---- .../src/ReactNativeEventEmitter.js | 10 +++++----- .../src/ReactNativeInjection.js | 4 ++-- .../src/ReactNativeInjectionShared.js | 4 ++-- .../react-native-renderer/src/ReactNativeRenderer.js | 2 +- .../src/__tests__/ReactNativeEvents-test.internal.js | 2 +- scripts/flow/react-native-host-hooks.js | 2 +- scripts/jest/config.build.js | 5 ----- scripts/rollup/forks.js | 4 ++-- scripts/shared/pathsByLanguageVersion.js | 2 +- 62 files changed, 88 insertions(+), 93 deletions(-) rename packages/{events => legacy-events}/EventBatching.js (100%) rename packages/{events => legacy-events}/EventPluginHub.js (100%) rename packages/{events => legacy-events}/EventPluginRegistry.js (100%) rename packages/{events => legacy-events}/EventPluginUtils.js (100%) rename packages/{events => legacy-events}/EventPropagators.js (100%) rename packages/{events => legacy-events}/EventSystemFlags.js (100%) rename packages/{events => legacy-events}/PluginModuleType.js (100%) rename packages/{events => legacy-events}/ReactControlledComponent.js (100%) rename packages/{events => legacy-events}/ReactGenericBatching.js (100%) rename packages/{events => legacy-events}/ReactSyntheticEventType.js (100%) rename packages/{events => legacy-events}/ResponderEventPlugin.js (100%) rename packages/{events => legacy-events}/ResponderSyntheticEvent.js (100%) rename packages/{events => legacy-events}/ResponderTopLevelEventTypes.js (100%) rename packages/{events => legacy-events}/ResponderTouchHistoryStore.js (100%) rename packages/{events => legacy-events}/SyntheticEvent.js (100%) rename packages/{events => legacy-events}/TopLevelEventTypes.js (100%) rename packages/{events => legacy-events}/__tests__/EventPluginRegistry-test.internal.js (99%) rename packages/{events => legacy-events}/__tests__/ResponderEventPlugin-test.internal.js (99%) rename packages/{events => legacy-events}/__tests__/accumulate-test.internal.js (95%) rename packages/{events => legacy-events}/__tests__/accumulateInto-test.internal.js (94%) rename packages/{events => legacy-events}/accumulate.js (100%) rename packages/{events => legacy-events}/accumulateInto.js (100%) rename packages/{events => legacy-events}/forEachAccumulated.js (100%) rename packages/{events => legacy-events}/forks/ResponderTopLevelEventTypes.dom.js (100%) rename packages/{events => legacy-events}/package.json (61%) diff --git a/packages/events/EventBatching.js b/packages/legacy-events/EventBatching.js similarity index 100% rename from packages/events/EventBatching.js rename to packages/legacy-events/EventBatching.js diff --git a/packages/events/EventPluginHub.js b/packages/legacy-events/EventPluginHub.js similarity index 100% rename from packages/events/EventPluginHub.js rename to packages/legacy-events/EventPluginHub.js diff --git a/packages/events/EventPluginRegistry.js b/packages/legacy-events/EventPluginRegistry.js similarity index 100% rename from packages/events/EventPluginRegistry.js rename to packages/legacy-events/EventPluginRegistry.js diff --git a/packages/events/EventPluginUtils.js b/packages/legacy-events/EventPluginUtils.js similarity index 100% rename from packages/events/EventPluginUtils.js rename to packages/legacy-events/EventPluginUtils.js diff --git a/packages/events/EventPropagators.js b/packages/legacy-events/EventPropagators.js similarity index 100% rename from packages/events/EventPropagators.js rename to packages/legacy-events/EventPropagators.js diff --git a/packages/events/EventSystemFlags.js b/packages/legacy-events/EventSystemFlags.js similarity index 100% rename from packages/events/EventSystemFlags.js rename to packages/legacy-events/EventSystemFlags.js diff --git a/packages/events/PluginModuleType.js b/packages/legacy-events/PluginModuleType.js similarity index 100% rename from packages/events/PluginModuleType.js rename to packages/legacy-events/PluginModuleType.js diff --git a/packages/events/ReactControlledComponent.js b/packages/legacy-events/ReactControlledComponent.js similarity index 100% rename from packages/events/ReactControlledComponent.js rename to packages/legacy-events/ReactControlledComponent.js diff --git a/packages/events/ReactGenericBatching.js b/packages/legacy-events/ReactGenericBatching.js similarity index 100% rename from packages/events/ReactGenericBatching.js rename to packages/legacy-events/ReactGenericBatching.js diff --git a/packages/events/ReactSyntheticEventType.js b/packages/legacy-events/ReactSyntheticEventType.js similarity index 100% rename from packages/events/ReactSyntheticEventType.js rename to packages/legacy-events/ReactSyntheticEventType.js diff --git a/packages/events/ResponderEventPlugin.js b/packages/legacy-events/ResponderEventPlugin.js similarity index 100% rename from packages/events/ResponderEventPlugin.js rename to packages/legacy-events/ResponderEventPlugin.js diff --git a/packages/events/ResponderSyntheticEvent.js b/packages/legacy-events/ResponderSyntheticEvent.js similarity index 100% rename from packages/events/ResponderSyntheticEvent.js rename to packages/legacy-events/ResponderSyntheticEvent.js diff --git a/packages/events/ResponderTopLevelEventTypes.js b/packages/legacy-events/ResponderTopLevelEventTypes.js similarity index 100% rename from packages/events/ResponderTopLevelEventTypes.js rename to packages/legacy-events/ResponderTopLevelEventTypes.js diff --git a/packages/events/ResponderTouchHistoryStore.js b/packages/legacy-events/ResponderTouchHistoryStore.js similarity index 100% rename from packages/events/ResponderTouchHistoryStore.js rename to packages/legacy-events/ResponderTouchHistoryStore.js diff --git a/packages/events/SyntheticEvent.js b/packages/legacy-events/SyntheticEvent.js similarity index 100% rename from packages/events/SyntheticEvent.js rename to packages/legacy-events/SyntheticEvent.js diff --git a/packages/events/TopLevelEventTypes.js b/packages/legacy-events/TopLevelEventTypes.js similarity index 100% rename from packages/events/TopLevelEventTypes.js rename to packages/legacy-events/TopLevelEventTypes.js diff --git a/packages/events/__tests__/EventPluginRegistry-test.internal.js b/packages/legacy-events/__tests__/EventPluginRegistry-test.internal.js similarity index 99% rename from packages/events/__tests__/EventPluginRegistry-test.internal.js rename to packages/legacy-events/__tests__/EventPluginRegistry-test.internal.js index c11554ed68283..c56f2e5748166 100644 --- a/packages/events/__tests__/EventPluginRegistry-test.internal.js +++ b/packages/legacy-events/__tests__/EventPluginRegistry-test.internal.js @@ -19,7 +19,7 @@ describe('EventPluginRegistry', () => { // The public API surface of this is covered by other tests so // if `EventPluginRegistry` is ever deleted, these tests should be // safe to remove too. - EventPluginRegistry = require('events/EventPluginRegistry'); + EventPluginRegistry = require('legacy-events/EventPluginRegistry'); createPlugin = function(properties) { return Object.assign({extractEvents: function() {}}, properties); diff --git a/packages/events/__tests__/ResponderEventPlugin-test.internal.js b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js similarity index 99% rename from packages/events/__tests__/ResponderEventPlugin-test.internal.js rename to packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js index 84d132993889e..c1959659a1db6 100644 --- a/packages/events/__tests__/ResponderEventPlugin-test.internal.js +++ b/packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js @@ -403,8 +403,8 @@ describe('ResponderEventPlugin', () => { jest.resetModules(); const ReactDOMUnstableNativeDependencies = require('react-dom/unstable-native-dependencies'); - EventBatching = require('events/EventBatching'); - EventPluginUtils = require('events/EventPluginUtils'); + EventBatching = require('legacy-events/EventBatching'); + EventPluginUtils = require('legacy-events/EventPluginUtils'); ResponderEventPlugin = ReactDOMUnstableNativeDependencies.ResponderEventPlugin; diff --git a/packages/events/__tests__/accumulate-test.internal.js b/packages/legacy-events/__tests__/accumulate-test.internal.js similarity index 95% rename from packages/events/__tests__/accumulate-test.internal.js rename to packages/legacy-events/__tests__/accumulate-test.internal.js index b5efd6bfa171a..7038502ffe708 100644 --- a/packages/events/__tests__/accumulate-test.internal.js +++ b/packages/legacy-events/__tests__/accumulate-test.internal.js @@ -13,7 +13,7 @@ let accumulate; describe('accumulate', () => { beforeEach(() => { - accumulate = require('events/accumulate').default; + accumulate = require('legacy-events/accumulate').default; }); it('throws if the second item is null', () => { diff --git a/packages/events/__tests__/accumulateInto-test.internal.js b/packages/legacy-events/__tests__/accumulateInto-test.internal.js similarity index 94% rename from packages/events/__tests__/accumulateInto-test.internal.js rename to packages/legacy-events/__tests__/accumulateInto-test.internal.js index 863df06f9e5d1..0a1b11d360f35 100644 --- a/packages/events/__tests__/accumulateInto-test.internal.js +++ b/packages/legacy-events/__tests__/accumulateInto-test.internal.js @@ -13,7 +13,7 @@ let accumulateInto; describe('accumulateInto', () => { beforeEach(() => { - accumulateInto = require('events/accumulateInto').default; + accumulateInto = require('legacy-events/accumulateInto').default; }); it('throws if the second item is null', () => { diff --git a/packages/events/accumulate.js b/packages/legacy-events/accumulate.js similarity index 100% rename from packages/events/accumulate.js rename to packages/legacy-events/accumulate.js diff --git a/packages/events/accumulateInto.js b/packages/legacy-events/accumulateInto.js similarity index 100% rename from packages/events/accumulateInto.js rename to packages/legacy-events/accumulateInto.js diff --git a/packages/events/forEachAccumulated.js b/packages/legacy-events/forEachAccumulated.js similarity index 100% rename from packages/events/forEachAccumulated.js rename to packages/legacy-events/forEachAccumulated.js diff --git a/packages/events/forks/ResponderTopLevelEventTypes.dom.js b/packages/legacy-events/forks/ResponderTopLevelEventTypes.dom.js similarity index 100% rename from packages/events/forks/ResponderTopLevelEventTypes.dom.js rename to packages/legacy-events/forks/ResponderTopLevelEventTypes.dom.js diff --git a/packages/events/package.json b/packages/legacy-events/package.json similarity index 61% rename from packages/events/package.json rename to packages/legacy-events/package.json index 66aeb11363975..8460cb438a8a5 100644 --- a/packages/events/package.json +++ b/packages/legacy-events/package.json @@ -1,5 +1,5 @@ { "private": true, - "name": "events", + "name": "legacy-events", "version": "0.0.0" } diff --git a/packages/react-dom/src/__tests__/ReactBrowserEventEmitter-test.internal.js b/packages/react-dom/src/__tests__/ReactBrowserEventEmitter-test.internal.js index 2a6b526218c48..b5984487936f7 100644 --- a/packages/react-dom/src/__tests__/ReactBrowserEventEmitter-test.internal.js +++ b/packages/react-dom/src/__tests__/ReactBrowserEventEmitter-test.internal.js @@ -57,8 +57,8 @@ describe('ReactBrowserEventEmitter', () => { LISTENER.mockClear(); // TODO: can we express this test with only public API? - EventPluginHub = require('events/EventPluginHub'); - EventPluginRegistry = require('events/EventPluginRegistry'); + EventPluginHub = require('legacy-events/EventPluginHub'); + EventPluginRegistry = require('legacy-events/EventPluginRegistry'); React = require('react'); ReactDOM = require('react-dom'); ReactDOMComponentTree = require('../client/ReactDOMComponentTree'); diff --git a/packages/react-dom/src/client/ReactDOM.js b/packages/react-dom/src/client/ReactDOM.js index 8e84b320c7a5f..2e3ccea8de18f 100644 --- a/packages/react-dom/src/client/ReactDOM.js +++ b/packages/react-dom/src/client/ReactDOM.js @@ -42,19 +42,19 @@ import { } from 'react-reconciler/inline.dom'; import {createPortal as createPortalImpl} from 'shared/ReactPortal'; import {canUseDOM} from 'shared/ExecutionEnvironment'; -import {setBatchingImplementation} from 'events/ReactGenericBatching'; +import {setBatchingImplementation} from 'legacy-events/ReactGenericBatching'; import { setRestoreImplementation, enqueueStateRestore, restoreStateIfNeeded, -} from 'events/ReactControlledComponent'; -import {injection as EventPluginHubInjection} from 'events/EventPluginHub'; -import {runEventsInBatch} from 'events/EventBatching'; -import {eventNameDispatchConfigs} from 'events/EventPluginRegistry'; +} from 'legacy-events/ReactControlledComponent'; +import {injection as EventPluginHubInjection} from 'legacy-events/EventPluginHub'; +import {runEventsInBatch} from 'legacy-events/EventBatching'; +import {eventNameDispatchConfigs} from 'legacy-events/EventPluginRegistry'; import { accumulateTwoPhaseDispatches, accumulateDirectDispatches, -} from 'events/EventPropagators'; +} from 'legacy-events/EventPropagators'; import {LegacyRoot, ConcurrentRoot, BatchedRoot} from 'shared/ReactRootTags'; import {has as hasInstance} from 'shared/ReactInstanceMap'; import ReactVersion from 'shared/ReactVersion'; diff --git a/packages/react-dom/src/client/ReactDOMClientInjection.js b/packages/react-dom/src/client/ReactDOMClientInjection.js index c2c6229e05656..604c3ff976bb8 100644 --- a/packages/react-dom/src/client/ReactDOMClientInjection.js +++ b/packages/react-dom/src/client/ReactDOMClientInjection.js @@ -5,8 +5,8 @@ * LICENSE file in the root directory of this source tree. */ -import {injection as EventPluginHubInjection} from 'events/EventPluginHub'; -import {setComponentTree} from 'events/EventPluginUtils'; +import {injection as EventPluginHubInjection} from 'legacy-events/EventPluginHub'; +import {setComponentTree} from 'legacy-events/EventPluginUtils'; import { getFiberCurrentPropsFromNode, diff --git a/packages/react-dom/src/client/ReactDOMComponent.js b/packages/react-dom/src/client/ReactDOMComponent.js index c2c3b791867a3..ea178c13ab644 100644 --- a/packages/react-dom/src/client/ReactDOMComponent.js +++ b/packages/react-dom/src/client/ReactDOMComponent.js @@ -9,12 +9,12 @@ // TODO: direct imports like some-package/src/* are bad. Fix me. import {getCurrentFiberOwnerNameInDevOrNull} from 'react-reconciler/src/ReactCurrentFiber'; -import {registrationNameModules} from 'events/EventPluginRegistry'; +import {registrationNameModules} from 'legacy-events/EventPluginRegistry'; import warning from 'shared/warning'; import {canUseDOM} from 'shared/ExecutionEnvironment'; import warningWithoutStack from 'shared/warningWithoutStack'; import endsWith from 'shared/endsWith'; -import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes'; +import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; import {setListenToResponderEventTypes} from '../events/DOMEventResponderSystem'; import { diff --git a/packages/react-dom/src/events/BeforeInputEventPlugin.js b/packages/react-dom/src/events/BeforeInputEventPlugin.js index 6895e0dc6254d..1a6225e827f7f 100644 --- a/packages/react-dom/src/events/BeforeInputEventPlugin.js +++ b/packages/react-dom/src/events/BeforeInputEventPlugin.js @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import type {TopLevelType} from 'events/TopLevelEventTypes'; +import type {TopLevelType} from 'legacy-events/TopLevelEventTypes'; -import {accumulateTwoPhaseDispatches} from 'events/EventPropagators'; +import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators'; import {canUseDOM} from 'shared/ExecutionEnvironment'; import { diff --git a/packages/react-dom/src/events/ChangeEventPlugin.js b/packages/react-dom/src/events/ChangeEventPlugin.js index 214becb6732a6..3f4690b81538b 100644 --- a/packages/react-dom/src/events/ChangeEventPlugin.js +++ b/packages/react-dom/src/events/ChangeEventPlugin.js @@ -5,11 +5,11 @@ * LICENSE file in the root directory of this source tree. */ -import {runEventsInBatch} from 'events/EventBatching'; -import {accumulateTwoPhaseDispatches} from 'events/EventPropagators'; -import {enqueueStateRestore} from 'events/ReactControlledComponent'; -import {batchedUpdates} from 'events/ReactGenericBatching'; -import SyntheticEvent from 'events/SyntheticEvent'; +import {runEventsInBatch} from 'legacy-events/EventBatching'; +import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators'; +import {enqueueStateRestore} from 'legacy-events/ReactControlledComponent'; +import {batchedUpdates} from 'legacy-events/ReactGenericBatching'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; import isTextInputElement from 'shared/isTextInputElement'; import {canUseDOM} from 'shared/ExecutionEnvironment'; diff --git a/packages/react-dom/src/events/DOMEventResponderSystem.js b/packages/react-dom/src/events/DOMEventResponderSystem.js index f034670465b0e..432ff1ba32e36 100644 --- a/packages/react-dom/src/events/DOMEventResponderSystem.js +++ b/packages/react-dom/src/events/DOMEventResponderSystem.js @@ -10,8 +10,8 @@ import { type EventSystemFlags, IS_PASSIVE, PASSIVE_NOT_SUPPORTED, -} from 'events/EventSystemFlags'; -import type {AnyNativeEvent} from 'events/PluginModuleType'; +} from 'legacy-events/EventSystemFlags'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; import {HostComponent} from 'shared/ReactWorkTags'; import type {EventPriority} from 'shared/ReactTypes'; import type { @@ -20,13 +20,13 @@ import type { ReactDOMResponderContext, ReactDOMResponderEvent, } from 'shared/ReactDOMTypes'; -import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes'; +import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; import { batchedEventUpdates, discreteUpdates, flushDiscreteUpdatesIfNeeded, -} from 'events/ReactGenericBatching'; -import {enqueueStateRestore} from 'events/ReactControlledComponent'; +} from 'legacy-events/ReactGenericBatching'; +import {enqueueStateRestore} from 'legacy-events/ReactControlledComponent'; import type {Fiber} from 'react-reconciler/src/ReactFiber'; import warning from 'shared/warning'; import {enableFlareAPI} from 'shared/ReactFeatureFlags'; diff --git a/packages/react-dom/src/events/DOMTopLevelEventTypes.js b/packages/react-dom/src/events/DOMTopLevelEventTypes.js index 31717af8b9099..2cd291855638f 100644 --- a/packages/react-dom/src/events/DOMTopLevelEventTypes.js +++ b/packages/react-dom/src/events/DOMTopLevelEventTypes.js @@ -7,12 +7,12 @@ * @flow */ -import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes'; +import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; import { unsafeCastStringToDOMTopLevelType, unsafeCastDOMTopLevelTypeToString, -} from 'events/TopLevelEventTypes'; +} from 'legacy-events/TopLevelEventTypes'; import getVendorPrefixedEventName from './getVendorPrefixedEventName'; /** diff --git a/packages/react-dom/src/events/EnterLeaveEventPlugin.js b/packages/react-dom/src/events/EnterLeaveEventPlugin.js index b608da3870d08..c16db1c111163 100644 --- a/packages/react-dom/src/events/EnterLeaveEventPlugin.js +++ b/packages/react-dom/src/events/EnterLeaveEventPlugin.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import {accumulateEnterLeaveDispatches} from 'events/EventPropagators'; +import {accumulateEnterLeaveDispatches} from 'legacy-events/EventPropagators'; import { TOP_MOUSE_OUT, diff --git a/packages/react-dom/src/events/ReactBrowserEventEmitter.js b/packages/react-dom/src/events/ReactBrowserEventEmitter.js index 810e08f106bb7..da9d477e4d7e0 100644 --- a/packages/react-dom/src/events/ReactBrowserEventEmitter.js +++ b/packages/react-dom/src/events/ReactBrowserEventEmitter.js @@ -7,8 +7,8 @@ * @flow */ -import {registrationNameDependencies} from 'events/EventPluginRegistry'; -import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes'; +import {registrationNameDependencies} from 'legacy-events/EventPluginRegistry'; +import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; import { TOP_BLUR, TOP_CANCEL, diff --git a/packages/react-dom/src/events/ReactDOMEventListener.js b/packages/react-dom/src/events/ReactDOMEventListener.js index d9b0eabd75996..0c8a3f99490bc 100644 --- a/packages/react-dom/src/events/ReactDOMEventListener.js +++ b/packages/react-dom/src/events/ReactDOMEventListener.js @@ -7,9 +7,9 @@ * @flow */ -import type {AnyNativeEvent} from 'events/PluginModuleType'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; import type {Fiber} from 'react-reconciler/src/ReactFiber'; -import type {DOMTopLevelEventType} from 'events/TopLevelEventTypes'; +import type {DOMTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; // Intentionally not named imports because Rollup would use dynamic dispatch for // CommonJS interop named imports. @@ -19,8 +19,8 @@ import { batchedEventUpdates, discreteUpdates, flushDiscreteUpdatesIfNeeded, -} from 'events/ReactGenericBatching'; -import {runExtractedPluginEventsInBatch} from 'events/EventPluginHub'; +} from 'legacy-events/ReactGenericBatching'; +import {runExtractedPluginEventsInBatch} from 'legacy-events/EventPluginHub'; import {dispatchEventForResponderEventSystem} from '../events/DOMEventResponderSystem'; import {isFiberMounted} from 'react-reconciler/reflection'; import {HostRoot} from 'shared/ReactWorkTags'; @@ -31,7 +31,7 @@ import { IS_PASSIVE, IS_ACTIVE, PASSIVE_NOT_SUPPORTED, -} from 'events/EventSystemFlags'; +} from 'legacy-events/EventSystemFlags'; import { addEventBubbleListener, diff --git a/packages/react-dom/src/events/SelectEventPlugin.js b/packages/react-dom/src/events/SelectEventPlugin.js index 9d1b7f16dda73..cff6bcf9f5c04 100644 --- a/packages/react-dom/src/events/SelectEventPlugin.js +++ b/packages/react-dom/src/events/SelectEventPlugin.js @@ -5,9 +5,9 @@ * LICENSE file in the root directory of this source tree. */ -import {accumulateTwoPhaseDispatches} from 'events/EventPropagators'; +import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators'; import {canUseDOM} from 'shared/ExecutionEnvironment'; -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; import isTextInputElement from 'shared/isTextInputElement'; import shallowEqual from 'shared/shallowEqual'; diff --git a/packages/react-dom/src/events/SimpleEventPlugin.js b/packages/react-dom/src/events/SimpleEventPlugin.js index c8798acda0cad..ffcc9b61b296b 100644 --- a/packages/react-dom/src/events/SimpleEventPlugin.js +++ b/packages/react-dom/src/events/SimpleEventPlugin.js @@ -11,21 +11,21 @@ import type {EventPriority} from 'shared/ReactTypes'; import type { TopLevelType, DOMTopLevelEventType, -} from 'events/TopLevelEventTypes'; +} from 'legacy-events/TopLevelEventTypes'; import type { DispatchConfig, ReactSyntheticEvent, -} from 'events/ReactSyntheticEventType'; +} from 'legacy-events/ReactSyntheticEventType'; import type {Fiber} from 'react-reconciler/src/ReactFiber'; -import type {EventTypes, PluginModule} from 'events/PluginModuleType'; +import type {EventTypes, PluginModule} from 'legacy-events/PluginModuleType'; import { DiscreteEvent, UserBlockingEvent, ContinuousEvent, } from 'shared/ReactTypes'; -import {accumulateTwoPhaseDispatches} from 'events/EventPropagators'; -import SyntheticEvent from 'events/SyntheticEvent'; +import {accumulateTwoPhaseDispatches} from 'legacy-events/EventPropagators'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; import * as DOMTopLevelEventTypes from './DOMTopLevelEventTypes'; import warningWithoutStack from 'shared/warningWithoutStack'; diff --git a/packages/react-dom/src/events/SyntheticAnimationEvent.js b/packages/react-dom/src/events/SyntheticAnimationEvent.js index 36e625041bffd..f284445f90524 100644 --- a/packages/react-dom/src/events/SyntheticAnimationEvent.js +++ b/packages/react-dom/src/events/SyntheticAnimationEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; /** * @interface Event diff --git a/packages/react-dom/src/events/SyntheticClipboardEvent.js b/packages/react-dom/src/events/SyntheticClipboardEvent.js index 16072137cd6bd..0bab76e2d7568 100644 --- a/packages/react-dom/src/events/SyntheticClipboardEvent.js +++ b/packages/react-dom/src/events/SyntheticClipboardEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; /** * @interface Event diff --git a/packages/react-dom/src/events/SyntheticCompositionEvent.js b/packages/react-dom/src/events/SyntheticCompositionEvent.js index 293ffe3bb0005..14697893ded5d 100644 --- a/packages/react-dom/src/events/SyntheticCompositionEvent.js +++ b/packages/react-dom/src/events/SyntheticCompositionEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; /** * @interface Event diff --git a/packages/react-dom/src/events/SyntheticInputEvent.js b/packages/react-dom/src/events/SyntheticInputEvent.js index c14fe56e0cfcd..3842a75f937ef 100644 --- a/packages/react-dom/src/events/SyntheticInputEvent.js +++ b/packages/react-dom/src/events/SyntheticInputEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; /** * @interface Event diff --git a/packages/react-dom/src/events/SyntheticTransitionEvent.js b/packages/react-dom/src/events/SyntheticTransitionEvent.js index 90933e7d5d041..f22a0147de8b3 100644 --- a/packages/react-dom/src/events/SyntheticTransitionEvent.js +++ b/packages/react-dom/src/events/SyntheticTransitionEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; /** * @interface Event diff --git a/packages/react-dom/src/events/SyntheticUIEvent.js b/packages/react-dom/src/events/SyntheticUIEvent.js index 1b6a7e3bee5bd..43fcef6602b3d 100644 --- a/packages/react-dom/src/events/SyntheticUIEvent.js +++ b/packages/react-dom/src/events/SyntheticUIEvent.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; const SyntheticUIEvent = SyntheticEvent.extend({ view: null, diff --git a/packages/react-dom/src/events/getEventModifierState.js b/packages/react-dom/src/events/getEventModifierState.js index 304fe84ed303f..b2f32b82b69fd 100644 --- a/packages/react-dom/src/events/getEventModifierState.js +++ b/packages/react-dom/src/events/getEventModifierState.js @@ -12,7 +12,7 @@ * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers */ -import type {AnyNativeEvent} from 'events/PluginModuleType'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; const modifierKeyToProp = { Alt: 'altKey', diff --git a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js index f3d43f1846590..3498111261857 100644 --- a/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js +++ b/packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js @@ -8,7 +8,7 @@ import { registrationNameModules, possibleRegistrationNames, -} from 'events/EventPluginRegistry'; +} from 'legacy-events/EventPluginRegistry'; import warning from 'shared/warning'; import { diff --git a/packages/react-dom/src/test-utils/ReactTestUtils.js b/packages/react-dom/src/test-utils/ReactTestUtils.js index a7e2fc582db78..947a0d0bf5e47 100644 --- a/packages/react-dom/src/test-utils/ReactTestUtils.js +++ b/packages/react-dom/src/test-utils/ReactTestUtils.js @@ -15,12 +15,12 @@ import { HostComponent, HostText, } from 'shared/ReactWorkTags'; -import SyntheticEvent from 'events/SyntheticEvent'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; import invariant from 'shared/invariant'; import lowPriorityWarning from 'shared/lowPriorityWarning'; import {ELEMENT_NODE} from '../shared/HTMLNodeType'; import * as DOMTopLevelEventTypes from '../events/DOMTopLevelEventTypes'; -import {PLUGIN_EVENT_SYSTEM} from 'events/EventSystemFlags'; +import {PLUGIN_EVENT_SYSTEM} from 'legacy-events/EventSystemFlags'; import act from './ReactTestUtilsAct'; const {findDOMNode} = ReactDOM; diff --git a/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js b/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js index d53daa4eda107..26b8f728cd804 100644 --- a/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js +++ b/packages/react-dom/src/unstable-native-dependencies/ReactDOMUnstableNativeDependencies.js @@ -6,9 +6,9 @@ */ import ReactDOM from 'react-dom'; -import {setComponentTree} from 'events/EventPluginUtils'; -import ResponderEventPlugin from 'events/ResponderEventPlugin'; -import ResponderTouchHistoryStore from 'events/ResponderTouchHistoryStore'; +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: diff --git a/packages/react-native-renderer/src/ReactFabric.js b/packages/react-native-renderer/src/ReactFabric.js index 632bf3b366f49..4637f9a0bc80d 100644 --- a/packages/react-native-renderer/src/ReactFabric.js +++ b/packages/react-native-renderer/src/ReactFabric.js @@ -26,7 +26,7 @@ import { } from 'react-reconciler/inline.fabric'; import {createPortal} from 'shared/ReactPortal'; -import {setBatchingImplementation} from 'events/ReactGenericBatching'; +import {setBatchingImplementation} from 'legacy-events/ReactGenericBatching'; import ReactVersion from 'shared/ReactVersion'; import NativeMethodsMixin from './NativeMethodsMixin'; diff --git a/packages/react-native-renderer/src/ReactFabricEventEmitter.js b/packages/react-native-renderer/src/ReactFabricEventEmitter.js index 78ea499df0614..f702c80408a31 100644 --- a/packages/react-native-renderer/src/ReactFabricEventEmitter.js +++ b/packages/react-native-renderer/src/ReactFabricEventEmitter.js @@ -12,13 +12,13 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber'; import { getListener, runExtractedPluginEventsInBatch, -} from 'events/EventPluginHub'; -import {registrationNameModules} from 'events/EventPluginRegistry'; -import {batchedUpdates} from 'events/ReactGenericBatching'; +} from 'legacy-events/EventPluginHub'; +import {registrationNameModules} from 'legacy-events/EventPluginRegistry'; +import {batchedUpdates} from 'legacy-events/ReactGenericBatching'; -import type {AnyNativeEvent} from 'events/PluginModuleType'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; import {enableFlareAPI} from 'shared/ReactFeatureFlags'; -import type {TopLevelType} from 'events/TopLevelEventTypes'; +import type {TopLevelType} from 'legacy-events/TopLevelEventTypes'; import {dispatchEventForResponderEventSystem} from './ReactFabricEventResponderSystem'; export {getListener, registrationNameModules as registrationNames}; diff --git a/packages/react-native-renderer/src/ReactFabricEventResponderSystem.js b/packages/react-native-renderer/src/ReactFabricEventResponderSystem.js index 7c9ea64374bc3..2a9cd8a482f33 100644 --- a/packages/react-native-renderer/src/ReactFabricEventResponderSystem.js +++ b/packages/react-native-renderer/src/ReactFabricEventResponderSystem.js @@ -13,7 +13,7 @@ import { batchedEventUpdates, discreteUpdates, flushDiscreteUpdatesIfNeeded, -} from 'events/ReactGenericBatching'; +} from 'legacy-events/ReactGenericBatching'; import type { ReactEventResponder, ReactEventResponderInstance, diff --git a/packages/react-native-renderer/src/ReactFabricInjection.js b/packages/react-native-renderer/src/ReactFabricInjection.js index 11279f4415979..a2502f700a04b 100644 --- a/packages/react-native-renderer/src/ReactFabricInjection.js +++ b/packages/react-native-renderer/src/ReactFabricInjection.js @@ -14,9 +14,9 @@ import { getInstanceFromNode, getNodeFromInstance, } from './ReactFabricComponentTree'; -import {setComponentTree} from 'events/EventPluginUtils'; +import {setComponentTree} from 'legacy-events/EventPluginUtils'; import ReactFabricGlobalResponderHandler from './ReactFabricGlobalResponderHandler'; -import ResponderEventPlugin from 'events/ResponderEventPlugin'; +import ResponderEventPlugin from 'legacy-events/ResponderEventPlugin'; setComponentTree( getFiberCurrentPropsFromNode, diff --git a/packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js b/packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js index 93a6c9fc8c125..27debbe52c91d 100644 --- a/packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js +++ b/packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js @@ -7,13 +7,13 @@ * @flow */ -import type {AnyNativeEvent} from 'events/PluginModuleType'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; import { accumulateTwoPhaseDispatches, accumulateDirectDispatches, -} from 'events/EventPropagators'; -import type {TopLevelType} from 'events/TopLevelEventTypes'; -import SyntheticEvent from 'events/SyntheticEvent'; +} from 'legacy-events/EventPropagators'; +import type {TopLevelType} from 'legacy-events/TopLevelEventTypes'; +import SyntheticEvent from 'legacy-events/SyntheticEvent'; import invariant from 'shared/invariant'; // Module provided by RN: diff --git a/packages/react-native-renderer/src/ReactNativeEventEmitter.js b/packages/react-native-renderer/src/ReactNativeEventEmitter.js index 912291cd457a6..9f21b39c7d619 100644 --- a/packages/react-native-renderer/src/ReactNativeEventEmitter.js +++ b/packages/react-native-renderer/src/ReactNativeEventEmitter.js @@ -10,15 +10,15 @@ import { getListener, runExtractedPluginEventsInBatch, -} from 'events/EventPluginHub'; -import {registrationNameModules} from 'events/EventPluginRegistry'; -import {batchedUpdates} from 'events/ReactGenericBatching'; +} from 'legacy-events/EventPluginHub'; +import {registrationNameModules} from 'legacy-events/EventPluginRegistry'; +import {batchedUpdates} from 'legacy-events/ReactGenericBatching'; import warningWithoutStack from 'shared/warningWithoutStack'; import {getInstanceFromNode} from './ReactNativeComponentTree'; -import type {AnyNativeEvent} from 'events/PluginModuleType'; -import type {TopLevelType} from 'events/TopLevelEventTypes'; +import type {AnyNativeEvent} from 'legacy-events/PluginModuleType'; +import type {TopLevelType} from 'legacy-events/TopLevelEventTypes'; export {getListener, registrationNameModules as registrationNames}; diff --git a/packages/react-native-renderer/src/ReactNativeInjection.js b/packages/react-native-renderer/src/ReactNativeInjection.js index 3e775c4572c7a..7c88fa03f6835 100644 --- a/packages/react-native-renderer/src/ReactNativeInjection.js +++ b/packages/react-native-renderer/src/ReactNativeInjection.js @@ -14,10 +14,10 @@ import { getInstanceFromNode, getNodeFromInstance, } from './ReactNativeComponentTree'; -import {setComponentTree} from 'events/EventPluginUtils'; +import {setComponentTree} from 'legacy-events/EventPluginUtils'; import {receiveEvent, receiveTouches} from './ReactNativeEventEmitter'; import ReactNativeGlobalResponderHandler from './ReactNativeGlobalResponderHandler'; -import ResponderEventPlugin from 'events/ResponderEventPlugin'; +import ResponderEventPlugin from 'legacy-events/ResponderEventPlugin'; // Module provided by RN: import {RCTEventEmitter} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'; diff --git a/packages/react-native-renderer/src/ReactNativeInjectionShared.js b/packages/react-native-renderer/src/ReactNativeInjectionShared.js index a8861d3589bf5..9e97891918812 100644 --- a/packages/react-native-renderer/src/ReactNativeInjectionShared.js +++ b/packages/react-native-renderer/src/ReactNativeInjectionShared.js @@ -16,8 +16,8 @@ // Module provided by RN: import 'react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore'; -import {injection as EventPluginHubInjection} from 'events/EventPluginHub'; -import ResponderEventPlugin from 'events/ResponderEventPlugin'; +import {injection as EventPluginHubInjection} from 'legacy-events/EventPluginHub'; +import ResponderEventPlugin from 'legacy-events/ResponderEventPlugin'; import ReactNativeBridgeEventPlugin from './ReactNativeBridgeEventPlugin'; import ReactNativeEventPluginOrder from './ReactNativeEventPluginOrder'; diff --git a/packages/react-native-renderer/src/ReactNativeRenderer.js b/packages/react-native-renderer/src/ReactNativeRenderer.js index 46685f4d098f1..853c5f54fc7ae 100644 --- a/packages/react-native-renderer/src/ReactNativeRenderer.js +++ b/packages/react-native-renderer/src/ReactNativeRenderer.js @@ -30,7 +30,7 @@ import {createPortal} from 'shared/ReactPortal'; import { setBatchingImplementation, batchedUpdates, -} from 'events/ReactGenericBatching'; +} from 'legacy-events/ReactGenericBatching'; import ReactVersion from 'shared/ReactVersion'; // Module provided by RN: import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface'; diff --git a/packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js b/packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js index e9de5541a3af0..6f7ddb09ec65a 100644 --- a/packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js +++ b/packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js @@ -68,7 +68,7 @@ beforeEach(() => { .RCTEventEmitter; React = require('react'); ReactNative = require('react-native-renderer'); - ResponderEventPlugin = require('events/ResponderEventPlugin').default; + ResponderEventPlugin = require('legacy-events/ResponderEventPlugin').default; UIManager = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface') .UIManager; createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface') diff --git a/scripts/flow/react-native-host-hooks.js b/scripts/flow/react-native-host-hooks.js index f93595a7e6495..4415dde1a2d88 100644 --- a/scripts/flow/react-native-host-hooks.js +++ b/scripts/flow/react-native-host-hooks.js @@ -16,7 +16,7 @@ import type { ReactNativeBaseComponentViewConfig, ViewConfigGetter, } from 'react-native-renderer/src/ReactNativeTypes'; -import type {RNTopLevelEventType} from 'events/TopLevelEventTypes'; +import type {RNTopLevelEventType} from 'legacy-events/TopLevelEventTypes'; import type {CapturedError} from 'react-reconciler/src/ReactCapturedValue'; declare module 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface' { diff --git a/scripts/jest/config.build.js b/scripts/jest/config.build.js index e3d91b9de3c6e..cbbf35d704c7e 100644 --- a/scripts/jest/config.build.js +++ b/scripts/jest/config.build.js @@ -10,11 +10,6 @@ const packages = readdirSync(packagesRoot).filter(dir => { if (dir.charAt(0) === '.') { return false; } - if (dir === 'events') { - // There's an actual Node package called "events" - // that's used by jsdom so we don't want to alias that. - return false; - } const packagePath = join(packagesRoot, dir, 'package.json'); return statSync(packagePath).isFile(); }); diff --git a/scripts/rollup/forks.js b/scripts/rollup/forks.js index 96790a1c1ea53..ac217405dbbff 100644 --- a/scripts/rollup/forks.js +++ b/scripts/rollup/forks.js @@ -381,9 +381,9 @@ const forks = Object.freeze({ }, // React DOM uses different top level event names and supports mouse events. - 'events/ResponderTopLevelEventTypes': (bundleType, entry) => { + 'legacy-events/ResponderTopLevelEventTypes': (bundleType, entry) => { if (entry === 'react-dom' || entry.startsWith('react-dom/')) { - return 'events/forks/ResponderTopLevelEventTypes.dom.js'; + return 'legacy-events/forks/ResponderTopLevelEventTypes.dom.js'; } return null; }, diff --git a/scripts/shared/pathsByLanguageVersion.js b/scripts/shared/pathsByLanguageVersion.js index dcf9b32544e81..396b28cdbd44a 100644 --- a/scripts/shared/pathsByLanguageVersion.js +++ b/scripts/shared/pathsByLanguageVersion.js @@ -12,7 +12,7 @@ const esNextPaths = [ 'packages/*/*.js', // Source files 'packages/*/src/**/*.js', - 'packages/events/**/*.js', + 'packages/legacy-events/**/*.js', 'packages/shared/**/*.js', // Shims and Flow environment 'scripts/flow/*.js',