Commit Graph

6337 Commits

Author SHA1 Message Date
Alexander Blom 3fe2e6581c Remove duplicate install of nativeFlushQueueImmediate
Summary:
This was accidentally added twice.

**Test plan (required)**

CI
Closes https://github.com/facebook/react-native/pull/7584

Differential Revision: D3305537

Pulled By: astreet

fbshipit-source-id: 7d652f9c7762cb66715f1b7235a186513d9b938d
2016-05-16 10:28:45 -07:00
Martin Konicek 10429b5822 Test that Picker selection is updated correctly
Summary:
A React pull request broke the Picker: https://github.com/facebook/react/pull/6572
This pull request adds a test so that we prevent breakages like this in the future.

`PickerAndroidExample` in the UIExplorer before the breakage (video): https://vid.me/h5Rg
`PickerAndroidExample` in the UIExplorer after the breakage (video): https://vid.me/atFc

**Test plan**

`./scripts/run-android-local-integration-test.sh`

The test is failing, we can only merge this once React is fixed.

<img width="837" alt="screen shot 2016-05-04 at 5 13 31 pm" src="https://cloud.githubusercontent.com/assets/346214/15020827/aca8d718-121b-11e6-91f6-a338293d7d92.png">
Closes https://github.com/facebook/react-native/pull/7390

Differential Revision: D3305223

Pulled By: mkonicek

fbshipit-source-id: 89137812940c578efff3e76864ab7cadccc9f2ea
2016-05-16 09:13:28 -07:00
Nick Lockwood d2934e58b3 Expose UIManager queue via a static function to prevent race conditions
Summary: Having UI modules access the shadowQueue via UIManager.methodQueue is fragile and leads to race conditions in startup, sometimes resulting in an error where the methodQueue is set twice, or not at all.

Reviewed By: javache

Differential Revision: D3304890

fbshipit-source-id: 7198d28314dbec798877fcaaf17ae017d50157e9
2016-05-16 08:13:21 -07:00
Naman Goel 1673e00e2b correct flow types
Summary:
The function should have optional arguments, but not nullable types.
Closes https://github.com/facebook/react-native/pull/7580

Differential Revision: D3304994

Pulled By: davidaurelio

fbshipit-source-id: 9918817429126ea16dd3076b61a3493c3a3a8388
2016-05-16 07:58:26 -07:00
Alexander Blom f13322c820 Add support for dumping current React hierarchy
Reviewed By: sebmarkbage

Differential Revision: D3287391

fbshipit-source-id: 0ef1cd25a910dcc0a50ed52a2cc0ae702a9654f4
2016-05-16 07:28:29 -07:00
Alexander Blom 610cfdc819 Add support for custom files in BugReporting
Reviewed By: astreet

Differential Revision: D3287186

fbshipit-source-id: ce7000ac110b78a4fb94c66229046617c292675f
2016-05-16 07:28:29 -07:00
Pieter De Baets 6a3fc86778 Remove 64-bit restriction from React Native tests
Reviewed By: majak

Differential Revision: D3298189

fbshipit-source-id: f25b223d677a0ec8e1a665dd54de685e00d497b8
2016-05-16 05:28:23 -07:00
David Aurelio 2f41c56f59 change to fixed size offset table + indexed lookup
Reviewed By: javache

Differential Revision: D3281989

fbshipit-source-id: 52db9f441dd46024eafac46ae8d32b26640cad71
2016-05-16 04:43:24 -07:00
Nick Lockwood 516bf7bd94 Fixed NativeEventListener deregistration
Summary:
The `EmitterSubscription.remove()` method was previously calling `this.subscriber.removeSubscription(this)` directly, bypassing the mechanism in `NativeEventEmitter` that keeps track of the number of subscriptions.

This meant that native event modules (subclasses of `RCTEventEmitter`) would keep sending events even after all the listeners had been removed. This wasn't a huge overhead, since these modules are singletons and only send one message over the bridge per event, regardless of the number of listeners, but it's still undesirable.

This fixes the problem by routing the `EmitterSubscription.remove()` method through the `EventEmitter` so that `NativeEventEmitter` can apply the additional native calls.

