Commit Graph

8427 Commits

Author SHA1 Message Date
Kazuki Sakamoto 1607ff2466 Introduce CSSLayoutSetLogger to pass the print result to C# side
Reviewed By: emilsjolander

Differential Revision: D4027044

fbshipit-source-id: 90e2e449260888770f71fa7ea790ca9764d91c44
2016-10-19 11:13:59 -07:00
Christoffer Bo Petersen 5d97f6df15 Update activity lifecycle callback example
Summary:
Updates the documentation for the the android life cycle methods, recent changes has deprecated

 `onHostPause()` for `onHostPause(Activity activity)`
 `onHostDestroy()` for `onHostDestroy(Activity activity)`

[deprecation commit](0b5c61250b)
Closes https://github.com/facebook/react-native/pull/10460

Differential Revision: D4044420

Pulled By: JoelMarcey

fbshipit-source-id: 54c5fc8fcd332235b6c0237a180e0c5bb2310a20
2016-10-19 09:43:37 -07:00
Konstantin Raev aee52eb148 Fixed uiexplorer legocastle starting script
Reviewed By: matryoshcow

Differential Revision: D4029497

fbshipit-source-id: 801294409129453c99aad1d4d8f7908548f6c3ef
2016-10-19 08:44:27 -07:00
Konstantin Raev 0e5c0d2f2c test refurb: removed xcpretty on travis + using yarn + e2e tests
Summary:
- switched to yarn on travis (experimental)
- removed xcpretty, we need more verbose logs
- returned jest test for e2e
Closes https://github.com/facebook/react-native/pull/10442

Differential Revision: D4043991

Pulled By: davidaurelio

fbshipit-source-id: 50062f6a77a17643bf9a7ba7add8cee5b3bb26d2
2016-10-19 07:58:38 -07:00
David Aurelio 0c7bc9801c Create integration types and code to use module resolution logic from node-haste
Summary:
This creates flow types for the module resolution code in node-haste, and implementations of types used by that code.

The idea is to use that code until we can replace it with something leaner, and provide objects that don’t touch the file system. These objects will be initialized with the static data provided by ModuleGraph/worker.

Reviewed By: cpojer

Differential Revision: D4037372

fbshipit-source-id: 2698dbb630f4122fc1d839d06e414d0963bd6ff2
2016-10-19 06:58:39 -07:00
Emil Sjolander a9d94c2dfb Change flex basis to override main axis size
Reviewed By: gkassabli

Differential Revision: D4029374

fbshipit-source-id: bc3c72879f3937a50bf8a636b547adc7b9a4f5a7
2016-10-19 06:43:57 -07:00
Jean Lauliac 2e06e708fe Bundler.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4036964

fbshipit-source-id: dceb81299d076493d12b2ade13354e927c10ea7c
2016-10-19 04:43:41 -07:00
Matthew Curtis 7fbb46c316 Fix typo on line 47 "make" to "makes"
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

Fix typo on line 47 "make" to "makes"

> **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/CONTRIBUTI
Closes https://github.com/facebook/react-native/pull/10449

Differential Revision: D4039572

Pulled By: hramos

fbshipit-source-id: 21ba41365f24f4f615b73051de63dfd5be6b4893
2016-10-18 15:13:51 -07:00
Héctor Ramos db474d95b4 Headless JS - fix markdown typo.
Summary: Closes https://github.com/facebook/react-native/pull/10448

Differential Revision: D4039297

Pulled By: lacker

fbshipit-source-id: 21a398e3d35b2aa3d34cd35c865d36cf5a9e4b25
2016-10-18 14:43:43 -07:00
Dmitry Petukhov d294e15c43 Two ReactART TODOs implemented on Android
Summary:
Implemented 2 TODOs from ReactART for Android:
- TODO(7255985): Use TextureView and pass Surface from the view to draw on it asynchronously instead of passing the bitmap (which is inefficient especially in terms of memory usage)
- TODO(6352067): Support dashes in ARTShape

We use ReactNativeART in our Android project.
1. Our app crashes sometimes on large screen smartphones with OutOfMemoryError. Crashes happen in ARTSurfaceShadowNode where TODO(7255985) was suggested in a comment in order to use memory more efficiently.
2. We needed dashes for drawing on ARTSurface.

