Commit Graph

5866 Commits

Author SHA1 Message Date
ahanriat 63211596e3 Add Azendoo to showcase
Summary:We've finally released our whole new Azendoo App on Both Android & iOS thanks to you !
We also would like to know if there is something special to do  to be part of the featured apps ?

Best,

Azendoo team !

cc Bhullnatik kemcake
Closes https://github.com/facebook/react-native/pull/6813

Differential Revision: D3140035

fb-gh-sync-id: 153dd4eb5add367633cbaba6e9284abef982fc08
fbshipit-source-id: 153dd4eb5add367633cbaba6e9284abef982fc08
2016-04-05 12:45:30 -07:00
Kyle Corbitt bafc506f7c Ignore Navigator touch events for background buttons
Summary:Currently, if the Navigator with the default `NavigatorNavigationBar` has two scenes on its `routeStack` and the bottom one defines a `RightButton` but the top one doesn't, a touch to the location of the underlying  `RightButton` will trigger its action.

This fix checks if the button's opacity is set to 0 (indicating it has been transitioned off the scene and shouldn't be interacted with) and ignores touch events if so.
Closes https://github.com/facebook/react-native/pull/5624

Differential Revision: D3139553

fb-gh-sync-id: 6d6da1459e289499b6d8769120a3b6114548c090
fbshipit-source-id: 6d6da1459e289499b6d8769120a3b6114548c090
2016-04-05 11:33:27 -07:00
Eric Vicenti 05a852a664 Fix up PanResponder example
Summary: Simplify and fix up a broken example

Reviewed By: hedgerwang

Differential Revision: D3137234

fb-gh-sync-id: 653086796d40a81f472274877fb890eee4b9b57b
fbshipit-source-id: 653086796d40a81f472274877fb890eee4b9b57b
2016-04-05 10:51:20 -07:00
Martin Kralik 3874c01292 make `RCTEventDispatcher` dispatch events in incoming order
Reviewed By: javache

Differential Revision: D3138215

fb-gh-sync-id: 430b57d7bb8e3f0f90877b627bfd6a842719ba5d
fbshipit-source-id: 430b57d7bb8e3f0f90877b627bfd6a842719ba5d
2016-04-05 09:17:28 -07:00
Martin Kralik 8efc098646 fixed coalescing key generation for RCTTouchEvent
Summary:Turns our using the same coalescing key until a person removes all fingers off screen is not ideal.
It doesn't work in a case where the first finger starts moving on screen and then a second finger joins it later (almost any pinch gesture),
since we would try to coalesce move events from the start when only one finger was touching screen with events where two fingers were moving on screen.
That doesn't work and results in a crash.

I've changed the logic for generating the coalescing key in order to prevent this.
We no longer have a single key for a single gesture, but we change the key each time amount of fingers increases ("touchStart") or decreases ("touchEnd").

Reviewed By: javache

Differential Revision: D3138275

fb-gh-sync-id: c32230ba401819fe3a70d1752b286d849520be89
fbshipit-source-id: c32230ba401819fe3a70d1752b286d849520be89
2016-04-05 09:10:27 -07:00
Nick Lockwood a10c1b5a30 Fix UIExplorer Image example on iOS
Reviewed By: javache

Differential Revision: D3138820

fb-gh-sync-id: 83bf3f6c60b80e9303b3c3a47dd5d05069623204
fbshipit-source-id: 83bf3f6c60b80e9303b3c3a47dd5d05069623204
2016-04-05 08:48:24 -07:00
Martin Bigio 40f13742b3 Use `^` version for react-native preset
Summary:See https://github.com/facebook/react-native/issues/6798
Closes https://github.com/facebook/react-native/pull/6814

Differential Revision: D3138776

fb-gh-sync-id: f43404e7bfdf0e3e7c6df16681653d1dd4016e1a
fbshipit-source-id: f43404e7bfdf0e3e7c6df16681653d1dd4016e1a
2016-04-05 07:58:25 -07:00
Spencer Ahrens ab44d32ec5 Better Incremental/TaskQueue error reporting
Reviewed By: yungsters

Differential Revision: D3135010

