Commit Graph

8075 Commits

Author SHA1 Message Date
Martin Kralik 46a3bea350 removed unused unrelated test
Summary:
This test wasn't being run externally (it's not added to the xcode project) or internally.
It doesn't even test anything related to RN.

Reviewed By: javache

Differential Revision: D4021791

fbshipit-source-id: fee3fd5e1c3ef47f5bc8480cdc98a10b4da21815
2016-10-14 10:58:43 -07:00
Ben Hughes 41f4f1eaaf CLI errors if no package.json is found
Summary:
If you don't have a `package.json` in your project you can't do anything with the cli as it errors. This fixes that by wrapping the reading of the `package.json` file and returns `my-react-native-app` if an error is caught.
Closes https://github.com/facebook/react-native/pull/10207

Differential Revision: D4022113

Pulled By: javache

fbshipit-source-id: ffe940160f9d0b58e630adfab5e0dc9d34b859e5
2016-10-14 10:58:43 -07:00
Tim Yung b77b760810 RN: Fix Remaining ReactElement References
Summary: Fixes remaining references to `ReactElement` that did not already have `React` in scope.

Reviewed By: bestander, vjeux

Differential Revision: D4022022

fbshipit-source-id: 4aeacee0cdbb2c825feba10282208316d064c578
2016-10-14 10:45:11 -07:00
Tim Yung e8198aed8d Cleanup: Prefer `React.Element` over `React$?Element`
Reviewed By: vjeux

Differential Revision: D4013049

fbshipit-source-id: 18a447fdbc584418d6a51770363bcd221e7fb7dc
2016-10-14 08:59:37 -07:00
kevyu的马甲 beca25083a fix typo in Alert.js
Summary:
after adding new parameter options in alert method, parameter type is the 5th.
Closes https://github.com/facebook/react-native/pull/10370

Differential Revision: D4021511

Pulled By: javache

fbshipit-source-id: 09476162b879d2081f0c0ac95260e673327871b8
2016-10-14 08:13:55 -07:00
kentaromiura 5d15ed0285 Force CircleCI to use JDK 8
Summary:
Circle CI is failing sometimes on the `buck && ant` task with a `Require JDK 8 or higher` error.

**Test plan (required)**
Make sure tests pass on Circle CI.
Closes https://github.com/facebook/react-native/pull/10390

Differential Revision: D4021546

Pulled By: bestander

fbshipit-source-id: 355657936bf90e70a10df418b378ad07978c0e5e
2016-10-14 08:13:55 -07:00
Konstantin Raev 80cb5efbb6 switched fast-fs to use fs for API calls
Summary:
When debugging graceful-fs I noticed that I don't get close() calls https://github.com/isaacs/node-graceful-fs/blob/master/graceful-fs.js#L37.
This is because fastfs uses fs returned from graceful-fs https://github.com/facebook/react-native/blob/master/packager/react-packager/src/node-haste/fastfs.js#L14 and graceful-fs returns close() of a clone object https://github.com/isaacs/node-graceful-fs/blob/master/graceful-fs.js#L27 that is not patched by graceful-fs yet.

Reviewed By: cpojer

Differential Revision: D4021446

fbshipit-source-id: 87e50ff779dfea13b8db2b97575bff0bfd7778eb
2016-10-14 07:47:22 -07:00
Sandro Machado 56ac2a45d7 Add the RCTNetwork to the podfile
Summary:
The pod `RCTNetwork` is missing from the `Podfile` documentation. Without it the view controller does not run.

This probably also closes #8449.
Closes https://github.com/facebook/react-native/pull/10389

Differential Revision: D4021432

Pulled By: JoelMarcey

fbshipit-source-id: 689ed540c6750bf4ccaee1e7943d9175ac50d6c5
2016-10-14 07:13:41 -07:00
Emil Sjolander 9a33f3f40e Don't assume a node with a measure function is a leaf node
Reviewed By: gkassabli

Differential Revision: D4021096

