Commit Graph

7966 Commits

Author SHA1 Message Date
Tim Yung 0e2591e90b RN: Fix `flow-bin` Dependency
Reviewed By: jeffmo

Differential Revision: D3957804

fbshipit-source-id: a05026d36e5d3eff45dbc982250d3ff887cbb581
2016-10-02 20:58:42 -07:00
Tim Yung feced42fea RN: Upgrade ESLint Packages
Reviewed By: vjeux

Differential Revision: D3946990

fbshipit-source-id: f1be05ee7efed63e54c133d790b193b61e40ea36
2016-10-01 17:58:31 -07:00
Andy a2aab625f3 Fix webview crash when trying to display local html files
Summary:
When using webview on android and trying to link to an html file located on device (using `file://`), the application would crash with an error specifying that nothing handles the fired intent. This is due to [`33a1f28`](33a1f28654) which attempts to intercept all non `http(s)` links.

This is a simple fix so hopefully it can make it into the next stable release.
Closes https://github.com/facebook/react-native/pull/9668

Differential Revision: D3956485

fbshipit-source-id: 5a752abc21802a44e3a26e88669ccb6852076992
2016-10-01 11:43:37 -07:00
Jeff Morrison 1a9853da37 fbobjc
Reviewed By: gabelevi

Differential Revision: D3949455

fbshipit-source-id: 1cbce4a85fe5b8798496752863bbca64b078aa9c
2016-10-01 11:16:21 -07:00
Pieter De Baets 86c195b3d8 Upgrade OSS folly dependency
Reviewed By: bestander

Differential Revision: D3952605

fbshipit-source-id: 70146987c07b3c9917d19d7fbf844242343f9777
2016-09-30 15:28:38 -07:00
Hoa Dinh 5a24ea0b42 Create headers symlinks for FBReactKit
Reviewed By: javache, skotchvail

Differential Revision: D3946452

fbshipit-source-id: c6354f529bec2f9635a0ecf5f65e21dc4e17b1e4
2016-09-30 14:28:41 -07:00
Tim Creasy 707aba822e Added RCTLog.h import for clarity
Summary:
Explicitly show import statements in example implementation file.  Xcode build fails unless RCTLog is imported.  Adding this clarifies this, as it is not stated anywhere else.
Closes https://github.com/facebook/react-native/pull/10117

Differential Revision: D3952631

Pulled By: javache

fbshipit-source-id: f268ff53ee2cf69aabd83c3305c5c25add338d83
2016-09-30 12:58:37 -07:00
Alexander Pantyuhov c4ac8b329c StatusBar: barStyle support for Android (API 23+)
Summary:
Android (starting from API 23) supports "light status bar", thus it is possible to extend StatusBar and make `barStyle` property work not only for iOS, but also for Android.

This PR introduces one more `barStyle` option `dark-content` in addition to two existing ones (`default` and `light-content`).
Why there are 3 options instead of 2?

Two simple reasons:
1) to make all existing applications fully compatible with these changes;
2) the default status bar on Android is dark with white text and icons, while on iOS it is light with black text and icons on it. Thus the `default` option means something like "I don't really care, just apply the default color for this platform", while two other options (`light-content` and `dark-content`) allow to accurately specify the required result.
Closes https://github.com/facebook/react-native/pull/10185

Differential Revision: D3952346

fbshipit-source-id: 999a67614abff52321fbeb06298ebf1946c3f1d1
2016-09-30 12:58:37 -07:00
Pieter De Baets 5b52dab781 Remove follySupport.h
Reviewed By: lexs

Differential Revision: D3944918

fbshipit-source-id: 702907a12e3916f9d6edde7362416188df909d70
2016-09-30 12:28:41 -07:00
Pieter De Baets 6ee319d8eb Only configure nativeInjectHMRUpdate in DEBUG builds
Reviewed By: martinbigio

Differential Revision: D3944601

