react/scripts/rollup
Nicolas Gallagher 9ce8711d5a
[react-events] Tap responder (#16628)
This is a partial replacement for the 'Press' responder:

1. `useTap` is scoped to pointers (no keyboard support). Our current thinking is
that "responders" should be limited to working with pointers, and that they can
be combined with 'useKeyboard' in user-space. For example, we might create a
'usePress' hook in user-space that combines 'useTap' with 'useKeyboard' to react
to both pointers and keyboard interactions.

2. `useTap` cancels the gesture once the pointer moves over an element that is
not within the responder target's subtree. This differs from `usePress` (and
React Native), where the gesture remains active after the pointer exits the
target's subtree and is restarted once the pointer reenters. One of the
drawbacks with the `usePress` behavior is that it requires repeatedly measuring
DOM elements (which can cause jank) to perform hit region tests. `useTap` avoids
doing this and relies on `document.elementFromPoint` only to support the
TouchEvent fallbacks.

3. `useTap` calls `onTapUpdate` when the active gesture's state changes,
`onTapEnd` when the gesture successfully completes. and `onTapCancel` when it
fails. There is no `onTap` callback. `usePress` did not explicitly report back
when the gesture failed, and product developers were confused about the
difference between `onPress` and `onPressEnd`.

4. `useTap` explicitly separates the PointerEvent implementation from the
MouseEvent/TouchEvent fallback.

5. `useTap` has better unit test coverage . All pointer types and the fallback
environment are tested. The shape of the gesture state object is also defined
and tested.
2019-09-04 17:09:33 -07:00
..
plugins Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
shims Remove mention of Prepack (#15922) 2019-06-19 11:05:28 +01:00
validate [Scheduler] Profiler Features (second try) (#16542) 2019-08-22 13:58:12 -07:00
build.js Remove duplicate character in regex group (#16572) 2019-08-29 14:49:27 +01:00
bundles.js [react-events] Tap responder (#16628) 2019-09-04 17:09:33 -07:00
consolidateBundleSizes.js Fix sizebot (#15771) 2019-05-29 21:30:16 -07:00
forks.js Rename legacy "events" package to "legacy-events" (#16388) 2019-08-14 07:32:42 -07:00
modules.js [react-native] Use path-based imports instead of Haste for the RN renderer (#15604) 2019-05-23 08:23:54 +01:00
packaging.js [Flare] Refine flow type annotations (#15950) 2019-06-21 12:32:43 +01:00
stats.js Fix sizebot (#15771) 2019-05-29 21:30:16 -07:00
sync.js Fork React Native renderer into FB and OSS bundles (#12625) 2018-04-18 13:16:50 -07:00
utils.js Refactor the build scripts (#11787) 2017-12-06 20:11:32 +00:00
wrappers.js Add UMD production+profiling entry points (#13642) 2018-09-13 17:44:08 -07:00