Commit Graph

8036 Commits

Author SHA1 Message Date
Héctor Ramos 7dff5d2e30 Load React Native Web Player from MaxCDN.
Summary:
unpkg (nee npmcdn) will [no longer serve HTML content with the text/html Content-Type](https://twitter.com/mjackson/status/779147399528718336). We need to switch to another provider to continue supporting the RN Web Player.
Closes https://github.com/facebook/react-native/pull/10072

Differential Revision: D3914585

Pulled By: lacker

fbshipit-source-id: 69833c157775f2b255f1cd11c5b52140d12a27be
2016-09-23 11:28:33 -07:00
Pieter De Baets 76c54847bb Extract native module logic from BatchedBridge
Reviewed By: lexs

Differential Revision: D3901630

fbshipit-source-id: c119ffe54a4d1e716e6ae98895e5a3a48b16cf43
2016-09-23 11:14:11 -07:00
Pieter De Baets 31b158c9fe Export native modules without RCT or RK prefix
Reviewed By: mmmulani

Differential Revision: D3901600

fbshipit-source-id: 7d4a027f0f2478e2a9ac9916326b91279bec3cb3
2016-09-23 11:14:11 -07:00
Pieter De Baets ff79224d37 Simplify ModuleConfig array format
Reviewed By: lexs, mhorowitz

Differential Revision: D3901563

fbshipit-source-id: 70aea19db1b01170be57b74ccfa1a306dfa1f362
2016-09-23 11:14:10 -07:00
Pieter De Baets acdd08aef7 Add flow-typing to MessageQueue
Reviewed By: majak

Differential Revision: D3901545

fbshipit-source-id: a9ccc3d11794830e21c778df0ae7100d79f7ee73
2016-09-23 11:14:10 -07:00
Joel Marcey 53c9dbabaf Remove survey banner.
Summary:
We have gathered enough data to determine whether our docs direction
was the right approach.
Closes https://github.com/facebook/react-native/pull/10071

Differential Revision: D3914445

Pulled By: hramos

fbshipit-source-id: 64bd507d3ac6dda5dd1b5c1be611c7a71a278ffd
2016-09-23 11:14:10 -07:00
Fred Liu 4c2fa7e4ee Remove unused state variable
Reviewed By: furdei

Differential Revision: D3909633

fbshipit-source-id: 9e4376ce3eb3e49d0330a625b44fa62a96c9ba91
2016-09-23 10:28:40 -07:00
Mike Grabowski db06fc6814 Better release script
Summary: Automatically tags and publish them upstream, less steps required in order to do the release rather than just `bump-oss-version.js`

Differential Revision: D3913826

Pulled By: bestander

fbshipit-source-id: 6e023e7ab7b486ff6e6cc8e946f19e10a7ceeef8
2016-09-23 08:28:35 -07:00
Ovidiu Viorel Iepure 23d84c8df8 Remove platform blacklists
Summary: File platform identifiers (`fileName.<platform>.js`) are no longer part of the blacklist regular expression. This allows the upcoming `jest-haste-map` to include all files for all platforms, therefore enabling Packager to build bundles for different platforms using the same `HasteMap`(jest-haste-map) instance.

Reviewed By: davidaurelio

Differential Revision: D3907508

fbshipit-source-id: d7d7f3bd93287a634a1ef0590a736d021be2aaa5
2016-09-23 08:13:46 -07:00
Don Yu 17219720e4 Add support for image onLoad, onLoadEnd, onError events for IgReactImageView
Summary: Create separate buck library for image events so you can depend on that without depending on all of fresco

Reviewed By: brosenfeld

Differential Revision: D3907894

fbshipit-source-id: dca7a00d38b8b8bb5bab05b6883f6933fff3fa76
2016-09-23 04:43:54 -07:00
Aaron Chiu 826d7345ad Test diff CI fix: Update CoreModulesPackage.java
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/10057

Differential Revision: D3913431

Pulled By: bestander

fbshipit-source-id: c761640839ce0e85196ffd7fc1a4e1c615078b06
2016-09-23 04:43:53 -07:00
Erik Arvidsson 04d870b10b XMLHttpRequest should dispatch loadend events
Summary:
The code was never dispatching the loadend event. The event should be
dispatched after the load, error, timeout and abort events (abort
events are not yet supported).

https://xhr.spec.whatwg.org/#event-xhr-loadend
Closes https://github.com/facebook/react-native/pull/10047

Differential Revision: D3911080

fbshipit-source-id: 450f50a6f2a5c6845889bce624c64a1ca47ec06b
2016-09-22 17:13:46 -07:00
mattpodwysocki 2da08884b2 Introducing .NET version of css-layout using P/Invoke
Summary:
This version of the css-layout project includes support for .NET projects.  Up in the air is how many configurations of .NET projects we allow for, such as Portable Class Libraries, Universal Windows Platform, .NET Core, etc.  Still needs integration with Buck.
Closes https://github.com/facebook/css-layout/pull/220

Reviewed By: lucasr

Differential Revision: D3909367

Pulled By: emilsjolander

fbshipit-source-id: aaaa9c4ff2d3452649f256c3268cf873cf33a0b9
2016-09-22 16:28:38 -07:00
Dustin Hoffner 727b7dffb4 Changed scrollEventThrottle check
Summary:
Hi there,

when using the ScrollView component with `onScroll` and `scrollEventThrottle = 0` as it is documented in [react-native/docs/scrollview](https://facebook.github.io/react-native/docs/scrollview.html#scrolleventthrottle) this message will appear unnecessary.

This happens because `!this.props.scrollEventThrottle` is `true` when the value is `0`.

So I changed it to `this.props.scrollEventThrottle == null`. Now it is `false` when the value is `0`.
Closes https://github.com/facebook/react-native/pull/10038

Differential Revision: D3909323

fbshipit-source-id: 3c701f23708b64576a8c9f47e140d87159087894
2016-09-22 13:58:31 -07:00
Mehdi Mulani 858e95b2aa Warn when displaying a modal with unsupported interface orientations
Summary: In dev mode, this removes all iOS crashes from specifying the incorrect interface orientations. It also includes okay-ish instructions for how to fix the problem.

Reviewed By: fkgozali

Differential Revision: D3904998

fbshipit-source-id: 699599fa77fd87e6615436250e38944e577e75a0
2016-09-22 12:58:33 -07:00
Aaron Chiu bdc47313e8 move some JS modules to debug only
Reviewed By: lexs

Differential Revision: D3893217

fbshipit-source-id: d84aea3391fea435ea1de39f7ce8cf08586b373f
2016-09-22 11:28:36 -07:00
Fred Liu 5c13eaccbd Close open rows on scroll
Summary: If a user scrolls the `SwipeableListView`, any open row(s) will close.

Reviewed By: furdei

Differential Revision: D3903787

fbshipit-source-id: efd9ae896ba50ad6e83e72d52bc1f5c0c35efd61
2016-09-22 09:58:33 -07:00
Brad Daily 61eb3e8826 Reverted commit D3841122
Summary:
This commit brings Android in line with iOS WebSockets by sending along cookies from the shared CookieManager. See: https://github.com/facebook/react-native/pull/5630
Closes https://github.com/facebook/react-native/pull/6067

Differential Revision: D3841122

Pulled By: wutalman

fbshipit-source-id: 6dae03bdf1c4599f12c0b191fcc56a61952fb59e
2016-09-22 09:13:41 -07:00
sunnylqm 5f8c82412f fix a broken link and provide a trick to diable log
Summary:
P.S, now we have four docs about navigator(s). But from my POV, the content are more or less repeated, and the logic is a little messy. I suggest someone to reforge these docs, in a more vivid and evolutionary way. Thank you!
Closes https://github.com/facebook/react-native/pull/9975

Differential Revision: D3907167

Pulled By: JoelMarcey

fbshipit-source-id: 9db05f8a3d70f28c6104e7cc6a2813e7eaa9f6fa
2016-09-22 07:43:32 -07:00
David Aurelio df5d14c568 throwing for unresolved modules: flip logic
Summary:
The current test checks whether the target platform is `'ios'`. When building with windows, errors will also be swallowed silently.

This adds a check whether the target platform is `'android'`, where we have to avoid throwing for FB-internal reasons.

Reviewed By: martinbigio

Differential Revision: D3907025

fbshipit-source-id: 5abeb06b9121265fe1aa3932ad1785f148f04ddf
2016-09-22 07:28:33 -07:00
Andrei Coman 3318483b31 Fix dev menu on top of modals
Summary:
The dialog intercepts all key events, we need to redirect some of them to the
activity so that it can display the dev menu.

Reviewed By: foghina

Differential Revision: D3894503

fbshipit-source-id: fb62346a4da783f28a73c5a9e20566a451177629
2016-09-22 04:49:58 -07:00
Héctor Ramos f1ce6426fe Rename Support to Help, and re-style to better guide users to help themselves
Summary:
Duplicate of #9552 which failed to land internally.
Closes https://github.com/facebook/react-native/pull/9796

Differential Revision: D3896927

Pulled By: hramos

fbshipit-source-id: 98d60827b72a272331d4d4287be4726cca0c4422
2016-09-21 16:43:38 -07:00
Rob Hogan 779f9e2b9c RCTLocationObserver: Fix reporting of timeout error
Summary:
Fixes an issue where location request timeout errors always reported "Unable to fetch location within **0s**".

Previously we had `@"Unable to fetch location within %zds.", (NSInteger)(timer.timeInterval * 1000.0)` but from the [NSTimer.timeInterval docs](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSTimer_Class/#//apple_ref/occ/instp/NSTimer/timeInterval) "If the receiver is a non-repeating timer, returns 0 even if a time interval was set.".

Change to use `request.options.timeout` instead, which is a `Double` defaulting to `INFINITY`. Tested on an iOS simulator.
Closes https://github.com/facebook/react-native/pull/9888

Differential Revision: D3902788

Pulled By: javache

fbshipit-source-id: aef717d6c39f3177cb7056a17adc35c1bfd94132
2016-09-21 14:28:43 -07:00
Toby Cox 1a62b66c51 FIX #9751 - Cancelling offscreen image loads causing crashes
Summary:
This fixes https://github.com/facebook/react-native/issues/9751

We were seeing the same issues as the original reporter.

I'm not an expert on this code, so apologies if it's naive, but we haven't seen the crash since making this change.

From my understanding of it, it seems like the `cancelLoad` block was being released before the block returned by `_loadImageOrDataWithURLRequest:` was called.
This PR checks the `cancelled` flag before calling `cancelLoad()`.
Closes https://github.com/facebook/react-native/pull/10016

Differential Revision: D3902723

Pulled By: javache

fbshipit-source-id: 75cd115e28694105c6fc29469986998ca0d4cd09
2016-09-21 14:28:43 -07:00
Mehdi Mulani 820b1c0e46 Add partial image loading to RCTImageView
Reviewed By: javache

Differential Revision: D3856918

fbshipit-source-id: ca98f8604213e7e583a188ccc4c25ea9d7aa9aa2
2016-09-21 12:14:09 -07:00
Martin Konicek 048449b678 Active opacity for TouchableHighlight should be 0.85 to match iOS native look
Summary:
While working on a feature in realized the buttons I built using `TouchableHighlight` were too dark when pressed.

When used white white views, `TouchableHighlight` produces the color `d4d5d5`. This is different from `dedede` which iOS uses.

Let's use opacity 0.85 instead of 0.8 to make the color match iOS. See a React Native view compared to iOS settings screen (same color for pressed items now): http://imgur.com/a/6CyL3

On Android, people should be using `TouchableNativeFeedback` everywhere.

Reviewed By: sahrens

Differential Revision: D3896168

fbshipit-source-id: a7dd12b4bde079b120faaffc36d25292533a2c6d
2016-09-21 07:13:38 -07:00
T. Brandon Ashley 33c3d5d2a9 Fix typo patter -> pattern
Summary: Closes https://github.com/facebook/react-native/pull/10008

Differential Revision: D3899083

fbshipit-source-id: c4e9392c931f5caa74e0538cd139f226109800a8
2016-09-20 23:28:38 -07:00
Muhammad Habib Rohman 52cbe7dc22 Add transition to input search in website
Summary:
I think if you add some transition to input search element in React-native website I think it should be good.
Closes https://github.com/facebook/react-native/pull/10000

Differential Revision: D3899115

Pulled By: hramos

fbshipit-source-id: 72778ecf1ccd3a97eae0f762aaf9101624e23a83
2016-09-20 23:28:38 -07:00
aleclarson b3ee595af7 Fix 'isRelativeImport' to allow require('.') and require('..')
Summary:
davidaurelio 👍
Closes https://github.com/facebook/react-native/pull/10006

Differential Revision: D3898703

fbshipit-source-id: 6d88122ed56108d52bc1ae1b14c7ff7c39fd9b9a
2016-09-20 20:58:38 -07:00
Yiding Jia bb933c8ad4 Make custom jsc initialization a link-time replacable function.
Reviewed By: bnham

Differential Revision: D3880106

fbshipit-source-id: 2a3c3c8ff120ecc66b31325700c187cbd957f361
2016-09-20 16:58:42 -07:00
Ioannis Kokkinidis fe84362a90 Adding PlaceAVote showcase app
Summary:
Just added the PlaceAVote app to the react-native showcase file.
Closes https://github.com/facebook/react-native/pull/9850

Differential Revision: D3896924

Pulled By: hramos

fbshipit-source-id: c012522e02d6a427f266cf05d4cd38a22e9845b3
2016-09-20 16:43:41 -07:00
Héctor Ramos 999ebb154d Deploy showcase, support when building gh-pages on master.
Summary:
Addresses #9865.

We want the showcase and support pages to be loaded from root regardless of which React Native version is selected.
Closes https://github.com/facebook/react-native/pull/10004

Differential Revision: D3896505

Pulled By: bestander

fbshipit-source-id: 0db64f72bca8bc68d6d489fa3ed34c0a6f671002
2016-09-20 15:58:48 -07:00
Fred Liu 0c7ccfe172 Prevent 1st breadcrumb from stealing touches from title
Summary:
In certain cases, if a navigation title is present in place of an empty nav stack, the first breadcrumb may steal part of the title's touch events since it's hardcoded to sit 1/4 from the left of the screen (for animation reasons). This diff fixes it, allowing titles on an empty nav stack to be entirely touchable while retaining all other breadcrumb functionality.

Also, applied some suggested lint changes.

Reviewed By: hedgerwang

Differential Revision: D3891909

fbshipit-source-id: 97d1fb3bba4e4118401d84cec2d8836b94bfde75
2016-09-20 14:13:30 -07:00
aleclarsoniv 82354640ff Fix node_modules resolution error messages
Summary:
We could probably relieve a lot of pain (in [this issue](https://github.com/facebook/react-native/issues/4968) specifically) by fixing the error message for when a module cannot be resolved after trying every relevant `node_modules` directory.

Currently, you get a confusing error message that only gives you the last `node_modules` directory checked. By creating the error message where we can access the `searchQueue`, we're able to provide all of the attempted `node_modules` directories.

Here's an example error message:

```
Unable to resolve module leftpad from /Users/aleclarson/ReactProject/src/stuff/index.js:
Module does not exist in the module map or as these directories:
  /Users/aleclarson/ReactProject/src/stuff/node_modules/leftpad
  /Users/aleclarson/ReactProject/src/node_modules/leftpad
  /Users/aleclarson/ReactProject/node_modules/leftpad
  /Users/aleclarson/node_modules/leftpad
  /Users/node_modules/leftpad
```
Closes https://github.com/facebook/react-native/pull/9832

Differential Revision: D3895408

Pulled By: davidaurelio

fbshipit-source-id: 872c9a3bb3633f751ec69b586a261616578ed511
2016-09-20 13:58:52 -07:00
James Ide 5ac77062be Add "assetPlugin" option to allow arbitrary asset processing
Summary:
Adds a new URL option to the packager server called "assetPlugin". This can be a name of a Node module or multiple Node modules (`assetPlugin=module1&assetPlugin=module2`). Each plugin is loaded using `require()` and is expected to export a function. Each plugin function is invoked with an asset as the argument. The plugins may be async functions; the packager will properly wait for them to settle and will chain them.

A plugin may be used to add extra metadata to an asset. For example it may add an array of hashes for all of the files belonging to an asset, or it may add the duration of a sound clip asset.
Closes https://github.com/facebook/react-native/pull/9993

Differential Revision: D3895384

Pulled By: davidaurelio

fbshipit-source-id: 0afe24012fc54b6d18d9b2df5f5675d27ea58320
2016-09-20 13:43:51 -07:00
Héctor Ramos ebecd4872b how to find and stop process using port on windows
Summary:
Improve troubleshooting section to include details on how to find and stop process using port on Windows.
Closes https://github.com/facebook/react-native/pull/9997

Differential Revision: D3893954

Pulled By: hramos

fbshipit-source-id: 2670b94c02b42516f8f610977b282032f3202a8b
2016-09-20 10:44:40 -07:00
Emil Sjolander 375a5805d1 Cleanup some multiline code
Reviewed By: lucasr

Differential Revision: D3886866

fbshipit-source-id: e19c1be4af58605933f90b5bf381008338be2236
2016-09-20 10:30:15 -07:00
Emil Sjolander 10601c921e Move justifyContent check into switch statement
Reviewed By: lucasr

Differential Revision: D3886861

fbshipit-source-id: 17ba2962016af34b5add3ce6d8355c9c305a35c0
2016-09-20 10:30:13 -07:00
Emil Sjolander be140107b9 Remove empty line in function call
Reviewed By: lucasr

Differential Revision: D3886856

fbshipit-source-id: cf76ad9b6c85a62b9f2683618a6abe986d98acc2
2016-09-20 10:30:11 -07:00
Emil Sjolander 7f2bbf4263 Remove use of snake_case
Reviewed By: lucasr

Differential Revision: D3886849

fbshipit-source-id: eaf3f219fe1ccb717ba363dba0d2f475ffb204e3
2016-09-20 10:30:08 -07:00
Andrei Coman 922cd6ddfc Fix Modal freeze
Summary:
In some cases, the size of the content view changes before we add views to the
Modal. That means that the size of that view will not be set through the
`onSizeChanged` method. This can result in some apps apparently freezing,
since the dialog is created, but there are no actual views in it.
For that reason, we still need the ModalHostShadowNode to set the size of the
initial view, so that by the time the view gets added it already has the correct
size.
There's a new helper class so that we can reuse the modal size computation.

Reviewed By: foghina

Differential Revision: D3892795

fbshipit-source-id: 6a32bd7680a74d9912a21bfebb4ebd7a3c3c3e38
2016-09-20 06:58:49 -07:00
Pieter De Baets 21fda19ca9 Consistently handle startup errors
Summary:
If we use RCTLogError, we show a redbox with a native stacktrace before we can actually show the JS stacktrace (which is only done through dispatch_async). Instead use RCTLogWarn so its logged to console but not reported as a redbox.

Also fix call to RCTNSErrorFromJSErrorRef off the main thread RCTJSCExecutor.

Reviewed By: majak, mmmulani

Differential Revision: D3886813

fbshipit-source-id: 119d04858cb0c85c79e12ff8a79806711f8e0b27
2016-09-20 06:28:36 -07:00
Gant Laborde c6024f6391 - Add ability to detect if location was mocked
Summary:
Since API 18, Android locations have had the `isFromMockProvider()` function, to verify the validity of a provided location.  This was one of many methods one could verify location data, but as of Marshmallow, the other ways of detecting if "Mock Locations" is on in developer settings has been deprecated or defunct.

This means some devices can only detect location mocking by exposing the method on the location object.

This change provides that exposure.
Closes https://github.com/facebook/react-native/pull/9390

Differential Revision: D3858205

Pulled By: bestander

fbshipit-source-id: 3bae429cc0596ea01926c5be204f4403e4a2414f
2016-09-20 05:59:04 -07:00
zxcpoiu f839627605 update base64-js version. follow up #6961
Summary:
**Motivation**
This is originally a follow up of PR #6327 by dewe and jeremyong
And mkonicek indicated this should split into a separate PR.

Now philikon takes over #6327 as #6961

**Test Plan:**
According to #6961 and #6889
Load WebSocketExample in UIExplorer app and start websocket test server script and test sending binary data on both iOS and Android
Closes https://github.com/facebook/react-native/pull/6937

Reviewed By: javache

Differential Revision: D3669596

Pulled By: mkonicek

fbshipit-source-id: 342e29eb34de882bcbd9f297aab71dd6bb236748
2016-09-20 05:43:36 -07:00
Brad Daily 04392f2428 Android WebSocket: include cookies with request
Summary:
This commit brings Android in line with iOS WebSockets by sending along cookies from the shared CookieManager. See: https://github.com/facebook/react-native/pull/5630
Closes https://github.com/facebook/react-native/pull/6067

Differential Revision: D3841122

Pulled By: mkonicek

fbshipit-source-id: 6607424feeb31c9da4e370ebe4b33dbbedc0a446
2016-09-19 15:44:17 -07:00
Stanisław Wasiutyński 74c32e2609 Docs fix: remove confusing typo
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

Copy&paste from the example in the documentation will cause exception because there is no `AndroidPermissions` object. To avoid confusion we should refer to `PermissionsAndroid` instead since this is how this module is named in the API.
Closes https://github.com/facebook/react-native/pull/9956

Differential Revision: D3889080

Pulled By: hramos

fbshipit-source-id: 8f30d8f51ffee1321088a16a1b454ab163a746a2
2016-09-19 14:46:12 -07:00
Cristian Carlesso 7b2080e118 Removing automatically reset modules between test run
Reviewed By: bestander

Differential Revision: D3886125

fbshipit-source-id: c8f47c3466add1e2c89649a1c6f47b01f0d7a89e
2016-09-19 12:43:55 -07:00
Héctor Ramos d41c3950eb Restore Android setup instructions in the Getting Started
Summary:
This PR restores some [additional detail](http://facebook.github.io/react-native/releases/0.28/docs/getting-started.html) that was removed from the Android Getting Started this summer.

I'm not fully restoring the original list of steps as the React Native website should not be the source of truth for setting up an Android development environment.
Closes https://github.com/facebook/react-native/pull/9867

Differential Revision: D3887834

Pulled By: fredemmott

fbshipit-source-id: 8e3599f8945ba68f31dc9b0f79c2db7e525e7f45
2016-09-19 12:14:00 -07:00
Laguana 7dbc8051e5 Fix symbolication outside of chrome debugging
Summary:
When debugging in VScode or nucleide using a nodejs environment rather than chrome, the JS sources are made to appear as if they exist on disk, rather than coming from a `http://` url. Prior to this change the packager would see these file paths and not know how to handle them.

Since all the application JS will be part of a bundle file, we can switch out the path to the bundle on the filesystem with paths to the bundle served by the packager, and things will work just as though it was debugging in chrome. We stop the replacement once we reach an internal module (`vm.js` in the case of both nucleide and VSCode) since that is the point when the execution switches from inside the app to the surrounding debugging environment.

I've verified that this fixes redbox stack trace symbolication in VSCode, and from my understanding of nucleide's debugging environment it should also work there without requiring any changes.
Closes https://github.com/facebook/react-native/pull/9906

Differential Revision: D3887166

Pulled By: davidaurelio

fbshipit-source-id: e3a6704f30e0fd045ad836bba51f6e20d9854c30
2016-09-19 10:58:40 -07:00
aleclarson 38c5621602 Check if node_modules dir exists before adding to search queue
Summary:
We can keep the `searchQueue` cleaner by using `this._fastfs.dirExists` on the potential `node_modules` directory. In addition to avoiding useless lookups, this also makes the error message provided by #9832 much more understandable.

/cc davidaurelio
Closes https://github.com/facebook/react-native/pull/9973

Differential Revision: D3887053

Pulled By: davidaurelio

fbshipit-source-id: 6a5a488bb4217dd0f9db1c9c9f988b498c746ca9
2016-09-19 10:43:58 -07:00