Commit Graph

6600 Commits

Author SHA1 Message Date
Andrei Coman 5de1151bdd Fix NPE in cancelling network calls
Summary:
Issue reported here
https://github.com/facebook/react-native/issues/7755#issuecomment-222950463

Converting int to Integer explicitly and not cancelling the call more than once
should fix it.

Reviewed By: bestander

Differential Revision: D3371238

fbshipit-source-id: cb00663b4ca19a788bd27b971b6447cc0788a818
2016-06-03 03:13:30 -07:00
Christian Ost 8fe58849a5 Update the documenation of ActionSheetIOS to include all possible options
Summary:
As it is shown in the examples, `subject` and `excludedActivityTypes` should be part of the documentation. `excludedActivityTypes` could be completed by a list of all possible options (see [UIActivity](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/#//apple_ref/doc/constant_group/Built_in_Activity_Types) documentation of Apple).

Screenshots of updated documentation:
![actionsheetios](https://cloud.githubusercontent.com/assets/12033337/15772879/0e54ca98-2974-11e6-9af5-df76c093ec5a.png)
Closes https://github.com/facebook/react-native/pull/7908

Differential Revision: D3384642

Pulled By: javache

fbshipit-source-id: 837e50eeabbcd532baf5ea1d4f8a64267c93c6ce
2016-06-03 02:58:31 -07:00
Basil Hosmer fe5c2615dd react-native-github: turn on strict type args in Flow, codemod stragglers
Reviewed By: frantic

Differential Revision: D3374980

fbshipit-source-id: 6dbefeffa588f676c8e162ba7ac7912b61a7711a
2016-06-03 02:43:57 -07:00
Kasim Tan a7f1428d4a Fix comment typos
Summary: Closes https://github.com/facebook/react-native/pull/7901

Differential Revision: D3384624

Pulled By: javache

fbshipit-source-id: 741343dec5406af1855624069dd8dc426a93bdb3
2016-06-03 02:43:57 -07:00
Philipp von Weitershausen e29350214a Correct semantics for XMLHttpRequest.responseText
Summary:
Accessing the `responseText` property when `responseType` is not `''` or `'text'` should throw. Also, the property is read-only.

**Test Plan:** UIExplorer example, unit tests
Closes https://github.com/facebook/react-native/pull/7284

Differential Revision: D3366893

fbshipit-source-id: a4cf5ebabcd1e03d6e2dc9d51230982922746c11
2016-06-02 18:13:23 -07:00
Kevin Lacker 16a97c8027 Update error message on unrecognized commands
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

(You can skip this if you're fixing a typo or adding an app to the Showcase.)

Kevin: This isn't quite a typo, but it's a change to an error message.

In my experience, frequently when this error message is displayed, the command is unrecognized because I haven't run npm install, I just checked out a repo of someone else's. We could just update this error message a bit, and I think it would improve the developer experience.
Closes https://github.com/facebook/react-native/pull/7859

Differential Revision: D3379234

fbshipit-source-id: 4fb6e5bae20904871c9c4f7504013dc18b1fe707
2016-06-02 17:58:28 -07:00
Igor Avramovic c55e3649dd Lazy load platform specific code
Differential Revision: D3369528

fbshipit-source-id: 0fbc63fbac5e96468598fb3d0a86c6b20f96f39d
2016-06-02 17:43:25 -07:00
Philipp von Weitershausen 1f2027a1fe Android: allow app/build.gradle to specify additional packager arguments
Summary:
If for instance you're using a custom transformer, having this hook will let you specify it without forking all of react.gradle

**Test plan:** Specified some additional packager args in my app's `android/app/build.gradle`:
```groovy
project.ext.react = [
  bundleInDebug: true,
  extraPackagerArgs: ["--transformer", "path/to/my/transformer.js"]
]
```
and ensured they show up when gradle invokes the bundler.
Closes https://github.com/facebook/react-native/pull/7858

Differential Revision: D3382996

Pulled By: mkonicek

fbshipit-source-id: 437b2e6c902931d45b9d2f7ec97c833ba0cd3217
2016-06-02 17:28:39 -07:00
Chris Hopman db3adb4445 Cancel pending bridge work during shutdown
Reviewed By: mhorowitz

Differential Revision: D3381541

fbshipit-source-id: 51a3f766509ec78262792817dee3d5e6969ff05f
2016-06-02 17:13:27 -07:00
Ahmed El-Helw 68c11e55ee Promote grandchildren of certain views are Views
Reviewed By: astreet

Differential Revision: D3161232

fbshipit-source-id: ea313d513bd7567e32f18765d479ba0538f2efbf
2016-06-02 14:13:28 -07:00
Chris Hopman 9a6e61426d Fixes to NativeMap/Array
Reviewed By: mhorowitz

Differential Revision: D3376409

fbshipit-source-id: 4efd1a8567358baf2634008af77f7e743ace849e
2016-06-02 13:43:47 -07:00
Steven Luscher 1b2d4266b9 Update `fbjs-scripts` to ^0.7.0
Summary:
`fbjs-scripts` 0.4.0 has Babel 5 as a dependency, which causes some amount of havoc when you're trying to use `react-native` in a project that's otherwise dependent on Babel 6 and using the flat-installing npm >=3.
Closes https://github.com/facebook/react-native/pull/7855

Reviewed By: frantic

Differential Revision: D3371679

Pulled By: steveluscher

fbshipit-source-id: 9f7643171d89da0de0492e7e97875f472725e990
2016-06-02 11:43:19 -07:00
Konstantin Raev 9172597019 Returned flow checks to CI
Summary: Closes https://github.com/facebook/react-native/pull/7894

Differential Revision: D3379513

fbshipit-source-id: 49290b3582ae66ea99d19ec3f490bdb4436536dd
2016-06-02 10:58:36 -07:00
Konstantin Raev 75c6bf5723 Open sourced more instrumentation tests
Reviewed By: avaly

Differential Revision: D3373926

fbshipit-source-id: da520b61c5e74d515b853cf1d9548ed3e671aa50
2016-06-02 07:13:38 -07:00
Christine Abernathy aaf557da52 Fix instructions so react-native packages are installed first
Summary:
Post React 15.x one of the files pulled in for documentation reside in that repo: NativeMethodsMixin.js

This ensures that developers install react-native packages first (which includes React) so the file can be found when it's referenced in server/extractDocs.js

**Test plan (required)**

1. Ran through the instructions.
2. Made sure http://localhost:8079/react-native/docs/nativemethodsmixin.html exists in the nav and is shows correctly.
Closes https://github.com/facebook/react-native/pull/7882

Differential Revision: D3376395

Pulled By: caabernathy

fbshipit-source-id: bfcef271516ed2b21f04d86114dfceb2ff35138c
2016-06-01 17:58:22 -07:00
Chris Hopman 886a558f75 Extract all NativeArray/NativeMap from OnLoad.cpp
Summary: These will, eventually, need to be moved to the new bridge and so must become standalone things. For *NativeArray, this is almost just moving them out into their own .h/.cpp files. The *NativeMaps are updated to be hybrids instead of countables (in addition to getting their own .h/.cpp).

Reviewed By: mhorowitz

Differential Revision: D3325169

fbshipit-source-id: 40cfcab92b3fb2310bcd4de8f39e82f85d404abd
2016-06-01 16:28:32 -07:00
Alex Kotliarskyi 0d1d7ba2b7 Remove dead SourceMap code
Summary:
In several pervious diffs we have moved symbolication of JS stack traces
to the packeger. This lets us save a bunch of memory (~80MB) and CPU on device,
reduces dependency on JS after exception occured.

This diff cleans up a bunch of code that was used to do symbolication on client side.

Reviewed By: javache

Differential Revision: D3348676

fbshipit-source-id: 88baa5c502836c9ca892896e1ee5d83db37486d3
2016-06-01 13:59:16 -07:00
Alex Kotliarskyi 2ef533352f Extract symbolicateStackTrace into its own module
Summary:
Having a function that symbolicates any given stack trace
is convenient, e.g. in #7459

More cleanup to follow.

Reviewed By: davidaurelio

Differential Revision: D3348616

fbshipit-source-id: 6313ec837869c6080829c811345a06aa1b2dcd21
2016-06-01 13:59:16 -07:00
Alex Kotliarskyi 7e100ac7a2 Extract getDevServerURL into reusable module
Summary:
Many RN devtools (inspector, source maps, etc.) rely on packager.
This refactors individual SourceCode.scriptURL parsing into one function
that will be easier to change in the future.

Reviewed By: javache

Differential Revision: D3348465

fbshipit-source-id: 5a55939ea59e1517cb63bcbe4963f57f02ab15f3
2016-06-01 13:59:16 -07:00
Martín Bigio bbc6139baf Reverted commit D3348218
Summary:
The TextInput when configured with `multiline=true` has a minor issue due to which if the initial text doesn't fit in one line, the input won't span multiple lines. The root cause of the problem is that the `onChange` event is not fired for the initial render. This issue has been reported on open-source: 481f560f64

This is an attempt to fix this problem by moving the logic to fire the event to the method that updates the content size. This way we can guarantee that anytime the content size changes we'll trigger the JS event.

The downside of this approach is that it's possible that multiple events get fired for a single character change. As per the comment that was removed, this was already happening when adding a character that when rendered, would increase the content size. By moving the code to the new place, this can happen more often (twice per character tapped). Let me know if you think this is an issue.

I don't know this code much, so please be careful reviewing. I'm happy to add more test cases I may have missed to the test plan :).

Reviewed By: nicklockwood

Differential Revision: D3348218

fbshipit-source-id: 6b457624c9126e771c326eac61cd1cdd6496671d
2016-06-01 13:38:33 -07:00
Adam Comella ee8496f364 iOS: Support HTTP headers for source prop on <Image> components
Summary:
Allows developers to specify headers to include in the HTTP request
when fetching a remote image. For example, one might leverage this
when fetching an image from an endpoint that requires authentication:

```
<Image
  style={styles.logo}
  source={{
    uri: 'http://facebook.github.io/react/img/logo_og.png',
    headers: {
      Authorization: 'someAuthToken'
    }
  }}
/>
```

Note that the header values must be strings.

Works on iOS and Android.

**Test plan (required)**

- Ran a small example like the one above on iOS and Android and ensured the headers were sent to the server.
- Ran a small example to ensure that \<Image\> components without headers still work.
- Currently using this code in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/7338

Reviewed By: javache

Differential Revision: D3371458

Pulled By: nicklockwood

fbshipit-source-id: cdb24fe2572c3ae3ba82c86ad383af6d85157e20
2016-06-01 10:43:28 -07:00
Jakob Kerkhove cec913e7ce Native propTypes RCTDatePickerIOS !== propTypes DatePickerIOS
Summary:
The propTypes of RCTDatePickerIOS do not fit with the propTypes of DatePickerIOS.
All dates (date, minimumDate, maximumDate) are a timestamp (check line 126), so they should have propType number.
OnDateChange function should not be required since it is called onChange in the iOS implementation.

The problem currently causes warnings that the given types are wrong, while they were added correctly.
Closes https://github.com/facebook/react-native/pull/7833

Differential Revision: D3371324

Pulled By: nicklockwood

fbshipit-source-id: bca5b2bbe7e9dd2e045288bfbd268578848c7bff
2016-06-01 08:58:22 -07:00
Siqi Liu 0cc0aaecbb Followup for Add Shortcut "Double R" to Reload JS in iOS
Summary: Change nit codes in comments.

Reviewed By: mkonicek

Differential Revision: D3371536

fbshipit-source-id: 4133af88568f15410ff90c945695f82ffd94eb95
2016-06-01 08:43:29 -07:00
Martín Bigio 572a85fa24 Fix multiline TextField initial render
Summary:
The TextInput when configured with `multiline=true` has a minor issue due to which if the initial text doesn't fit in one line, the input won't span multiple lines. The root cause of the problem is that the `onChange` event is not fired for the initial render. This issue has been reported on open-source: 481f560f64

This is an attempt to fix this problem by moving the logic to fire the event to the method that updates the content size. This way we can guarantee that anytime the content size changes we'll trigger the JS event.

The downside of this approach is that it's possible that multiple events get fired for a single character change. As per the comment that was removed, this was already happening when adding a character that when rendered, would increase the content size. By moving the code to the new place, this can happen more often (twice per character tapped). Let me know if you think this is an issue.

I don't know this code much, so please be careful reviewing. I'm happy to add more test cases I may have missed to the test plan :).

Reviewed By: nicklockwood

Differential Revision: D3348218

fbshipit-source-id: d3da3c0da1a0da9b9960625441191497e91d322e
2016-06-01 08:13:27 -07:00
Konstantin Raev 88190f7e9d A few instrumentation tests were fixed and are supposed to be more stable
Reviewed By: avaly

Differential Revision: D3354433

fbshipit-source-id: 4e3f00fae94e5cb910e188b0e3fbe204361a4d01
2016-06-01 08:13:27 -07:00
Emilio Rodriguez e87bea464b Replaced old password prop with secureTextEntry
Summary: Closes https://github.com/facebook/react-native/pull/7783

Differential Revision: D3371521

Pulled By: javache

fbshipit-source-id: f442b549e6fc8c2c8e5ec12f32185bfabafbdd81
2016-06-01 06:58:24 -07:00
Nick Lockwood 002024cc45 Removed hard-coded DatePicker width
Summary: The DatePicker had a hard-coded width of 320 for no reason I can think of. Removing it allows the DatePicker to naturally scale to fit the width of the container, which is how the regular Picker works already.

Reviewed By: lexs

Differential Revision: D3371355

fbshipit-source-id: e06d31f7275de41bb00226232cf47ad022d25b4d
2016-06-01 06:58:23 -07:00
Nick Lockwood bdcdfb03d4 Fixed "Sending `didSendNetworkData` with no listeners registered" warning
Summary:
XMLHttpRequest was sending the request before registering any listeners, resulting in a warning from the native event emitter.

Since we weren't seeing widespread problems with XHR missing data, this was probably working OK in practice because the queuing of events meant that the listener would have been registered before the message was actually delivered.

Still, this was working more through luck than design. This diff fixes it by registering the listeners *before* sending the request.

Reviewed By: lexs

Differential Revision: D3371320

fbshipit-source-id: c688d4053a61f856eaacccd0106905edbefcc86a
2016-06-01 06:28:22 -07:00
Konstantin Raev aa53770c25 removed unused code: _numPrependedModules
Summary:
cc davidaurelio
Closes https://github.com/facebook/react-native/pull/7873

Differential Revision: D3371406

Pulled By: javache

fbshipit-source-id: 72ed3838a88022ae5c0832dcca5abda75f18dbe1
2016-06-01 06:28:22 -07:00
Alessandro Nadalin 0e82eb3bed Update Upgrading.md
Summary:
Just updating the docs as .18 is quite old :)
Closes https://github.com/facebook/react-native/pull/7824

Differential Revision: D3371417

Pulled By: javache

fbshipit-source-id: 91b8249f814eeef68cbeff4b481624644dc7be73
2016-06-01 05:43:32 -07:00
Emil Sjolander 6603cef95c Fix ScrollView to work correctly for new css-layout
Reviewed By: sahrens

Differential Revision: D3367140

fbshipit-source-id: ea470f289c92ebca71543a9b9328a7a5ed6d572b
2016-06-01 04:28:29 -07:00
Martin Konicek 4391ef218b Tweak dev menu label: Stop Remote JS Debugging
Summary:
"Stop" is a bit clearer - the debugger is started and stopped, rather than enabled / disabled. Small difference :)

