Commit Graph

7499 Commits

Author SHA1 Message Date
Paul O'Shannessy 7655e537ed Upgrade to React v15.3.1-rc.2
Reviewed By: spicyj, sebmarkbage

Differential Revision: D3720586

fbshipit-source-id: c739762a2c263b7dd0c321311e4c173e9dcacfcf
2016-08-16 11:28:32 -07:00
Mehdi Mulani e9d6f29b64 Don't allow unsetting a region in RCTMapView
Reviewed By: javache

Differential Revision: D3723065

fbshipit-source-id: c922d03fa6c2a696b2ec00965b17b7215060aee5
2016-08-16 10:59:03 -07:00
Jonathan Chen 7ca3764eae Fix Wikipedia link
Summary:
The end of the Wikipedia link has a parenthesis, which was incorrectly used as end of markdown format for link.
Closes https://github.com/facebook/react-native/pull/9429

Differential Revision: D3722972

Pulled By: javache

fbshipit-source-id: af00f0291f00c6f2bf9bfeb7555fecd957cc6925
2016-08-16 09:58:45 -07:00
Martin Konicek 700574fe76 Use an ES6 class in ListView docs
Reviewed By: mkonicek

Differential Revision:
D3723141
Ninja: docs only

fbshipit-source-id: e1030f85b524777d2efbedb3cf78c218c34bad88
2016-08-16 09:58:45 -07:00
Emil Sjolander fc5bed8693 Support 64 bit platforms
Reviewed By: davidaurelio

Differential Revision: D3722479

fbshipit-source-id: c132f24c92c8476b328713861ad30670a43040c4
2016-08-16 08:58:53 -07:00
Felix Oghina af2bb20893 make main component name nullable
Summary: Sometimes the main component name is not known at activity construction time and depends on e.g. reading shared preferences. To support this use case, make `(Fragment)ReactActivity#getMainComponentName()` nullable and return `null` by default. In this case, the app will not be loaded in `onCreate` by default and the user has to call `loadApp` manually once the component name is known.

Reviewed By: andreicoman11

Differential Revision: D3722517

fbshipit-source-id: 062eed158798606e4160f1c142b23fd98ca618c8
2016-08-16 07:43:31 -07:00
Pieter De Baets 2f78852411 Fix warning on unused return values in RCTSRWebSocket
Summary:
Assert that the return value of these methods is sane.

Closes https://github.com/facebook/react-native/issues/8108

Reviewed By: majak

Differential Revision: D3722629

fbshipit-source-id: 2a67daae6dc380721e5dad27acd2ab67f71d0c6c
2016-08-16 07:28:28 -07:00
Charles Dick 1199c5ade9 Add function name, url, line, column to heap capture
Reviewed By: bnham

Differential Revision: D3703012

fbshipit-source-id: 8e15deeeabe15da2a87a71c2baf0fa72d5bc6568
2016-08-16 06:59:06 -07:00
Emil Sjolander 30847b2b35 Fix parameter order
Differential Revision: D3722391

fbshipit-source-id: 9adaf7b80d7bad93887a122c10eb06159a5189c2
2016-08-16 05:58:34 -07:00
Andrei Coman 35d60ecac8 Reinstate view example for screenshot tests
Reviewed By: javache

Differential Revision: D3716630

fbshipit-source-id: 07381f0afe541d0bfea8de6a719d0fa176ccbc3f
2016-08-16 04:58:30 -07:00
Alon Schwarz 862b6570ee Add 'center' to the allowed values in Android Image.resizeMode proptype
Reviewed By: foghina

Differential Revision: D3703258