**Test plan (required)**

I attach a screenshot of our app which shows dashed-lines and two ARTSurfaces on top of each other rendering exactly the same as in the pervious implementation of ARTSurface.
![screenshot_2016-08-19-16-45-43](https://cloud.githubusercontent.com/assets/18415611/17811741/cafc35c4-662c-11e6-8a63-7c35ef1c5ba9.png)
Closes https://github.com/facebook/react-native/pull/9486

Differential Revision: D4021303

Pulled By: foghina

fbshipit-source-id: 880175e841e3c598013982a7748b6fc691c7e8d6
2016-10-18 12:28:48 -07:00
Konstantin Raev 8acf1a052e Reverted commit D4036668
Reviewed By: cpojer

Differential Revision: D4036668

fbshipit-source-id: 5b75709526c3e87774e0943a76d55cd729c6143d
2016-10-18 12:13:36 -07:00
Konstantin Raev ebc8126ad2 removed leaked internal yarn.lock 2016-10-18 10:53:38 -07:00
Jean Lauliac 8e2b1aa482 BundleBase.js: @flow
Reviewed By: matryoshcow

Differential Revision: D4036938

fbshipit-source-id: 2c151d98f99ab1e325bb07050d0a2c59ee8f4761
2016-10-18 10:29:30 -07:00
Emil Sjolander 6d3ecbe07a Use typedefs from header
Reviewed By: gkassabli

Differential Revision: D4036421

fbshipit-source-id: 01f15cb840363850970e6a60e661af06fd6ec9e0
2016-10-18 10:29:30 -07:00
Emil Sjolander c805cf8376 Use switch instead of ifelse chain
Reviewed By: gkassabli

Differential Revision: D4036445

fbshipit-source-id: 2159946f53507ff3d7505795e5baa5f820cdb65c
2016-10-18 10:13:39 -07:00
Emil Sjolander 0699a30980 Fix flex-shrink when shrinking to zero size
Reviewed By: gkassabli

Differential Revision: D4036345

fbshipit-source-id: f6848d7a316a694426f761d5e51d972bd379d90e
2016-10-18 09:28:45 -07:00
Jean Lauliac 1a6b43e67b react-packager/index.js: @flow
Reviewed By: cpojer

Differential Revision: D4036668

fbshipit-source-id: 286963fd1f18f92389ec642c43dcf4c9d55f19f8
2016-10-18 09:28:45 -07:00
YUYA FUJIMOTO 2230117f36 Add HorizontalSwipeJumpFromLeft animation to Navigator
Summary:
This brings RN Navigator to add HorizontalSwipeJumpFromLeft animation.
HorizontalSwipeJumpFromRight has been implemented but FromLeft version of SwipeJumpAnimation hasn't been there.
Closes https://github.com/facebook/react-native/pull/10406

Differential Revision: D4035212

fbshipit-source-id: edcbae18148e533b02a7d056de03154fb86280d0
2016-10-18 08:43:41 -07:00
Mehdi Mulani 40e8d8904b RN TextInput: don't let user more than maxLength when TextInput already exceeds it
Summary:
We had a classic integer underflow problem here. Before we would let you type endlessly when the text already exceeded the TextInput maxLength, now we only let you erase characters.

There is still a small problem with the TextInput: how do you handle when the value (set from JS) exceeds the maxLength? This could happen pragmatically, just by passing in a very large value or when changing maxLength (e.g. when changing from 4 to 3 digits in the case of a AMEX security code -> VISA security code).

Me and achen1 discussed firing onChange in these cases and truncating the number manually (to ensure JS's data model) was aware of the change but it seemed fraught with bugs and general weirdness in what the caller would expect to happen.

Reviewed By: javache

Differential Revision: D3991210

fbshipit-source-id: dc401c4a7aefe09fa749cd1168d36343d39dc196
2016-10-18 08:13:41 -07:00
David Aurelio 7762f374d5 entry point: remove unused code
Summary: Removes code that is no longer used

Reviewed By: matryoshcow

Differential Revision: D4021932

fbshipit-source-id: d73dc8450478288afd71eab451a30a505e7de945
2016-10-18 07:28:40 -07:00
Emil Sjolander 4d0b3e684a Remove default: usage to ensure compiler can help with missing cases
Reviewed By: gkassabli

Differential Revision: D4036440

fbshipit-source-id: f5ef4c8afff0f353de50681ad304878f90255fef
2016-10-18 07:02:01 -07:00
Emil Sjolander 02fc4c8ffa Move absolute layout calculation out into seperate function
Reviewed By: gkassabli

Differential Revision: D4028329

fbshipit-source-id: 2903f66b028063cec0a6b3037ca7cb4d6552176d
2016-10-17 12:14:17 -07:00
Geordie 73c5360470 NavigatorIOS: stopPropagation on navigationComplete event. Fixes #1241
Summary:
With nested NavigatorIOS components:

```
<NavigatorIOS initialRoute={{
  component: ComponentWithAnotherNavigatorIOSInSubtree
  title: 'xyz'
}}>
```

Navigating (via push etc.) in ComponentWithAnotherNavigatorIOSInSubtree's `navigator` caused an invariant error, making apps with this structure unusable. The reason was that the `navigationComplete` nativeEvent was being propagated to the outer Navigator due to React's automatic event bubbling, making the outer NavigatorIOS incorrectly think it was holding navigation stack state inconsistent with its native UINavigationController.

Concretely, if the outer navigation stack is empty except for its initial state and something is pushed onto the inner stack, the outer NavigatorIOS suddenly complains that it has 2 items on its stack rather than 1. In reality, the outer Navigator still only has 1 item on its stack but the inner Navigator's event (containing information about the inner Navigator) incorrectly bubbles up and reaches the outer Navigator too.
Closes https://github.com/facebook/react-native/pull/9828

Differential Revision: D4030167

Pulled By: ericvicenti

fbshipit-source-id: d04de3d5b70b4862a78610c92701ebdab2b047dd
2016-10-17 10:28:41 -07:00
Cristian Carlesso 6a462fb085 Moving the jest configuration from jest-react-native to react native.
Reviewed By: cpojer

Differential Revision: D3923609

fbshipit-source-id: 62804df81b064871b499ae8c091e13dd1e0f229b
2016-10-17 08:44:05 -07:00
Emil Sjolander 3e332d9cc8 Fix justify content + min dimension when children overflow
Reviewed By: gkassabli

Differential Revision: D4029442

fbshipit-source-id: d28ebd269c452c3359e16ecc5749a415da6e4d75
2016-10-17 08:13:38 -07:00
Emil Sjolander 72cd12ed13 Move flex basis calculation out into seperate function
Reviewed By: gkassabli

Differential Revision: D4028328

fbshipit-source-id: 6d5f3bf1321077675eaa65408a70c9dc92a675be
2016-10-17 05:43:50 -07:00
Emil Sjolander d376155e2c Fix justify content + min dimension usage in root
Reviewed By: gkassabli, lucasr

Differential Revision: D4021443

fbshipit-source-id: 00f58c6078ac3076221e1148aacc34712786deb5
2016-10-17 04:14:34 -07:00
Christoph Pojer c84157a8ad Synchronous file reading
Reviewed By: matryoshcow

Differential Revision: D4021460

fbshipit-source-id: 88e4846d4434468d68e6071d05b27e3b7d2ed325
2016-10-16 18:43:38 -07:00
Christoph Pojer d6c5258000 Remove `fastfs.readWhile`
Reviewed By: davidaurelio

Differential Revision: D4021265

fbshipit-source-id: 578ad54ea5a81e5b091cecafcb2fe6d08746e7f6
2016-10-16 18:43:38 -07:00
dlowder-salesforce 64a4c6070d Travis CI reliability fixes: preload package manager and increase tim…
Summary:
- Consolidate common code in iOS and tvOS test scripts
- Start the packager before starting tests, to improve reliability
- Increase timeout value in RCTTestRunner.m
Closes https://github.com/facebook/react-native/pull/10378

Differential Revision: D4028364

Pulled By: bestander

fbshipit-source-id: 24c2124a1c62643a02f0668b60a67b971e08d1a3
2016-10-16 15:43:44 -07:00
Jonathan Chen f8b0728d9b Update file for Markdown link syntax
Summary:
Reference: https://daringfireball.net/projects/markdown/syntax#link
Closes https://github.com/facebook/react-native/pull/10416

Differential Revision: D4028353

fbshipit-source-id: 22f396fd0f3942a8429128f2b60341da1d96183c
2016-10-16 15:28:42 -07:00
leeight 9db8910e36 Clean unused import modules.
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/10413

Differential Revision: D4028108

fbshipit-source-id: 99a864dfda578d640f582b296583591415ba26cd
2016-10-16 11:13:40 -07:00
Jacob Parker abb8ea3aea Implement a postMessage function and an onMessage event for webviews …
Summary:
JS API very similar to web workers and node's child process.

Work has been done by somebody else for the Android implementation over at #7020, so we'd need to have these in sync before anything gets merged.

I've made a prop `messagingEnabled` to be more explicit about creating globals—it might be sufficient to just check for an onMessage handler though.

![screen shot 2016-09-06 at 10 28 23](https://cloud.githubusercontent.com/assets/7275322/18268669/b1a12348-741c-11e6-91a1-ad39d5a8bc03.png)
Closes https://github.com/facebook/react-native/pull/9762

Differential Revision: D4008260

fbshipit-source-id: 84b1afafbc0ab1edc3dfbf1a8fb870218e171a4c
2016-10-16 06:43:46 -07:00
Konstantin Raev 6ea26c01de Reverted commit D4027388
Reviewed By: yungsters

Differential Revision: D4027388

fbshipit-source-id: 8e3341b6f393ccf432c1a4e22a7cbf422284a06f
2016-10-16 04:13:42 -07:00
leeight dbfd046145 Change require('invariant') to require('fbjs/lib/invariant')
Summary:
FIX #10400
Closes https://github.com/facebook/react-native/pull/10409

Differential Revision: D4027850

fbshipit-source-id: c69e2ce892d119847902db3d6689ec237df35332
2016-10-16 02:13:52 -07:00
Jan Kassens e58d17e68b React.Element<any> » React.Element<*>
Reviewed By: yungsters

Differential Revision: D4027388

fbshipit-source-id: 5bc178eab1ab72283622b4b7d418f9fd43ec0792
2016-10-15 17:58:38 -07:00
Liam Doran 8e2d4cc680 Added documentation on string interpolation to Animations doc
Summary:
**Motivation**
I saw that [Clearer documentation on how to animate string properties](https://github.com/facebook/react-native/issues/2276) had the Good First Task label so I thought I'd take a crack at it. My only change is to the Animations doc, where I added a few sentences and an example based on JedWatson's comment in the issue.

**Test plan (required)**
I wrote a small example app that contains the code snippet from the docs and ran it in the ios simulator and on a Nexus 5X. You can see it [here](https://github.com/liamfd/react_native_examples/tree/master/TestStringInterpolation).

I also looked at the docs and the formatting seemed fine:

<img width="671" alt="screen shot 2016-10-14 at 10 43 21 am" src="https://cloud.githubusercontent.com/assets/5359538/19391550/29bd1d54-91fb-11e6-92d0-1c5b53c6f346.png">

I got the "colors as well as values with units" part from a comment [in the source](https://github.com/facebook/react-native/blob/master/Libraries/Animated/src/Interpolation.js#L178). The c
Closes https://github.com/facebook/react-native/pull/10392

Differential Revision: D4027445

fbshipit-source-id: 03fabb3cd6139b11b0f17b19c90b602160ed7f55
2016-10-15 17:43:54 -07:00
Timur Gibadullin c32ab7e608 Add disabled prop
Summary:
Implemented feature requested in https://github.com/facebook/react-native/issues/10354, updated docs.
The colours were picked from native interface for iOS and from material-ui for android.
Closes https://github.com/facebook/react-native/pull/10398

Differential Revision: D4026189

Pulled By: ericvicenti

fbshipit-source-id: f3316e76f5a4126c07ffcdfb134cd902f40624d5
2016-10-14 19:43:40 -07:00
Tim Yung efcdef711e RN: Stop Deep Linking `ReactChildren`
Reviewed By: sebmarkbage

Differential Revision: D4025469

fbshipit-source-id: 311f9d741101133155395355d8468938435063f7
2016-10-14 18:59:10 -07:00
Tim Yung edecbcddcc RN: Stop Deep Linking `ReactElement`
Reviewed By: sebmarkbage

Differential Revision: D4025461

fbshipit-source-id: bdb35bd8948bf96e791e2c0d567ad6bd42806188
2016-10-14 18:59:10 -07:00
Tim Yung 7263c349c7 RN: Stop Deep Linking `ReactPropTypes`
Reviewed By: sebmarkbage

Differential Revision: D4025448

fbshipit-source-id: 4e9b6ee002a86f638fc57a4bbeb45bf35fabf74c
2016-10-14 18:59:10 -07:00
Tim Yung c4fc13b997 RN: Change `onlyChild => React.Children.only`
Reviewed By: sebmarkbage

Differential Revision: D4025440

fbshipit-source-id: efbcb44dcc89a6059688cf5a00cf28ada8a6a4c4
2016-10-14 18:59:10 -07:00
Tim Yung 331c13d4dc RN: Require {react/lib/ => }ReactNative
Reviewed By: sebmarkbage

Differential Revision: D4024375

fbshipit-source-id: cd2226a3580a7a4ff319d6a93b67b68f2942eb00
2016-10-14 18:59:10 -07:00
Tim Yung c7d68238ec RN: Stop Exporting `Perf` and `TestUtils`
Reviewed By: sebmarkbage

Differential Revision: D4024221

fbshipit-source-id: d35e3dfbff8cc9ce08d34f854b9eb8c79fc1d4af
2016-10-14 18:59:10 -07:00
Tim Yung 421e7880d9 RN: Fix References to ReactComponent / ReactElement
Reviewed By: sebmarkbage

Differential Revision: D4023832

fbshipit-source-id: 6074efe614380119da4f8aa93b47593eeb981fbd
2016-10-14 18:59:09 -07:00
Felix Oghina 9df93c1071 Fix and re-enable TimingModuleTest
Summary:
For some reason the transitive dependency isn't picked up in OSS, so make it hard.

bestander
Closes https://github.com/facebook/react-native/pull/10397

Differential Revision: D4024350

Pulled By: bestander

fbshipit-source-id: 32182857dcc88744ebf6ce0e5cf8eaee390bf067
2016-10-14 15:28:43 -07:00
Stephen Poter 8b55e50d1d Fix error in react-native run-ios when Product Name and Scheme are inequal
Summary:
In xcode, you can modify the Product Name per build configuration.  During the build, the app file name is made using that value.  For example, I name my app "MyApp Dev", it will build into "MyApp Dev.app".

react-native run-ios doesn't extract the proper app name.  Instead it uses the scheme name + ".app".  So if in the example above I use the default Scheme "MyApp", which references the build configuration whose name is "MyApp Dev".  The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.

My fix parses the build output and extracts the app name from the line "export FULL_PRODUCT_NAME=$(appfilename)" and uses that instead of the scheme.  If there is any issue parsing, the scheme name is used like it currently is.

**Test plan (required)**

1) Change the Product Name in xcode project manager to be something different than the scheme name.
2) Run react-native run-ios and ensure it works.
Closes https://github.com/facebook/react-native/pull/10178

Differential Revision: D4022116

Pulled By: javache

fbshipit-source-id: c1bd8e7a1f6364d681c505557a96955a293bc05c
2016-10-14 14:43:52 -07:00
Scott Wolchok 3f472e0bfa Fix cxxreact build error with -Wmissing-prototypes
Differential Revision: D4022143

fbshipit-source-id: 6afbd29a030ff51915cfb552f74737e9146b2ffd
2016-10-14 13:28:36 -07:00
Ovidiu Viorel Iepure ceb9ce36ae Rate limit HasteMap
Reviewed By: davidaurelio

Differential Revision: D4021676

fbshipit-source-id: 383f9a17ac8ede72f41939192ec25a6277a36864
2016-10-14 12:13:41 -07:00
Pieter De Baets 8355ef91ad Add a default context name to RCTJSCExecutor
Reviewed By: mmmulani

Differential Revision: D4015748

fbshipit-source-id: 077287b8438aa13f2a1479d68eacb0662bf295aa
2016-10-14 11:43:43 -07:00