Commit Graph

7447 Commits

Author SHA1 Message Date
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
tfallon@mail.depaul.edu c6b6f53ae7 Initial implementation of adjustsFontSizeToFit.
Summary: Closes https://github.com/facebook/react-native/pull/4026

Differential Revision: D2678492

Pulled By: nicklockwood

fbshipit-source-id: 0467814f810fee997ac50960ffb1daa74d52acba
2016-08-10 11:28:37 -07:00
Pieter De Baets 6775d1f136 Set property ivar for shadow view frame
Reviewed By: emilsjolander

Differential Revision: D3683649

fbshipit-source-id: d818cb0eea064baca99be2bc6edf1b61b90bb64b
2016-08-10 10:58:49 -07:00
Pieter De Baets 4afaf5e538 Fix RCTRootView invalidation using the wrong bridge
Reviewed By: majak

Differential Revision: D3696533

fbshipit-source-id: e7ef4373e975e585f4c34df71966c8b5b30d3e9a
2016-08-10 07:43:33 -07:00
Dan Caspi 0cc3b4b079 Fixes to jscProfilerMiddleware
Reviewed By: bnham

Differential Revision: D3691098

fbshipit-source-id: dbadda69ff0b6a8d9d349b33c45234ff4f8c3b65
2016-08-10 06:43:51 -07:00
Emil Sjolander c74938e72e Use spacing for position
Differential Revision: D3690235

fbshipit-source-id: 4c04952e6ded32fd5fbfdccf63736cf025ae470e
2016-08-10 05:13:30 -07:00
Ben Nham 94ac3e4d08 fix static jsc build for ios
Reviewed By: dcaspi

Differential Revision: D3693192

fbshipit-source-id: dca500262e698e02c27c840e74c421ec6bc006fe
2016-08-10 04:28:26 -07:00
Eric Vicenti 6c4d3c39c6 Remove shouldComponentUpdate policy from NavigationCard and NavigationCardStack
Summary:
The `shouldComponentUpdate` policies were meant to be a built-in optimization, but it prevents rendering at unexpected times, which has been causing confusion. Apps can use normal react optimization techniques to avoid extra rendering- Navigation will no longer attempt to optimize the render tree

Addresses https://github.com/facebook/react-native/issues/7720

Reviewed By: hedgerwang

Differential Revision: D3649735

fbshipit-source-id: 9461620445a6a57a1635113df7ec4026c0d6b9d2
2016-08-09 20:28:30 -07:00
Mengjue Wang 380830e4aa Add `isPrefSet` and `setPref` to make I18nUtil cleaner
Summary: Add `isPrefSet` and `setPref` function to make I18nUtil cleaner

Reviewed By: fkgozali

Differential Revision: D3684958

fbshipit-source-id: 96f51d495d700d46096dc162c7599bc51a0b37cd
2016-08-09 18:58:47 -07:00
Jhen f89f09f14c Fix tabs in project.pbxproj of iOS template
Summary:
Should be `tab` instead of `space`.
Closes https://github.com/facebook/react-native/pull/9317

Differential Revision: D3691795

fbshipit-source-id: 812c63d16ab56ed943949026a11dfb172de5e3ed
2016-08-09 13:28:19 -07:00
Evgueni Naverniouk e2aa237cfe Minor doc improvements in Debugging.md
Summary:
As per: https://github.com/facebook/react-native/pull/9276#issuecomment-238153756

Minor clarity and styling improvements for Debugging.md for the "Stetho" section

No test changes required.
Closes https://github.com/facebook/react-native/pull/9303

Differential Revision: D3690557

Pulled By: hramos

fbshipit-source-id: f5ce13d96884f1c11836b278697d2815f40c5216
2016-08-09 11:13:30 -07:00
David Aurelio a5678983bb Fix building without writing a source map
Reviewed By: bestander

Differential Revision: D3690117

fbshipit-source-id: f162352c09c4c2a387a9414dbd7da55b86551ee3
2016-08-09 09:43:26 -07:00
Jacob Parker f951da912d Add iOS support for CSS property font-variant, accepting tabular-nums…
Summary:
Ground work for allowing `font-variant`s. Currently allows switching between `tabular-nums` and `proportional-nums`. I will need guidance on how to test this, and a few pointers on code style (new to Objective C, and had to make one or two hacks).
Closes https://github.com/facebook/react-native/pull/9045

Reviewed By: majak

Differential Revision: D3664338

Pulled By: javache

fbshipit-source-id: 032f326c37ee6150348da2b33b6a3fc1988e8920
2016-08-09 08:43:34 -07:00
funorpain ced272d906 Android: TicTacToe Example Project
Summary:
**Motivation**

Android project for TicTacToe example is missing.

**Test plan (required)**

Open Android Studio and run TicTacToe-android-app. It builds and runs as expected.
Closes https://github.com/facebook/react-native/pull/8918

Differential Revision: D3684375

Pulled By: foghina

fbshipit-source-id: cd4112467179d3d334cab198d817ed8b5b32599b
2016-08-09 07:58:30 -07:00
Konstantin Raev 52e771dc2f Reduced precision in bezier test
Summary:
This should not happen again:

Summary of all failing tests
 FAIL  Libraries/Animated/src/__tests__/bezier-test.js (0.259s)
● bezier › symetric curves › it should have a central value y~=0.5 at x=0.5
  - Error: expected '0.5015953397493733' to be close to '0.5' with 3-digit precision
        at assertClose (Libraries/Animated/src/__tests__/bezier-test.js:9:11)
        at Libraries/Animated/src/__tests__/bezier-test.js:84:1
        at Libraries/Animated/src/__tests__/bezier-test.js:28:22
        at Object.<anonymous> (Libraries/Animated/src/__tests__/bezier-test.js:81:11)
Closes https://github.com/facebook/react-native/pull/9316

Differential Revision: D3690223

Pulled By: davidaurelio

fbshipit-source-id: 3ee0a283206680203a8b685d4ee5a430ef821704
2016-08-09 07:43:51 -07:00
David Aurelio 94666f16c7 Auto-fix lint errors
Reviewed By: bestander

Differential Revision: D3683952

fbshipit-source-id: 9484d0b0e86859e8edaca0da1aa13a667f200905
2016-08-09 06:43:46 -07:00
Rickard Ekman 8e2906ae89 Android: Implement cancelable option for Alerts
Summary:
**Motivation**
In iOS you cannot dismiss alerts by clicking outside of their box, while on Android you can. This can create some inconsistency if you want to have identical behavior on both platforms. This change makes it possible for Android apps to have irremovable/required alert boxes just like in iOS.

This adds an additional parameter to the Alert method. The way to use it is by providing an object with the cancelable property. The cancelable property accepts a boolean value.