fbshipit-source-id: 8b98b7ae9a10c1e95d0ae80f6bbd90675d7c3ef5
2016-09-30 12:28:41 -07:00
Michał Gregorczyk 67f9d92478 Do not use bare file descriptors
Reviewed By: nadavrot

Differential Revision: D3945330

fbshipit-source-id: f3a28e2632c7f17a0b6394f3dd3de183bc9e97af
2016-09-30 12:13:51 -07:00
AgtLucas dbc853246d Remove missing link from Modal doc
Summary:
Is okay to remove this link? It seems that we don't have the Navigator Comparison anymore.
Closes https://github.com/facebook/react-native/pull/10186

Differential Revision: D3951863

Pulled By: mmmulani

fbshipit-source-id: 170f4cc9288f84d88c3b607e3a1a85619d9776c8
2016-09-30 11:43:44 -07:00
Pieter De Baets 4b70c66a27 Use glob in cxxreact BUCK rule
Reviewed By: lexs

Differential Revision: D3944546

fbshipit-source-id: 73cb3eeff3b3f5f543e69893f5071c4bd3e78be4
2016-09-30 09:28:47 -07:00
David Aurelio 31a78f3644 Rename Activity events for more clarity
Summary: Changed “Finding dependencies” and “Building Module Graph” to “Transforming modules” and “Initializing Packager” for more clarity

Reviewed By: matryoshcow

Differential Revision: D3950811

fbshipit-source-id: 7a2e655ef7e1655244ce427e7adc8c1e5afa7329
2016-09-30 08:58:36 -07:00
Ovidiu Viorel Iepure 2817b397de Add file transform event to Activity
Summary: Add a telemetric event to the transformer.

Reviewed By: davidaurelio

Differential Revision: D3950902

fbshipit-source-id: c46e95ee93925fb0f9d1784aebdc3206baf74dc6
2016-09-30 08:43:34 -07:00
David Aurelio 90db4f3c6d Add more information to activity events
Reviewed By: matryoshcow

Differential Revision: D3950787

fbshipit-source-id: b6ac22027380a9f7cc7bcb39ecd33d5c9255301f
2016-09-30 07:43:35 -07:00
Andrei Coman 9b261dbc94 Modal statusbar cleanup
Summary:
The hack for the status bar height is not necessary any longer, so we can remove
all code related to it

Reviewed By: lexs

Differential Revision: D3943770

fbshipit-source-id: 2d70f4ea10dd76ea6e6a73bb6edccae388bde1c0
2016-09-30 03:13:36 -07:00
Dave Pack 12a97e1ecd Fix Modal size on Android tablet
Summary:
On tablets, using Display.getRotation() returned ROTATION_0 or ROTATION_180 when it was in landscape, not portrait as it does on phones. This resulted in the Modal being sized incorrectly on tablets. Using size and comparing width and height is the only way I can think of to figure out the device orientation and give the modal the correct size. With this change, all issues listed in #7708 should be resolved.

**Test plan**
Modal should correctly fill screen on Android phone and tablet in both portrait and landscape.
Closes https://github.com/facebook/react-native/pull/10159

Differential Revision: D3950369

Pulled By: andreicoman11

fbshipit-source-id: 9488c4302a76cc48e4f8a4026eb5770d40b6e3d2
2016-09-30 02:44:09 -07:00
Michał Gregorczyk b1fdac47b5 Wire compiled bundle API
Differential Revision: D3887878

fbshipit-source-id: 212fc3188f059d7378ecd61bb5e31fc87a857e8a
2016-09-29 09:13:39 -07:00
Nicolas Charpentier aa36adb116 Fix example in buck DEFS
Summary:
I noticed that the example doesn't match the definition below.

cc bestander
Closes https://github.com/facebook/react-native/pull/10175

Differential Revision: D3943967

Pulled By: bestander