I've also improved the architecture so that each `NativeEventEmitter` uses its own `EventEmitter`, but they currently all still share the same `EventSubscriptionVendor` so that legacy code which registers events via `RCTDeviceEventEmitter` still works.

Reviewed By: vjeux

Differential Revision: D3292361

fbshipit-source-id: d60e881d50351523d2112473703bea826641cdef
2016-05-16 04:13:56 -07:00
Alexander Blom 9a899bed65 Memoize lazy module configs
Reviewed By: javache

Differential Revision: D3293010

fbshipit-source-id: feab7bb0a1f8990baea9c0aca8c9c3cccbcb04e8
2016-05-16 03:58:23 -07:00
Dave Miller ccef1b2941 More touch logging
Reviewed By: andreicoman11

Differential Revision: D3298518

fbshipit-source-id: 0ddbba5c05848ac164f6f1562b26609924978169
2016-05-16 02:58:21 -07:00
Shane O'Sullivan fa5d1fefa1 Make the root view background color explicit
Summary:
The default white background for the root view causes an unattractive flash when loading any app with a non-white background.  Almost every developer has to search for how to fix it.

This change makes the background color explicit in the file, so it can be easily change to match the color of the splash screen and the main screen without having to search for it.

**Test plan (required)**
Launched my app and it still has a white flash for the background before loading the app.  I changed the background colors to other values and the flash was that color.
Closes https://github.com/facebook/react-native/pull/7570

Differential Revision: D3303451

Pulled By: vjeux

fbshipit-source-id: 61dbab768095c430bcb583bafb57575a7d767e6f
2016-05-14 22:43:20 -07:00
Yao Bin Then 433c0e8021 Add comments on NetInfo.js
Summary:
Further describe the methods available on NetInfo.

Question: How do I update the docs on the website?
Closes https://github.com/facebook/react-native/pull/7375

Differential Revision: D3303300

fbshipit-source-id: 4343d490f65e4e47b93f2c98a645cb675d2cf708
2016-05-14 21:50:24 -07:00
David Aurelio e34c9c4e5f Include forwarding modules into npm package
Reviewed By: bestander

Differential Revision: D3301666

fbshipit-source-id: 723d87f1df217f0f1f78661bb6c41a9bbfab6814
2016-05-14 16:28:26 -07:00
Spencer Ahrens c2a8e52d72 Fix source map utils
Reviewed By: javache

Differential Revision: D3302496

fbshipit-source-id: de15a289497119c7f600b8796452fc9573ea7394
2016-05-14 10:43:30 -07:00
Marc Horowitz 3a2d024514 avoid waiting on the main thread just to send a notification
Reviewed By: nicklockwood

Differential Revision: D3234837

fbshipit-source-id: 587a68df7d08999d4357583ba3160b315bd85239
2016-05-13 17:29:00 -07:00
Marc Horowitz 9e9dfd2ac9 Introduce non-copyable JSBigString for managing large strings efficiently
Reviewed By: astreet

Differential Revision: D3234836

fbshipit-source-id: 2b95b585dc1215988b88cf0d609c778a95b362a1
2016-05-13 17:29:00 -07:00
Marc Horowitz f433ed716c Make the pattern for adding systrace sections more concise
Reviewed By: astreet

Differential Revision: D3234834

fbshipit-source-id: 73e191deb4dd0e06d4c242e46a582051d4bcc9ba
2016-05-13 17:29:00 -07:00
Marc Horowitz 267264f1ec Add a bunch more systrace logging
Reviewed By: tadeuzagallo

Differential Revision: D3234831

fbshipit-source-id: 177f9b987e938c59d50fc07bce01fb5c912652e7
2016-05-13 17:29:00 -07:00
Marc Horowitz 86f2eb18e5 Support JS Systrace on all platforms
Reviewed By: tadeuzagallo

Differential Revision: D3234830

fbshipit-source-id: 94cc870d47d620c8bd8d35f83d0b017e5ddba90d
2016-05-13 17:29:00 -07:00
Marc Horowitz b7fe8e68be Finer granularity systracing
Reviewed By: astreet

Differential Revision: D3234826

fbshipit-source-id: 900ab93b847949413a134a87a20b0d826c58da3d
2016-05-13 17:29:00 -07:00
Marc Horowitz 86e18ace94 make RCTFBSystrace actually work
Reviewed By: tadeuzagallo