In contrast, live reloading and hot reloading are enabled and disabled.

satya164 pointed it out in [this comment](31eea8eee3 (commitcomment-17682563)) and I agree.

**Test Plan**

Ran the UIExplorer:

<img width="432" alt="screen shot 2016-05-31 at 11 11 28 pm" src="https://cloud.githubusercontent.com/assets/346214/15692439/473c26b6-2786-11e6-969a-d494067cbc3b.png">

On Android the change is kind of obvious :)
Closes https://github.com/facebook/react-native/pull/7861

Differential Revision: D3371207

Pulled By: mkonicek

fbshipit-source-id: 769288f687a98d62cf5c1a22cbc857b7dc4acf00
2016-06-01 04:13:35 -07:00
Siqi Liu 2d32a6df27 Add Shortcut "Double R" to Reload JS in iOS
Summary:
Enable double tap R on iOS, consistent with Android.
Keep the existing Cmd+R on iOS because people are already used to it.
Make Cmd+Key and Double Key both invalid when focus is in textview or textfield.
Also try to add Cmd+R in Android, but seems no good.

Reviewed By: nicklockwood

Differential Revision: D3343907

fbshipit-source-id: 68f7e3b0393711c137e1d932db33e1b6a2a19e09
2016-06-01 03:43:27 -07:00
Jim Remsik a49558def8 Documentation typo – missing word
Summary:
Adds a word to enhance readability.
Closes https://github.com/facebook/react-native/pull/7867