This utilizes the Android DialogFragment method [setCancelable](https://developer.android.com/reference/android/app/DialogFragment.html#setCancelable(boolean))

**Usage example**
```js
Alert.alert(
   'Alert Title',
   null,
   [
     {text: 'OK', onPress: () => console.log('OK Pressed!')},
   ],
   {
     cancelable: false
   }
);
```

**Test plan (required)**

I added an additional alert to the UIExplorer project where it can be tested. I also added a part in the Dialog Module test to make sure setting canc
Closes https://github.com/facebook/react-native/pull/8652

Differential Revision: D3690093

fbshipit-source-id: 4cf6cfc56f464b37ce88451acf33413393454721
2016-08-09 06:13:48 -07:00
Richard Evans 44b3cfe6bf Add rmevans9 to Github Issue Task Force
Summary:
Simply adding myself to the Github Issue Task Force so I can help out closing, tagging or whatever is needed for the issues.

Thanks!
Closes https://github.com/facebook/react-native/pull/9311

Differential Revision: D3690115

fbshipit-source-id: feb063df4f7d811e36d0d03dfad395e069d5b142
2016-08-09 05:58:28 -07:00
Felix Oghina 750a46a12e remove extraneous warning
Reviewed By: astreet

Differential Revision: D3690014

fbshipit-source-id: 353a40aafc6a6e9f777ac80937713e1abb9cecc5
2016-08-09 05:29:16 -07:00
Adrian Paul Matos 8af6aefd54 Fix alert's error message
Summary:
`error` is not an object so `error.message` will return 'undefined'
Closes https://github.com/facebook/react-native/pull/9271

Differential Revision: D3689980

Pulled By: javache

fbshipit-source-id: 07de946f04cdff0e8013faa2c5512c51c82147b9
2016-08-09 04:43:34 -07:00
Emil Sjolander 1227675e0a Expose methods to set position Start|End
Differential Revision: D3669177

fbshipit-source-id: b06f382cb89546e817a2475298cf2cad17d95a2c
2016-08-09 04:28:53 -07:00
Charles Dick c43c80bd7c fix error handling in react native heap capture server middleware
Reviewed By: bnham

Differential Revision: D3684092

fbshipit-source-id: 1856fa4c04a173e1df49dfe17ebef09a066447e5
2016-08-09 04:28:53 -07:00
Felix Oghina e6b850871b flow autofix AnimatedImplementation.js
Reviewed By: davidaurelio

Differential Revision: D3683918

fbshipit-source-id: af402bcd61872667b82a25c1e6614c6ae74e2097
2016-08-09 04:28:53 -07:00
Felix Oghina b7903e4f96 fix method overriding when using native animations
Reviewed By: davidaurelio

Differential Revision: D3683921

fbshipit-source-id: 8be9437c1f2625c69d0e07142010494a01f52005
2016-08-09 04:13:46 -07:00
Pieter De Baets 335132ad63 Fix some analyzer warnings
Reviewed By: majak

Differential Revision: D3683672

fbshipit-source-id: 879578b050186bc779d01a17822d41bf7e473123
2016-08-09 03:58:36 -07:00
Pieter De Baets 910d0e1d8b Have React only as a peer dependency
Reviewed By: davidaurelio

Differential Revision: D3683793

fbshipit-source-id: 6ffb8c24e81cfb33b11b9f99d440220287161fb6
2016-08-09 03:58:36 -07:00
Aaron Chiu 0561336ae4 Add @ReactModule annotation
Reviewed By: astreet

Differential Revision: D3310686

fbshipit-source-id: ec2dc7fdf2dfbb3eedde667d7228fc3241860e35
2016-08-09 01:58:55 -07:00
David Aurelio 24236a8926 Strip down asset data
Summary: This removes asset data that is not used at runtime from the bundle.

Reviewed By: javache

Differential Revision: D3628486

fbshipit-source-id: 33cd579c904e0b0e29502df39a4ff92cad43367c
2016-08-08 18:28:49 -07:00
David Aurelio 6ead260508 don't use full path to source map in bundles
Summary: This shortens the source map URL to its basename for bundles built via the command line API. This makes builds reproducible across different file system locations.

Reviewed By: michalgr

Differential Revision: D3684263

fbshipit-source-id: 2d5fdb5c5d0aa229f5a85465b2d1919f54e33d55
2016-08-08 18:28:48 -07:00
Roshan Jossey 915345bd01 Fix memory leak bug in RCTModalHost
Summary:
This PR addresses issue #9265.

Negated the condition that checks if `_hostViews` exists so that `_hostViews` will be allocated only if it doesn't exist
Closes https://github.com/facebook/react-native/pull/9295

Differential Revision: D3686214

fbshipit-source-id: ec0caac99d231786eefad023f3f0ed44a79f687e
2016-08-08 15:58:33 -07:00
nuhbye 55b76b1798 Update example link to new link.
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/9289

Differential Revision: D3684467

Pulled By: hramos

fbshipit-source-id: 625b01f1e21c526048832d2c4af0d37f02fed44e
2016-08-08 10:28:27 -07:00
Felix Oghina 3c4fd42749 add ReactFragmentActivity, share delegate with ReactActivity
Summary: Add FragmentActivity-based ReactFragmentActivity to support apps using the v4 support lib. Add delegate class to share implementation details between the new class and ReactActivity.

Reviewed By: astreet

Differential Revision: D3655428

fbshipit-source-id: d3ff916538e13b6f0d594bbb91555e322645e954
2016-08-08 09:13:53 -07:00
Felix Oghina 0b5c61250b check lifecycle event is coming from current activity
Summary:
If a paused activity is destroyed (e.g. because of resource contention), we send onHostDestroyed to all modules even if there's an on-screen, resumed activity using the current react instance.

This diff adds a check to make sure lifecycle events come from the current activity, and ignores ones that don't.

Reviewed By: astreet

Differential Revision: D3655422

fbshipit-source-id: 0f95fda124df3732447853b9bc34c40836a4b1da
2016-08-08 09:13:53 -07:00
Felix Oghina 46dc46a3b3 clear mCurrentActivity in onHostDestroy
Summary: It doesn't make sense to clear mCurrentActivity in onHostPause -- we're not going to leak a paused activity. Only keeping it around after onDestroy could lead to leaks. This allows us to check the source of lifecycle events and only send them if they come from the current activity (upcoming diff).

Reviewed By: astreet

Differential Revision: D3655370

fbshipit-source-id: f54b04a95c5c090636219832e63a348f3ae5a5c3
2016-08-08 09:13:53 -07:00
Felix Oghina baf5a5b99a add RedBoxHandler & UIImplementation to ReactNativeHost
Summary: Allow overriding RedBoxHandler and UIImplementation in custom ReactNativeHost implementations.

Reviewed By: astreet

Differential Revision: D3655354

fbshipit-source-id: cc168613c75a8540e8a802ce33576b3b6a97749c
2016-08-08 09:13:52 -07:00
Pierre-Yves Desnoues deb0d60c09 Update PlatformSpecificInformation.md
Summary:
Fix internal anchor ref links
Closes https://github.com/facebook/react-native/pull/8946

Differential Revision: D3683755

fbshipit-source-id: 5b145e751460ba24e058430b325558405fa323bf
2016-08-08 04:58:30 -07:00
ymmuse 7b02c1de3f fix CSSNodeList memory leak
Summary:
CSSNodeListFree does not free the list->items memory
Closes https://github.com/facebook/css-layout/pull/214

Differential Revision: D3683643

Pulled By: emilsjolander

fbshipit-source-id: 7f9ef19f4603d5558cc2f8302756b3bcec2f6c12
2016-08-08 04:58:30 -07:00
Charles Dick 54f867f0d6 Process heap capture into trace html
Reviewed By: bestander

Differential Revision: D3642188

fbshipit-source-id: c9a4699b2a0d60eb5961333dec45941085e19324
2016-08-08 04:28:32 -07:00
Pieter De Baets cb59264e73 Specify React dependency correctly
fbshipit-source-id: c25ad1b942e75d9a631134fc277306931c7bc859
2016-08-08 04:28:32 -07:00
Pieter De Baets 631b1beeb6 Unbreak upgrade to React 15.3.0
fbshipit-source-id: 0373b4dd11895f3b1c76a904a0a59b70aaa845f9
2016-08-08 03:58:29 -07:00