Commit Graph

7486 Commits

Author SHA1 Message Date
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
Don Yu 031fe4d797 Move JSPackagerWebSocketClient and JSDebuggerWebSocketClient to react/devsupport module
Summary: This move lets us remove the dependency on okhttp3 from react/bridge. The classes I moved are all strictly related to dev support features and don't need to go into the core bridge module that gets shipped to production.

Reviewed By: AaaChiuuu

Differential Revision: D3698977

fbshipit-source-id: 6ba1517377061690cef289a544ec1622122cef85
2016-08-11 09:58:42 -07:00
Don Yu 6e60b1763c Strip out okhttp3 dependency from react/common module
Reviewed By: AaaChiuuu

Differential Revision: D3698882

fbshipit-source-id: 15a123b42382f11b6f88d7b0c1e12c463bb6a740
2016-08-11 09:58:42 -07:00
Aaron Chiu 541eaef4be Convert most packages to use LazyReactPackage
Reviewed By: astreet

Differential Revision: D3334261

fbshipit-source-id: 8533e3dd9395ffb2fd8c9b71a0d352fe475d1cb9
2016-08-11 08:58:36 -07:00
Felix Oghina 96e41218ed forward ThemedReactContext#has/getCurrentActivity calls to wrapped context
Summary:
`ThemedReactContext` wraps the actual `ReactContext` but doesn't actually receive any lifecycle events, which would set `mCurrentActivity`, so that's always stuck as `null`. To fix, we override `has/getCurrentActivity` and forward the call to the wrapped context, which actually has the correct lifecycle status.

Fixes issue #9310 on github.

Reviewed By: mkonicek

Differential Revision: D3703005

fbshipit-source-id: 363e87ac91d50516899b413e823d5312cbb807f4
2016-08-11 07:28:50 -07:00
Konstantin Raev f76f4cf432 Fixed trunk: added jsr-330
Summary: Closes https://github.com/facebook/react-native/pull/9346

Differential Revision: D3702977

Pulled By: foghina

fbshipit-source-id: b9c1285b6cc84daf31a883aef0a30282ad052fbd
2016-08-11 04:43:38 -07:00
Felix Oghina eb3360b02a fix all eslint errors/warnings in AnimatedImplementation.js
Summary: It was bothering me.

Reviewed By: davidaurelio

Differential Revision: D3690646

fbshipit-source-id: 50551f0bc4e879c36a262e923649745377ff0e2f
2016-08-11 04:28:30 -07:00
leeight 4963a37e80 Move `getLaunchOptions` from ReactActivity to ReactActivityDelegate
Summary:
After 3c4fd42749, `getLaunchOptions` no longer exists in class `ReactActivity`.
We need refactor UIExplorerActivity to fix the build error.
Closes https://github.com/facebook/react-native/pull/9320

Differential Revision: D3696381

Pulled By: astreet

fbshipit-source-id: 5700cf2363029a95cfbdaf6230e4f82ea69fb472
2016-08-11 04:13:40 -07:00
Alexander Jarvis 7cdd4c9a75 Fix image source prop change updating image
Summary:
fixes #7795
fixes #8500

Motivation: When having a simple button that changes the Image source when tapped, the image doesn't change (or at least sometimes, intermittently it works).

This was found to be an issue where the request was being sent to the native layer correctly but then being subsequently cancelled by the `reactSetFrame: method`  ...
Closes https://github.com/facebook/react-native/pull/9137

Differential Revision: D3702867

Pulled By: javache

fbshipit-source-id: c89ce6b841179394b6b23850b3128751ef9e0313
2016-08-11 03:28:40 -07:00
Emil Sjolander 656f9f4b9d Use modern initializer syntax instead of comments
Reviewed By: adamjernst

Differential Revision: D3698569

fbshipit-source-id: c92b18540140662979cf001aeedaa76504c6a3ac
2016-08-11 02:58:31 -07:00
Tim Yung 1a37527606 JS1: Bump `sane` Dependency Version
Reviewed By: jingc

Differential Revision: D3700427

fbshipit-source-id: caa444d0be352a28e18339c1e35037a6b9ee622c
2016-08-10 17:28:33 -07:00
Aaron Chiu 1feb462f44 Add LazyReactPackage
Summary:
LazyReactPackage is an extension of ReactPackage that allows us to lazily construct native modules.
It's a separate class to avoid breaking existing packages both internally and in open source.

Reviewed By: astreet

Differential Revision: D3334258

fbshipit-source-id: e090e146adc4e8e156cae217689e2258ab9837aa
2016-08-10 17:13:27 -07:00
Mani Ghasemlou dba1ce46bf Android: Setting numberOfLines to 0 behaves differently than on iOS.
Summary:
**Motivation**

For the `Text` component, if `numberOfLines` is set to `0`, the behavior on iOS is such that there is no limit.

On Android, the behavior is such that `numberOfLines={0}` will not render the `Text` component.

Since we want behavior to be the same across platforms, this change will make sure Android behaves the same as iOS.

**Test Plan**

Create a `Text` component specifying `numberOfLines={0}` on an Android project.

Expected:
- `Text` component displays, with no limit to number of lines.

Result:
- `Text` component does not appear at all.
Closes https://github.com/facebook/react-native/pull/9188

Differential Revision: D3697115

fbshipit-source-id: c1768ac22bab3c0e41a9df38b7314f3201512eb2
2016-08-10 14:58:31 -07:00
Kellie Medlin 2bd1f627ea Test building with clang 3.9
Reviewed By: compnerd

Differential Revision: D3667327

fbshipit-source-id: f3ad04360068ee26aeec6f1c2dbe0ed96ba32ad0
2016-08-10 13:13:34 -07:00