Commit Graph

9576 Commits

Author SHA1 Message Date
Mehdi Mulani b2c545dcb6 Try to re-enable some failing tests
Reviewed By: fkgozali

Differential Revision: D4552657

fbshipit-source-id: ce247839a8ea8a85885c2b20ca4f50801adf88e1
2017-02-13 17:51:22 -08:00
Spencer Ahrens 73e0b01b06 SectionList
Summary:
Simple API takes structured `sections` prop instead of `data` array. `sections` is an array of
`Section` objects, each of which has a `key` and an `itemData` array which is analogous to a
`FlatList` `data` prop, plus optional props like `ItemComponent` that can be overridden on a
per-section level, allowing heterogeneous section item rendering via clean composition.

Flattens the sections data and renders with VirtualizedList under the hood. Doesn't support
sticky headers yet.

Reviewed By: yungsters

Differential Revision: D4519354

fbshipit-source-id: 58de959dadb6f55f681245ecd99a5dc356a48f36
2017-02-13 16:32:17 -08:00
Janic Duplessis 7baecca9a4 Native Animated blog post
Summary:
Blog post I promised about native animated :)

There's a few placeholders, one could be for a little graphic that to represent the node graph (would appreciate if someone with good design skills would make one for me hehe) and the other one for other resources about native Animated if you know of any other.
Closes https://github.com/facebook/react-native/pull/12202

Differential Revision: D4554402

Pulled By: hramos

fbshipit-source-id: db56d841c5c21cd9b7af00d020d576cd243b2778
2017-02-13 15:46:08 -08:00
Valentin Shergin c928f1127f Revert D4538026: Stop allocating an RCTView for everying RCTRawText
Differential Revision: D4538026

fbshipit-source-id: 8728e674cf120a46706e1d05c968439d0e825d46
2017-02-13 15:00:18 -08:00
Aaron Chiu 50de41d5d6 log getConstants for Java modules
Reviewed By: fkgozali

Differential Revision: D4548706

fbshipit-source-id: ffcb6acd15e517ee13da88ef9a901f15e96a87c8
2017-02-13 14:45:17 -08:00
Andrew Monshizadeh 8b63fd7bb2 Formatting fixes
Summary:
What existing problem does the pull request solve?
It fixes some formatting issues that appear in the React Native documentation.

**Test plan**
Run the documentation extraction and verify the content appears correctly as `code` formatted sections.
Closes https://github.com/facebook/react-native/pull/12346

Differential Revision: D4553340

Pulled By: hramos

fbshipit-source-id: b8307b3c3e1c3451f740c46222e10ec3c45e3008
2017-02-13 13:32:22 -08:00
Spencer Ahrens 0a86c1cb15 debug overlay
Reviewed By: yungsters

Differential Revision: D4534822

fbshipit-source-id: ceef5bc5c0dc8cdc0d3927e198273b4411045bde
2017-02-13 13:03:30 -08:00
Spencer Ahrens 12b228c5d9 Improve scroll to top performance
Reviewed By: yungsters, bvaughn

Differential Revision: D4533070

fbshipit-source-id: 9458801aa679b830642f43be93f43bc08ef841cd
2017-02-13 13:03:30 -08:00
Pieter De Baets 7d51580479 Use weakSelf in RCTNetworking callbacks
Reviewed By: shergin

Differential Revision: D4551000

fbshipit-source-id: fcfce41adb8fd76343b973339ffe1cac0bf8a756
2017-02-13 12:29:58 -08:00
Pieter De Baets 4695508826 Remove iOS7 API check
Reviewed By: shergin

Differential Revision: D4551186

fbshipit-source-id: ab5ec3c01bbfe0faca833960431a9739cbc1ea44
2017-02-13 12:17:01 -08:00
Valentin Shergin 7686274e13 Removed RTL workaround in RCTShadowText
Reviewed By: fkgozali

Differential Revision: D4511274

