Commit Graph

11865 Commits

Author SHA1 Message Date
ivanpdigitalalchemist 235c8874cc missing parentheses in example code
Summary:
in the example code for configuring animations, Easing.back should be Easing.back()

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/15273

Differential Revision: D5929874

Pulled By: shergin

fbshipit-source-id: 89921d0dda899e1697ee1fa5d96752964a2dc3f9
2017-09-27 21:30:17 -07:00
James Ide 4119182b51 Add missing node-notifier npm dependency
Summary:
local-cli now depends on the node-notifier package but it wasn't listed in package.json.
Closes https://github.com/facebook/react-native/pull/15905

Reviewed By: TheSavior

Differential Revision: D5814773

Pulled By: hramos

fbshipit-source-id: 3c397b0a21fea5009f35a69515e70a6d78ece375
2017-09-27 19:34:27 -07:00
Valentin Shergin ac6b1d1091 Removed unused imports from RCTUIManager
Reviewed By: mmmulani

Differential Revision: D5916606

fbshipit-source-id: f7a301928f68bc2aa15a8e50c4b25f2779d27567
2017-09-27 19:00:29 -07:00
Spencer Ahrens e16b514c5f Add onScrollToIndexFailed support
Summary: Allows handling the case of wanting to scroll beyond the measured window.

Reviewed By: TheSavior

Differential Revision: D5915331

fbshipit-source-id: 329927632f4d04f213567ce4bbe547b04b8ea86d
2017-09-27 18:31:15 -07:00
Janic Duplessis 1af645b2fd Validate that JS and Native code versions match for RN releases
Summary:
Basic implementation of the proposal in #15271

Note that this should not affect facebook internally since they are not using OSS releases.

Points to consider:
- How strict should the version match be, right now I just match exact versions.
- Wasn't able to use haste for ReactNativeVersion because I was getting duplicate module provider caused by the template file in scripts/versiontemplates. I tried adding the scripts folder to modulePathIgnorePatterns in package.json but that didn't help.
- Redscreen vs. warning, I think warning is useless because if the app crashes you won't have time to see the warning.
- Should the check and native modules be __DEV__ only?

**Test plan**
Tested that it works when version match and that it redscreens when versions don't before getting other errors on Android and iOS.
Closes https://github.com/facebook/react-native/pull/15518

Differential Revision: D5813551

Pulled By: hramos

fbshipit-source-id: 901757e25724b0f22bf39de172b56309d0dd5a95
2017-09-27 18:31:15 -07:00
David Vacca 9b3cc30357 Backed out changeset 7c338fe3b747
Reviewed By: AaaChiuuu

Differential Revision: D5926999

fbshipit-source-id: 58595f74f1fab764b63b5d7d6c2f20d8edb2efda
2017-09-27 16:45:11 -07:00
Aaron Chiu 672db77eae add UI Manager operations
Reviewed By: achen1

Differential Revision: D5741087

fbshipit-source-id: f6b8f713cb3c4e48b417b47557a45ff9a4a5bf05
2017-09-27 16:16:20 -07:00
Valentin Shergin e9a090fd9b Enabling `flashScrollIndicators` example for all platforms
Summary: ... because it was recently implemented for Android.

Reviewed By: mmmulani

Differential Revision: D5916305

fbshipit-source-id: b8af0f8712e36aee5c44f7ede41da25fc944134f
2017-09-27 16:16:20 -07:00
Hector Ramos 01a6178873 Add missing website dep
Summary: Closes https://github.com/facebook/react-native/pull/16089

Differential Revision: D5906760

Pulled By: hramos

fbshipit-source-id: 523a5b63d7c0882fe7d257bdbc07b86e672f501d
2017-09-27 14:40:24 -07:00
Rafael Oleza 28525ba418 Bump metro-bundler dependency to 0.19.x
Reviewed By: cpojer

Differential Revision: D5920597

fbshipit-source-id: fdc4f50ffdb43487e7c3480b7cc587b7ff483681
2017-09-27 14:40:24 -07:00
Alex Dvornikov 47f6068b16 Log call stack symbols in case of native module method's failure
Differential Revision: D5921069

fbshipit-source-id: c386a836e6f3c314d668e02f3bae243dadcab6e3
2017-09-27 10:00:33 -07:00
Christopher Chedeau 70c6700be8 Codemod to 1.7.0
Differential Revision: D5763302