Differential Revision: D3370881

Pulled By: nicklockwood

fbshipit-source-id: e3555a859dd3a44f2b9d12a22d1a2366a6a8097f
2016-06-01 00:58:29 -07:00
Alexey Lang 6321ad486b Fix OSS tests
Reviewed By: bestander

Differential Revision: D3368572

fbshipit-source-id: 11326c21767bf7851d06f019c6aa2f8c16408d74
2016-05-31 16:43:27 -07:00
Fred Liu c1ab766096 Disable right-swipe from closed position
Summary: Disables right-swipe from closed position.

Reviewed By: fkgozali

Differential Revision: D3368525

fbshipit-source-id: b850458bd088dfda09bbbe4db71b33c3577a2167
2016-05-31 16:28:22 -07:00
Satyajit Sahoo d46ac110cd Use a dot before patch release number for RCs
Summary:
Using RC release versions like `0.22.0-rc.2` instead of `0.22.0.rc2` will allow NPM to pick up patch releases to the RC.
Closes https://github.com/facebook/react-native/pull/7856

Differential Revision: D3367889

fbshipit-source-id: 43aacdc8f7d13353a353b6c553e8cbcd04c34a77
2016-05-31 14:28:27 -07:00
Alexey Lang abe0b349bc Implement RCTJSCWrapper
Reviewed By: tadeuzagallo