fbshipit-source-id: f658afb4e1c943cc9ecab2dd2a91f251edd3fa36
2017-02-13 12:00:57 -08:00
Adam Comella ea6845ca22 BREAKING: Android: Refactor so uimanager can depend on modules/core
Summary:
cc astreet

The goal of this PR is to enable the buck module `uimanager` to depend on `modules/core` without introducing any dependency cycles.

PR #11008 relies on this PR. PR #11008 needs `uimanager` to depend on `modules/core` so that `uimanager` can fire events using `RCTDeviceEventEmitter` which is in `modules/core`.

This PR moved a number of classes and interfaces:
  - `com.facebook.react.modules.debug.DeveloperSettings` -> `com.facebook.react.modules.debug.interfaces.DeveloperSettings`
  - `com.facebook.react.devsupport.DevOptionHandler` -> `com.facebook.react.devsupport.interfaces.DevOptionHandler `
  - `com.facebook.react.devsupport.DevSupportManager` -> `com.facebook.react.devsupport.interfaces.DevSupportManager`
  - `com.facebook.react.devsupport.DevServerHelper.PackagerStatusCallback` -> `com.facebook.react.devsupport.interfaces.PackagerStatusCallback`
  - The class `com.facebook.react.devsupport.StackTraceHelper.StackFrame` was renamed to `StackFram
Closes https://github.com/facebook/react-native/pull/12329

Differential Revision: D4551160

Pulled By: astreet

fbshipit-source-id: 3a78443c4f30469b13ddfbdcc9bbef6af9e8381a
2017-02-13 11:02:44 -08:00
Kyle Mathews 4161bada4a Tighten blog typography
Summary:
The blog header/body line-height is a bit loose. Also generally the font-height is a good distance for in-between paragraph spacing. Right now is a bit hard to tell where a paragraph starts and ends.

Before:
<img width="666" alt="screen shot 2017-02-10 at 6 43 24 pm" src="https://cloud.githubusercontent.com/assets/71047/22850589/fab283b8-efc0-11e6-9613-3f359ccaeffd.png">

After:
<img width="671" alt="screen shot 2017-02-10 at 6 43 14 pm" src="https://cloud.githubusercontent.com/assets/71047/22850592/ff277a8e-efc0-11e6-8858-c95cb83595f6.png">
Closes https://github.com/facebook/react-native/pull/12338

Differential Revision: D4552228

Pulled By: hramos

fbshipit-source-id: c6b009d72a75e2769b814ef13f469028c4922d13
2017-02-13 10:48:01 -08:00
Jeff Morrison 64f3688473 fbobjc deploy
Reviewed By: gabelevi

Differential Revision: D4544571

fbshipit-source-id: 0b0776d91dea647b0b84a9ca400019aef49963f4
2017-02-13 10:30:39 -08:00
Sokovikov 24d34fe203 Fix inspector crash
Summary:
**Motivation**

Use inspector

**Test plan (required)**

UIExplorer

<img width="305" src="https://cloud.githubusercontent.com/assets/1488195/22839533/46be7cd6-efe3-11e6-9fdc-4f483b471388.gif" />
Closes https://github.com/facebook/react-native/pull/12335

Differential Revision: D4545191

fbshipit-source-id: 27ad519032c6c48199875a62d8e768af5336ce23
2017-02-13 01:30:32 -08:00
Sokovikov fe075732af update image on gratuitous example
Summary:
Update image since previous one was deleted

*Test plan (required)**

UIExplorer

<img width="305" alt="screen shot 2017-02-10 at 13 23 11" src="https://cloud.githubusercontent.com/assets/1488195/22821355/1d98dc06-ef94-11e6-8f6b-8e3ea2c328ae.png">
Closes https://github.com/facebook/react-native/pull/12328

Differential Revision: D4550913

fbshipit-source-id: 7a75e80f207394cafbe94402685753e9228442c3
2017-02-13 01:30:32 -08:00
Emil Sjolander 4ea355a362 Revert D4528559: [yoga][PR] Fix align-content strech with multiple lines
Differential Revision: D4528559

fbshipit-source-id: 4bd82b399cb36acb348f2c6fedcae6b360513424
2017-02-13 01:16:47 -08:00
Angela Hess 9e2d3c5d0d Add row style for multi-column lists
Reviewed By: sahrens

Differential Revision: D4545238

fbshipit-source-id: e85cd598b6776e104bdcaf1e74dd46218785f536
2017-02-11 14:22:29 -08:00
Lukas Wöhrl f288368cef Fix align-content strech with multiple lines
Summary:
Fixes ```align-content:strech``` on nodes without specified cross dimension, if there are multiple lines. Currently it uses the full height of the parent, but it has to use the line height. As we don't know the number of lines until here, we need to realign the relevant children.
Closes https://github.com/facebook/yoga/pull/368

Reviewed By: gkassabli

Differential Revision: D4528559

Pulled By: emilsjolander

fbshipit-source-id: 019e6f85fa452d0c3412f711e3886f0c4452da47
2017-02-11 08:48:24 -08:00
Lukas Wöhrl 8d695e1147 Fix resolving bug on changing layout and optimized memory usage
Summary:
Due to the changes in 46817a38. We have a bug if the layout changes.

This PR fixes this bug and adds a test for it.

Additionally it correctly marks negative percentage values as undefined dim.

It also changes the ```resolvedDimensions``` to use a reference instead of the full value in order to minimize the memory requirement of a ```YGNode``` and reduces the copying of the ```YGValue```.
Closes https://github.com/facebook/yoga/pull/379

Reviewed By: gkassabli

Differential Revision: D4528552

Pulled By: emilsjolander

fbshipit-source-id: c024fe3a009c3788af319b689858ea3374c46477
2017-02-11 08:48:24 -08:00
Lukas Wöhrl 17604ec6fe Add support for space-between and space-around on align-content
Summary:
Adds the two missing alignments ```space-between``` and ```space-around``` for ```align-content``` . Those values are a noop on ```align-items``` in order to prevent a breaking changes for an additional enum.

Fix #229
Closes https://github.com/facebook/yoga/pull/364

Reviewed By: gkassabli

Differential Revision: D4528561

Pulled By: emilsjolander

fbshipit-source-id: ea6291b6dd22cef05d9eec03893250d50371236e
2017-02-11 08:48:24 -08:00
Emil Sjolander 427b92e210 Use Float.compare in java equals
Reviewed By: astreet

Differential Revision: D4531805

fbshipit-source-id: 723e15381e9fa39837a4c99f726501eda26af11b
2017-02-11 06:30:53 -08:00
Emil Sjolander 5194e0349c Always return undefined value if nothing is set
Reviewed By: astreet

Differential Revision: D4531779

fbshipit-source-id: 97a789e70dcf0fb5174e2039991e7a2b27f45f01
2017-02-11 06:30:53 -08:00
Emil Sjolander 21475e58b3 Expose layout border to java
Reviewed By: astreet

Differential Revision: D4543284

fbshipit-source-id: 6030915fc6f758e785a688f94c8ffbec7fbac8b8
2017-02-11 06:30:52 -08:00
Emil Sjolander aac7b19a7c Fix min/max not overriding width/height
Differential Revision: D4537576

fbshipit-source-id: c003f723f424afbca63170d41e54fd5ff837926d
2017-02-11 05:32:26 -08:00
Spencer Ahrens 906e579dd7 numColumns default
Reviewed By: blairvanderhoof

Differential Revision: D4545192

fbshipit-source-id: 75a1e9eb27f0d3cab0c78b44d842847b64849dba
2017-02-10 18:15:23 -08:00
Aaron Chiu 476b9f83a8 log CREATE_MODULE time of all non-laifiable modules
Reviewed By: fkgozali

Differential Revision: D4513014

fbshipit-source-id: f52c8286da3418c575e14bda0a04866719f2b1cb
2017-02-10 15:33:23 -08:00
Sebastian Markbage 0cb7316311 Unmock and disable tests in the React renderer
Summary:
We should unmock React just because we do that elsewhere and tests work better
that way. I was trying to get React tests working in this repo but because
we do so many special things in the React Core repo I gave up.

These test run in the React Core repo already.

Reviewed By: spicyj, bvaughn

Differential Revision: D4541126

fbshipit-source-id: ffbb1b76aac910a976222db91b80b8839fcecc60
2017-02-10 13:49:29 -08:00
Matthew Oaxaca 34edf92cbf Network/FormData typeof object allowing null
Summary:
Submitting PR in response to https://github.com/facebook/react-native/issues/12251

**Test plan (required)**

$formData = new FormData()
$formData.append('value', null)

Included Unit Tests
Closes https://github.com/facebook/react-native/pull/12253

Differential Revision: D4545291

Pulled By: lacker

fbshipit-source-id: 2780f24e1fe1e0d5be3bb12b64aa6cd9a20554bf
2017-02-10 13:30:48 -08:00
Eloy Durán 1dd84f0d47 Add myself as recipient for notifications.
Summary:
This is simply so I will start receiving Travis CI build notifications so I can keep an eye on the CocoaPods podspecs, as discussed with mkonicek.
Closes https://github.com/facebook/react-native/pull/12318

Differential Revision: D4543194

Pulled By: mkonicek

fbshipit-source-id: 95d3bf9d6d5aea97cfdb919ff67be92ad51b08bf
2017-02-10 13:30:48 -08:00
Aaron Chiu 15ceed4069 annotate "CREATE_MODULE" QP log with the name of the module being created
Reviewed By: achen1

Differential Revision: D4513001

fbshipit-source-id: b98024796c0b0cd2489a67bf0695c86d994689d6
2017-02-10 12:56:08 -08:00
Kevin Gozali c7c3e4c5d8 modernize AppRegistry.js and introduce app-specific 'sections'
Summary:
Simple cleanup for AppRegistry.

Also added `registerSection()` helper to mark registered components as app-specific sections. Sections can be treated in many custom ways, e.g. they could just indicate the top level tabs, or something else. A bunch of helpers are also added.

Reviewed By: yungsters

Differential Revision: D4542788

fbshipit-source-id: 07addecb78a7514e973335bca24414fd8db40997
2017-02-10 12:56:08 -08:00
Lukas Piatkowski 6f2544a16b Extract the JSPackagerWebSocketClient into a reusable packagerconnection module
Reviewed By: cwdick

Differential Revision: D4488628

fbshipit-source-id: ad07b7bfe74c6916beceb0ebcc506a57319f4ae9
2017-02-10 10:47:04 -08:00
Lukas Piatkowski 3329969b63 Pass WebSocketSender wrapper instead of WebSocket to callback handler
Reviewed By: cwdick

Differential Revision: D4488064

fbshipit-source-id: eb7113f5f4ba65546c0bd0336dc65b6fae610a53
2017-02-10 10:47:04 -08:00
Spencer Ahrens 4388783a21 Add multi column support
Reviewed By: angelahess

Differential Revision: D4540706

fbshipit-source-id: d8f84d13484d50692405c4a461c8d6c0e49f2cc9
2017-02-10 10:06:31 -08:00
Max Sherman a97f665629 Guard against small window where sending a message can crash the packager
Reviewed By: davidaurelio

Differential Revision: D4541015

fbshipit-source-id: 025039c593f7f0f6e40f5fd38ccc07e50f7d04b0
2017-02-10 09:30:08 -08:00
Jean Lauliac e56b5be904 packager: JSONReporter: expose errors correctly
Reviewed By: cpojer

Differential Revision: D4536721

fbshipit-source-id: d8969a42e844da809bd167cbc1bae2cb11f1db57
2017-02-10 09:30:08 -08:00
Pieter De Baets 49ef06f9bd Stop allocating an RCTView for everying RCTRawText
Reviewed By: shergin

Differential Revision: D4538026

fbshipit-source-id: 17278d60b99632bfb19c4a20979860716be45d2b
2017-02-10 09:03:16 -08:00
Nicolas Cuillery 1116a59019 Allow binary files to be upgraded
Summary:
`react-native-git-upgrade` doesn't handle the binary files. An error is thrown if the user has changed the default Android icons. See #11402

With this PR, the upgrader would also be ready for the assets optimization: #10408 by GantMan

- Publish `react-native-git-upgrade` to sinopia
- `npm install -g react-native-git-upgrade`

- Init a new project with an old version: `react-native init MyApp --version=0.40.0`
- Replace an Android icon (i.e. `MyApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png`) by any other image file.
- Change the content of a text file.
- Run `react-native-git-upgrade`

👉 The project is upgraded successfully.
👉 The replaced image file is still here.
👉 The text change is still here.

- Replace an Android icon in the RN sources (i.e. https://github.com/facebook/react-native/blob/master/local-cli/templates/HelloWorld/android/app/src/mai
Closes https://github.com/facebook/react-native/pull/12201

Differential Revision: D4543190

Pulled By: mkonicek

fbshipit-source-id: f1df32ee064557220deed717a129c3e175a6e9e2
2017-02-10 07:30:44 -08:00
Andy Street 36ab9f6a60 Don't continue to execute UI operations after one has thrown an exception
Summary:
If we throw an exception from a UIOperation, the UI is likely in a bad state and we shouldn't execute any other operations on it. In non-dev mode, this would mean we've crashed and don't have to worry about that. But in dev mode, we may have shown a redbox and the instance is still active. This means doing something like reloading, which will trigger onPause and thus flush more UI operations, can crash the app while its sitting on a red box.

This diff aims to prevent that by no longer executing UI operations after one has thrown an exception.

Reviewed By: AaaChiuuu

Differential Revision: D4536925

fbshipit-source-id: 15c21bb76ad3419a54d9d5de94b6bd1f70a3e4a4
2017-02-10 07:02:33 -08:00
Andy Street b38f345d4c Guard activity lifecycle events with redbox
Summary: Activity lifecycle events in native modules can cause exceptions: we should redbox them like we do all other application-logic triggered exceptions.

Reviewed By: AaaChiuuu

Differential Revision: D4537111

fbshipit-source-id: 71abf8696173a3d647e858c4ea316a169ad2d8ef
2017-02-10 07:02:33 -08:00
Aaron Chiu 53a7d5822b don't call OnBatchComplete on specific modules unless we need to
Summary:
Don't call OnBatchComplete on NativeModules that have'nt been initialized.
Also a follow up to D4479604. This also removes the extra allocation of OnBatchCompleteListener per NativeModule that implements OnBatchCompleteListener.

This means NativeModules which implement OnBatchCompleteListener will have to be explicitly initialized or called into before the OnBatchCompleteListener of that NativeModule will be triggered.

Reviewed By: javache

Differential Revision: D4483682

fbshipit-source-id: 6a9431c82f72d17605d1c1e0ee9194f8d8fc2ddc
2017-02-09 22:30:03 -08:00
Libin Lu 6a5225fb22 return if UIManager failed to measure node
Summary:
iOS return all 0 metrics for <Text> inside <Text>, which results immediate `onPressOut` event on press in. These kind of response should be ignored

this solved issue #11462
Closes https://github.com/facebook/react-native/pull/11530

Differential Revision: D4541452

Pulled By: ericvicenti

fbshipit-source-id: efd7bf1b380b1aecf7301b23f1fbd5a77a9e9095
2017-02-09 21:00:17 -08:00
Aaron Chiu 9d7f2498f6 fix overriding RN Perf markers
Reviewed By: fkgozali

Differential Revision: D4513000

fbshipit-source-id: c7c24d3c4851f5719d998b4f08c338a73f47875f
2017-02-09 20:30:42 -08:00
Connor McEwen 5a0012efd3 Export Animated.Interpolation
Summary:
Flow was complaining about an interpolated value I created in a class constructor, and I realized there was no way to properly import the `AnimatedInterpolation` class type. This allows for using `Animated.Interpolation` as a type to match `Animated.Value`
Closes https://github.com/facebook/react-native/pull/9360

Differential Revision: D4538770

Pulled By: lacker

fbshipit-source-id: 49da2374f2d73ad3d667dafaa6338b77b9aec8a8
2017-02-09 14:46:11 -08:00
Konstantin Raev d649dd04c2 added JSC headers download to prepare stage on Circle CI
Summary:
So that Circle CI builds don't stress github API too much
Closes https://github.com/facebook/react-native/pull/11574

Differential Revision: D4538778

Pulled By: lacker

fbshipit-source-id: af80d13acf7d61c390848764d661a70db2ec961f
2017-02-09 14:32:18 -08:00
Spencer Ahrens 7ac1cc744c Fix nav state persistence
Summary:
We were saving the old state, so it would always be one screen away when reloading before.
Now it works the same way as android. Ideally we would factor out all this shared code...

Reviewed By: ericvicenti

Differential Revision: D4537509

fbshipit-source-id: 28ea8fd579521bd45829013364e884678af81c30
2017-02-09 14:16:17 -08:00
Kevin Lacker a023d0d057 remove inaccurate docs
Summary:
Our docs suggest using this babel plugin to remove console.log statements in production. Unfortunately, it does not actually work when you run it on a new React Native project, and the root cause is that the plugin does not handle all cases correctly. See discussion in https://github.com/facebook/react-native/issues/10412 . For now, we should just stop recommending that people use this plugin, because it doesn't work.
Closes https://github.com/facebook/react-native/pull/12315

Differential Revision: D4538567

Pulled By: hramos

fbshipit-source-id: f3ae1b9143130a05601907ee902a02fc0b2818b0
2017-02-09 13:32:31 -08:00
Dan Abramov 7a3ab96d94 Fix race condition during initialization
Summary:
I discovered this while trying to pinpoint why Nuclide Inspector integration with RN is so flaky. It turns out that, for some reason, if I create a `WebSocket` instance early enough (which I need to when setting up DevTools integration), and the connection is fast enough (which it is on localhost), the `websocketOpen` message may arrive earlier than an `onopen` event handler is registered, causing the `onopen` handler to never fire.

```
mkdir ~/my-server
cd ~/my-server
npm i ws
nano index.js
```

Paste this code:

```js
const ws = require('ws');
const wss = new ws.Server({
  port: 8099
});
```

Run the server:

```js
node index.js
```

Now, inside React Native, paste right after [these lines](57010d63b6/Libraries/Core/InitializeCore.js (L193-L194)):

```js
  const ws = new window.WebSocket('ws://localhost:8099');
  ws.onopen = function() {
    alert('open!');
  };
```

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

Differential Revision: D4536554

Pulled By: gaearon

fbshipit-source-id: 3021fa26b3bf275cba3704a7f3a30c77db69a1f8
2017-02-09 13:32:31 -08:00
Frazer Kirkman a9ccc8133e Text docs - Update to improve readability for ellipsizeMode
Summary:
added context for easier understanding as 'ellipsizeMode' appears before 'numberOfLines' in https://facebook.github.io/react-native/docs/text.html

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Upon first reading the Text docs, the ellipsizeMode function is confusing.  This update aims to remove the confusion.
Closes https://github.com/facebook/react-native/pull/11881

Differential Revision: D4533700

Pulled By: lacker

fbshipit-source-id: 948df16235a0ba02c14e630518bbd7261bc2b802
2017-02-09 13:15:31 -08:00