fbshipit-source-id: 6941d4d663e1fd42f8723cd722eb8a5712a63dc8
2016-09-29 08:28:39 -07:00
Andrei Coman 17405b9774 Fix image example
Summary: Bundled images is ios only, legacy image was not present in android resources.

Reviewed By: javache

Differential Revision: D3930349

fbshipit-source-id: 663019351615b173621ef27dbf67ec595f8a590f
2016-09-29 07:28:55 -07:00
Andrei Coman 05de4dbb94 Fix inspector on top of Modal
Summary:
Very similar to https://github.com/facebook/react-native/pull/9600.
Does not trigger on DEV, but there are two inspectors: one underneath and one
above the modal. This looks like something we should fix, but the only solution
I've come up with so far was to mangle the event that AppContainer listens to, so that
only the AppContainer in the modal responds to it. This seems pretty ugly, I'd
rather look for something else. Wdyt?

Reviewed By: frantic

Differential Revision: D3937096

fbshipit-source-id: a6e648b6d583088514d6ba8df7851f9a8ef48f74
2016-09-29 04:58:33 -07:00
Emil Sjolander a75ec1153c Free memory used in tests to enable use of valgrind
Reviewed By: javache

Differential Revision: D3937493

fbshipit-source-id: 23c6970d7769b081575d39de583ba954fc65a397
2016-09-29 04:13:33 -07:00
Konstantin Raev 0eea9c61ee added new property to mock in chalk.js
Summary:
Tests started [failing](https://travis-ci.org/facebook/react-native/jobs/163517412) with release of new  babel that uses chalk.white.bgRed in code.
Jest does not like chalk and needs it mocked.
Removed code duplication and patched the mock.
Closes https://github.com/facebook/react-native/pull/10169

Differential Revision: D3943493

Pulled By: davidaurelio

fbshipit-source-id: 11f57f60ed909a394f15de7b9cc511400aeff510
2016-09-29 04:13:33 -07:00
Felix Oghina 3080b8d26c Android: add support for headless js tasks
Summary: Provide a base `HeadlessJsTaskService` class that can be extended to run JS in headless mode in response to some event. Added `HeadlessJsTaskEventListener` for modules that are interested in background lifecycle events, and `HeadlessJsTaskContext` that basically extends `ReactContext` without touching it. The react instance is shared with the rest of the app (e.g. activities) through the `ReactNativeHost`.

Reviewed By: astreet

Differential Revision: D3225753

fbshipit-source-id: 2c5e7679636f31e0e7842d8a67aeb95baf47c563
2016-09-29 03:58:33 -07:00
Gant Laborde 542ab8643e adds `Keyboard.dismiss()` function and document Keyboard
Summary:
Simple and elegant.  Now someone can dismiss a keyboard in a way that makes sense.

```js
import { Keyboard } from 'react-native'

// Hide that keyboard!
Keyboard.dismiss()
```

+ docs
Closes https://github.com/facebook/react-native/pull/9925

Differential Revision: D3935357

fbshipit-source-id: ecd2fb5c72c4dd769951d308e9bb6ee5d888052a
2016-09-28 18:13:37 -07:00
Chris Hopman eafd9b258f Use std=c++1y in xreact pertests
Reviewed By: mzlee

Differential Revision: D3935375

fbshipit-source-id: b477d865427ed56d5271477b198af633bba2f314
2016-09-28 16:29:01 -07:00
Raphael Porto 154c4890c6 Remove unnecessary View and add a space
Summary:
Only a few adjustments to the import of _react-native_.
Closes https://github.com/facebook/react-native/pull/10153

Differential Revision: D3940472

fbshipit-source-id: 3a93799ac89002e129d4c357db29a076afdf1074
2016-09-28 15:43:37 -07:00
Michael Lee fc154fcd74 Add `sign-compare` suppression for warning coming from `gtest.h`
Differential Revision: D3935414

fbshipit-source-id: 5f531cc65e74cae4cb23a0706b92dac0f3ef272d
2016-09-28 14:43:46 -07:00
Weixi Yen e4c21fe292 Adding Sleeperbot to RN Showcase
Summary:
Purpose: Adding Sleeperbot to Showcase

The top rated Fantasy Football app on Android and iOS - built mostly in React Native.

Funding Info:
https://www.crunchbase.com/organization/sleeperbot
https://angel.co/sleeperbot

Post:
https://medium.com/sleeperbot-hq/switching-to-react-native-in-production-on-ios-and-android-e6b675402712
Closes https://github.com/facebook/react-native/pull/10113

Differential Revision: D3939356

Pulled By: hramos

fbshipit-source-id: 58ee72419d36579a6d14d5fadd023541caae29f3
2016-09-28 14:28:55 -07:00
Atticus White 462ab9f988 Robin Rooms added to showcase apps
Summary:
This adds [Robin Powered's Room Display](https://robinpowered.com/features/room-display) to the showcased apps.
Closes https://github.com/facebook/react-native/pull/10148

Differential Revision: D3939340

Pulled By: hramos

fbshipit-source-id: 7344ea8ee3c813856e13ecd5612843bdeee216b4
2016-09-28 14:28:55 -07:00
Marc Horowitz 9981b8928d Make shared new bridge work in wilde/pyml
Reviewed By: javache

Differential Revision: D3926487

fbshipit-source-id: 6c40233c6140ef7ca1f78a5119e34c0979c444ee
2016-09-28 14:13:55 -07:00
Marc Horowitz af5c8a8fd2 Add support for new ios bridge to FBReactBridgeJSExecutor
Reviewed By: javache

Differential Revision: D3897535

fbshipit-source-id: 35bdaf885b03c0c95017a68b69f1f506e6943f2b
2016-09-28 14:13:55 -07:00
Marc Horowitz 441d146b7b Include the name of the bridge class in the dev menu
Reviewed By: javache

Differential Revision: D3933300

fbshipit-source-id: 933191c31731f4ad1a44dfe0854b28ef802e4dd1
2016-09-28 13:58:41 -07:00
Mattias Pfeiffer b2dac834fb Use strong reference in RCTImageLoader
Summary:
This PR is related to the multitude of crashes (#10016, #9751, #9882).

From my understanding, we should be using a strong reference when calling `decodeImageData` or we could be calling the method on a deallocated instance.

PR #9751 have mitigated this by adding a fail-safe, but I think the culprint is the weak reference, which this PR fixes.

Tested on iOS only, since it doesn't touch Android.
Closes https://github.com/facebook/react-native/pull/10147

Differential Revision: D3938763

fbshipit-source-id: 7389d4ae7a98926014401a1fe0cbbdcdd5ee6a01
2016-09-28 13:28:35 -07:00
Emil Sjolander c43a3f5d84 Default scrollview to flexShrink to allow views below it
Summary: Changing from flex -> flexGrow on Scrollview caused some layouts to break due to having views below the scrollview. Adding flexShrink allows for the behavior again.

Reviewed By: blairvanderhoof

Differential Revision: D3936963

fbshipit-source-id: 0f43e6f5148918d3d431b98d26d185bbcc1548d0
2016-09-28 10:13:37 -07:00
Jagdeep Nagpal e083f9a139 Fix missing static images when using data binding
Summary:
**Motivation**
Images not getting bundled when data binding is enabled in gradle in Android projects.
So to fix it running the bundle task before ```dataBindingProcessLayouts``` gradle task

**Test plan**

Example project with data binding enabled

https://github.com/jaggs6/rn_data_binding (master)

note in ```app/build.gradle```
```
dataBinding {
   enabled = true
}
```
when the app is running in debug you will see the following
![screenshot_1474456348](https://cloud.githubusercontent.com/assets/1941517/18708823/b11e306c-7ff4-11e6-89c9-5b74f0f5d1c6.png)

and when installing and running a release variant (```./gradlew uninstallAll clean installRelease```) you will see this

![screenshot_1474456603](https://cloud.githubusercontent.com/assets/1941517/18708926/4658991a-7ff5-11e6-9a29-78333504b20f.png)
(note the missing image)

to fix this problem I added the fix in react.gradle file and moved it into the project (branch master_working)

here is the compare https://github.com/jaggs6/rn_d
Closes https://github.com/facebook/react-native/pull/10017

Differential Revision: D3936552

Pulled By: bestander

fbshipit-source-id: 9ed9181eb331668de15745b1e06fcf6f79cebb0f
2016-09-28 04:28:38 -07:00
Andrei Coman 404b7cc069 BREAKING: Fix modal resizing on keyboard show
Summary:
This changes modal behavior to resize when the keyboard appears/disappears.
Previously, the modal would not react in any way, or it would pan above to bring the
TextInput into view. Resizing is the correct behavior for android.

This is not trivial, as in, setting the flag, because of the combination of
react native laying out all views and the system reacting to the keyboard
appearance in a weird way. Namely:
- if `windowTranslucentStatus` is not set, the system will just call
  `onSizeChanged` on the dialog's content view, and everything works nicely
- with `windowTranslucentStatus` set, the system will consider the dialog as a
  full screen view that doesn't resize. In order for it to resize, the base
  view of the layout needs to have
  `setFitsSystemWindows(true)` called on it. This is needed, so that the system
  can call layout on that base view with the new value of `paddingBottom` that
  coincides with the height of the keyboard. Neat.

We fix this by wrapping our existing content view (mHostView) in a simple
FrameLayout that has `setFitsSystemWindows` set. That way, `mHostView` will have
`onSizeChanged` called on itself with the correct new size of the dialog.

This has the fortunate consequence of our layout now also getting `paddingTop` as the size of the
status bar, which means that we can remove the JS `top` hack in Modal, which
was necessary for no view getting drawn under the status bar.

This behavior is set as default, since that is the default correct Android behavior.

Reviewed By: astreet

Differential Revision: D3913784

fbshipit-source-id: 4378ada21f466dc7ac6e357abeca10b88009ca3f
2016-09-28 02:58:37 -07:00
Marc Horowitz fc62b00880 Update tests to work better with async runJSBundle
Reviewed By: bestander

Differential Revision: D3932963

fbshipit-source-id: 16967987b3f777104ab3a41d5967ff1b2f4678db
2016-09-27 14:58:41 -07:00
David Aurelio ba8066d7f3 Disable `extra-arrow-initializer` rule in node directories
Reviewed By: bestander

Differential Revision: D3929929

fbshipit-source-id: a78e22104a5ac593d7f396907cb0252d1629870c
2016-09-27 13:43:37 -07:00
Lord Daniel Zautner 95b1fc42b7 Emit `willfocus` from immediatelyResetRouteStack
Summary:
The Navigator component inconsistently emits the `willfocus` event.

While it is emitted in `Navigator#resetTo`, `Navigator#push`, `Navigator#pop` and event `Navigator#replaceAtIndex` it is not emitted from `Navigator#immediatelyResetRouteStack`. This leads to surprising inconsistencies when working with these events.

With the PR I suggest to emit the `willfocus` event before resetting the route stack.
Closes https://github.com/facebook/react-native/pull/10125

Differential Revision: D3931284

fbshipit-source-id: 6e4f45c6d38426bcd0acc8f8c39478524032a03a
2016-09-27 11:43:32 -07:00
Emil Sjolander b32a857d60 Fix bug introduced by D3886866
Reviewed By: lucasr

Differential Revision: D3923635

fbshipit-source-id: bfeb175bb40393be63cafb6a995b22701b87ffec
2016-09-27 10:14:35 -07:00
Aaron Chiu d22a85211e remove CompositeLazyReactPackage in favor of ReactInstanceManager.Builder's existing ReactPackage list
Reviewed By: andreicoman11

Differential Revision: D3928330

fbshipit-source-id: aee8a7c31d80f5500744029676b9f2b8c87aa98a
2016-09-27 09:58:30 -07:00
Aaron Chiu 1f27dd6643 log into QPL time to create module for lazy native modules
Reviewed By: andreicoman11

Differential Revision: D3928797

fbshipit-source-id: d1c6c024c4994b237155f16e6a915b16f216d56d
2016-09-27 09:43:30 -07:00
Dan Caspi dfcfb90baa Fix [JSValue ...] & [JSContext ...] access with custom JSC
Reviewed By: bnham

Differential Revision: D3859956

fbshipit-source-id: 966aba9a267371eb553b8be574fa247b21930d1c
2016-09-27 09:43:30 -07:00
Konstantin Raev 449c195941 Temporarily disabled CatalystUIManagerTestCase.testFlexWithTextViews test
Summary:
After D3876927 this test started failing on CI.
Locally we can't reproduce it, and it will take some time to understand what this test is intended for so that we could remove the variable part.
More investigation will follow, t13583009

Reviewed By: emilsjolander

Differential Revision: D3930334

fbshipit-source-id: 279f67eb5a77b5d4250afd48c8b94c828da6925c
2016-09-27 07:13:30 -07:00
Douglas Lowder d368ebfab2 Apple TV support 1: existing Objective C code should compile for tvOS
Summary:
First commit for Apple TV support: changes to existing Objective-C code so that it will compile correctly for tvOS.
Closes https://github.com/facebook/react-native/pull/9649

Differential Revision: D3916021

Pulled By: javache

fbshipit-source-id: 34acc9daf3efff835ffe38c43ba5d4098a02c830
2016-09-27 06:28:33 -07:00
Pieter De Baets 339531065f Fix some linter warnings
Reviewed By: majak

Differential Revision: D3930059

fbshipit-source-id: dbbf67f287c46535f9c5947cd7ac101c5c91615e
2016-09-27 06:13:31 -07:00
Andrei Coman 30989dd24a Fix ReactSwipeRefreshLayout
Summary:
`ReactSwipeRefreshLayout` extends `SwipeRefreshLayout` which does not play nice with Android's touch handling system.
There are two problems:
1. `SwipeRefreshLayout` overrides and swallows `requestDisallowInterceptTouchEvent`, which means that Views underneath the `SwipeRefreshLayout` will not interact correctly with parent Views of
`SwipeRefreshLayout`. We've seen this in practice by H-ScrollViews having their touches intercepted by an enclosing ViewPager. This is fixed by passing `requestDisallowInterceptTouchEvent` up to the parents of `SwipeRefreshLayout`.
2. `SwipeRefreshLayout` overrides `onInterceptTouchEvent` and never calls `super.onInterceptTouchEvent`, therefore ignoring the value of `disallowIntercept`. That means that it will intercept some touches when it
shouldn't. One such case is again the H-ScrollView, which should receive all horizontal scrolls and stop `SwipeRefreshLayout` from intercepting any touch events after scrolling. Currently, after the H-ScrollView starts scrolling, it is still possible to get the `SwipeRefreshLayout` to detect and emit refresh events. This is fixed by checking and blocking on horizontal scrolls.

Reviewed By: foghina

Differential Revision: D3929893

fbshipit-source-id: e6f8050fb554e53318a7ca564c49c20cb5137df9
2016-09-27 04:28:34 -07:00
Martin Kralik cfae3e376d fixed crash when setting custom shadow props to null
Reviewed By: emilsjolander

Differential Revision: D3923634

fbshipit-source-id: 005e316e70fa280960c796375b2e94f9967a089d
2016-09-27 03:43:34 -07:00