Differential Revision: D3258713

fbshipit-source-id: 418eb9d350bf3541c976b631bd9799a1c578f5e5
2016-05-31 12:58:25 -07:00
Andrew Sardone 0f57702cd8 Enable ATS w/ localhost exception for generated iOS proj
Summary:
Building off of the work in https://github.com/facebook/react-native/pull/5290, this…

- Remove the total disabling of ATS from the react-native generated iOS project in favor of a localhost exception
Closes https://github.com/facebook/react-native/pull/5355

Differential Revision: D2837517

fbshipit-source-id: ba4b7bd2f6ba4359f5d45175944b990f9927db3b
2016-05-31 12:28:23 -07:00
Hedger Wang 69627bf914 Clean up examples.
Summary:
The recent and upcoming API refactoring works makes maintaining
the examples harder and harder.

This removes the old examples that use too much deprecated APIs such as
Reducers, Animated View.

The new examples will be forcus on using new API with all-in-one sample
codes and detailed documentation.

Reviewed By: ericvicenti

Differential Revision: D3354711

fbshipit-source-id: ac6360b1573989eb075d91cb9bf1ae8357dce7fa
2016-05-31 11:43:29 -07:00
Adam Comella 486dbe4e8f iOS: Enable views to be nested within <Text>
Summary:
Previously, only Text and Image could be nested within Text. Now, any
view can be nested within Text. One restriction of this feature is
that developers must give inline views a width and a height via
the style prop.

