Commit Graph

334 Commits

Author SHA1 Message Date
Vince Oppedisano 9c8c597000 Don't truncate in the middle of an emoji
Reviewed By: adiphos, mantong01

Differential Revision: D7198155

fbshipit-source-id: 360955de7ed686170a23b9883058e3137e17b277
2018-03-12 12:33:54 -07:00
Tim Yung 01fffa245d RN: Remove DebugEnvironment from OSS
Reviewed By: TheSavior

Differential Revision: D7209266

fbshipit-source-id: 9f9ce66121ff375e5a5d965d58f4137616407853
2018-03-10 19:07:48 -08:00
Alexey Lang 8803ab2f11 Fix race condition when there're two flags next to each other
Reviewed By: yungsters

Differential Revision: D7194598

fbshipit-source-id: a76328d63f649403de15503596a179c7baaf7dc3
2018-03-09 04:27:56 -08:00
Héctor Ramos f2ad77f90a Update additional license headers
Reviewed By: sophiebits

Differential Revision: D7196607

fbshipit-source-id: 9e6452f583b2b5616f5bb38f26f2ae33c14bb820
2018-03-08 12:10:14 -08:00
Krzysztof Ciombor b7bb2e5745 Add support for Android TV devices
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

* To be on par with Apple TV support, this makes it possible to run React Native apps on Android TV devices (See also: https://react-native.canny.io/feature-requests/p/android-tv-support)
* These changes also make it possible to navigate through the app using D-PAD buttons that are present on some mobile devices
* Since these changes affect, among others, `ReactRootView.java` and `Touchable.js` code and are closely related to Apple TV implementation, it makes sense for them to be included in the core

 - React native apps can be launched on Android TV devices and properly render their content
 - Navigation is possible using left, right, top, bottom arrows from the remote (or D-PAD)
 - Touchable components can handle D-PAD center button press events and correctly fire their `onPress` handlers
 - Touchable components will receive `onPressIn` and `onPressOut` events and can react to focus/blur changes appropriately (just like on Apple TV)
 - `Platform` constants allow to check if the react-native app is running on TV (`Platform.isTV`)
 - `ScrollView`s behave correctly (same as native implementation) when switching to view outside bounds – that is, the container would scroll such that the newly focused element is fully visible
 - Native "clicking" sounds are played when moving between focusable elements
 - Play/Pause click event is send to `TVEventHandler`
 - Rewind and FastForward events are send to `TVEventHandler`
 - Back button behaves as a normal Android back button
 - Diagonal buttons work correctly on Android TV, e.g. if there is no button directly to the right from the focused one, but there is one to the right but a bit higher/lower it will grab focus
 - Dev menu can be accessed by long pressing fast forward button

A demo showing RNTester app running on Android TV device (Amazon Fire TV Stick) can be found here:
[![RNAndroidTVDemo](http://img.youtube.com/vi/EzIQErHhY20/0.jpg)](http://www.youtube.com/watch?v=EzIQErHhY20)

- `TextInput` will not work on Android TV devices. There's an issue with native `ReactEditText` implementation that prevents it from receiving focus. This makes it impossible to navigate to `TextInput`.
This will be fixed next, but will be included in a separate Pull Request
- ~Overlay permissions cannot be granted on Android TV devices running Android version >= 6.0
This is because the overlay permission can only be granted by firing an Intent to open settings page (`ACTION_MANAGE_OVERLAY_PERMISSION`). Since this page does not exist on TV devices the permission cannot be requested. This will make the app crash when trying to open dev menu (⌘+M) or displaying a redbox error.
Note: This does not affect devices running Android version < 6.0 (for example Amazon Fire TV Stick)~
This is now fixed by: https://github.com/facebook/react-native/pull/16596

* Launch the RNTester app on Android TV device.
  * Ensure it launches without a crash
  * Ensure basic navigation is possible
  * Ensure Touchable components can receive select events
* Ensure the changes do not break current Android and iOS mobile devices functionality.
* Ensure the changes do not break current Apple TV functionality.

[RNAndroidTVDemo video](http://img.youtube.com/vi/EzIQErHhY20/0.jpg)

* Added `ReactAndroidTVViewManager` that handles TV `KeyEvent`s and dispatches events to JS - This is the core that enables basic navigation functionality on Android TV devices
* Following the above change we copy `TVEventHandler.ios.js` into `TVEventHandler.android.js` to enable JS to pick up those native navigation events and dispatch them further to subscribed views. (Note: We do not have a native `TVNavigationEventEmitter` implementation on Android, thus this file is slightly modified, e.g. it does pass `null` to `NativeEventEmitter` constructor)
* Added `uiMode` to `AndroidInfoModule`. (**Note**: This required changing `extends BaseJavaModule` to `extends ReactContextBaseJavaModule` to be able to use `getSystemService` which requires `Context` instance!
* Added `isTV` constants to both `Platform.ios.js` (keeping the deprecated `isTVOS` as well) and `Platform.android.js`
* Changed condition check on `Touchable.js` to use the newly added `isTV` flag to properly handle TV navigation events on Android as well
* Added `LEANBACK_LAUNCHER` to `RNTester` `intent-filter` so that it is possible to launch it on Android TV devices.
* See also a PR to `react-native-website` repo with updated docs for Android TV: https://github.com/facebook/react-native-website/pull/59

 - [ ] Fix `TextInput` components handling by allowing them to be focused and making a proper navigation between them (and/or other components) possible. One thing to note here that the default behavior to immediately open software keyboard when focused on `TextInput` field will need to be adjusted on Android TV as well)
 - [x] Fix overlay permissions issue by changing the way redbox/dev menu are displayed (see: https://github.com/facebook/react-native/pull/16596)
 - [ ] Adjust placement of TV-related files (e.g. the `TVEventHandler.js` file is placed inside `AppleTV` directory which is not accurate, since it does handle Android TV events as well)

Previous discussion: https://github.com/SoftwareMansion/react-native/pull/1
<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAl  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[ANDROID] [FEATURE] [TV] - Added support for Android TV devices
Closes https://github.com/facebook/react-native/pull/16500

Differential Revision: D6536847

Pulled By: hramos

fbshipit-source-id: 17bbb11e8583b97f195ced5fd9762f8902fb8a3d
2018-03-06 10:47:02 -08:00
David Vacca 87690570c8 Remove log in JSDevSupportModule
Reviewed By: fkgozali

Differential Revision: D7138115

fbshipit-source-id: f9cdda250b60a305195e01a11d0907f658d0a9d1
2018-03-05 10:55:50 -08:00
Alex McKelvey f7343576fc Truncate filter label if it's too long to fit
Differential Revision: D7144192

fbshipit-source-id: 4001930b194421682fa9bdc9b097434910f339b6
2018-03-02 22:06:23 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Alex Dvornikov f7f5dc6649 Extract polyfillGlobal from InitializeCore
Reviewed By: jeanlauliac

Differential Revision: D6987657

fbshipit-source-id: 8762732de671418520376a98bdd724bbb24e4e36
2018-02-15 04:23:43 -08:00
Spencer Ahrens d220118dbd Freeze UTFSequence
Summary:
Don't want anyone accidentally mutating it.

Also make deepFreezeAndThrowOnMutationInDev easier to use with nice flow typing.

Reviewed By: yungsters

Differential Revision: D6974089

fbshipit-source-id: 0f90e7939cb726893fa353a4f2a6bbba701205bc
2018-02-13 14:36:37 -08:00
Dmitry Zakharov 0c49c1f332 Native Modules -> Native Extensions
Reviewed By: danzimm

Differential Revision: D6887988

fbshipit-source-id: 475c05f60a2e1ddcfaa9263ab363bff8a528236a
2018-02-07 08:07:13 -08:00
Dmitry Zakharov 429fcc8cab Migrate DeviceInfoModule from RN Module to Native Function.
Reviewed By: danzimm

Differential Revision: D6750934

fbshipit-source-id: f453801737e41632c6b84ff894e7f0eb66b575dc
2018-01-29 11:18:42 -08:00
Rafael Oleza 9a19867798 Make the React Native HMR client extend from the generic metro HMR client
Reviewed By: BYK

Differential Revision: D6752278

fbshipit-source-id: 5c93cba3e9f3cee2119cb90a711909e0b4a5b835
2018-01-22 10:20:19 -08:00
Jean Lauliac 5e11b8870a xplat/js: asyncRequire: redirect async modules to control modules
Reviewed By: davidaurelio

Differential Revision: D6750305

fbshipit-source-id: 4cf3f1b6e0adbe88a9e7afb6a1784d1528e131b2
2018-01-22 03:17:38 -08:00
Mathias Bynens 431670f908 Remove internal `utf8` utility
Summary:
As requested by davidaurelio in https://github.com/mathiasbynens/utf8.js/issues/17#issuecomment-312500535, this makes it possible for developers to use the `utf8` package from npm in combination with React Native.

Ref. https://github.com/mathiasbynens/utf8.js/issues/17
Closes https://github.com/facebook/react-native/pull/17146

Differential Revision: D6765030

Pulled By: hramos

fbshipit-source-id: dda9b3255618470aea2e32c5ba3cf1325e2ec997
2018-01-19 16:18:32 -08:00
David Vacca 4d3519cc6a Adding JS hierarchy information when a StackOverflowException is thrown in Dev mode
Reviewed By: achen1

Differential Revision: D6716309

fbshipit-source-id: 23458cd126d13fec3aa9c09420f7cdd230ec8dd0
2018-01-19 13:02:41 -08:00
James Ide 2b80cdf1bb Fix HMR syntax error messages (`message` instead of `description`)
Summary:
The code to display HMR errors on the client was reading the `description` field from Metro payloads. Metro does not include `description` in the body of its error payloads -- only in its `body.errors[]` items. This commit changes RN's HMR code to show `body.message` (set consistently with https://github.com/facebook/metro/pull/124) instead of the non-existent `body.description`.

Open a test RN app, enable HMR, and then introduce a syntax error in an app source file. See that the redbox provides information about the syntax error instead of just saying "TransformError undefined".

- https://github.com/facebook/metro/pull/124

[GENERAL][ENHANCEMENT][HMR] - Fix display of syntax error messages when HMR is enabled
Closes https://github.com/facebook/react-native/pull/17619

Differential Revision: D6726516

Pulled By: mjesun

fbshipit-source-id: b1d1008d6f1aa8f88ff8a2aa1374724a305c773b
2018-01-16 03:42:44 -08:00
Eli White 11a495cb32 Fixing eslint-comments warnings
Reviewed By: yungsters

Differential Revision: D6678252

fbshipit-source-id: ee93b7ee52520b750ca11fcc625cccf3cd82d075
2018-01-08 17:04:29 -08:00
Eli White 183c316f4c Strengthen React Native eslint rules
Reviewed By: sahrens

Differential Revision: D6670469

fbshipit-source-id: f4f86fd0921eab3697c10caaba00934ba8adc2f6
2018-01-08 14:17:55 -08:00
Jean Lauliac f871d25eb4 metro-buck: check validity of segments
Reviewed By: davidaurelio

Differential Revision: D6496312

fbshipit-source-id: 586dc8d9f64d13cfddaf6bfe768e8f7b3442561a
2017-12-14 09:49:37 -08:00
Rafael Oleza fbf0aed3ac Implement changes needed to HMRClient to handle wrapped modules from metro
Reviewed By: cpojer

Differential Revision: D6550532

fbshipit-source-id: 606f536cc22df15b248b6a435587e9d2cc7cda57
2017-12-13 04:27:51 -08:00
Brian Shin 5ee27ff755 Fork Platform with a modified API
Reviewed By: sahrens

Differential Revision: D6501208

fbshipit-source-id: c4dbe9d5491f2d42e1a84a61758025e5b2dfa0fe
2017-12-08 14:17:19 -08:00
Jean Lauliac a7b231a327 metro: introduce asyncRequire function
Reviewed By: davidaurelio

Differential Revision: D6498107

fbshipit-source-id: a9c4ab634e60f19b7058205eddcd248f57f63500
2017-12-07 10:53:20 -08:00
Jean Lauliac 1988ba1d79 react-native: BundleSegments: remove async/await
Reviewed By: fromcelticpark

Differential Revision: D6508646

fbshipit-source-id: 9e5c05bde5420cb030912eb187f6333af4b580f9
2017-12-07 07:16:27 -08:00
Rafael Oleza 231c7a0304 Add end to end Delta support to Android devices
Reviewed By: davidaurelio

Differential Revision: D6338677

fbshipit-source-id: 8fa8f618bf8d6cb2291ce4405093cad23bd47fc3
2017-11-17 07:47:38 -08:00
Alex Dvornikov 963c61d4d5 Rename BundleFetcher to SegmentFetcher
Reviewed By: jeanlauliac

Differential Revision: D6271908

fbshipit-source-id: ed1259148ac5ca44789166e22d519a7a21f4cfd9
2017-11-08 07:46:26 -08:00
Adriano Melo 45ed142596 Docs: Improve BackHandler documentation (addEventListener and removeEventListener)
Summary:
This commit adds documentation to two methods of BackHandler API, addEventListener and removeEventListener. Despite being a simple change, it helps to keep the documentation consistent.

I have tested the `./website` locally, the changes look similar to some other components such as `NetInfo`.

[DOCS][ENHANCEMENT][BackHandler] - Improve BackHandler documentation (addEventListener and removeEventListener)
Closes https://github.com/facebook/react-native/pull/16618

Differential Revision: D6260935

Pulled By: hramos

fbshipit-source-id: ab04a9fca89ddaa1925844b5754caf1c355a9329
2017-11-07 10:53:59 -08:00
Jean Lauliac b9f21dc2be react-native: BundleSegments
Reviewed By: davidaurelio

Differential Revision: D6231309

fbshipit-source-id: 565cbadedc5fd8ab25025b5846c098f24fb15a82
2017-11-06 03:46:35 -08:00
Jia Li 59a5dbc0b0 Revert D6210177: react-native: BundleSegments
Differential Revision: D6210177

fbshipit-source-id: 8cb4ee37cd03698e9f3980a9819269086a9d6eab
2017-11-02 12:01:05 -07:00
Jean Lauliac 74371bc50d react-native: BundleSegments
Reviewed By: davidaurelio

Differential Revision: D6210177

fbshipit-source-id: c39e4118389a9739e9e70ba34feb5d335a7f2546
2017-11-02 10:01:25 -07:00
Miguel Jimenez Esun 834b9d4e6e Adding @email tags to most of the tests
Reviewed By: rafeca

Differential Revision: D6185623

fbshipit-source-id: 30df83288fe85516d8d5a1617a4fb8fea826ed6f
2017-11-02 06:25:03 -07:00
Daniel Friesen 165b38ab7a Remove usage of the ... operator in BackHandler
Summary:
This usage of `...` currently causes BackHandler to silently become non-functional when a `Symbol` polyfill is used.

Why?
- The `[...obj]` operator implicitly calls the object's iterator to fill the array
- react-native's internal `Set` polyfill has a load order issue that breaks it whenever a project uses a `Symbol` polyfill
- This means that when `BackHandler` tries to `[...set]` a `Set` of subscriptions the result is always an empty array instead of an array of subscriptions

Additionally it's worth noting that the current code is also wastefully inefficient as in order to reverse iterate over subscriptions it:
- Clones the `Set` (which fills it by implicitly running the set's iterator)
- Uses `[...set]` to convert the cloned set into an array (which also implicitly runs the iterator on the clone)
- Finally reverses the order of the array

----

This code fixes this problem by replacing the use of multiple Set instance iterators with a simple `.forEach` loop that unshifts directly into the final array.

I've tested this by opening the repo's RNTester app on Android and tvOS ensuring that the back handler works before changes, the application crashes when I introduce an error (to verify my code changes are being applied to the app), the back handler works and after changes.

Fixes #11968
Closes https://github.com/facebook/react-native/pull/15182

Differential Revision: D6114696

Pulled By: hramos

fbshipit-source-id: 2eae127558124a394bb3572a6381a5985ebf9d64
2017-10-20 18:02:14 -07:00
Janic Duplessis 0cd69e8a02 Run eslint --fix
Summary:
CI is currently failing because of a lint issue, this fixes it and a bunch of other warnings that are auto-fixable.

**Test plan**
Quick manual test, cosmetic changes only.
Closes https://github.com/facebook/react-native/pull/16229

Differential Revision: D6009748

Pulled By: TheSavior

fbshipit-source-id: cabd44fed99dd90bd0b35626492719c139c89f34
2017-10-09 17:46:44 -07:00
Daniel Andersson 915ac20c76 Avoid eval in buildStyleInterpolator
Reviewed By: vjeux

Differential Revision: D5950405

fbshipit-source-id: ee794317f820e8fbb87752b88539171115a8e00e
2017-10-02 17:05:34 -07:00
Daniel Andersson 3e31038301 Extend unit test for buildStyleInterpolator
Reviewed By: vjeux

Differential Revision: D5950672

fbshipit-source-id: 921ed6ae6a2b307b050c721cedd4b51e880695ae
2017-10-02 17:05:28 -07:00
Matt Bruce d3e1a21399 Change all calls to no-console from no-console-disallow
Reviewed By: TheSavior

Differential Revision: D5944700

fbshipit-source-id: cdd78d1b32fa98d8a792a39ccc3cb37241ab4366
2017-09-29 16:38:06 -07:00
Gregory 3849765ac1 fix params order in comments clamp.js
Summary:
/**
 * param {number} value
 * param {number} min
 * param {number} max
 * return {number}
 */

should be:
/**
 * param {number} min
 * param {number} value
 * param {number} max
 * return {number}
 */

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

(Write your motivation here.)

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes https://github.com/facebook/react-native/pull/16077

Differential Revision: D5938021

Pulled By: shergin

fbshipit-source-id: 3a6e4ff5ab39a657bc0d9271ae2a2600998b2ddf
2017-09-29 00:01:10 -07:00
Marshall Roch 91b6b4efb9 @allow-large-files Flow v0.54.0
Reviewed By: leebyron

Differential Revision: D5773490

fbshipit-source-id: 2c54bb6326f23edbe9a969f3010f79da8189923e
2017-09-06 03:33:43 -07:00
Hector Ramos 5be8c4af26 Cleanup stray markdown files, update contributing guidelines
Summary:
Several changes here. The `Text.md` and `PixelRatio.md` files were appended to the autodocs during site generation. This seemed excessive for just two files, so I've just merged the content into the autodocs themselves. It should help us simplify the website generation process in the future.

I've also merged IssueGuidelines.md and PullRequestGuidelines.md into the Contribution/Maintainers guidelines to improve their visibility.

Finally, I renamed Help to Community in the nav bar.

Ran the website locally, and verified every page rendered as expected: the Community page, Contributing page, Maintainers page.
Closes https://github.com/facebook/react-native/pull/15374

Differential Revision: D5567400

Pulled By: hramos

fbshipit-source-id: e06056edb12c9a17319fe1af46b2ef3a2e1b5854
2017-08-04 16:18:01 -07:00
Pieter De Baets e697ed75d1 Report native warnings to YellowBox
Reviewed By: fkgozali

Differential Revision: D5553601

fbshipit-source-id: b80f019b11d02865a17a25cbff61edf65173cd84
2017-08-04 07:56:14 -07:00
Spencer Ahrens eec58237ce gets Relay/Classic/Compat building
Reviewed By: fkgozali

Differential Revision: D5482765

fbshipit-source-id: 0a7c2b8d99256352f09b6510ec8ca1631425e232
2017-07-24 21:39:00 -07:00
James Burnett 51c0e81557 remove disableAutomock from jest tests (new default) @bypass-lint
Reviewed By: cpojer

Differential Revision: D5237192

fbshipit-source-id: dccca52a91259d7fea27931f92bca94184a82d4a
2017-06-13 15:04:09 -07:00
Tim Yung 82edc131b0 RN: Fix deepFreezeAndThrowOnMutationInDev-test for Node v8.1.0
Reviewed By: raluca-elena

Differential Revision: D5222219

fbshipit-source-id: e34903a506b8e6e0c81e1c21fd9e8e015b25b2d7
2017-06-09 16:04:18 -07:00
James Burnett 3360999431 disable automock by default in as many places as possible @bypass-lint
Reviewed By: cpojer

Differential Revision: D5190858

fbshipit-source-id: d3125cf81427dbbe3362ef1f958413394a6dc51d
2017-06-08 07:45:54 -07:00
Alex Dvornikov 485bb70691 Allow lazy modules registration with the BatchedBridge
Reviewed By: javache

Differential Revision: D5181849

fbshipit-source-id: f63562c360488a9818605b25c1338214daac7411
2017-06-06 07:07:19 -07:00
Spencer Ahrens 2a3de8f192 Cleanup PerformanceLogger a bit
Summary: `prettier`, lint, etc.

Reviewed By: javache

Differential Revision: D5156709

fbshipit-source-id: a9e63602c10e6e413446660b32ff972f5591c6d1
2017-06-01 10:03:27 -07:00
Gabe Levi 3ddc7d47d5 Fix react-native function call arity errors
Reviewed By: zertosh

Differential Revision: D5081816

fbshipit-source-id: 5978770c30a69fb287d03aa7511999ce30f856a1
2017-05-18 16:55:55 -07:00
Janic Duplessis f3dbddcf2b BREAKING - Remove React forwarding and wrong import warnings
Summary:
Importing `react` modules from `react-native` has been deprecated since 0.25 so I think it's safe to remove it now since everyone has migrated their code and it is now well know and documented that you import from different packages. This finishes the spring cleanup of `react-native-implementation.js` :)

**Test plan**
Tested that UIExplorer still works.
Closes https://github.com/facebook/react-native/pull/13354

Reviewed By: bvaughn

Differential Revision: D4928785

Pulled By: javache

fbshipit-source-id: 38c623c309b06b2cb5e73074833342d2745ab198
2017-04-26 10:02:32 -07:00
Alex Kotliarskyi ea7c5ab04b Add mock for BackHandler
Reviewed By: fkgozali

Differential Revision: D4861901

fbshipit-source-id: b1b74e63731328d2235bf86794aa481a8275ed8c
2017-04-11 12:25:38 -07:00
Spencer Ahrens f72d9dd08b Add option to track when we're showing blankness during fast scrolling
Summary:
If tracking is enabled and the sampling check passes on a scroll or layout event,
we compare the scroll offset to the layout of the rendered items. If the items don't cover
the visible area of the list, we fire an `onFillRateExceeded` call with relevant stats for
logging the event through an analytics pipeline.

The measurement methodology is a little jank because everything is async, but it seems directionally
useful for getting ballpark numbers, catching regressions, and tracking improvements.

Benchmark testing shows a ~2014 MotoX starts hitting the fill rate limit at about 2500 px / sec,
which is pretty fast scrolling.

This also reworks our frame rate stuff so we can use a shared `SceneTracking` thing and track blankness
globally.

Reviewed By: bvaughn

Differential Revision: D4806867

fbshipit-source-id: 119bf177463c8c3aa51fa13d1a9d03b1a96042aa
2017-04-07 01:00:39 -07:00