fbshipit-source-id: 7e039239b1697a0ac42dce9f4b7e252a931bad7e
2016-10-14 04:43:38 -07:00
Cristian Carlesso 9ffe2ee0d8 Updating jest to 16.0.1
Reviewed By: cpojer

Differential Revision: D4001464

fbshipit-source-id: cbbf6a9d77605657151c86334fbc03d21f16e5fd
2016-10-13 13:13:46 -07:00
Sandro Machado ae9cc004b9 Remove setUseOldBridge from the documentation
Summary:
This PR removes the `.setUseOldBridge(true)` from the documentation. The method was removed from the `ReactInstanceManager` class at [this](1a690d5674 (diff-dc0f3a09c238b372cb1c27aa5f7dcbce)) commit and currently it is not available.
Closes https://github.com/facebook/react-native/pull/10368

Differential Revision: D4016564

Pulled By: JoelMarcey

fbshipit-source-id: 0d9f83c1708dc85043d80a82ecd4fad6b9d42cf5
2016-10-13 12:13:46 -07:00
Alex Kotliarskyi 5f548e15f9 Show packager progress in UI
Reviewed By: javache

Differential Revision: D3941904

fbshipit-source-id: 4ea3b61e9d636eeaddbadbe4ba6c62069955f022
2016-10-13 11:43:41 -07:00
David Aurelio ef91708fdb Add support for JSON files to `js_file` rule
Reviewed By: cpojer

Differential Revision: D3981152

fbshipit-source-id: 94b5018a1afa27c635ddff5e26c1ff2bed09baf9
2016-10-13 11:14:04 -07:00
Georgiy Kassabli ef021348af Compatibility with Apple TVOS
Reviewed By: emilsjolander

Differential Revision: D4001901

fbshipit-source-id: f095b4ac0ba91addb28d877b411ec27ecff4aad6
2016-10-13 10:58:47 -07:00
Dan Caspi ce179d4b43 Properly removing bytecode caching from iOS
Reviewed By: alexeylang

Differential Revision: D4003142

fbshipit-source-id: 9decdba54417bce8240a5e8f34c0c32b16c9f494
2016-10-13 06:58:45 -07:00
Scott Wolchok 863459064f Fix build with -Wmissing-prototypes
Reviewed By: mzlee

Differential Revision: D4012611

fbshipit-source-id: f56949d464e0ce602138b60f4abfd45b211be3b2
2016-10-12 21:13:45 -07:00
Evgrafov Denis 924c9927d0 Update Modal.js
Summary: Closes https://github.com/facebook/react-native/pull/9825

Differential Revision: D4010331

Pulled By: mmmulani

fbshipit-source-id: 81c0a07716d47429dae8f28d08c9b5b13d30bf26
2016-10-12 21:13:45 -07:00
Tim Yung a3868722f8 Cleanup: Remove `@typechecks`
Reviewed By: spicyj

Differential Revision: D4010629

fbshipit-source-id: b243b2ca09cdfcaeec49b5f6850139d0461b80c5
2016-10-12 19:28:42 -07:00
Connor McEwen 9c3bfe0cbb Prevent app from crashing when getCurrentActivity is null
Summary:
We're seeing a lot of crashes from `PermissionsModule` not being able to access the current activity, mentioned in #10009 and here: https://github.com/facebook/react-native/issues/9310#issuecomment-245657347