Differential Revision: D3234824

fbshipit-source-id: 9f2f7efd6877fe7b9096dedecb311d226eae7bc8
2016-05-13 17:29:00 -07:00
Marc Horowitz 418e16f711 Support flow events in RCTProfile
Summary: Add begin/end async flow to the callbacks for external profiling

Reviewed By: tadeuzagallo

Differential Revision: D3234812

fbshipit-source-id: cdbe46883fd566d50a04de9ad67f947876a78a0c
2016-05-13 17:29:00 -07:00
Marc Horowitz 05832c3469 Catch any std::exception from unbundling
Reviewed By: davidaurelio

Differential Revision: D3148408

fbshipit-source-id: 78dc47e1b092cb7fd06307d505a795d2009cee4d
2016-05-13 17:29:00 -07:00
Marc Horowitz 448b48ca85 remove useless text from js errors
Reviewed By: astreet

Differential Revision: D3127112

fbshipit-source-id: 56ee9da8cd7d409c7b13864e6d4cc863146d19f0
2016-05-13 17:29:00 -07:00
Marc Horowitz 7762297f77 add supportsWebWorkers
Reviewed By: lexs

Differential Revision: D3149754

fbshipit-source-id: 58bce886aff526bc7152eaca2f43a654dcb5ad2a
2016-05-13 17:29:00 -07:00
Adam Comella 03edc75b56 iOS: Provide correct animation function for hiding keyboard
Summary:
Currently, `7 << 16` is used as the animation easing function for both the showing and hiding of the keyboard.

Instead, `7 << 16` should be used for showing the keyboard and `6 << 16` for hiding the keyboard.

For details, see: http://stackoverflow.com/questions/18870447/how-to-use-the-default-ios7-uianimation-curve/19439283#19439283

**Test plan (required)**

Testing animating the position of a view to coordinate with the keyboard hiding and showing and it looks good.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/7372

Differential Revision: D3300464

Pulled By: nicklockwood

fbshipit-source-id: 3fdc161f709de11deb7de511aad28767f5d80bd6
2016-05-13 15:43:22 -07:00
Arno Fortelny cac5ce3b93 RefreshControl on initial render will not beginRefresh when refreshing state is false
Summary:
There's an edge case in the `RefreshControl` which causes it to show as refreshing when the state is set to false. When the component is initialized with `refreshing` set to `true` on initial render but set to `false` before `layoutSubviews` is called, it will call `beginRefresh` and ignore its state. That's because `layoutSubviews` never checks if `_currentRefreshingState` is in fact still `true`, it merely assumes it is.

This is fixed by simply doing a check for `_currentRefreshingState` before entering `beginRefresh` from `layoutSubviews`.
Closes https://github.com/facebook/react-native/pull/7556

Differential Revision: D3300124

fbshipit-source-id: d1dce8612e2c03b1f14284d513803d00af4b5c8a
2016-05-13 14:43:26 -07:00
Hedger Wang 8975bb8e70 `didFocus` event should fired after transition finishes.
Summary:
For now, we emit `didFocus` event before fully resetting the transition and
hiding the stale scenes, so handler for `didFocus` event does not get the right
scenes in place. We should emit the didFocus event after resetting the transition and
hiding the stale scenes.

Reviewed By: ericvicenti

Differential Revision: D3299002

fbshipit-source-id: 6a79528097aabc4f61d4dba322820c228c889a84
2016-05-13 12:58:24 -07:00
Jimmy Mayoukou 2849bafbc3 Fix typo in ViewPagerAndroid.android.js
Summary: Closes https://github.com/facebook/react-native/pull/7456

Differential Revision: D3299061

fbshipit-source-id: 417995191d675e2ae625926df93412c660d1931a
2016-05-13 11:58:23 -07:00
Nathan Spaun b67d4a20d7 Add FpsListener to React Scroll Views
Summary:
We want to give people the ability to log scroll performance (including Fb).
This adds an interface that can be enabled and disabled from the react scroll views.
This is a prerequisite to implementing the actual framerate logger that will log dropped
frames while scrolling in prod.

Reviewed By: astreet

