• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

facebook / react / 12674
86%

Build:
DEFAULT BRANCH: master
Ran 07 Sep 2016 09:15PM UTC
Jobs 1
Files 226
Run time 12s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
12674

push

travis-ci

web-flow
Flow type event plugins (#7667)

* Type SimpleEventPlugin and TapEventPlugin

- Renamed file from 'ReactSynteticEvent' to 'ReactSyntheticEventType'
- Fills in the 'any' holes that were left in DispatchConfig type and the
  type annotations in EventPluginRegistry.
- Adds polymorphic PluginModule type and related types
- Uses hack to support indexable properties on 'Touch' type in
  TapEventPlugin

The issue in TapEventPlugin is that the code is accessing one of four
possible properties on the 'Touch' type native event using the bracket
accessor. Classes in Flow don't support using the bracket accessor,
unless you use a declaration and the syntax `[key: Type]: Type`.[1] The
downside of using that here is that we create a global type, which we
may not need in other files.

[1]: https://github.com/facebook/flow/issues/1323

Other options:
- Use looser typing or a '@FixMe' comment and open an issue with Flow to
  support indexing on regular classes.
- Rewrite TapEventPlugin to not use the bracket accessor on 'Touch'. I
  thought the current implementation was elegant and didn't want to
  change it. But we could do something like this:
```
 if (nativeEvent.pageX || nativeEvent.pageY) {
   return axis.page === 'pageX' ? nativeEvent.pageX : nativeEvent.pageY;
 } else {
   var clientAxis = axis.client === 'clientX' ? nativeEvent.clientX : nativeEvent.clientY;
   return nativeEvent[axis.client] + ViewportMetrics[axis.envScroll];
 }
```

15 of 15 new or added lines in 3 files covered. (100.0%)

7461 of 8555 relevant lines covered (87.21%)

3234.44 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
src/renderers/shared/stack/event/EventPluginRegistry.js
Jobs
ID Job ID Ran Files Coverage
2 12674.2 (TEST_TYPE=test) 07 Sep 2016 09:15PM UTC 0
87.21
Travis Job 12674.2
Source Files on build 12674
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #12674
  • 7b2d9655 on github
  • Prev Build on master (#12666)
  • Next Build on master (#12680)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc