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

Use browser event names for top-level event types in React DOM #12629

Merged
merged 46 commits into from
May 15, 2018
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d02d86a
Add TopLevelEventTypes
philipp-spiess Apr 16, 2018
45713ce
Fix `ReactBrowserEventEmitter`
philipp-spiess Apr 16, 2018
5f11da0
Fix EventPluginUtils
philipp-spiess Apr 16, 2018
58a24ba
Fix TapEventPlugin
philipp-spiess Apr 16, 2018
390fb51
Fix ResponderEventPlugin
philipp-spiess Apr 16, 2018
3dcbf4d
Update ReactDOMFiberComponent
philipp-spiess Apr 16, 2018
1fb5cd8
Fix BeforeInputEventPlugin
philipp-spiess Apr 16, 2018
96ce3cd
Fix ChangeEventPlugin
philipp-spiess Apr 16, 2018
737626a
Fix EnterLeaveEventPlugin
philipp-spiess Apr 16, 2018
a03d896
Add missing non top event type used in ChangeEventPlugin
philipp-spiess Apr 16, 2018
d58cd30
Fix SelectEventPlugin
philipp-spiess Apr 16, 2018
e1b9166
Fix SimpleEventPlugin
philipp-spiess Apr 16, 2018
f07a64f
Fix outstanding Flow issues and move TopLevelEventTypes
philipp-spiess Apr 16, 2018
da64f27
Inline a list of all events in `ReactTestUtils`
philipp-spiess Apr 16, 2018
16c39e5
Fix tests
philipp-spiess Apr 17, 2018
4a7114e
Make it pretty
philipp-spiess Apr 17, 2018
2a87568
Fix completly unrelated typo
philipp-spiess Apr 17, 2018
0d864ca
Don’t use map constructor because of IE11
philipp-spiess Apr 17, 2018
586708e
Update typings, revert changes to native code
philipp-spiess Apr 21, 2018
12c9ac3
Make topLevelTypes in ResponderEventPlugin injectable and create DOM …
philipp-spiess Apr 21, 2018
9d684fc
Set proper dependencies for DOMResponderEventPlugin
philipp-spiess Apr 21, 2018
c27ab85
Prettify
philipp-spiess Apr 21, 2018
4043f87
Make some react dom tests no longer depend on internal API
philipp-spiess Apr 21, 2018
f029940
Use factories to create top level speific generic event modules
philipp-spiess Apr 21, 2018
0ace5a1
Remove unused dependency
philipp-spiess Apr 21, 2018
653492c
Revert exposed module renaming, hide store creation, and inline depen…
philipp-spiess Apr 23, 2018
7e8b34f
Add Flow types to createResponderEventPlugin and its consumers
philipp-spiess Apr 23, 2018
2d21c09
Remove unused dependency
philipp-spiess Apr 23, 2018
d1c390b
Use opaque flow type for TopLevelType
philipp-spiess Apr 24, 2018
ec0b881
Add missing semis
philipp-spiess Apr 24, 2018
352dfbf
Use raw event names as top level identifer
philipp-spiess Apr 24, 2018
ac6e3e2
Upgrade baylon
philipp-spiess Apr 24, 2018
4a7bf07
Clean up flow types
philipp-spiess Apr 24, 2018
3ebd359
Revert Map changes of ReactBrowserEventEmitter
philipp-spiess Apr 24, 2018
6095b0f
Upgrade babel-* packages
philipp-spiess Apr 24, 2018
bb057bc
Revert Map changes of SimpleEventPlugin
philipp-spiess Apr 24, 2018
6800d01
Clean up ReactTestUtils
philipp-spiess Apr 24, 2018
4d76b15
Add missing semi
philipp-spiess Apr 24, 2018
af02875
Fix Flow issue
philipp-spiess Apr 25, 2018
c1f6b38
Make TopLevelType clearer
philipp-spiess Apr 25, 2018
0cb8fad
Favor for loops
philipp-spiess Apr 25, 2018
df7f91d
Explain the new DOMTopLevelEventTypes concept
philipp-spiess Apr 25, 2018
15c2723
Use static injection for Responder plugin types
gaearon May 4, 2018
4b2ca6b
Remove null check and rely on flow checks
philipp-spiess May 7, 2018
e19f37b
Add missing ResponderEventPlugin dependencies
philipp-spiess May 11, 2018
0c6982d
Merge branch 'master' into no-top-level-events
gaearon May 15, 2018
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 @@ -15,7 +15,7 @@ function NumberInputs() {
`}
affectedBrowsers="IE Edge, IE 11">
<TestCase.Steps>
<li>Type any string (not an actual password</li>
<li>Type any string (not an actual password)</li>
</TestCase.Steps>

<TestCase.ExpectedResult>
Expand Down
5 changes: 3 additions & 2 deletions packages/events/EventPluginHub.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import type {PluginModule} from './PluginModuleType';
import type {ReactSyntheticEvent} from './ReactSyntheticEventType';
import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {AnyNativeEvent} from './PluginModuleType';
import type {TopLevelType} from './TopLevelEventTypes';

/**
* Internal queue of events that have accumulated their dispatches and are
Expand Down Expand Up @@ -165,7 +166,7 @@ export function getListener(inst: Fiber, registrationName: string) {
* @internal
*/
function extractEvents(
topLevelType: string,
topLevelType: TopLevelType,
targetInst: Fiber,
nativeEvent: AnyNativeEvent,
nativeEventTarget: EventTarget,
Expand Down Expand Up @@ -227,7 +228,7 @@ export function runEventsInBatch(
}

export function runExtractedEventsInBatch(
topLevelType: string,
topLevelType: TopLevelType,
targetInst: Fiber,
nativeEvent: AnyNativeEvent,
nativeEventTarget: EventTarget,
Expand Down
15 changes: 0 additions & 15 deletions packages/events/EventPluginUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,6 @@ export const injection = {
},
};

export function isEndish(topLevelType) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those methods have been used by the responder plugin and a dependency of the responder and were thus added in the events/ shared package. Since don't have the top level types for DOM here anymore, those were removed.

return (
topLevelType === 'topMouseUp' ||
topLevelType === 'topTouchEnd' ||
topLevelType === 'topTouchCancel'
);
}

export function isMoveish(topLevelType) {
return topLevelType === 'topMouseMove' || topLevelType === 'topTouchMove';
}
export function isStartish(topLevelType) {
return topLevelType === 'topMouseDown' || topLevelType === 'topTouchStart';
}

let validateEventDispatches;
if (__DEV__) {
validateEventDispatches = function(event) {
Expand Down
3 changes: 2 additions & 1 deletion packages/events/PluginModuleType.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
DispatchConfig,
ReactSyntheticEvent,
} from './ReactSyntheticEventType';
import type {TopLevelType} from './TopLevelEventTypes';

export type EventTypes = {[key: string]: DispatchConfig};

Expand All @@ -22,7 +23,7 @@ export type PluginName = string;
export type PluginModule<NativeEvent> = {
eventTypes: EventTypes,
extractEvents: (
topLevelType: string,
topLevelType: TopLevelType,
targetInst: Fiber,
nativeTarget: NativeEvent,
nativeEventTarget: EventTarget,
Expand Down
3 changes: 2 additions & 1 deletion packages/events/ReactSyntheticEventType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
*/

import type {Fiber} from 'react-reconciler/src/ReactFiber';
import type {TopLevelType} from './TopLevelEventTypes';

export type DispatchConfig = {
dependencies: Array<string>,
dependencies: Array<TopLevelType>,
phasedRegistrationNames?: {
bubbled: string,
captured: string,
Expand Down
Loading