Skip to content

Commit

Permalink
Consolidate events between EventConstants and BrowserEventEmitter
Browse files Browse the repository at this point in the history
This is a follow up to
#9333. This commit removes some
duplication of event names and renames the EventConstants module to
BrowserEventConstants.
  • Loading branch information
nhunzaker committed Apr 24, 2017
1 parent 86dd083 commit eef542a
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 235 deletions.
88 changes: 44 additions & 44 deletions docs/js/react-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEv
}

/**
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} topLevelType Record from `BrowserEventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The string corresponding to this `beforeInput` event.
*/
Expand Down Expand Up @@ -404,7 +404,7 @@ function getNativeBeforeInputChars(topLevelType, nativeEvent) {
* For browsers that do not provide the `textInput` event, extract the
* appropriate string to use for SyntheticInputEvent.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} topLevelType Record from `BrowserEventConstants`.
* @param {object} nativeEvent Native browser event.
* @return {?string} The fallback string for this `beforeInput` event.
*/
Expand Down Expand Up @@ -878,7 +878,7 @@ module.exports = CSSPropertyOperations;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -2380,11 +2380,11 @@ var topLevelTypes = {
topWheel: null
};

var EventConstants = {
var BrowserEventConstants = {
topLevelTypes: topLevelTypes
};

module.exports = EventConstants;
module.exports = BrowserEventConstants;
},{}],17:[function(_dereq_,module,exports){
/**
* Copyright 2013-present, Facebook, Inc.
Expand Down Expand Up @@ -2645,7 +2645,7 @@ module.exports = EventPluginHub;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -3567,7 +3567,7 @@ module.exports = HTMLDOMPropertyConfig;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -3761,7 +3761,7 @@ module.exports = LinkedValueUtils;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -4399,7 +4399,7 @@ module.exports = ReactComponentBrowserEnvironment;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -8343,7 +8343,7 @@ module.exports = ReactDOMUnknownPropertyHook;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -8858,7 +8858,7 @@ module.exports = {
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -8908,7 +8908,7 @@ module.exports = ReactEmptyComponent;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -9111,7 +9111,7 @@ var ReactEventListener = {
/**
* Traps top-level events by using event bubbling.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} topLevelType Record from `BrowserEventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
Expand All @@ -9128,7 +9128,7 @@ var ReactEventListener = {
/**
* Traps a top-level event by using event capturing.
*
* @param {string} topLevelType Record from `EventConstants`.
* @param {string} topLevelType Record from `BrowserEventConstants`.
* @param {string} handlerBaseName Event name (e.g. "click").
* @param {object} element Element on which to attach listener.
* @return {?object} An object with a remove function which will forcefully
Expand Down Expand Up @@ -9173,7 +9173,7 @@ module.exports = ReactEventListener;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -9271,7 +9271,7 @@ module.exports = ReactHostComponent;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -9511,7 +9511,7 @@ module.exports = ReactInstanceMap;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand All @@ -9535,7 +9535,7 @@ module.exports = { debugTool: debugTool };
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -10610,7 +10610,7 @@ module.exports = ReactMultiChild;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -10650,7 +10650,7 @@ module.exports = ReactNodeTypes;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -10744,7 +10744,7 @@ module.exports = ReactOwner;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -11245,7 +11245,7 @@ module.exports = ReactPerfAnalysis;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand All @@ -11270,7 +11270,7 @@ module.exports = ReactPropTypeLocationNames;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -11633,7 +11633,7 @@ module.exports = ReactReconciler;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -11812,7 +11812,7 @@ module.exports = ReactServerRenderingTransaction;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -12093,7 +12093,7 @@ module.exports = ReactShallowRenderer;
var _prodInvariant = _dereq_(125),
_assign = _dereq_(158);

var EventConstants = _dereq_(16);
var BrowserEventConstants = _dereq_(16);
var EventPluginHub = _dereq_(17);
var EventPluginRegistry = _dereq_(18);
var EventPropagators = _dereq_(20);
Expand All @@ -12109,7 +12109,7 @@ var ReactShallowRenderer = _dereq_(79);
var findDOMNode = _dereq_(108);
var invariant = _dereq_(150);

var topLevelTypes = EventConstants.topLevelTypes;
var topLevelTypes = BrowserEventConstants.topLevelTypes;

function Event(suffix) {}

Expand Down Expand Up @@ -12343,7 +12343,7 @@ var ReactTestUtils = {
/**
* Simulates a top level event being dispatched from a raw event that occurred
* on an `Element` node.
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`
* @param {!Element} node The dom to simulate an event occurring on.
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
*/
Expand All @@ -12355,7 +12355,7 @@ var ReactTestUtils = {
/**
* Simulates a top level event being dispatched from a raw event that occurred
* on the `ReactDOMComponent` `comp`.
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
* @param {!ReactDOMComponent} comp
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
*/
Expand Down Expand Up @@ -12456,7 +12456,7 @@ buildSimulators();
* - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
* - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
* - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
* - ... (All keys from `EventConstants.topLevelTypes`)
* - ... (All keys from `BrowserEventConstants.topLevelTypes`)
*
* Note: Top level event types are a subset of the entire set of handler types
* (which include a broader set of "synthetic" events). For example, onDragDone
Expand Down Expand Up @@ -13482,7 +13482,7 @@ module.exports = SelectEventPlugin;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -14568,7 +14568,7 @@ module.exports = SyntheticWheelEvent;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -14820,7 +14820,7 @@ module.exports = ViewportMetrics;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -14878,7 +14878,7 @@ module.exports = accumulateInto;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -15306,7 +15306,7 @@ module.exports = findDOMNode;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -15383,7 +15383,7 @@ module.exports = flattenChildren;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -15674,7 +15674,7 @@ module.exports = getHostComponentFromComposite;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -15715,7 +15715,7 @@ module.exports = getIteratorFn;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -16122,7 +16122,7 @@ module.exports = isEventSupported;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

'use strict';
Expand Down Expand Up @@ -16199,7 +16199,7 @@ module.exports = quoteAttributeValueForBrowser;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/
'use strict';

Expand Down Expand Up @@ -17250,7 +17250,7 @@ module.exports = camelizeStyleName;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

var isTextNode = _dereq_(152);
Expand Down Expand Up @@ -17501,7 +17501,7 @@ module.exports = createNodesFromMarkup;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
*/

function makeEmptyFunction(arg) {
Expand Down Expand Up @@ -17924,7 +17924,7 @@ module.exports = isTextNode;
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*
* @typechecks static-only
*/

Expand Down Expand Up @@ -18012,7 +18012,7 @@ module.exports = performanceNow;
* of patent rights can be found in the PATENTS file in the same directory.
*
* @typechecks
*
*
*/

/*eslint-disable no-self-compare */
Expand Down
Loading

0 comments on commit eef542a

Please sign in to comment.