fb-gh-sync-id: 2d6d8800c7f7557221bd57869b6a6fa30d65f122
fbshipit-source-id: 2d6d8800c7f7557221bd57869b6a6fa30d65f122
2016-04-05 02:35:22 -07:00
Janic Duplessis c61100d0ce Fix HMR on Windows
Summary:Tested HMR on Windows and found 2 small issues related to paths that made it not work. Now it works nicely :)

**Test plan (required)**
Tested HMR in UIExplorer on Windows.
Closes https://github.com/facebook/react-native/pull/6678

Differential Revision: D3138379

fb-gh-sync-id: f27cd2fa21f95954685c8c6916d820f41bc187be
fbshipit-source-id: f27cd2fa21f95954685c8c6916d820f41bc187be
2016-04-05 01:13:18 -07:00
Will Fleming bef175af61 Update watchman version in docs to latest stable release
Summary:Update documentation. Per https://facebook.github.io/watchman/docs/install.html the latest stable release of watchman is now at v4.5.0

This is my first pull request and I have completed the CLA.
Closes https://github.com/facebook/react-native/pull/6372

Differential Revision: D3133665

fb-gh-sync-id: b4215fdc862c68d69952717a9e74039850d38459
fbshipit-source-id: b4215fdc862c68d69952717a9e74039850d38459
2016-04-04 10:06:20 -07:00
Janic Duplessis 114dde99ce Fix TouchableNativeFeedback state propagating to children
Summary:For some reason Android propagates the the pressed state to all of the ViewGroup's children when calling `setPressed`. This caused the issue described in #3952. Luckily we can override the `dispatchSetPressed` method of ViewGroup to prevent it from doing so.

Had to dig in the Android source a bit to find this one, here's the relevant pieces :
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/View.java#L7883
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/ViewGroup.java#L3722