Previously, inline Images were supported by using iOS's built-in support
for rendering images with an NSAttributedString via NSTextAttachment.
However, NSAttributedString doesn't support rendering arbitrary views.

This change adds support for nesting views within Text by creating one
NSTextAttachment per inline view. The NSTextAttachments act as placeholders.
They are set to be the size of the corresponding view. After the text is
laid out, we query the text system to find out where it has positioned each
NSTextAttachment. We then position the views to be at those locations.

This commit also contains a change in `RCTShadowText.m`
`_setParagraphStyleOnAttributedString:heightOfTallestSubview:`. It now only sets
`lineHeight`, `textAlign`, and `writingDirection` when they've actua
Closes https://github.com/facebook/react-native/pull/7304

Reviewed By: javache

Differential Revision: D3365373

Pulled By: nicklockwood

fbshipit-source-id: 66d149eb80c5c6725311e1e46d7323eec086ce64
2016-05-31 10:28:25 -07:00
Nick Lockwood 5136d95f2c Reduce boxing overhead of arrays in uiBlockWithLayoutUpdateForRootView
Summary: The view update cycle in UIManager was relying on a bunch of boolean values boxes as NSNumbers in parallel arrays. This diff packs those values into a struct, which is more efficient and easier to maintain.

Reviewed By: javache