fbshipit-source-id: a91ca1786c7ac8eb9aa3dd43555a7a223dc6f9cf
2017-09-26 23:45:48 -07:00
Christopher Chedeau 888c6e7eac Upgrade to 1.7.0
Reviewed By: fkgozali

Differential Revision: D5763293

fbshipit-source-id: 865ed74a78606cb54f274ebedae49de980dcab6f
2017-09-26 23:45:48 -07:00
Marko Novakovic 5038b06b31 Un-inline-ing a method declared as export
Reviewed By: compnerd

Differential Revision: D5909847

fbshipit-source-id: 7108dd88271e640e1881b20c0cbf1ad28bbf63c9
2017-09-26 19:01:38 -07:00
James Isaac 227a5f4e8f Default TextInput autoCapitalize to sentences on Android
Summary:
Currently `TextInput.autoCapitalize` is defaulting to 'none' on Android.  This PR sets the default to 'sentences', to match iOS and the PropTypes documentation.

Fixes #14846
Closes https://github.com/facebook/react-native/pull/14853

Differential Revision: D5918196

Pulled By: shergin

fbshipit-source-id: d0d00e75d44a410c6821b4ff8910099aae2b2c7c
2017-09-26 18:32:14 -07:00
Rafael Oleza ee8aeddc52 Make Module.getName() synchronous
Reviewed By: cpojer

Differential Revision: D5911221

fbshipit-source-id: 2381d70008adff9e0f7613fe43c8fb562222acd6
2017-09-26 17:25:11 -07:00
esbenvb 43d394cb4b Updated support for WebStorm
Summary:
Added the executable path to the `COMMON_EDITORS`
Added the executable name to the arguments selections

<!--
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!

-->

Need to be able to jump to specific files and line numbers in WebStorm and autodetect WebStorm as editor, without setting up any environment vars.

Start a new RN project in WebStorm, make some JS errors and click the errors to confirm that it will jump to the right file and line number in WebStorm.

Make sure that none of the other `COMMON_EDITORS` are running, unless you set the `REACT_EDITOR` environment variable.
Closes https://github.com/facebook/react-native/pull/15984

Differential Revision: D5911698

Pulled By: shergin

fbshipit-source-id: 54fced7539520553dd2a93bf7ca7e4f457b0bfc3
2017-09-26 15:03:52 -07:00
Valentin Shergin 6d67e2dbbc Bunch of utility funcs were moved to RCTUIManagerUtils
Summary: Because `RCTUIManager` is already overcomplicated and that stuff deserves separate file and header.

Reviewed By: javache

Differential Revision: D5856653

fbshipit-source-id: 7001bb8ba611976bf3b82d6a25f5619810a35b34
2017-09-26 14:08:28 -07:00
Rafael Oleza 34487c0591 Make the runBeforeMainModule config param to RN repo and make it absolute
Reviewed By: davidaurelio

Differential Revision: D5880700

fbshipit-source-id: 5df6781026030395900388c561283abadefa6511
2017-09-26 13:06:14 -07:00
Caleb Meredith 292b19d339 Update typings for Promise.all() for D5827319
Reviewed By: samwgoldman

Differential Revision: D5830645

fbshipit-source-id: db2bb0715aab58d3601712ee0b080abaa9f8f131
2017-09-26 11:38:31 -07:00
tfallon@mail.depaul.edu 03ae65bc25 Fixes removeClipSubviews check for offscreen rendering of ListViews
Summary:
This issue has been open for a really long time, but I'm pretty sure this is the line that needed to change:
https://github.com/facebook/react-native/issues/1831

What was happening here is that `CGRectIsEmpty` returns true when either height or width is zero. With the current logic, one of those would always be zero when the parent was rendered off screen. This ensures that there the intersection be of CGSizeZero for the view to actually be clipped.

That being said, there seems to be something more complex going on here that I'm not understanding? I would think that you'd simply want to check if the child view's frame is within the bounds of the parent at all. If it was, then don't clip it. If I'm in the wrong, could someone explain this a bit more? If so, I'll fix this issue.

