Commit Graph

9685 Commits

Author SHA1 Message Date
Lukas Piatkowski 47616d84d8 Split JSPackagerWebSocketClient into JSPackagerClient and ReconnectingWebSocket
Reviewed By: cwdick

Differential Revision: D4495054

fbshipit-source-id: 49c634dde789317270c711370dfbdc82f70f44cd
2017-02-14 09:45:57 -08:00
Emil Sjolander 0ea47424ff Fix align-content strech with multiple lines
Reviewed By: astreet

Differential Revision: D4551234

fbshipit-source-id: 2964f19cf415991dc55dfa2caa4868cb00c56bd0
2017-02-14 09:17:53 -08:00
Adam Comella 186f308aec BREAKING: Android: Correct value of Dimensions.get('screen').fontScale
Summary:
The PR description has been updated to reflect the new approach.

**Breaking Change Summary**

On Android, the following properties now return a different number:
  - `Dimensions.get('window').fontScale`
  - `Dimensions.get('screen').fontScale`
  - `PixelRatio.getFontScale()`

This is a breaking change to anyone who was using these properties because the meaning of these properties has now changed.

These properties used to return a value representing font scale times density ([`DisplayMetrics.scaledDensity`](https://developer.android.com/reference/android/util/DisplayMetrics.html#scaledDensity)). Now they return a value representing just font scale ([`Configuration.fontScale`](https://developer.android.com/reference/android/content/res/Configuration.html#fontScale)).

**PR Description**

This PR changes a few things:
  - Correctly exposes the font scale to JavaScript as `Dimensions.get('screen').fontScale`. UIManager was exporting `DisplayMetrics.scaledDensity` under the name `fontScale`. How
Closes https://github.com/facebook/react-native/pull/11008

Differential Revision: D4558207

Pulled By: astreet

fbshipit-source-id: 096ce7b28051325dfd45fdb2a14b5e9b7d3bc46f
2017-02-14 08:45:38 -08:00
Janic Duplessis 7f9876c049 Fix animated blog lists
Summary:
Didn't notice when testing initially but the lists didn't show up properly without the extra new line before it.
Closes https://github.com/facebook/react-native/pull/12373

Differential Revision: D4557642

fbshipit-source-id: 874a7163a9b6b5492f3374b32aa0f9b7d48ffb0b
2017-02-13 22:51:37 -08:00
Michael Bolin 6a4f7c0993 Eliminate the need for `import re` in a BUCK file.
Reviewed By: mzlee

Differential Revision: D4550304

fbshipit-source-id: 59a101a35ea33aa8043046f64b675fab0f6f889a
2017-02-13 22:32:37 -08:00
Michael Bolin f294f61eeb Replace top-level `elif` with `if` in BUCK files.
Reviewed By: mzlee

Differential Revision: D4550165

fbshipit-source-id: 65d636c2e9e273bf45e093fe2c07aec18659e733
2017-02-13 22:32:37 -08:00
Aaron Chiu 7c82803c4d clean up ModuleHolder.java
Reviewed By: achen1

Differential Revision: D4548524

fbshipit-source-id: 5fab273e7a461c0312fa555aaccb8869843d9d95
2017-02-13 20:31:07 -08:00
Aaron Chiu 78801793f3 move the module creation out of the constants creation systrace
Reviewed By: achen1

Differential Revision: D4555801

fbshipit-source-id: 5ee338a686bca33f0a480bd6b428a44f626620d1
2017-02-13 19:31:04 -08:00
Spencer Ahrens 91bda43e56 Fix `getItemLayout` flow type to include `index`
Summary:
The index is used to make sure the layout corresponds to the correct index, which can get
out of sync if cell layout is cached and then cells are re-ordered.

Reviewed By: bvaughn

Differential Revision: D4554721

fbshipit-source-id: 9acb37f390a6e40ad89f813b78f81b399ec11e9a
2017-02-13 18:15:43 -08:00
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