Skip to content

Commit 988fbf0

Browse files
committed
Consolidate events between EventConstants and BrowserEventEmitter
This is a follow up to facebook#9333. This commit removes some duplication of event names and renames the EventConstants module to BrowserEventConstants.
1 parent 86dd083 commit 988fbf0

10 files changed

+168
-234
lines changed

docs/js/react-dom.js

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEv
350350
}
351351

352352
/**
353-
* @param {string} topLevelType Record from `EventConstants`.
353+
* @param {string} topLevelType Record from `BrowserEventConstants`.
354354
* @param {object} nativeEvent Native browser event.
355355
* @return {?string} The string corresponding to this `beforeInput` event.
356356
*/
@@ -404,7 +404,7 @@ function getNativeBeforeInputChars(topLevelType, nativeEvent) {
404404
* For browsers that do not provide the `textInput` event, extract the
405405
* appropriate string to use for SyntheticInputEvent.
406406
*
407-
* @param {string} topLevelType Record from `EventConstants`.
407+
* @param {string} topLevelType Record from `BrowserEventConstants`.
408408
* @param {object} nativeEvent Native browser event.
409409
* @return {?string} The fallback string for this `beforeInput` event.
410410
*/
@@ -878,7 +878,7 @@ module.exports = CSSPropertyOperations;
878878
* LICENSE file in the root directory of this source tree. An additional grant
879879
* of patent rights can be found in the PATENTS file in the same directory.
880880
*
881-
*
881+
*
882882
*/
883883

884884
'use strict';
@@ -2380,11 +2380,11 @@ var topLevelTypes = {
23802380
topWheel: null
23812381
};
23822382

2383-
var EventConstants = {
2383+
var BrowserEventConstants = {
23842384
topLevelTypes: topLevelTypes
23852385
};
23862386

2387-
module.exports = EventConstants;
2387+
module.exports = BrowserEventConstants;
23882388
},{}],17:[function(_dereq_,module,exports){
23892389
/**
23902390
* Copyright 2013-present, Facebook, Inc.
@@ -2645,7 +2645,7 @@ module.exports = EventPluginHub;
26452645
* LICENSE file in the root directory of this source tree. An additional grant
26462646
* of patent rights can be found in the PATENTS file in the same directory.
26472647
*
2648-
*
2648+
*
26492649
*/
26502650

26512651
'use strict';
@@ -3567,7 +3567,7 @@ module.exports = HTMLDOMPropertyConfig;
35673567
* LICENSE file in the root directory of this source tree. An additional grant
35683568
* of patent rights can be found in the PATENTS file in the same directory.
35693569
*
3570-
*
3570+
*
35713571
*/
35723572

35733573
'use strict';
@@ -3761,7 +3761,7 @@ module.exports = LinkedValueUtils;
37613761
* LICENSE file in the root directory of this source tree. An additional grant
37623762
* of patent rights can be found in the PATENTS file in the same directory.
37633763
*
3764-
*
3764+
*
37653765
*/
37663766

37673767
'use strict';
@@ -4399,7 +4399,7 @@ module.exports = ReactComponentBrowserEnvironment;
43994399
* LICENSE file in the root directory of this source tree. An additional grant
44004400
* of patent rights can be found in the PATENTS file in the same directory.
44014401
*
4402-
*
4402+
*
44034403
*/
44044404

44054405
'use strict';
@@ -8343,7 +8343,7 @@ module.exports = ReactDOMUnknownPropertyHook;
83438343
* LICENSE file in the root directory of this source tree. An additional grant
83448344
* of patent rights can be found in the PATENTS file in the same directory.
83458345
*
8346-
*
8346+
*
83478347
*/
83488348

83498349
'use strict';
@@ -8858,7 +8858,7 @@ module.exports = {
88588858
* LICENSE file in the root directory of this source tree. An additional grant
88598859
* of patent rights can be found in the PATENTS file in the same directory.
88608860
*
8861-
*
8861+
*
88628862
*/
88638863

88648864
'use strict';
@@ -8908,7 +8908,7 @@ module.exports = ReactEmptyComponent;
89088908
* LICENSE file in the root directory of this source tree. An additional grant
89098909
* of patent rights can be found in the PATENTS file in the same directory.
89108910
*
8911-
*
8911+
*
89128912
*/
89138913

89148914
'use strict';
@@ -9111,7 +9111,7 @@ var ReactEventListener = {
91119111
/**
91129112
* Traps top-level events by using event bubbling.
91139113
*
9114-
* @param {string} topLevelType Record from `EventConstants`.
9114+
* @param {string} topLevelType Record from `BrowserEventConstants`.
91159115
* @param {string} handlerBaseName Event name (e.g. "click").
91169116
* @param {object} element Element on which to attach listener.
91179117
* @return {?object} An object with a remove function which will forcefully
@@ -9128,7 +9128,7 @@ var ReactEventListener = {
91289128
/**
91299129
* Traps a top-level event by using event capturing.
91309130
*
9131-
* @param {string} topLevelType Record from `EventConstants`.
9131+
* @param {string} topLevelType Record from `BrowserEventConstants`.
91329132
* @param {string} handlerBaseName Event name (e.g. "click").
91339133
* @param {object} element Element on which to attach listener.
91349134
* @return {?object} An object with a remove function which will forcefully
@@ -9173,7 +9173,7 @@ module.exports = ReactEventListener;
91739173
* LICENSE file in the root directory of this source tree. An additional grant
91749174
* of patent rights can be found in the PATENTS file in the same directory.
91759175
*
9176-
*
9176+
*
91779177
*/
91789178

91799179
'use strict';
@@ -9271,7 +9271,7 @@ module.exports = ReactHostComponent;
92719271
* LICENSE file in the root directory of this source tree. An additional grant
92729272
* of patent rights can be found in the PATENTS file in the same directory.
92739273
*
9274-
*
9274+
*
92759275
*/
92769276

92779277
'use strict';
@@ -9511,7 +9511,7 @@ module.exports = ReactInstanceMap;
95119511
* LICENSE file in the root directory of this source tree. An additional grant
95129512
* of patent rights can be found in the PATENTS file in the same directory.
95139513
*
9514-
*
9514+
*
95159515
*/
95169516

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

95419541
'use strict';
@@ -10610,7 +10610,7 @@ module.exports = ReactMultiChild;
1061010610
* LICENSE file in the root directory of this source tree. An additional grant
1061110611
* of patent rights can be found in the PATENTS file in the same directory.
1061210612
*
10613-
*
10613+
*
1061410614
*/
1061510615

1061610616
'use strict';
@@ -10650,7 +10650,7 @@ module.exports = ReactNodeTypes;
1065010650
* LICENSE file in the root directory of this source tree. An additional grant
1065110651
* of patent rights can be found in the PATENTS file in the same directory.
1065210652
*
10653-
*
10653+
*
1065410654
*/
1065510655

1065610656
'use strict';
@@ -10744,7 +10744,7 @@ module.exports = ReactOwner;
1074410744
* LICENSE file in the root directory of this source tree. An additional grant
1074510745
* of patent rights can be found in the PATENTS file in the same directory.
1074610746
*
10747-
*
10747+
*
1074810748
*/
1074910749

1075010750
'use strict';
@@ -11245,7 +11245,7 @@ module.exports = ReactPerfAnalysis;
1124511245
* LICENSE file in the root directory of this source tree. An additional grant
1124611246
* of patent rights can be found in the PATENTS file in the same directory.
1124711247
*
11248-
*
11248+
*
1124911249
*/
1125011250

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

1127611276
'use strict';
@@ -11633,7 +11633,7 @@ module.exports = ReactReconciler;
1163311633
* LICENSE file in the root directory of this source tree. An additional grant
1163411634
* of patent rights can be found in the PATENTS file in the same directory.
1163511635
*
11636-
*
11636+
*
1163711637
*/
1163811638

1163911639
'use strict';
@@ -11812,7 +11812,7 @@ module.exports = ReactServerRenderingTransaction;
1181211812
* LICENSE file in the root directory of this source tree. An additional grant
1181311813
* of patent rights can be found in the PATENTS file in the same directory.
1181411814
*
11815-
*
11815+
*
1181611816
*/
1181711817

1181811818
'use strict';
@@ -12093,7 +12093,7 @@ module.exports = ReactShallowRenderer;
1209312093
var _prodInvariant = _dereq_(125),
1209412094
_assign = _dereq_(158);
1209512095

12096-
var EventConstants = _dereq_(16);
12096+
var BrowserEventConstants = _dereq_(16);
1209712097
var EventPluginHub = _dereq_(17);
1209812098
var EventPluginRegistry = _dereq_(18);
1209912099
var EventPropagators = _dereq_(20);
@@ -12109,7 +12109,7 @@ var ReactShallowRenderer = _dereq_(79);
1210912109
var findDOMNode = _dereq_(108);
1211012110
var invariant = _dereq_(150);
1211112111

12112-
var topLevelTypes = EventConstants.topLevelTypes;
12112+
var topLevelTypes = BrowserEventConstants.topLevelTypes;
1211312113

1211412114
function Event(suffix) {}
1211512115

@@ -12343,7 +12343,7 @@ var ReactTestUtils = {
1234312343
/**
1234412344
* Simulates a top level event being dispatched from a raw event that occurred
1234512345
* on an `Element` node.
12346-
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`
12346+
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`
1234712347
* @param {!Element} node The dom to simulate an event occurring on.
1234812348
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
1234912349
*/
@@ -12355,7 +12355,7 @@ var ReactTestUtils = {
1235512355
/**
1235612356
* Simulates a top level event being dispatched from a raw event that occurred
1235712357
* on the `ReactDOMComponent` `comp`.
12358-
* @param {Object} topLevelType A type from `EventConstants.topLevelTypes`.
12358+
* @param {Object} topLevelType A type from `BrowserEventConstants.topLevelTypes`.
1235912359
* @param {!ReactDOMComponent} comp
1236012360
* @param {?Event} fakeNativeEvent Fake native event to use in SyntheticEvent.
1236112361
*/
@@ -12456,7 +12456,7 @@ buildSimulators();
1245612456
* - `ReactTestUtils.SimulateNative.mouseMove(Element/ReactDOMComponent)`
1245712457
* - `ReactTestUtils.SimulateNative.mouseIn/ReactDOMComponent)`
1245812458
* - `ReactTestUtils.SimulateNative.mouseOut(Element/ReactDOMComponent)`
12459-
* - ... (All keys from `EventConstants.topLevelTypes`)
12459+
* - ... (All keys from `BrowserEventConstants.topLevelTypes`)
1246012460
*
1246112461
* Note: Top level event types are a subset of the entire set of handler types
1246212462
* (which include a broader set of "synthetic" events). For example, onDragDone
@@ -13482,7 +13482,7 @@ module.exports = SelectEventPlugin;
1348213482
* LICENSE file in the root directory of this source tree. An additional grant
1348313483
* of patent rights can be found in the PATENTS file in the same directory.
1348413484
*
13485-
*
13485+
*
1348613486
*/
1348713487

1348813488
'use strict';
@@ -14568,7 +14568,7 @@ module.exports = SyntheticWheelEvent;
1456814568
* LICENSE file in the root directory of this source tree. An additional grant
1456914569
* of patent rights can be found in the PATENTS file in the same directory.
1457014570
*
14571-
*
14571+
*
1457214572
*/
1457314573

1457414574
'use strict';
@@ -14820,7 +14820,7 @@ module.exports = ViewportMetrics;
1482014820
* LICENSE file in the root directory of this source tree. An additional grant
1482114821
* of patent rights can be found in the PATENTS file in the same directory.
1482214822
*
14823-
*
14823+
*
1482414824
*/
1482514825

1482614826
'use strict';
@@ -14878,7 +14878,7 @@ module.exports = accumulateInto;
1487814878
* LICENSE file in the root directory of this source tree. An additional grant
1487914879
* of patent rights can be found in the PATENTS file in the same directory.
1488014880
*
14881-
*
14881+
*
1488214882
*/
1488314883

1488414884
'use strict';
@@ -15306,7 +15306,7 @@ module.exports = findDOMNode;
1530615306
* LICENSE file in the root directory of this source tree. An additional grant
1530715307
* of patent rights can be found in the PATENTS file in the same directory.
1530815308
*
15309-
*
15309+
*
1531015310
*/
1531115311

1531215312
'use strict';
@@ -15383,7 +15383,7 @@ module.exports = flattenChildren;
1538315383
* LICENSE file in the root directory of this source tree. An additional grant
1538415384
* of patent rights can be found in the PATENTS file in the same directory.
1538515385
*
15386-
*
15386+
*
1538715387
*/
1538815388

1538915389
'use strict';
@@ -15674,7 +15674,7 @@ module.exports = getHostComponentFromComposite;
1567415674
* LICENSE file in the root directory of this source tree. An additional grant
1567515675
* of patent rights can be found in the PATENTS file in the same directory.
1567615676
*
15677-
*
15677+
*
1567815678
*/
1567915679

1568015680
'use strict';
@@ -15715,7 +15715,7 @@ module.exports = getIteratorFn;
1571515715
* LICENSE file in the root directory of this source tree. An additional grant
1571615716
* of patent rights can be found in the PATENTS file in the same directory.
1571715717
*
15718-
*
15718+
*
1571915719
*/
1572015720

1572115721
'use strict';
@@ -16122,7 +16122,7 @@ module.exports = isEventSupported;
1612216122
* LICENSE file in the root directory of this source tree. An additional grant
1612316123
* of patent rights can be found in the PATENTS file in the same directory.
1612416124
*
16125-
*
16125+
*
1612616126
*/
1612716127

1612816128
'use strict';
@@ -16199,7 +16199,7 @@ module.exports = quoteAttributeValueForBrowser;
1619916199
* LICENSE file in the root directory of this source tree. An additional grant
1620016200
* of patent rights can be found in the PATENTS file in the same directory.
1620116201
*
16202-
*
16202+
*
1620316203
*/
1620416204
'use strict';
1620516205

@@ -17250,7 +17250,7 @@ module.exports = camelizeStyleName;
1725017250
* LICENSE file in the root directory of this source tree. An additional grant
1725117251
* of patent rights can be found in the PATENTS file in the same directory.
1725217252
*
17253-
*
17253+
*
1725417254
*/
1725517255

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

1750717507
function makeEmptyFunction(arg) {
@@ -17924,7 +17924,7 @@ module.exports = isTextNode;
1792417924
* LICENSE file in the root directory of this source tree. An additional grant
1792517925
* of patent rights can be found in the PATENTS file in the same directory.
1792617926
*
17927-
*
17927+
*
1792817928
* @typechecks static-only
1792917929
*/
1793017930

@@ -18012,7 +18012,7 @@ module.exports = performanceNow;
1801218012
* of patent rights can be found in the PATENTS file in the same directory.
1801318013
*
1801418014
* @typechecks
18015-
*
18015+
*
1801618016
*/
1801718017

1801818018
/*eslint-disable no-self-compare */

0 commit comments

Comments
 (0)