Using this [repository](https://github.com/jcharlet/react_native_listview_bug), this one line change fixes the issue and still clips cells as they are scrolled off screen.
Closes https://github.com/facebook/react-native/pull/15669

Differential Revision: D5815056

Pulled By: shergin

fbshipit-source-id: 32382e4954139e4d5af67d786422fd87173b1a1a
2017-09-26 11:01:39 -07:00
Chris Geirman e3a6be5d37 explicitly show how to add the optional listener
Summary:
The previous example only showed where to add the optional "listener" but didn't show how to make use of it.

<!--
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/15576

Differential Revision: D5911716

Pulled By: shergin

fbshipit-source-id: 60023470d23c2cbbde47ab9aa82c7ecef73be467
2017-09-26 10:26:22 -07:00
Kevin Doherty 6f6329d5e3 Only disallow changes if the value actually changed
Differential Revision: D5884661

fbshipit-source-id: 2d9fe28a0ecfc46afc9ca459975455e1fd13d19b
2017-09-26 08:18:24 -07:00
faifai21 64ffe4516e Use BitmapRegionDecoder to efficiently crop images on Android
Summary:
The Android ImageEditingManager is inefficient and slow when cropping images. It loads the full resolution image into memory and then crops it. This leads to slow performance and occasional OutOfMemory Exceptions.
[BitmapRegionDecoder](https://developer.android.com/reference/android/graphics/BitmapRegionDecoder.html) can be used to crop without needing to load the full resolution image into memory. Using it is much more efficient and much faster.

Relevant issue: https://github.com/facebook/react-native/issues/10470

Attempt to crop a very large image (2000x2000) on Android. With this change, the crop should happen almost instantly. On the master branch, it should take 2-3 seconds (and might run out of memory).

Please let me know if there's anything else I can provide.
Closes https://github.com/facebook/react-native/pull/15439

Differential Revision: D5628223

Pulled By: shergin

fbshipit-source-id: bf314e76134cd015380968ec4533225e724c4b26
2017-09-26 05:17:40 -07:00
Rafael Oleza e6596dc102 Move debugger client code to its own folder
Reviewed By: davidaurelio

Differential Revision: D5899764

fbshipit-source-id: 3498dd71a11b47841a492cf77df7c887404c1719
2017-09-26 05:17:40 -07:00
Guizmo Martinez 31904d523d Fix slider colors in Android
Summary:
Hey !

I noticed that the `minimumTrackTintColor` and `maximumTrackTintColor` are exchanged in iOS and Android.
In iOS, `minimumTrackTintColor` is the left color and `maximumTrackTintColor` is the right color.
In Android, `minimumTrackTintColor` is the right color and `maximumTrackTintColor` is the left color.

With this code :
```jsx
<Slider
  style={{ width: 300 }}
  minimumTrackTintColor="red"
  maximumTrackTintColor="blue"
/>
```

|iOS|Android|
|----|----|
|![image](https://user-images.githubusercontent.com/17292331/30700555-2b8ae828-9ee8-11e7-94a3-f1d3adee7fd5.png)|![screenshot_2017-09-21-15-59-59](https://user-images.githubusercontent.com/17292331/30699855-246c1280-9ee6-11e7-9653-e61c4798a50f.png)|

|iOS|Android|
|----|----|
|![image](https://user-images.githubusercontent.com/17292331/30700563-2fc8c25c-9ee8-11e7-9c0d-955d9921660f.png) (same)|![screenshot_2017-09-21-16-12-04](https://user-images.githubusercontent.com/17292331/30700418-def3e136-9ee7-11e7-982b-48aeba23a5ea.png)|
Closes https://github.com/facebook/react-native/pull/16053

Differential Revision: D5910299

Pulled By: shergin

fbshipit-source-id: 74851e4cc6d54f72ea2755200e26b0d921890b48
2017-09-26 02:15:27 -07:00
Rajesh Singh 979629504b Allow applicationId to be specified on build
Summary:
Added the ability to define a specific applicationId (in case it's different to the package name)

<details>
  Thanks for submitting a PR! Please read these instructions carefully:

  - [x] Explain the **motivation** for making this change.
  - [ ] Provide a **test plan** demonstrating that the code is solid.
  - [x] Match the **code formatting** of the rest of the codebase.
  - [x] Target the `master` branch, NOT a "stable" branch.

  Please read the [Contribution Guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md) to learn more about contributing to React Native.
</details>

We have a specific requirement that our package name differs from the applicationId but not in a way that allows us to add it as a suffix to our package name. I wanted to add the option to specify a specific applicationId.

`react-native run-android --appId <Specific Application Id>`
Closes https://github.com/facebook/react-native/pull/14524

Differential Revision: D5910259

Pulled By: shergin

fbshipit-source-id: 768fbc910f6b520dd18936f6bceeee136fca7025
2017-09-26 00:15:29 -07:00
Valentin Shergin c70ac24966 Using SafeAreaView in YellowBox (2nd attempt)
Summary: Now it does not clipped on iPhone X.

Reviewed By: yungsters

Differential Revision: D5907527

fbshipit-source-id: 10d05e4ac5d16a9e257efa78795bff9f14f4c0bb
2017-09-25 23:30:19 -07:00
Janic Duplessis 3cbc36138a Native Animated - Allow events that are dispatched from any thread
Summary:
Instead of preventing events from working when not on the UI Thread we can just dispatch to it instead.

**Test plan**
Tested manually that animated events still work in RNTester
Closes https://github.com/facebook/react-native/pull/15953

Differential Revision: D5909816

Pulled By: shergin

fbshipit-source-id: 48d02b6aa9f2bc3bcb638e8852fccaac3f205276
2017-09-25 23:15:15 -07:00
David Vacca b694f96762 adding error message including stacktrace and example
Reviewed By: fkgozali

Differential Revision: D5908789

fbshipit-source-id: 061e414d5105df607b7dcafefb134ad9c94a9a71
2017-09-25 22:03:02 -07:00
Alex Dvornikov 29e7659111 Use const reference in RCTNativeModule::invokeInner
Reviewed By: mhorowitz

Differential Revision: D5909088

fbshipit-source-id: 3104e3d0a4b29d457c3c7fad2a29e2f0943b478d
2017-09-25 20:39:16 -07:00
Lee Byron bd70f3ab3b Remove older devtools hook
Summary:
As of v1.4.0, a new devtools hook is used that is hosted within `relay-devtools` instead of `relay-runtime`. That allows debugging of production relay apps, and reduces byte size of Relay.

As a result, relay-debugger-react-native-runtime and RelayDebugger can be removed.

Reviewed By: kassens

Differential Revision: D5904296

fbshipit-source-id: 2b215f5a25ecb2922b00cdf86f7d31415d8d1328
2017-09-25 19:30:06 -07:00
Valentin Shergin eeda4f3cea Using modern API to get available size in RCTShadowText
Summary: This is just more correct.

Reviewed By: javache

Differential Revision: D5860755

fbshipit-source-id: 8ae0e92b2faedfb6dfa02f59f2a63a044bb6912d
2017-09-25 19:02:20 -07:00
Valentin Shergin 73b596cfdd Small NaN related optimisation in RCTShadowText
Summary: NaN values can not be compared directly, so we have to use `isnan` function.

Reviewed By: mmmulani

Differential Revision: D5859761

fbshipit-source-id: bf99a1ae574cd820265bef0c2bd255b194c5dc3c
2017-09-25 19:02:20 -07:00
Kevin Gozali 3649fce129 Revert D5887667: Adding error message including stacktrace
Differential Revision: D5887667

fbshipit-source-id: 2b3b877317bd4bfddcb5d7886c7399c669d4bbd6
2017-09-25 16:32:02 -07:00
Hector Ramos c5d8785fa5 Fix website generation
Summary: Closes https://github.com/facebook/react-native/pull/16088

Differential Revision: D5903999

Pulled By: hramos

fbshipit-source-id: 707b97d2727fbc5cad82c468ce86a8959ec1c104
2017-09-25 13:34:10 -07:00
Valentin Shergin 5536252376 Revert D5894101: [RN] Using SafeAreaView in YellowBox
Differential Revision: D5894101

fbshipit-source-id: b18b09572c2362d4867ed94a406f56206cdfe6d5
2017-09-25 11:51:23 -07:00
Mehdi Mulani e220878b00 Add a hack to fix the Modal component interacting with LayoutAnimation
Summary: As per the comment, <Modal> uses entering/leaving the view hierarchy as a cue to show/hide the modal. By re-adding it, we are causing a bunch of confusion.

Reviewed By: shergin

Differential Revision: D5893607

fbshipit-source-id: ecd05799751a9bba843998ae93f24fe35edca8b4
2017-09-25 11:07:55 -07:00
Jakub Grzmiel d005c8c08a Fix format warnings for clang 5.0
Reviewed By: mzlee

Differential Revision: D5900751

fbshipit-source-id: 4e9aea068aab3d2d882b8fb103a8828e861da97c
2017-09-25 10:30:53 -07:00
David Vacca eae0241a7d Adding error message including stacktrace
Reviewed By: shergin

Differential Revision: D5887667

fbshipit-source-id: 6c1f1ad74db886a01f76171cdcafa97169fef4c3
2017-09-25 10:17:51 -07:00
Valentin Shergin e10f7788c4 Using SafeAreaView in YellowBox
Summary:
Now it does not clipped on iPhone X.
{F74889000}

Reviewed By: mmmulani

Differential Revision: D5894101

fbshipit-source-id: 5dc91583aa38bb14607421e5afc2ae796e35cce0
2017-09-24 23:01:25 -07:00
Valentin Shergin 8606e04c5d Enabled pretier (@format) for all files in ReactNative folder
Reviewed By: mmmulani

Differential Revision: D5894100

fbshipit-source-id: fae0d02547c0f049fc77f87f209b2ae4f2a298fd
2017-09-24 23:01:25 -07:00
Valentin Shergin 7e5d4335ca SafeAreaViewExample inside RNTester
Reviewed By: mmmulani

Differential Revision: D5888672

fbshipit-source-id: 3de827cbbbb71c9d4bfcc8a1830eea962e707bbe
2017-09-24 23:01:25 -07:00
Valentin Shergin 983b05441d Introducing <SafeAreaView>
Summary:
<SafeAreaView> renders nested content and automatically applies paddings reflect the portion of the view
that is not covered by navigation bars, tab bars, toolbars, and other ancestor views.
Moreover, and most importantly, Safe Area's paddings feflect physical limitation of the screen,
such as rounded corners or camera notches (aka sensor housing area on iPhone X).

Reviewed By: mmmulani

Differential Revision: D5886411

fbshipit-source-id: 7ecc7aa34de8f5527c4e59b0fb4efba3aaea28c8
2017-09-24 23:01:25 -07:00
Valentin Shergin 8b4ed9490c Introducting `-[UIManager.setLocalData:forView:]`, the way to provide environmental data to ShadowView
Summary:
In some cases we need a way to specify some environmental data to shadow view
to improve layout (or do something similar), so `localData` serves these needs.
For example, any stateful embedded native views may benefit from this.
Have in mind that this data is not supposed to interfere with the state of
the shadow view.

Reviewed By: mmmulani

Differential Revision: D5884711

fbshipit-source-id: f0bf66e4608894ec4479b8aca262afcfba6b9f4b
2017-09-24 23:01:25 -07:00
Mike Grabowski e5d4d494db Create 2017-09-21-react-native-monthly-4.md
Summary: Closes https://github.com/facebook/react-native/pull/16056

Differential Revision: D5896471

Pulled By: hramos

fbshipit-source-id: e3327e4897c04e13459a4b6991e64d67f546257c
2017-09-24 15:33:19 -07:00
Paul van Staden 0818f3bdf5 Adding TLSv1 support for custom SSL socket factory
Summary:
This problem tries to solve issue #14244

Implemented a fetch request to a TLSv1 server. It now successfully resolves TLS handshake.
Tested same fetch to TLSv1.2 server and still successfully resolves TLS handshake.
Closes https://github.com/facebook/react-native/pull/14245

Differential Revision: D5898689

Pulled By: shergin

fbshipit-source-id: 8766ebe6909443367651ab868aa5ff62747cd906
2017-09-23 17:22:57 -07:00
Mehdi Mulani 9bf936ccba Avoid oversending modalDismissed event
Reviewed By: shergin

Differential Revision: D5895366

fbshipit-source-id: 6d1ca424d2d43fadb48354a1cbad94714448a380
2017-09-23 10:46:17 -07:00
Andrew Gallagher 49359e879b Deprecate older API uses of `prebuilt_cxx_library`
Reviewed By: ttsugriy

Differential Revision: D5878523

fbshipit-source-id: 2c8c1fd1d19597ff7459bbd527c89573520db74b
2017-09-22 13:20:17 -07:00
Taylor Kline 82b4b9b115 Give complex FlatList example more motivation
Summary:
Previously, the example MyListItem never referenced the selected prop, leaving ambiguity about the intention of the demo.

By adding a concrete implementation with coloring based on the selected prop, we can see that this is a demo of a multi-select list for batch actions instead of, say, a click-to-navigate nested list.

Here is a working Snack demo for future reference:
https://snack.expo.io/BkRMRTGB-

References #14872

<!--
Thank you for sending the PR!

If you changed any code, please provide us with clear instructions on how you verified your changes work. In other words, a test plan is *required*. Bonus points for screenshots and videos!

Please read the Contribution Guidelines at https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md to learn more about contributing to React Native.

Happy contributing!
-->
Closes https://github.com/facebook/react-native/pull/14957

Differential Revision: D5892186

Pulled By: sahrens

fbshipit-source-id: c7b46b5f6eae8f36bd4bda7cbbd354cc22108b42
2017-09-22 13:04:06 -07:00