Differential Revision: D3365346

fbshipit-source-id: d9cbf2865421f76772c1761b13992d40ec3675f0
2016-05-31 08:43:24 -07:00
Konstantin Raev 0b6764d18e Made React version not exact again
Summary:
React is a peer dependency and apps may depend on a wider range of versions of React, so strict dependency is not a good choice.
Also `react-native init` does `npm install react` internally creating package.json with `react: ^0.15.x`, this change makes versions consistent as well.

Reviewed By: matryoshcow

Differential Revision: D3365433

fbshipit-source-id: d2810662c36129ff9af184c359ac190544db75da
2016-05-31 08:28:33 -07:00
Siqi Liu 31eea8eee3 Android Dev Menu Options Reorder and Relabel
Summary:
Just rename and rearrange the dev menu options in Android, so as to be consistent with those in iOS.

{F61192593}                          {F61192595}

{F61192594}                          {F61192597}

There are other issues to solve on the inspector and profiling in Android, so I just ignore them for now.

Reviewed By: mkonicek

Differential Revision: D3361415

fbshipit-source-id: ffa823a0c54a27f7918e4e43ecea3c845d2a2f90
2016-05-31 07:58:28 -07:00
Li Jie eb69d036d5 Log image url when image size doesn't match.
Summary:
Sometimes I got error message about image size doesn't match, but I don't know which image is wrong.

Before:
<img width="376" alt="2016-05-31 11 03 58" src="https://cloud.githubusercontent.com/assets/8459/15662148/aa4e1d7e-2720-11e6-863a-aa7dd662460b.png">

After this PR:
<img width="377" alt="2016-05-31 10 59 21" src="https://cloud.githubusercontent.com/assets/8459/15662153/b5b1fd2a-2720-11e6-9807-c7e4aa314c4b.png">

**Test plan (required)**

```
<Image source={require('image!test')} />
```
And don't add this image into project, it would report errors when run it.
Closes https://github.com/facebook/react-native/pull/7840

Differential Revision: D3365467

Pulled By: nicklockwood

fbshipit-source-id: de3d5989ef0a3c443cce557901486c4770d4e906
2016-05-31 05:28:31 -07:00
Nathan Azaria 3ccd99fb53 Added RCTBundleURLProvider
Reviewed By: javache

Differential Revision: D3352568

fbshipit-source-id: fbba6771a1c581e2676bd0f81d3da62dbf21916b
2016-05-31 04:59:56 -07:00
Emil Sjolander c2c370c886 import css-layout-185
Reviewed By: lucasr

Differential Revision: D3312496

fbshipit-source-id: 259b6db2fc0166696eb171dc6e2974c81ec2133f
2016-05-31 04:13:32 -07:00
Andrej Badin d31a54a018 Fix scrolling issue on iOS devices.
Summary:
It was not possible to scroll due to overlaying (and visually not present) docs navigation layer.

Fixes issue introduced in PR #7669, see this [comment](https://github.com/facebook/react-native/pull/7669#issuecomment-220784882)
Additionally, script makes sure only single target is "in" and closes any other target with "in" state.
Closes https://github.com/facebook/react-native/pull/7731

Differential Revision: D3344927

Pulled By: vjeux

fbshipit-source-id: b2c64d90a2a6e531a9be79b936d6a5da61a69b22
2016-05-30 20:43:27 -07:00
Andrei Coman 7914d3334d Correctly cancel network calls in catalyst instance destroy
Reviewed By: bestander

Differential Revision: D3358458

fbshipit-source-id: 69ee83ba33b02d21310030a457c6378f67e168f9
2016-05-30 05:58:23 -07:00
Ben Alpert 5571794035 Change survey image
Reviewed By: vjeux

Differential Revision: D3362968

fbshipit-source-id: f6de18a5f27e32e6bb64a65bc233d741cb276f41
2016-05-28 12:43:23 -07:00