As far as I can tell, there is no way to ensure the Activity exists since the `ReactContext` holds a `WeakReference` to the current Activity and it appears that the lifecycle calls are happening in the right order (so not the same as #9310).

This will at least allow people to catch the error in JS and update the UI or try again as opposed to crashing the app.

I'm working on some bigger changes in #10221 but this is a smaller change and important to get fixed I think.
Closes https://github.com/facebook/react-native/pull/10351

Differential Revision: D4010242

fbshipit-source-id: 7a76973bb2b3e45817d4283917740c89a10ec0b0
2016-10-12 12:58:49 -07:00
Gaëtan Renaudeau 0010df514e iOS: Fix CameraRoll to support custom user groups
Summary:
on iOS, if you pull photo from one of user's custom album, the app crashes on the assertion `RCTAssert(resolvedPromise == NO, @"Resolved the promise before we finished processing the results.");` . assertion that was assumed to never been reached.

According to iOS doc, the enumerateGroupsWithTypes `usingBlock` block is called with `group=nil` when the iteration is over, but in current react-native implementation, it is stopping in other circumstance (because the `else` case) which is probably a mistake.

You have probably never seen the bug because you didn't tried to use getPhotos with something else than the pre-defined groups, but it should be possible to do so *(and it seems to work fine as soon as I included my fix. Later I should provide a PR that includes a way to list user groups :) but at least I need this to gets in, otherwise it crashes)*.

For instance, User have a Photo Folder (or "album", whatever you call it) called "Instagram", when I call `CameraRoll.getPhotos({ groupName: "Instagram",
Closes https://github.com/facebook/react-native/pull/10272

Differential Revision: D4009342

Pulled By: javache

fbshipit-source-id: a73ca828133b4f0d880c229f9b675538854020de
2016-10-12 11:28:50 -07:00
Pieter De Baets 8802db3cc0 Update checked-in xcodeproj for RCTHTTPRequestHandler.mm
Reviewed By: majak

Differential Revision: D4009309

fbshipit-source-id: a88021d935a2ac21a220956e77f167c8598eaf1c
2016-10-12 10:58:53 -07:00
Ovidiu Viorel Iepure 5cffc035a3 Add details to Activity events
Summary: Update Activity API to allow adding more details to events for telemetry purposes.

Reviewed By: davidaurelio

Differential Revision: D3982691

fbshipit-source-id: 07f3ed5d1ec4eddbbdeb00feb02ea75e1168705e
2016-10-12 10:43:59 -07:00
Emil Sjolander 1f36d98874 Add tests for java jni bindings
Reviewed By: lucasr

Differential Revision: D4008411

fbshipit-source-id: c896a3925ff3f7fa368176a3d03c84eb7188ef60
2016-10-12 09:58:37 -07:00
leeight c9960817ee Add viewConfig to RCTSlider Component, fix #10158
Summary:
And check componet.viewConfig before call component.setNativeProps method.

FIX #10158
Closes https://github.com/facebook/react-native/pull/10238

Differential Revision: D4008640

Pulled By: javache

fbshipit-source-id: 1bf9b34c0e56f1ffbcd31ae64b3cbafe77a9a1fd
2016-10-12 08:59:05 -07:00
Pieter De Baets 4b7f84aee8 Add lock to RCTHTTPRequestHandler
Reviewed By: mmmulani

Differential Revision: D4001762

fbshipit-source-id: 3a388bbeddeb7b5f6923274137abfc5e20d001b1
2016-10-12 08:59:04 -07:00
Omeid 54f48de48a ios:websocket:exectuor : Grab port from Bundle URL
Summary:
Grabbing the port from Bundle URL allows concurrent Remote JS Debugging using the same machine with running multiple instances of packager on different ports.

This improves the developer experience when developing and debugging cross-platform components.
Closes https://github.com/facebook/react-native/pull/10007

Differential Revision: D4008630

Pulled By: javache

fbshipit-source-id: fcf8495e564fd9ac7baf26a87ed3904898132aa0
2016-10-12 08:43:37 -07:00
Pieter De Baets 1df5c251ab Fix website generation
Reviewed By: kentaromiura

Differential Revision: D4003655

fbshipit-source-id: c67a6d82bd4f8cbc28745489c3b6bcde1fd713ac
2016-10-12 08:28:50 -07:00
leeight ddb1e44b43 Warning: bind(): You are binding a component method to the component
Summary:
Warning: bind(): You are binding a component method to the component.
React does this for you automatically in a high-performance way, so you can safely remove this call. See TouchableOpacity
Closes https://github.com/facebook/react-native/pull/10349

Differential Revision: D4008552

Pulled By: javache

fbshipit-source-id: d98fe9a0d694dee74ea872e51b02fbd75a133e43
2016-10-12 08:28:50 -07:00
Felix Oghina d91a5c4ffb add headless js guide
Summary:
**Test plan (required)**

Run the website, check everything renders.
Closes https://github.com/facebook/react-native/pull/10325

Differential Revision: D4008427

Pulled By: bestander

fbshipit-source-id: 2ba78d33efab2bf2267a806bfc8d3b0ec50f54f5
2016-10-12 06:28:35 -07:00
Konstantin Raev 47537183ec Integrated generic install-node-modules for React Native
Reviewed By: yungsters

Differential Revision: D3996416

fbshipit-source-id: 078b2ca5c076c2c6e2e7209945e59aaa31ebc4aa
2016-10-12 04:43:57 -07:00
Emil Sjolander fb245cca83 Rename init() -> reinit() to be more in line with what it now does
Reviewed By: lucasr

Differential Revision: D3992811

fbshipit-source-id: 61a10acc873ec028b2789007a400d89e62cf31d6
2016-10-12 03:58:45 -07:00
Emil Sjolander 64455ced5d Rename reset() -> free() to be more in line with what it now does
Reviewed By: lucasr

Differential Revision: D3992808

fbshipit-source-id: 8428ae33268d1417ce8642b741e47150a17bf077
2016-10-12 03:58:44 -07:00
Emil Sjolander 38bd937b40 Automatically init native memory when allocating java wrapper
Reviewed By: lucasr

Differential Revision: D3992802

fbshipit-source-id: 06d65821f1802ed8f2b2db651cef69f6851803f2
2016-10-12 03:58:44 -07:00
Emil Sjolander 6dae68306e JNI version is the default, its name should reflect that
Reviewed By: lucasr

Differential Revision: D3992777

fbshipit-source-id: cdd4cc58f3c15b5db1158f6f794394eb5c44a44d
2016-10-12 03:58:44 -07:00
Emil Sjolander 5c728a47b9 Clearly mark java CSSNode as deprecated. It will go away very soon
Reviewed By: lucasr

Differential Revision: D3992775

fbshipit-source-id: b3ceca277e5c7426eb51f8cbeacf5e2fe451c6ec
2016-10-12 02:59:18 -07:00
David Perrenoud a13b373c94 <br /> doesn't exist in React Native
Summary:
Replace `<br />` with `{'\n'}` in order to provide an example of working line breaks in React Native.
Closes https://github.com/facebook/react-native/pull/10323

Differential Revision: D3995544

Pulled By: JoelMarcey

fbshipit-source-id: 8404db8f23eeb606a5a5ed98ca1b7f9b20917e46
2016-10-11 15:13:46 -07:00
Dan Caspi 9408461405 Disabling bytecode caching for custom JSC
Reviewed By: michalgr

Differential Revision: D4002399

fbshipit-source-id: 7ac836873ee4b0d5fc0e9529d7e4257fe577e852
2016-10-11 13:43:42 -07:00
Pieter De Baets 26be005b0a Cancel network requests from the correct queue
Summary: Fix suggested by sooth-sayer (https://github.com/facebook/react-native/pull/10280)

Reviewed By: mmmulani

Differential Revision: D4001618

fbshipit-source-id: cc28d19d02a29b62d2bdbddcd30f94b1c1bcfd76
2016-10-11 12:43:40 -07:00
Alex Kotliarskyi 84eaeb0adf Add multipart response download task (2nd edition)
Reviewed By: mmmulani

Differential Revision: D3976605

fbshipit-source-id: c15cc859aa1288e831f70256566f743f4a8d9cd2
2016-10-11 12:28:42 -07:00
Jameshen17 584bd0da24 add JD(手机京东) to featured list in showcase
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/10317

Differential Revision: D4002531

Pulled By: hramos

fbshipit-source-id: f70421f39ed17c4d3511c104347d66063c15e0b3
2016-10-11 11:58:50 -07:00
Pieter De Baets c90bf303c1 Remove queryLayoutByID
Reviewed By: vjeux

Differential Revision: D3987495

fbshipit-source-id: 43a3cc0fb9ea718064e59e988619c39a23cd0c38
2016-10-11 11:43:40 -07:00
Pieter De Baets 292cc82d0e Reorganize core JS files
Reviewed By: lexs

Differential Revision: D3987463

fbshipit-source-id: fa8f1d1bea7ed699120b9705ddc1c83767fcf8e4
2016-10-11 10:14:28 -07:00
Seph Soliman d1f8add4d0 Documentation fix: dx vs. x0
Summary:
> What existing problem does the pull request solve?

Purely a documentation/example error. Was misled/wasted time debugging because of this issue.

Description:
`dx`/`dy` are zero in onPanResponderGrant, not `x0`/`y0`. `x0`/`y0` will be the coordinates relative to the granted element, which are rarely zero.
Closes https://github.com/facebook/react-native/pull/9984

Differential Revision: D4001603

Pulled By: hramos

fbshipit-source-id: 32580795f62394585ccfb8f9a2ae65b0b72add69
2016-10-11 08:13:39 -07:00
Connor McEwen 9a8b5fcf61 Add repeatInterval to PushNotificationIOS
Summary:
This just cleans up the work done in #7219 by adamterlson based on grabbou's feedback
Closes https://github.com/facebook/react-native/pull/10337

Differential Revision: D4001540

Pulled By: javache

fbshipit-source-id: c73b5fef912fa71d1d988dae41094c9c46dc610b
2016-10-11 07:43:52 -07:00
Joshua May 0f3d24c7fb Updates Swift @objc export for recent Swift versions
Summary:
As of Swift 3, [Swift converts Objective-C API names based on parameters](https://github.com/apple/swift-evolution/blob/master/proposals/0005-objective-c-name-translation.md), so the docs should explicitly declare what the Objective-C API is (because it's also used in the JavaScript side too).

An alternative to this would be to update the Objective-C and JavaScript calls to be `addEventWithName:location:date:` / `addEventWithName()` based on the default Swift API, but I think the approach in the PR is most correct here.
Closes https://github.com/facebook/react-native/pull/10176

Differential Revision: D4001604

Pulled By: hramos

fbshipit-source-id: cd4143d19d2d375288a086b9d7995e75fe1e9170
2016-10-11 07:43:52 -07:00
Satyajit Sahoo fa5ad85252 Remove deprecated APIs and modules
Summary:
We've deprecated these APIs for quite a few releases and we should be able to get rid of them now.

Remove following deprecated modules/components
 - AppStateIOS
 - ActivityIndicatorIOS
 - IntentAndroid
 - SliderIOS
 - SwitchAndroid
 - SwitchIOS
 - LinkingIOS

Update following modules to remove callback support
 - Clipboard
 - NetInfo

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

Reviewed By: bestander

Differential Revision: D3974094

Pulled By: javache

fbshipit-source-id: 9abe32716bd85d0cea9933894f4447d53bdd5ee7
2016-10-11 07:43:52 -07:00
Pieter De Baets 9ed9bca0bf Lazily instantiate native modules
Summary: Instead of sending a list of modules over to JS on startup (and actually blocking script execution) instead provide a proxy object that constructs each of these lazily.

Reviewed By: lexs

Differential Revision: D3936979

fbshipit-source-id: 71bde822f01eb17a29f56c5e60e95e98e207d74d
2016-10-11 07:28:42 -07:00
Pieter De Baets 606fc11487 Increase laziness in InitializeJavaScriptAppEngine
Reviewed By: davidaurelio

Differential Revision: D3981026

fbshipit-source-id: fa7c0a0e98fb4ddccc61fffbb6644dd3d39b857c
2016-10-11 06:58:56 -07:00
Pieter De Baets d99623fcdc Remove keyMirror usage in JSTimers
Reviewed By: davidaurelio

Differential Revision: D3981015

fbshipit-source-id: 9ce7601038b7cdf8a7feb580380557ed84008397
2016-10-11 06:58:56 -07:00
Pieter De Baets 3137ba993d Cleanup console and ErrorUtils
Reviewed By: davidaurelio

Differential Revision: D3981005

fbshipit-source-id: 3c95e62177f78785c7f971dd632126dbfb83746b
2016-10-11 06:58:55 -07:00