Differential Revision: D3283588

fbshipit-source-id: ed9736cb9ed3f441511647f36b1460092bd91e56
2016-05-13 11:28:21 -07:00
Olivier Notteghem fd376660df Fix race condition when clicks are received on react root view and react context is pending
Reviewed By: astreet

Differential Revision: D3297574

fbshipit-source-id: 27ac81342d19947e9425a845d7ef7c73cc4cf090
2016-05-13 09:43:22 -07:00
Niklas Lindroos cc683bc088 Fixed a few language errors in the Introducing Hot Reloading blog post.
Summary:
Have completed the CLA.
Closes https://github.com/facebook/react-native/pull/7552

Differential Revision: D3298347

Pulled By: vjeux

fbshipit-source-id: 1945a3d266b19ad66d03e03e8f36baf44ca804b8
2016-05-13 08:58:24 -07:00
Dave Miller e491f7d5c6 Reverted commit D3292369
Reviewed By: andreicoman11

Differential Revision: D3292369

fbshipit-source-id: 1a41d845ff46c44544f37d85e8154557a979a4ff
2016-05-13 04:28:27 -07:00
qingfeng 1322e06cb2 Add "SAY a Short Video Community" app to the showcase.
Summary:
SAY is "Q & A community-based short video", All based react native development

- You can shoot video
- Video Filters can be switched
- Private chat