**Test plan (required)**
Reproduced the bug using [this gist](https://gist.github.com/janicduplessis/9f1d42c670aefd660afb4c96e8bb6a4f) in UIExplorer. Touching the parent should not trigger the ripple on the children.

I also made sure all the touchable still work properly.

Fixes #3952
Closes https://github.com/facebook/react-native/pull/6783

Differential Revision: D3133407

fb-gh-sync-id: 317e55de2652ea185a1082cd96b8fe3a8b807962
fbshipit-source-id: 317e55de2652ea185a1082cd96b8fe3a8b807962
2016-04-04 08:48:22 -07:00
James Ide 5663ab4771 Add gradle wrapper files for example projects to gitignore
Summary:Hide the gradle wrapper files for example projects like the UIExplorer
Closes https://github.com/facebook/react-native/pull/6771

Differential Revision: D3133423

fb-gh-sync-id: 077f5a647e17e60a190dcc69fda4e96a4b31a391
fbshipit-source-id: 077f5a647e17e60a190dcc69fda4e96a4b31a391
2016-04-04 08:38:27 -07:00
James Ide 4c478f7beb Use semver in the .flowconfig version number
Summary:Flow 0.22.1 is the latest release, but RN asks for 0.22.0 in the .flowconfig file. This commit makes use of Flow's support for semver matching (https://github.com/facebook/flow/issues/592) so that the latest version of Flow can be used as long as it's semver-compatible.
Closes https://github.com/facebook/react-native/pull/6767

Differential Revision: D3133424

fb-gh-sync-id: 5a7a7ff7fc4b0a5a6fd7c162923d3e85a3fc0f08
fbshipit-source-id: 5a7a7ff7fc4b0a5a6fd7c162923d3e85a3fc0f08
2016-04-04 08:30:18 -07:00
Martin Konicek 52ddfd9b51 Bugfix: Make iOS Slider it the responder
Summary:This fixes issues with other view (like the Navigator) stealing the responder and becoming interactive while the user is dragging the slider.

From [documentation](https://facebook.github.io/react-native/docs/gesture-responder-system.html):
- `onStartShouldSetResponder`: Does this view want to become responder on the start of a touch? -> Yes.
- `onResponderTerminationRequest`: Something else wants to become responder. Should this view release the responder? -> No.

Reviewed By: ericvicenti

Differential Revision: D3133337

fb-gh-sync-id: 3d7e1e6a2ed6fa605857cfb0549ffa71df85fd22
fbshipit-source-id: 3d7e1e6a2ed6fa605857cfb0549ffa71df85fd22
2016-04-04 08:24:18 -07:00
Tadeu Zagallo 2f2703936d Use indirect jumps on armv7
Summary:Immediate jumps on arm cannot jump further than 32mb, which might be a problem for large binaries.

+ add the missing `.thumb_func` directive.

Reviewed By: michalgr

Differential Revision: D3121148

fb-gh-sync-id: a53ad0ac70af9df84437b37f19b8a1cb49dd6fa2
fbshipit-source-id: a53ad0ac70af9df84437b37f19b8a1cb49dd6fa2
2016-04-04 06:49:19 -07:00
Christine Abernathy 09958618c5 Adding emulator, simulator UIExplorer example across docs
Summary:Current docs show an Appetize.io example for AlertIOS doc. This pull request adds that feature across all applicable iOS and Android docs. So if a doc has an example in UIExplorer, it shows up in the top right and clicking to Play should navigate to the relevant example.

The changes here also touched NavigationExperimental to fix a typo that prevented iOS deep link from working. Code was also added to help support Android deep links but there's an outstanding issue (a race condition) around how Android deep links trigger getInitialURL in NavigationRootContainer that prevents this from fully working.

For adding the docs, a few things were done outside this pull request:

1/ Release builds for UIExplorer Android and iOS apps were uploaded to Appetize.io. The Appetize.io info (public key to run the build) is embedded in the docs.
2/ The iOS build was generated by making a few changes to get a local bundle. The current UIExplorer set up doesn't support "react-native run-ios".

Regarding the Appetize bu
Closes https://github.com/facebook/react-native/pull/6306

Differential Revision: D3129651

Pulled By: bestander

fb-gh-sync-id: d296d64db8236faa36f35484bb6b362990caf934
fbshipit-source-id: d296d64db8236faa36f35484bb6b362990caf934
2016-04-04 06:05:23 -07:00
Aaron Connolly 67b138e77c Added a small note about an issue I ran into vending a simple `UIView?
Summary:?` instance to React Native. The layout system suppressed the values for `frame` and `backgroundColor` on my simple view and it wasn't clear why. After some debugging and hacking it became apparent that React Native needed to adjust those properties during layout. The workaround I found was to wrap my custom `UIView` in another `UIView` instance.

**Motivation**

When attempting to bridge a simple 100x100 red background `UIView` to ReactNative I could not get the view to show up as a `RCTView`. The view was there, but it was not 100x100 and it didn't have a red background. After a couple hours of poking around and debugging the call stacks on `setBackgroundColor` and `setFrame` it became apparent that React Native calls those messages on your `UIView` and sends new values. This is likely because of the layout system React Native uses.

I was encouraged to provide a small comment in the documentation if I thought others might find it useful. This PR is an attempt to provide a note in the documentation
Closes https://github.com/facebook/react-native/pull/6786

Differential Revision: D3133093

fb-gh-sync-id: 77d895f2f8e09978d283ee9e3193ee68cc5a7cb8
fbshipit-source-id: 77d895f2f8e09978d283ee9e3193ee68cc5a7cb8
2016-04-04 04:36:19 -07:00
Pieter De Baets d95757037a Update css-layout from github
Summary:Update to latest master version of css-layout. Update integration in RCTShadow(Root)View to match.

This solves the issue with items not strechting vertically in column layouts (https://github.com/facebook/css-layout/issues/127)

Reviewed By: vjeux

Differential Revision: D3120699

fb-gh-sync-id: beba162e1255d3527e1160e9bd414a712cb10713
fbshipit-source-id: beba162e1255d3527e1160e9bd414a712cb10713
2016-04-04 04:10:24 -07:00
Konstantin Raev 5387e09dc7 Fixed e2e test being run twice on Circle
Summary: Closes https://github.com/facebook/react-native/pull/6768

Differential Revision: D3132093

fb-gh-sync-id: 9ff9208b4549ee56c4bcf5531699857056940fc9
fbshipit-source-id: 9ff9208b4549ee56c4bcf5531699857056940fc9
2016-04-03 10:08:19 -07:00
Martin Kralik 02b6e38bee better event emitting II: no deadlocks
Summary:D3092867 / 1d3db4c5dc caused deadlock when chrome debugging was turned on, so it was reverted as D3128586 / 144dc30661.
The reason: I was calling `[_bridge dispatchBlock:^{ [self flushEventsQueue]; } queue:RCTJSThread];` from main thread and expecting it will `dispatch_async` to another,
since a held lock was being accessed the dispatched block and was released after the dispatch.
Turns out `RCTWebSocketExecutor` (which is used when chrome debugger is turned on) executes all blocks dispatched this way to `RCTJSThread` synchronously on the main thread.
This resulted in a deadlock. The "dispatched" block was trying to acquired lock which held by the same thread in the dispatching phase.

A fix for this is pretty simple. We will release the lock before dispatching the block.

However it's not super straightforward to see this won't introduce some race condition in a case with two threads where we would end up with events not being processed.
My thinking why that shouldn't happen goes like this: We could get in a bad state if `flushEventsQueue` would run on JS thread while `sendEvent:` is running on MT.
(I don't have a specific example how, maybe it's not possible. However when I show this case is safe we know we are good.)
The way how locking is setup in this diff the only possible scenario where these two threads would execute in these methods concurrently is JS holding the lock and MT going to enqueue another block on JS thread (since that's outside of "locked" zone).
But this scenarion can never happen, since if MT is about to enqueue the block on JS thread it means there cannot be a not yet fully executed block on JS thread.
Therefore nothing bad can happen.

So this diff brings back the reverted diff and adds to it the fix for the deadlock.

Reviewed By: javache

Differential Revision: D3130375

fb-gh-sync-id: 885a166f2f808551d7cd4e4eb98634d26afe6a11
fbshipit-source-id: 885a166f2f808551d7cd4e4eb98634d26afe6a11
2016-04-02 23:31:25 -07:00
Luqmaan Dawoodjee 5d44dad43f Fix spelling of letter (leter)
Summary:Fix spelling of the word letter. Was leter, now letter.

🐒
Closes https://github.com/facebook/react-native/pull/6780

Differential Revision: D3131714

fb-gh-sync-id: a368304267347211c139b09b82f6da12e8b67615
fbshipit-source-id: a368304267347211c139b09b82f6da12e8b67615
2016-04-02 21:55:27 -07:00
Alex Kotliarskyi 144dc30661 Revert [RN][iOS] better event emitting
Reviewed By: sahrens

Differential Revision: D3128586

fb-gh-sync-id: 5c3c79fa983f6c1c43319a6c14049f99e0dfee8a
fbshipit-source-id: 5c3c79fa983f6c1c43319a6c14049f99e0dfee8a
2016-04-01 14:26:20 -07:00
Spencer Ahrens cd79e269dc cleanup and open source WindowedListView
Summary:`WindowedListView` is designed for memory efficient scrolling of
huge/infinite lists of variable height rows. It works by measuring row heights
with `onLayout` and caching the results, then unmounting rows that scroll
offscreen, replacing them with an equivalent offset in the spacer view. Care is
taken to render a constant number of rows, and to only render one new row per
tick to improve framerate and app responsiveness. WLV is also compatible with
<Incremental> used within the rows themselves.

`WindowedListView` is not a drop-in replacement for `ListView` - it doesn't
support many of the features of `ListView`, such as section headers, only
accepts a simple array of data instead of a datasource, and doesn't support
horizontal scrolling. This may change in the future.

This is still experimental - we haven't deployed this for any production apps
yet.

Differential Revision: D2791402

fb-gh-sync-id: 5f104e0903f6ba586d2d651bdf82863a231279d8
fbshipit-source-id: 5f104e0903f6ba586d2d651bdf82863a231279d8
2016-04-01 13:54:29 -07:00
Paul O’Shannessy cb5d37713f Remove use of Object.assign module
Summary:I'm [getting rid of it from React](https://github.com/facebook/react/pull/6376) and so I'd like to get this in before we accidentally break RN. There are a bunch of other uses of Object.assign directly so this should be perfectly safe.
Closes https://github.com/facebook/react-native/pull/6766

Differential Revision: D3128135

Pulled By: vjeux

fb-gh-sync-id: 675913ba457abcd8c194facb9ff58255c9dceda5
fbshipit-source-id: 675913ba457abcd8c194facb9ff58255c9dceda5
2016-04-01 13:50:22 -07:00
Tisho Georgiev 8a3e1e92f3 Prevent loading message from resetting simulator orientation on every reload.
Summary:If you're working on an app that needs to support landscape, reloading the app causes the iPhone simulator to reset its orientation to portrait every time the `RCTDevLoadingView` shows up. This is because it sets the root VC to `RCTModalHostViewController`, which currently supports only portrait orientations on iPhone. Changing the root view to a vanilla `UIViewController` fixes the issue.

**Steps to Reproduce**

1. Create a blank RN project: `react-native init RNTest`
2. Open it up and run it.
3. Rotate to landscape `Cmd+Right Arrow`.
4. Reload by pressing `Cmd+R`.

**Expected**

The simulator stays in landscape mode.

**Actual**

The simulator goes back to portrait.
Closes https://github.com/facebook/react-native/pull/6765

Differential Revision: D3127339

Pulled By: javache

fb-gh-sync-id: e2543c90c8d116307dcefa89a417447c1f1a327f
fbshipit-source-id: e2543c90c8d116307dcefa89a417447c1f1a327f
2016-04-01 12:31:21 -07:00
Alexey Lang b57d90a479 Append D3126321
Reviewed By: javache

Differential Revision: D3126614

fb-gh-sync-id: b36bb5eaa306823dce4bd7276f2dd63a2e5cb759
fbshipit-source-id: b36bb5eaa306823dce4bd7276f2dd63a2e5cb759
2016-04-01 11:09:22 -07:00
Michael Patricios 55920c2444 Add uSwitch app to showcase
Summary:Adding an app to the react-native showcase
Closes https://github.com/facebook/react-native/pull/6761

Differential Revision: D3126765

Pulled By: mkonicek

fb-gh-sync-id: 248d9ad2644b638741dd42ddfa2432a49237694c
fbshipit-source-id: 248d9ad2644b638741dd42ddfa2432a49237694c
2016-04-01 10:44:27 -07:00
Yao Bin 425a7f7a84 Improve Android native module doc
Summary:Show the complete example of the Package code, as the auto generated snippet will return null in `createJSModules` and `createViewManagers`, which will then result in error described in http://stackoverflow.com/questions/35823908
Closes https://github.com/facebook/react-native/pull/6763

Differential Revision: D3126729

Pulled By: mkonicek

fb-gh-sync-id: 8fd4bf8e37242b40670d95679aa5c836e32a7cec
fbshipit-source-id: 8fd4bf8e37242b40670d95679aa5c836e32a7cec
2016-04-01 10:08:19 -07:00
Robin Breuker d5dffceec0 Updated documentation of local notifications for PushNotificationIOS addEventListener()
Summary:I've updated the documentation of addEventListener, so it mentions the use of the 'localNotification' event. Which is currently not mentioned at all.

**Test plan (required)**
<img width="1019" alt="screen shot 2016-03-22 at 08 09 15" src="https://cloud.githubusercontent.com/assets/1757473/13963693/a47c0636-f066-11e5-859c-445a0f9d823c.png">

?
Closes https://github.com/facebook/react-native/pull/6591

Differential Revision: D3126643

Pulled By: vjeux

fb-gh-sync-id: bf2bb301cc5d94d324a3b34ca14f038158092a7c
fbshipit-source-id: bf2bb301cc5d94d324a3b34ca14f038158092a7c
2016-04-01 09:56:24 -07:00
Martin Konicek 879eed671d Update release notes
Reviewed By: mkonicek

Differential Revision:D3126733
Ninja: oss docs only

fb-gh-sync-id: af6182a48dabd8f67dbc223b79c322b35278a785
fbshipit-source-id: af6182a48dabd8f67dbc223b79c322b35278a785
2016-04-01 09:38:20 -07:00
VonD 351c97ec37 adding missing string case in ReadableNativeMap to HashMap
Summary:about #6639
Closes https://github.com/facebook/react-native/pull/6762

Differential Revision: D3126541

fb-gh-sync-id: f895e6d3b4c0abec41b56a031828763a4e8e210f
fbshipit-source-id: f895e6d3b4c0abec41b56a031828763a4e8e210f
2016-04-01 09:12:20 -07:00
Bruno Barbieri 9eb75b4dfb - added available SceneConfigs to Navigator docs
Summary:At the beginning of the navigator docs it says " See Navigator.SceneConfigs for default animations and more info on scene config options."

but then this is the only information available:

<img width="658" alt="screen shot 2016-03-23 at 2 40 49 am" src="https://cloud.githubusercontent.com/assets/1247834/13977670/733cdaa6-f0a1-11e5-92e6-fc98725f65e0.png">

And the only way of knowing about the available options is to look at the source code. I think a lot of people will appreciate this...

If you think this is too much, maybe adding a link to the source code would help.
Closes https://github.com/facebook/react-native/pull/6599

Differential Revision: D3088592

fb-gh-sync-id: f11025b76441e9394ce42ed6c796fa1ace3e8c27
fbshipit-source-id: f11025b76441e9394ce42ed6c796fa1ace3e8c27
2016-04-01 09:03:25 -07:00
Konstantin Raev ce1261a3dd Added BUCK to generated app with react-native-cli init
Summary:BUCK is faster than Gradle.
For example `gradle app:installDebug` vs `buck install app` is ~7 seconds vs ~2 seconds with warm caches.
This is just the beginning to allow people to become familiar with BUCK.
It is enough for running the app locally and testing on a device.

Gradle is still used for dependency resolution.
Closes https://github.com/facebook/react-native/pull/6733

Differential Revision: D3126328

Pulled By: bestander

fb-gh-sync-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
fbshipit-source-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
2016-04-01 08:54:19 -07:00
Martin Bigio 4133de04d7 Use full path for react-native on HMR config
Summary:Fixes https://github.com/facebook/react-native/issues/6731
Closes https://github.com/facebook/react-native/pull/6748

Differential Revision: D3126410

Pulled By: martinbigio

fb-gh-sync-id: fc462ec82e72914d13341a4543212c017bd3838c
fbshipit-source-id: fc462ec82e72914d13341a4543212c017bd3838c
2016-04-01 08:08:27 -07:00
Nicolas Charpentier a74d05be62 Add default render loading on Android WebView
Summary:I just noticed that Android WebView do not have a render loading default like iOS, so I added one.

**Test plan**

I used WebView without renderLoading on Android.

![image](https://cloud.githubusercontent.com/assets/7189823/14028408/bd94c83e-f1d2-11e5-8791-3372684b429e.png)
Closes https://github.com/facebook/react-native/pull/6635

Differential Revision: D3126416

Pulled By: andreicoman11

fb-gh-sync-id: 422966ba3dd6912cbcb0b540e26a3ec48c85daea
fbshipit-source-id: 422966ba3dd6912cbcb0b540e26a3ec48c85daea
2016-04-01 08:05:21 -07:00
Mark Oswald dac028d496 Make iOS project path configurable by parameter in run-ios cli command
Summary:In projects where you have multiple apps or a different structure (ios is not the directory containing the xcode project) it would be helpful to have the option to configure the directory containing the xcode project when doing "react-native run-ios"

As my PR does not change and does not affect UI it's hard to show a video ;-) Steps to reproduce are:

1. checkout facebook/react-native
2. run 'react-native run-ios' (it will fail)
3. npm link react-native (with my PR)
4. re-run 'react-native run-ios --ios-project-path Examples/Movies/

Now the simulator should open the Movies example app
Closes https://github.com/facebook/react-native/pull/6134

Differential Revision: D3035188

fb-gh-sync-id: edb924ce3cca4e82161cdce3d25f321b03abc765
fbshipit-source-id: edb924ce3cca4e82161cdce3d25f321b03abc765
2016-04-01 08:03:20 -07:00
Alexey Lang ef8ad82a62 Add more performance logs and Systrace events for RAM and bridge startup
Summary: Add more performance logs and Systrace events for RAM and bridge startup.

Reviewed By: javache

Differential Revision: D3126321

fb-gh-sync-id: bb059f1f0302b751c6bf97bbe6bdbaf0aba27e21
fbshipit-source-id: bb059f1f0302b751c6bf97bbe6bdbaf0aba27e21
2016-04-01 07:25:38 -07:00
Dmitry Gladkov b5106a8fca Implement TextInput.selectTextOnFocus for Android
Summary:Uses native Android `TextView.setSelectAllOnFocus` method. Triggers TextInput's `onSelectionChanged` event on focus as expected.
Closes https://github.com/facebook/react-native/pull/6654

Differential Revision: D3126354

Pulled By: mkonicek

fb-gh-sync-id: faa64314c0ddc87296277ccd707f18effef8f407
fbshipit-source-id: faa64314c0ddc87296277ccd707f18effef8f407
2016-04-01 07:16:20 -07:00
Håvard Fossli 41b0160b60 Sample code closer to tutorial
Summary:I found several inconcistencies with the repo and the tutorial.

- No app transport security policy was set in `Info.plist`
- `Pods` folder was ignored / missing
- `node_modules` was ignored / missing
- In the tutorial the folder was named `ReactComponents`, but in source it was `ReactComponents`
- link to tutorial from readme doesn't work

I think the repo should have all these problems fixed. I found it simpler to start from scratch and figure what's wrong that way than adjusting https://github.com/tjwudi/EmbededReactNativeExample
Closes https://github.com/facebook/react-native/pull/5285

Differential Revision: D3126361

Pulled By: mkonicek

fb-gh-sync-id: f8a4365c4b4497c3aeb6f8cf929bb65d0b7f5708
fbshipit-source-id: f8a4365c4b4497c3aeb6f8cf929bb65d0b7f5708
2016-04-01 07:13:20 -07:00
Pieter De Baets b00c77af80 Increase RN devtools retry timeout
Summary:The 200ms timeout was causing resource issues and causing a lot of overhead when you're not running the devtools, since it will basically create a new socket every 200ms.

Also clean up the way we do logging so it's completely compiled out in prod, and standardize all the names we use for threading to lowercase react.

Reviewed By: frantic

Differential Revision: D3115975

fb-gh-sync-id: e6e51c0621d8e9fc4eadb864acd678b8b5d322a1
fbshipit-source-id: e6e51c0621d8e9fc4eadb864acd678b8b5d322a1
2016-04-01 07:02:25 -07:00
Atticus White dc3836a9d3 Add toArrayList and toHashMap methods for ReadableArray and ReadableMap. Fixes #4655
Summary:Context #4658

I kept the original commit and author.

cc mkonicek
Closes https://github.com/facebook/react-native/pull/6639

Differential Revision: D3126336

Pulled By: mkonicek

fb-gh-sync-id: 5ae7b37f0eb1db355bb87076d621a405ff9c23c5
fbshipit-source-id: 5ae7b37f0eb1db355bb87076d621a405ff9c23c5
2016-04-01 07:02:25 -07:00
Martin Kralik 31bb85a210 limit fake scroll event emitting
Summary:A need for sending a scroll events outside of scrollview made D3092854 a bit clunky. This diff kinda fixes it by tightening up emitting of fake scroll events just to the only usecase we have right now.

Why not just simply construct the event in `RCTNavigator`, so we can drop the code from `RCTScrollView` altogether?
`RCTScrollEvent` is private to `RCTScrollView`, and that's good. We don't want anyone have an ability to make up scroll events. Even this existing functionality should be sunset one day when we better integrate with native gesture recognizers.

Depends on D3092867.

Reviewed By: javache

Differential Revision: D3120751

fb-gh-sync-id: 6519c055b983cfd48c4b4a9d619c4452e12efda1
fbshipit-source-id: 6519c055b983cfd48c4b4a9d619c4452e12efda1
2016-04-01 06:54:50 -07:00
Martin Kralik 1d3db4c5dc better event emitting
Summary:Previously, (mostly touch and scroll) event handling on iOS worked in a hybrid way:
* All incoming coalesce-able events would be pooled and retrieved by js thread in the beginning of its frame (all of this happens on js thread)
* Any non-coalesce-able event would be immediately dispatched on a js thread (triggered from main thread), and if there would be pooled coalesce-able events they would be immediately dispatched at first too.

This behavior has a subtle race condition, where two events are produced (on MT) in one order and received in js in different order.
See https://github.com/facebook/react-native/issues/5246#issuecomment-198326673 for further explanation of this case.

The new event handling is (afaik) what Android already does. When an event comes we add it into a pool of events and dispatch a block on js thread to inform js there are events to be processed. We keep track of whether we did so, so there is at most one of these blocks waiting to be processed. When the block is executed js will process all events that are in pool at that time (NOT at time of enqueuing the block).
This creates a single way of processing events and makes it impossible to process them in different order in js.

The tricky part was making sure we don't coalesce events across gestures/different scrolls. Before this was achieved by knowing that gestures and scrolls start/end with  non-coalesce-able event, so the pool never contained events that shouldn't be coalesced together. That "assumption" doesn't hold now.
I've re-added `coalescingKey` and made touch and scroll events use it to prevent coalescing events of the same type that should remain separate in previous diffs (see dependencies).

On top of it it decreases latency in events processing in case where we get only coalesce-able events. Previously these would be processed at begging of the next js frame, even when js would be free and could process them sooner. This delay is done, since they would get processed as soon as the enqueued block would run.

To illustrate this improvement let's look at these two systraces.
Before: https://cloud.githubusercontent.com/assets/713625/14021417/47b35b7a-f1d3-11e5-93dd-4363edfa1923.png
After: https://cloud.githubusercontent.com/assets/713625/14021415/4798582a-f1d3-11e5-8715-425596e0781c.png

Reviewed By: javache

Differential Revision: D3092867

fb-gh-sync-id: 29071780f00fcddb0b1886a46caabdb3da1d5d84
fbshipit-source-id: 29071780f00fcddb0b1886a46caabdb3da1d5d84
2016-04-01 06:54:50 -07:00
Martin Kralik b1b53aad8b coalescingKeys for RCTTouchEvent
Reviewed By: javache

Differential Revision: D3092864

fb-gh-sync-id: b703dca92578e05195eac9171b5b6eee83976cc9
fbshipit-source-id: b703dca92578e05195eac9171b5b6eee83976cc9
2016-04-01 06:54:50 -07:00
Martin Kralik 7c2b397b00 RCTTouchEvent's init takes coalescing key
Reviewed By: javache

Differential Revision: D3092861

fb-gh-sync-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
fbshipit-source-id: 69beb58c0a2ca3fe33712a57098c8b7300ad49f4
2016-04-01 06:54:49 -07:00
Martin Kralik cefc5a66f2 adding coalescing key generation for scroll events
Reviewed By: javache

Differential Revision: D3092857

fb-gh-sync-id: 79a1e235d97d484ee7247f17250759b161bc2c07
fbshipit-source-id: 79a1e235d97d484ee7247f17250759b161bc2c07
2016-04-01 06:54:49 -07:00
Martin Kralik a37075dcec RCTScrollEvent's init takes coalescing key
Reviewed By: javache

Differential Revision: D3092854

fb-gh-sync-id: 5aaab55638871510e6a46797189c123a0ecef6b7
fbshipit-source-id: 5aaab55638871510e6a46797189c123a0ecef6b7
2016-04-01 06:54:49 -07:00
Martin Kralik a496baa68c reintroduced coalescing key for events
Summary: This was previously removed in D2884587, but we will need it going forward. See D3092867 for reasons why it's necessary again.

Reviewed By: javache

Differential Revision: D3092848

fb-gh-sync-id: 0d10dbac4148fcc8e035d32d8eab50f876d99e88
fbshipit-source-id: 0d10dbac4148fcc8e035d32d8eab50f876d99e88
2016-04-01 06:54:49 -07:00
Martin Kralik 8f07b01ac8 move `RCTBatchedBridge` interface to a private header
Summary:Interface to `RCTBatchedBridge` was being declared in two different implementation files. This is suboptimal, since it makes it hard to mock that class in a test.
So I've merged and moved these two definitions in `RCTBridge+Private.h`, so it's still obvious it's a private class, but can be included if you really need it.

Reviewed By: javache

Differential Revision: D3126135

fb-gh-sync-id: 173e4c5c2925be387b92deb7f99952ca7bf28588
fbshipit-source-id: 173e4c5c2925be387b92deb7f99952ca7bf28588
2016-04-01 06:54:49 -07:00
Nicolas Charpentier b098d0e839 Fix typos in NavigationExperimental
Summary: Closes https://github.com/facebook/react-native/pull/6749

Differential Revision: D3122485

fb-gh-sync-id: 86f10407a398f9dc73177f3d85076729e4d8d574
fbshipit-source-id: 86f10407a398f9dc73177f3d85076729e4d8d574
2016-03-31 13:54:24 -07:00