Commit Graph

7434 Commits

Author SHA1 Message Date
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
Pieter De Baets f35b372883 Make sure layout happens after setFrame:forView:
Reviewed By: majak

Differential Revision: D3682745

fbshipit-source-id: 108ff292aa79765d8e5bb7fc364717eba662c0ea
2016-08-08 03:43:23 -07:00
James Ide 02b71cb7b5 Use React 15.3.0 instead of 15.3.0-rc.2
Summary:
React 15.3.0 was officially released. We especially should try not depend on RCs in RN releases and npm doesn't handle RC versions well.
Closes https://github.com/facebook/react-native/pull/9279

Differential Revision: D3683587

fbshipit-source-id: fc4f8a030769232b7697434a419e1e07e482e308
2016-08-08 02:28:30 -07:00
Ryan Gomba bf82a8d1a8 Move RCTNativeAnimatedModule onto the main queue
Summary:
We're mutating dictionaries on one thread for bookkeeping (anytime we receive a call over the bridge) and iterating over them on the main thread each frame (in `updateAnimations`). Seems like this can all happen on the main thread without issue. Am I missing something?

**Test plan (required)**

Run UIExplorer NativeAnimated examples before and after - compare the results. Nothing should have changed.
Closes https://github.com/facebook/react-native/pull/9049

Differential Revision: D3682871

fbshipit-source-id: c6de62063e724b15b9678a9ef0290284e928b31b
2016-08-07 12:58:20 -07:00
Pieter De Baets 6b9406ed5a Fix missing font constants on iOS7
Reviewed By: dinhviethoa

Differential Revision: D3682528

fbshipit-source-id: 7e3a0b7c2c043a869f2f5dfe9aaf404897076d0b
2016-08-07 11:58:30 -07:00
Nam Se Hyun 20c6d11f84 Edit Docs Making Offline iOS Bundle
Summary:
via commit 8c29a52c54 , the way has changed building offline bundle. So this commit update the docs about that.
Closes https://github.com/facebook/react-native/pull/9186

Differential Revision: D3682643

Pulled By: JoelMarcey

fbshipit-source-id: 3e4127ca0c00f254dc3464e73c1c2496c0710b85
2016-08-07 09:28:38 -07:00
Janic Duplessis df05311777 Add transform support for native animated on Android
Summary:
This adds support for the `transform` animated node. This brings feature parity with the iOS implementation and allows running the NativeAnimated UIExplorer example that was created with the iOS implementation on Android. This is based on some work by kmagiera in the exponent RN fork.

This also adds support for mixing static values with animated ones in the same transform as well which is not supported on iOS at the moment. It is also implemented in a way that rebuilds the transform matrix the same way as we build it in JS so it will be easy to remove some of the current limitations like forcing the transforms order and only supporting one of each type.

**Test plan (required)**

Tested with the NativeAnimated example on Android and iOS. Also tested mixing in static values in a transform (`[{ rotate: '45deg' }, { translateX: animatedValue }]`).
Closes https://github.com/facebook/react-native/pull/8839

Differential Revision: D3682143

fbshipit-source-id: 5e6fd4b0b8be6a76053f24a36d1785771690a6f8
2016-08-07 00:58:36 -07:00
Geoffrey Goh 1168d0db45 Should be R.string, not R.strings
Summary:
Fix regression of https://github.com/rnpm/rnpm-plugin-link/pull/88.
Closes https://github.com/facebook/react-native/pull/9252

Differential Revision: D3680785

fbshipit-source-id: a6ea63295ae8f61b17c0a1b2ca5e6a5f5da7437a
2016-08-06 07:28:28 -07:00
Nikhilesh Sigatapu a2417065b1 Fix off-by-one error in range requests
Summary:
https://github.com/facebook/react-native/pull/8219 adds range requests to the asset server, but there was an off-by-one-error that made responses end prematurely. This made (for example) react-native-video not work for video assets. This change fixes the off-by-one error and react-native-video works with assets.

**Test plan (required)**

Try the test in the original pull request for range requests: https://github.com/facebook/react-native/pull/8219
Closes https://github.com/facebook/react-native/pull/9254

Differential Revision: D3680070

fbshipit-source-id: 3f2a18ba9f35b45b340f4a1046bc099b8444eb7d
2016-08-06 03:28:32 -07:00
Cameron Hunter bdf5adc40b Ensure that existing properties are configurable before redefining
Summary:
`Libraries/JavaScriptAppEngine/Initialization/InitializeJavaScriptAppEngine.js` attempts to setup global variables typical in most JavaScript environments. It finds the previous property value using `Object.getOwnPropertyDescriptor` and preserves it as `original[PropertyName]` (if it existed), it then redefines the property using `Object.defineProperty`.

Properties may only be redefined if the property descriptor specifies that it is configurable ([MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor)). Attempting to redefine an non-configurable property will result in an error: `TypeError: Cannot redefine property: [PropertyName]`.

Not all properties being setup in `InitializeJavaScriptAppEngine.js` are necessarily configurable in the target environment.
Closes https://github.com/facebook/react-native/pull/9244

Differential Revision: D3679683

fbshipit-source-id: cd3398ef2cdf38e58c58862e64b159951c2b22c2
2016-08-05 21:58:29 -07:00
Janic Duplessis 12fb313e54 Fix scale transform on Android
Summary:
cc kmagiera astreet
Closes https://github.com/facebook/react-native/pull/9251

Differential Revision: D3679466

Pulled By: astreet

fbshipit-source-id: bd4262169827151ed584f7f8d167f9e6b8d533af
2016-08-05 17:43:31 -07:00
Andrew Y. Chen 3feef3ff72 Move JavascriptException from react/modules/core to react/common
Reviewed By: jingc

Differential Revision: D3675858

fbshipit-source-id: 6e1fd4f9476afb28f9c24978be3a7a7cc50afaba
2016-08-05 14:28:30 -07:00
Sreejumon a4bff46791 Update Upgrading.md
Summary:
Updating the RN version 0.31, so that doc is also upto date with latest version.
Closes https://github.com/facebook/react-native/pull/9247

Differential Revision: D3677606

fbshipit-source-id: 8ec5999dfaa243377d85a533935ccfe2d4c97fae
2016-08-05 13:43:35 -07:00
Mengjue Wang 9de0b79e87 Provide forceRTL for LTR language to test
Summary:
Provide forceRTL function for developer to test RTL layout in LTR language bundle in I18nUtil and expose it in I18nManager.
Rename allowRTL and setAllowRTL functions

Differential Revision: D3673601

fbshipit-source-id: 98f9c99e8a6948336fb918c24566dc9e5c0a3a3e
2016-08-05 13:28:40 -07:00