![image](https://cloud.githubusercontent.com/assets/18495/15239741/7a1152be-1917-11e6-9c93-0e75b3a7bd60.png)

![image](https://cloud.githubusercontent.com/assets/18495/15239758/ae7a08c0-1917-11e6-82ea-f0f998785bd6.png)

![image](https://cloud.githubusercontent.com/assets/18495/15239776/c89b5588-1917-11e6-8962-5803865a02b4.png)

![image](https://cloud.githubusercontent.com/assets/18495/15239783/d0500670-1917-11e6-9699-708b1d9ebceb.png)
Closes https://github.com/facebook/react-native/pull/7547

Differential Revision: D3297728

fbshipit-source-id: 3ef57a8042c5de34d56ce4fcde1b62cccbb3f422
2016-05-13 01:58:34 -07:00
Matt Mcnamee b66f098193 Added 'Whisky Journal' to Showcase
Summary: Closes https://github.com/facebook/react-native/pull/7541

Differential Revision: D3297739

fbshipit-source-id: fc87f1b409cffe26049292ca7cfb421cf0fb1c26
2016-05-13 01:58:34 -07:00
Olivier Notteghem 99b106658f Reverted commit D3278698
Summary:
= Breaking Change (for experimental features) =

Major API changes in  NavigationAnimatedView

= New prop `transition` for scene renderer

In NavigationAnimatedView, we should not use `position` as a proxy of the
transtion which happens whenever navigation state changes.

Because `position` does not change unless navigation index changes, it won't
be possible to build animations for actions that replace navigation state
without changing the index.

This diff introduces an abstract prop `transition` that is exposed to the scene
renderers.

= Replace `applyAnimation` with `configureTransition`.

Expose a new optional prop  `configureTransition` that allows people to configure
transitions easily.

For instance, to configure the transition, do this:

```
function configureTransition() {
  return {
    dutation: 123,
    easing: Easing.easeInOut,
  };
}

```
<NavigationAnimatedView configureTransition={configureTransition) />

```

Reviewed By: ericvicenti

Differential Revision: D3278698

fbshipit-source-id: b790b92e0fabb42488ff1135b1c37a3f0e9420f7
2016-05-12 18:58:45 -07:00
Konstantin Raev 588183b166 Increased timeouts and retries for instrumentation tests
Summary:
Tests fail quite often but retries seem to help.
Closes https://github.com/facebook/react-native/pull/7537

Differential Revision: D3295833

fbshipit-source-id: e74be5d62b7fb9c1859477e51bf18fe3d1d25ce4
2016-05-12 17:43:35 -07:00
David Aurelio b4e970f6c3 Use continuous module IDs for random access bundles
Reviewed By: bestander

Differential Revision: D3292980

fbshipit-source-id: ab5791d31add42a26cf55a0309564330c383eaa2
2016-05-12 17:28:25 -07:00
Fred Liu 3f1cd5aa4e Center align text on Android
Summary: Center align text on Android

Reviewed By: fkgozali

Differential Revision: D3295222

fbshipit-source-id: c707d1102c8aa86aa04dc9b34a4746b1ff1543bc
2016-05-12 16:09:30 -07:00
Christopher Chedeau 90663bcb12 Add link to the survey at the bottom of the page
Summary:
![simulator screen shot may 11 2016 3 03 14 pm](https://cloud.githubusercontent.com/assets/197597/15198889/3374abe6-178f-11e6-95e5-378004ea45aa.png)

<img width="1333" alt="screen shot 2016-05-11 at 3 03 25 pm" src="https://cloud.githubusercontent.com/assets/197597/15198886/2e545a8a-178f-11e6-8fd1-975ca700e49b.png">
Closes https://github.com/facebook/react-native/pull/7524

Reviewed By: JoelMarcey

Differential Revision: D3293684

Pulled By: vjeux

fbshipit-source-id: c0e7d138040eae49c6b7f7398de8d50f0ed2f564
2016-05-12 14:43:22 -07:00
Alexander Blom e4bb9f52e5 Move all hooks over to new helper
Reviewed By: astreet

Differential Revision: D3292927

fbshipit-source-id: baafa6ded3872391ae1319b2855b2616ec79c2ad
2016-05-12 14:33:28 -07:00
Alexander Blom cafd63440a Add helper for installing method as hook
Reviewed By: astreet

Differential Revision: D3292457

fbshipit-source-id: 590637dbf868097214ca9cb7b9a6543dc48a898f
2016-05-12 14:33:28 -07:00
Reem Helou a53d0f99dd Add an array of scrollviewlisteners in RCTScrollableProtocol
Summary: We are deprecating nativeScrollDelegate property in RCTScrollableProtocol in favor of a scrollListener api. To register/unregister from scroll events use the addScrollListener/removeScrollListener methods

Reviewed By: javache

Differential Revision: D3278218

fbshipit-source-id: 54373cae8e9f8efa7cdbd40c51bcf21d368acf75
2016-05-12 12:17:20 -07:00
Fred Liu 853074d1ee Pass along scrollResponder()
Summary: Allows calls to `scrollResponder()` without crashing

Reviewed By: fkgozali

Differential Revision: D3293272

fbshipit-source-id: c46d99c0d7430a37fc364fa3aaf77dd192d7ab37
2016-05-12 11:49:24 -07:00
Konstantin Raev 2c3ca4c058 Open sourced 4 more instrumentation tests for RN Android
Summary:
More instrumentation tests in OSS means less work for FB engineers to investigate if a PR breaks some internal tests.

+ increased timeouts and retries for OSS tests runner

Reviewed By: andreicoman11

Differential Revision: D3292582

fbshipit-source-id: 3f8aa4d3536450ea3af7acff044b9bb62be0f9db
2016-05-12 10:52:30 -07:00
Dave Miller 31c8b3bd61 Add some defensive loggin in Android touch handling
Reviewed By: andreicoman11

Differential Revision: D3292369

fbshipit-source-id: 43315f7d8e81f1a0ec238c08c3cb689e6648fd0b
2016-05-12 10:01:21 -07:00
Dave Miller f2c1868b56 Update the timestamp we send in touch events to be the more accurate timestamp we use
Summary: Use the more accurate timestamp that we have computed for the touch event rather than the event timestamp that Android provides.

Reviewed By: andreicoman11

Differential Revision: D3292705

fbshipit-source-id: dad082ab74406d391481d16cdac19629751aa1eb
2016-05-12 09:40:26 -07:00
Nick Lockwood 2525feb37f Updated Websocket to use new event system
Reviewed By: javache

Differential Revision: D3292473

fbshipit-source-id: f9a9e0a1b5a12f7fa8b36ebdba88405370f91c54
2016-05-12 08:30:24 -07:00
Michał Gregorczyk cd691e2cc2 Let jsc know it will run web worker
Reviewed By: astreet

Differential Revision: D3287543

fbshipit-source-id: 2a9de938feec417aef34c0ff26f138730b32929f
2016-05-12 08:13:21 -07:00