fbshipit-source-id: fc2546a8c2e595ec51416f3453a12d087cc68515
2016-08-16 04:15:03 -07:00
JRK dd6370fed2 Ask for device when using adb with run-android
Summary:
Sometimes adb see many devices (see: http://puu.sh/qoASz/c13f010dd0.jpg) and it can't `adb reverse` because of that (see: http://puu.sh/qoAR1/8412dfe25a.jpg)

So I've added the possibility to choose a device when you `run-android` your app.

Final result: http://puu.sh/qoB12/329d5c27db.jpg
Closes https://github.com/facebook/react-native/pull/9190

Differential Revision: D3719050

fbshipit-source-id: 269cf8507e067218880aa1e0c0e0e625228e25b5
2016-08-16 00:58:26 -07:00
Muraleekrishna c7d0bc73c2 Fix documentation inconsistancy with flexbox alignItems default value
Summary:
As per mozilla docs alignItems already has made `stretch` as default
value

https://developer.mozilla.org/en-US/docs/Web/CSS/align-items.

This resolves issue https://github.com/facebook/react-native/issues/8920
Closes https://github.com/facebook/react-native/pull/9397

Differential Revision: D3718410

fbshipit-source-id: 6c747396fd06652e17cb21a79b0dfa513841cabd
2016-08-15 20:28:30 -07:00
Sriram Ramasubramanian dcef202aab Pass in the locale identifier from Android
Reviewed By: AaaChiuuu, achen1

Differential Revision: D3668583

fbshipit-source-id: f34b6e24d9ff4fa044d24f4133c9c85564a3f00f
2016-08-15 18:28:40 -07:00
Ian MacLeod 02557d2cfe Accept children of all types for NavigationHeaderTitle
Summary:
`<Text>` accepts more than just string as its children; and it's handy to be able to style nav titles without a proptype warning throwing
Closes https://github.com/facebook/react-native/pull/8338

Differential Revision: D3719045

fbshipit-source-id: a02d181b5e133dbe467fbaca794f0d2119be2da7
2016-08-15 18:13:30 -07:00
Lloyd d20918319a Update docs to use correct import statement
Summary:
Docs currently contain incorrect example code.
React should be imported from react since https://github.com/facebook/react-native/releases/tag/v0.25.1
Closes https://github.com/facebook/react-native/pull/9418

Differential Revision: D3719742

Pulled By: hramos

fbshipit-source-id: 0d6a9cc8900c534e92ffe1f7883f81079934a6e0
2016-08-15 15:58:40 -07:00
Ben Nham 53c5c4f8c3 Rename custom JavaScriptCore.framework to JSC.framework
Reviewed By: michalgr

Differential Revision: D3709748

fbshipit-source-id: bc2a7124127944c5d24e584747074065eefa1207
2016-08-15 15:13:40 -07:00
David Aurelio f8ce2f9f70 remove unused property
Reviewed By: matryoshcow

Differential Revision: D3717515

fbshipit-source-id: 5ecba83367cd11b19b56d19edf72efe9db717e2b
2016-08-15 12:43:31 -07:00
Héctor Ramos 35a6cbac71 San Francisco React Native meetup recap
Summary:
New blog up up for review. I've added a bit of padding between posts in the blog index as well.
Closes https://github.com/facebook/react-native/pull/9362

Differential Revision: D3717908

Pulled By: bestander

fbshipit-source-id: ac3c01c43685548c6fa336541ccb9a9a01dd52a8
2016-08-15 12:28:46 -07:00
Andrew Y. Chen 506e1b1c6d Update the native CLC for relay queries
Reviewed By: yuzhi

Differential Revision: D3529747

fbshipit-source-id: e14ccd1d3f58dd2152f9782c7b0844747c4b81c7
2016-08-15 12:13:45 -07:00
James Ide 8eed600d5b Define Flow types for style and stylesheet objects, more checking
Summary:
- Define a Styles type for the object that gets passed into StyleSheet.create
- Define a StyleSheet type that is returned from StyleSheet.create
- Clean up the type declarations in StyleSheet.create
Closes https://github.com/facebook/react-native/pull/8882

Differential Revision: D3587964

Pulled By: gabelevi

fbshipit-source-id: 629e0176484436848be69b1417638e1200a3669a
2016-08-15 10:43:34 -07:00
Felix Oghina 5ee70415bc add oss-based fb activity and host classes
Reviewed By: andreicoman11

Differential Revision: D3655436

fbshipit-source-id: 3ca6535cd819171867c79f5e9801d9013676a80f
2016-08-15 09:43:40 -07:00
Emil Sjolander f7a22bc33c Use single function for margin, position, padding, and border
Reviewed By: lucasr

Differential Revision: D3715201

fbshipit-source-id: ea81ed426f0f7853bb542355c01fc16ae4360238
2016-08-15 09:28:41 -07:00
Emil Sjolander 0ea4198009 Add support for flex-grow, flex-shrink, and flex-basis
Reviewed By: lucasr

Differential Revision: D3714520

fbshipit-source-id: 80d3a9a1e2b6f74b863bbe22357f2c9865fa290e
2016-08-15 09:28:41 -07:00
Emil Sjolander 451cc2dee7 Use library style imports
Reviewed By: IanChilds

Differential Revision: D3714512

fbshipit-source-id: 4c42d52b3ab92903e9e9451df0ca1564e2d33f0f
2016-08-15 09:28:41 -07:00
Emil Sjolander 043a6cd2c1 Update clang-format rules
Reviewed By: IanChilds

Differential Revision: D3714510

fbshipit-source-id: f6d0436346416aab023aacbedd70ea189e583e8d
2016-08-15 09:28:41 -07:00
Mani Ghasemlou 8095707938 store borderColor in a non lossy way
Summary:
Fix for issue #3652 -

Converting from `int` to `float` is lossy for very large numbers, so storing `borderColor` as a single `Spacing` object (which uses `float`) was not working for certain colors.

So, this pull request splits `borderColor` into alpha and RGB components, and stores each of these as their own respective `Spacing` objects.

*Test Plan*

Check out cosmith sample code here that triggers the bug: https://rnplay.org/apps/l1bw2A

What currently looks like this:

<img width="548" alt="screen shot 2016-08-13 at 6 22 28 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645965/9346f05e-6183-11e6-8d40-3e458b08fd9a.png">

Should look like this (with my fix applied):

<img width="543" alt="screen shot 2016-08-13 at 6 20 08 pm" src="https://cloud.githubusercontent.com/assets/1630466/17645968/9c26d1d0-6183-11e6-8759-75a5e99f498a.png">
Closes https://github.com/facebook/react-native/pull/9380

Differential Revision: D3716707

Pulled By: foghina

fbshipit-source-id: 1164378112e2a58d43c8f5fc671c2efdb64b412b
2016-08-15 09:13:28 -07:00
David Aurelio 8240339dca Clear bundles for potential dependency resolution changes
Summary:
This clears the packager server cache for potential changes of module resolutions.
We will make this a lot better in the future, but for now this crude mechanism will have to do.

Reviewed By: cpojer

Differential Revision: D3713143

fbshipit-source-id: 7c81f40e8ec71404c3369211b29f63928d6634b9
2016-08-15 08:43:34 -07:00
Connor McEwen 0fb2ccfcc3 Add JS library for requesting Android M Permissions
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

The Android permissions native module was open sourced recently (b7352b4667) but it is currently undocumented and requires directly interfacing with the native module.

This provides a JS wrapper to make it easier to use the permissions module and documents it.

This could be cleaner if the native code used Promise blocks instead of callbacks, but I didn't want to change the native code without a thumbs up since I'm guessing this is used in one of facebook's apps. Happy to do that if it makes sense

I also tried to make the `PERMISSIONS` object a class property - it works in the actual code but not in the documentation (think it's a jsdocs problem), so decided to initialize in the constructor.

**Test plan (required)**

If the API looks good, I will change the UIExplorer example to use this.

cc andreicoman11
Closes https://github.com/facebook/react-native/pull/9292

Differential Revision: D3716303

Pulled By: andreicoman11

fbshipit-source-id: cd40b8757fdf70ea8faecfb58caa00e99a99789e
2016-08-15 05:58:33 -07:00
Edward Delaporte 1a683fa5e8 Warn about long run time of init.
Summary:
I, like many before me, had to Google why react-native init appeared to hang the first time I tried it.

It turns out it can just take a really long time, but does not give any warning of this fact.

This patch provides such a warning.
Closes https://github.com/facebook/react-native/pull/9406

Differential Revision: D3716357

Pulled By: bestander

fbshipit-source-id: 6a460c881a20b9edb1bd1c8c5df09e5a7e5020ed
2016-08-15 04:43:51 -07:00
David Aurelio 5df9c67351 Make reloads faster for simple file changes
Summary:
This is a very hacky solution to make reloads from packager faster for simple file changes.

Simple means that no dependencies have changed, otherwise packager will abort the attempt to update and fall back to the usual rebuilding method.

In principle, this change avoids re-walking and analyzing the whole dependency tree, and just updates modules in existing bundles.

Reviewed By: bestander

Differential Revision: D3713704

fbshipit-source-id: ba182325c4f4003c0a7402ea87444a94c75ebaf8
2016-08-15 04:43:49 -07:00
Hedger Wang d600367715 NavigationExperimental: Add documentation for NavigationCardStack
Summary: Add documentation for NavigationCardStack

Reviewed By: ericvicenti

Differential Revision: D3685319

fbshipit-source-id: 6cd62195a434b3a7ed6b9cdca6fbd17212160ee2
2016-08-14 23:28:51 -07:00
Hedger Wang 3a8c302ae8 NavigationExperimental: Add documentation for NavigationStateUtils.
Summary: Add docs to NavigationStateUtils.

Reviewed By: ericvicenti

Differential Revision: D3679295

fbshipit-source-id: 26fc1e4f39af58e11572b74b150e08b3094e36c6
2016-08-14 23:13:23 -07:00
Steven Leiva e106a4f094 Change Networking examples to use HTTPS.
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/9388

Differential Revision: D3715004

fbshipit-source-id: c12abcdd54ae1176aaf666eed520b85e2f8db6bd
2016-08-14 02:30:08 -07:00
Felix Oghina fbd2e13910 Add Activity to onActivityResult listener interface
Summary:
The Android lifecycle is weird: turns out `onActivityResult` is called before `onResume`. This means `getCurrentActivity()` could return the wrong instance, or `null` if the activity was destroyed. To give developers access to the Activity receiving the result (which is also about to become the current activity), pass it as an argumento the listener.

Fixes github issue #8694.

Reviewed By: donyu

Differential Revision: D3704141

fbshipit-source-id: e7e00ccc28114f97415e5beab8c9b10cb1e530be
2016-08-13 08:44:12 -07:00
Ben Nham d22003a0de dynamically load JavaScriptCore with RTLD_LOCAL option
Reviewed By: tadeuzagallo

Differential Revision: D3703415

fbshipit-source-id: c67865b7fe75c21a3b620dc3a794b5a0005cf71e
2016-08-13 03:31:08 -07:00
Eric Vicenti de9d22ee7e Ensure NavigationTransitioner props.onTransitionEnd happens after scene cleanup
Summary:
We only want to call onTransitionEnd after the transition has fully completed, including scene cleanup.

This will help avoid race conditions when we start new navigation after a transition completes.

Reviewed By: fkgozali

Differential Revision: D3712235

fbshipit-source-id: 146f30a0caf3d2fe164285fbef12293b7b161c6e
2016-08-12 17:13:37 -07:00
Jing Chen 5b040a52c4 Reverted commit D3703896
Summary:
This is a very hacky solution to make reloads from packager faster for simple file changes.

Simple means that no dependencies have changed, otherwise packager will abort the attempt to update and fall back to the usual rebuilding method.

In principle, this change avoids re-walking and analyzing the whole dependency tree, and just updates modules in existing bundles.

Reviewed By: bestander

Differential Revision: D3703896

fbshipit-source-id: abc2a41144536baf969d346522a17044c1c9558b
2016-08-12 16:58:26 -07:00
Don Yu d16c676262 Remove unused okhttp dependency from cxxbridge module
Summary: This dependency on okhttp is unused. Removing this to lower the method-count increase from including the core RN modules.

Reviewed By: AaaChiuuu

Differential Revision: D3711870

fbshipit-source-id: 54b92edb4a55140b33cc74a5e9270650ced56ab9
2016-08-12 16:28:28 -07:00
Aaron Chiu 705daabbb1 Reverted commit D3334273
Reviewed By: astreet

Differential Revision: D3334273

fbshipit-source-id: a3849604ea89db74900850c294685e7da9aeeacc
2016-08-12 15:58:31 -07:00
Adam Miskiewicz 757ab0b936 Add `--config` option to CLI to allow passing a path to an `rn-cli.config.js`
Summary:
Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js.

cc ide
Closes https://github.com/facebook/react-native/pull/7883

Differential Revision: D3382823

Pulled By: bestander

fbshipit-source-id: b946f3bb355050fc2fe99273d0e99e441dbed111
2016-08-12 11:58:33 -07:00
David Aurelio 3f504ec147 Make reloads faster for simple file changes
Summary:
This is a very hacky solution to make reloads from packager faster for simple file changes.

Simple means that no dependencies have changed, otherwise packager will abort the attempt to update and fall back to the usual rebuilding method.

In principle, this change avoids re-walking and analyzing the whole dependency tree, and just updates modules in existing bundles.

Reviewed By: bestander

Differential Revision: D3703896

fbshipit-source-id: 671206618dc093965822aed7161e3a99db69a529
2016-08-12 09:43:27 -07:00
ColCh 8edb952403 make fsop timeout injectable
Summary:
We have a weak build machine for React Native app: a poor Mac Book Air with HDD, which is very slow.

So, fs operations sometimes fail because of timeout.

We likely don't care about build time, but it's pretty annoying to restart builds sometimes.

In this PR I make timeout injectable via environment variable.

__USAGE__:
export this variable into environment. It's measured in miliseconds.
Example, for 1 minute timeout:
`export REACT_NATIVE_FSOP_TIMEOUT=60000`

If you don't specify it, it will remain default value: `15000`

This should not break anything, but repair slow builds.

Related to : #9373 , #8794 (I think so)

This PR should handle case of issue and close #9373
Closes https://github.com/facebook/react-native/pull/9374

Differential Revision: D3709325

Pulled By: bestander

fbshipit-source-id: b00c89e10d05362314546faea7a4524f3d327c97
2016-08-12 07:28:38 -07:00
Pieter De Baets ad677426cf Cleanup clear/set/throwImmediate
Reviewed By: vjeux

Differential Revision: D3703300

fbshipit-source-id: ad03d558d6af61aba17899ec256d71fdda4c4c84
2016-08-12 07:28:38 -07:00
Emil Sjolander c2a41e42f2 Expose alignContent to java
Reviewed By: IanChilds

Differential Revision: D3709071

fbshipit-source-id: 421d75924ecc12d6d0975e342f3862cf5592f65f
2016-08-12 04:28:34 -07:00
Ben Nham ce2f119222 fix loading of dynamic linked JavaScriptCore on iOS simulator
Reviewed By: michalgr

Differential Revision: D3703392

fbshipit-source-id: 670185de1eefd1c542de2df96e40aede3b2c12cc
2016-08-11 18:43:27 -07:00
Janic Duplessis 0e204e1141 Add support for value listener
Summary:
Adds support for `Animated.Value#addListener` for native driven animated values. Same as #8844 but for iOS. This depends on some JS code in #8844 so only review the 2nd commit and let's wait for #8844 to land first.

**Test plan**
Tested using the UIExplorer example.
Closes https://github.com/facebook/react-native/pull/9194

Differential Revision: D3681749

fbshipit-source-id: 521a61e2221c1ad1f6f40c75dd2dc957361d0271
2016-08-11 18:13:31 -07:00
Jacob Parker 68d483e041 Centre text in case where the distance between baselines is larger th…
Summary:
…an the font size (per CSS spec)

Extending upon work https://github.com/facebook/react-native/pull/7603
Closes https://github.com/facebook/react-native/pull/8851

![screen shot 2016-08-04 at 14 49 21](https://cloud.githubusercontent.com/assets/7275322/17404165/bd67bc48-5a52-11e6-9ba1-5a8524f18867.png)
![screen shot 2016-08-04 at 14 49 24](https://cloud.githubusercontent.com/assets/7275322/17404167/be5f4044-5a52-11e6-9014-391349f9c5e1.png)
Closes https://github.com/facebook/react-native/pull/9211

Differential Revision: D3706347

fbshipit-source-id: 0adfff8e8418b02f9b5d6671f5c89669e41abec3
2016-08-11 16:58:33 -07:00
Aaron Chiu c64213653e Convert modules to use @ReactModule instead of getName()
Reviewed By: astreet

Differential Revision: D3334273

fbshipit-source-id: a33bf72c5c184844885ef3ef610a05d9c102c8ea
2016-08-11 15:58:43 -07:00
Felix Oghina 9965642ebc Fix docs generation
Summary: Docs generator can't handle arrow functions as class members, resort to old-style function & bind in constructor.

Reviewed By: bestander

Differential Revision: D3703698

fbshipit-source-id: 894e2ba3686cbda437d186c913979b2f1170fe34
2016-08-11 12:13:28 -07:00