Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename legacy "events" package to "legacy-events" #16388

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"private": true,
"name": "events",
"name": "legacy-events",
"version": "0.0.0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
12 changes: 6 additions & 6 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOMClientInjection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/BeforeInputEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions packages/react-dom/src/events/ChangeEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
10 changes: 5 additions & 5 deletions packages/react-dom/src/events/DOMEventResponderSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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';
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/DOMTopLevelEventTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/EnterLeaveEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/ReactBrowserEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions packages/react-dom/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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';
Expand All @@ -31,7 +31,7 @@ import {
IS_PASSIVE,
IS_ACTIVE,
PASSIVE_NOT_SUPPORTED,
} from 'events/EventSystemFlags';
} from 'legacy-events/EventSystemFlags';

import {
addEventBubbleListener,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/events/SelectEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
10 changes: 5 additions & 5 deletions packages/react-dom/src/events/SimpleEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticAnimationEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticClipboardEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticCompositionEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticInputEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticTransitionEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/SyntheticUIEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/events/getEventModifierState.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import {
registrationNameModules,
possibleRegistrationNames,
} from 'events/EventPluginRegistry';
} from 'legacy-events/EventPluginRegistry';
import warning from 'shared/warning';

import {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/test-utils/ReactTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 5 additions & 5 deletions packages/react-native-renderer/src/ReactFabricEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Loading