Commit Graph

10498 Commits

Author SHA1 Message Date
Janic Duplessis 9a51fa8e15 Improve z-index implementation on Android
Summary:
Use `getChildDrawingOrder` instead of reordering views. The old implementation didn't work properly when `removeClippedSubviews` was enabled and this one should have better performance since we don't play with the view hierarchy at all.

This fixes weird bugs with sticky headers in `SectionList` and allows removing the hack that disabled `removeClippedSubviews` when using sticky section headers.

**Test plan**
Tested using the SectionList and ListViewPaging examples that use sticky headers which uses z-index.
Closes https://github.com/facebook/react-native/pull/13105

Reviewed By: sahrens

Differential Revision: D4765869

Pulled By: achen1

fbshipit-source-id: be3c824658a3ce965b6e7324ad95c77cbd8a86ae
2017-04-05 09:17:46 -07:00
Marc Horowitz af533ac7f1 Remove the dependency of I18nManagerModule on ReactApplicationContext
Reviewed By: javache

Differential Revision: D4809492

fbshipit-source-id: 775c6b95aab734568ea4750804477c04d13502b6
2017-04-05 01:07:48 -07:00
Marc Horowitz a893d0bb23 Refactor CxxModuleWrapper to support different use cases
Reviewed By: javache

Differential Revision: D4807680

fbshipit-source-id: 48eccfb382814a0c4082f56617e0359e61345da7
2017-04-05 01:07:48 -07:00
Andrew Y. Chen 0ec9c93eeb Add comment about adding new resource directories
Reviewed By: ericvicenti

Differential Revision: D4833151

fbshipit-source-id: 64ad77e7c4d277f19d1c545dc1d75ab870ddd49e
2017-04-04 23:00:26 -07:00
daose 2b0282aa69 #11587 invoke error for getCurrentLocation
Summary:
It started with https://github.com/facebook/react-native/issues/11587, which reported that the error returned by `getCurrentLocation` did not match the spec.

This resulted in PR https://github.com/facebook/react-native/pull/11723, which did not get merged because it was said by ide and mkonicek that simply emitting the error will cause it to hang since the `error` callback was never invoked.

However, it seems like somewhere along the way PR https://github.com/facebook/react-native/pull/13140 got merged in which did exactly that.

Since it now matches the spec, turning off location services on Android then running the below example code from [Geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) docs errors out correctly.

```javascript
var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current po
Closes https://github.com/facebook/react-native/pull/13306

Differential Revision: D4833377

Pulled By: ericvicenti

fbshipit-source-id: dbea5948790a3f521751a0cc0a25f0e323b30667
2017-04-04 22:18:58 -07:00
Brent Vatne b31704bcfb Update issue template for Sketch -> Snack rename
Summary:
[We changed the name from Sketch to Snack](https://blog.expo.io/expo-sketch-expo-snack-a444f8dec72b)

It's just some text in the issue template :)

- Make it clear on the Snack website which version of react-native you are using. Right now we make it possible to pick SDK versions but it's not at all obvious which react-native version that maps to.
Closes https://github.com/facebook/react-native/pull/13304

Differential Revision: D4833399

Pulled By: ericvicenti

fbshipit-source-id: 25b1fe8b4b1ac7db6737e1ba8f611ad4d8dc3804
2017-04-04 22:03:40 -07:00
Brian Vaughn 36c599b2e0 ReactNativeFiber renderer type-fix for leaf node children
Reviewed By: sebmarkbage

Differential Revision: D4830872

fbshipit-source-id: 6e1a476c921ffff8f720fd9b81da65cb1e724eef
2017-04-04 17:03:29 -07:00
Fred Blau d8f23f79c7 Allow specifying an appIdSuffix to run-android
Summary:
Motivation

Currently react-native run-android instals and starts your app, but if you have more than one variant, it doesn't know which one to start.  This allows developers to pass in the suffix specified in build.gradle, so that the correct app is started.

Test Plan

verify that `react-native run-android` runs properly
verify that `react-native run-android --appIdSuffix validSuffix` runs properly
Closes https://github.com/facebook/react-native/pull/13169

Differential Revision: D4823391

Pulled By: ericvicenti

fbshipit-source-id: 31ed35fd79403804b4781e81eb49f1c4627d7f8e
2017-04-04 16:45:27 -07:00
Pieter De Baets ff95805657 Fix YGEnums references in ReactCxx.xcodeproj
Summary:
cc ericvicenti
Closes https://github.com/facebook/react-native/pull/13301

Differential Revision: D4830381

Pulled By: ericvicenti

fbshipit-source-id: 866864ac34f6c873c1646e59cd0245b3f6634d7e
2017-04-04 15:40:04 -07:00
Andrew Y. Chen eb300b60f3 Revert D4770368: [rn] Use tag ids for testID
Differential Revision: D4770368

fbshipit-source-id: 4bf8131a2a2974c8db072f62e8fb26686faa100d
2017-04-04 15:09:51 -07:00
Aaron Chiu c0b64ce519 use Log.d instead of Log.w in CatalystInstanceImpl.java
Reviewed By: achen1

Differential Revision: D4829620

fbshipit-source-id: d3648b7b9afdaec30790995e59abe23805fb6b1e
2017-04-04 14:56:29 -07:00
Eric Vicenti 9c5cc145e6 Fixwebsite
Summary:
This fixes the website build because docgen was unable to parse this `*`
Closes https://github.com/facebook/react-native/pull/13300

Differential Revision: D4828837

Pulled By: ericvicenti

fbshipit-source-id: 7ebc04241742f7bb5a871e7e438fb23af90a70bd
2017-04-04 13:52:31 -07:00
Aaron Chiu f8e583b2d0 clean out the last used bitmap
Reviewed By: achen1

Differential Revision: D4828134

fbshipit-source-id: bf54f7c9f61016cc0735338f99de7b0378c1234b
2017-04-04 12:46:43 -07:00
Martin Konicek 40eb353487 Minor adjustments to the mobile site
Summary:
I noticed the mobile website did not look as great, specifically the hero and the showcase had some issues.

Before:

![screen shot 2017-04-04 at 11 08 41 am](https://cloud.githubusercontent.com/assets/165856/24671655/2fb45660-1927-11e7-8ee7-bf933f459550.png)
![screen shot 2017-04-04 at 11 08 48 am](https://cloud.githubusercontent.com/assets/165856/24671656/2fb44bc0-1927-11e7-9b2e-eb944e61d778.png)

After:
![screen shot 2017-04-04 at 11 08 54 am](https://cloud.githubusercontent.com/assets/165856/24671666/36de3942-1927-11e7-81ff-eeda74d8e748.png)
![screen shot 2017-04-04 at 11 08 59 am](https://cloud.githubusercontent.com/assets/165856/24671665/36d0be70-1927-11e7-9035-382a0a09b701.png)
Closes https://github.com/facebook/react-native/pull/13298

Differential Revision: D4828679

Pulled By: hramos

fbshipit-source-id: 478ab1c5eefa5292cb2f99a9a91e18d86b3e6192
2017-04-04 12:46:43 -07:00
Andrew Y. Chen 77c19ccf73 Use tag ids for testID
Summary: View tags are currently used for end-to-end test IDs. We'd like to overload the tag field with other information such as nativeID (for native refs) and transitionID (for shared element transitions) in the future. Added a key for testID's tag

Reviewed By: AaaChiuuu

Differential Revision: D4770368

fbshipit-source-id: b76c53a20520aac1b25d435b6d5eb809e8833675
2017-04-04 12:33:30 -07:00
Eric Vicenti 67e54f8bdb Add YGEnums to fix gradle build
Summary:
Attempt to fix CircleCI build by adding YGEnums to the yoga gradle file
Closes https://github.com/facebook/react-native/pull/13296

Differential Revision: D4827856

Pulled By: ericvicenti

fbshipit-source-id: cb03af77919c811d06352fbe0b77084e97d2e6c1
2017-04-04 12:01:43 -07:00
Pieter De Baets c128612c5c A proxy so a singleton CxxModule can be shared by multiple ModuleRegistry instances.
Reviewed By: mhorowitz

Differential Revision: D4814438

fbshipit-source-id: db6cdd9e948643bb24a443bd45b7b0843a0a86c2
2017-04-04 10:36:19 -07:00
Sai Grandhi 0fe0fc038b Make copy button work on android emulator in Linux using xsel
Summary:
Resolves issue [#13165](https://github.com/facebook/react-native/issues/13165). The copy button in the redbox for RN android is not currently supported for Linux. This pull request provides the copy button functionality to Linux RN users.

I have tested the updated code locally.
Firstly, I edited `index.android.js` that caused the following error.
![pasted image at 2017_03_27 10_21 am](https://cloud.githubusercontent.com/assets/22376429/24426834/f567c5dc-13d6-11e7-8e3b-a650e2f6237c.png)
After I clicked the copy button and pasted from the clipboard into the chrome address bar, the message appeared.
![pasted_image_at_2017_03_27_10_21_am](https://cloud.githubusercontent.com/assets/22376429/24426896/2c0d4d64-13d7-11e7-8650-da19c44b177d.png)
Closes https://github.com/facebook/react-native/pull/13188

Differential Revision: D4819796

Pulled By: ericvicenti

fbshipit-source-id: 9adc6e93330f89240a505a403e4913dc10e5a31f
2017-04-04 10:20:19 -07:00
Hector Ramos 058a5406ba Add UberEATS article to showcase
Summary:
Adds UberEATS technical blog post, https://eng.uber.com/ubereats-react-native/, to the showcase.

This is not an ideal entry, as the app in question, the UberEATS Restaurant Dashboard, is not widely available in the app stores for people to download and try out. I still think it's worth adding this to the showcase as a good example of a large, known company leveraging React Native to build a new experience.

Test Plan
=======

Built website and verified everything rendered correctly in the Showcase.
Closes https://github.com/facebook/react-native/pull/13274

Differential Revision: D4823507

Pulled By: ericvicenti

fbshipit-source-id: 7929124dfc17254d1bc5970a20ba393a54e34409
2017-04-04 10:20:18 -07:00
Douglas Lowder 6a81de37d4 Add YGEnums to tvOS build
Summary:
**Motivation** Fix the Apple TV build, which is broken after a recent commit.

**Test plan** Travis tvOS test script should succeed.
Closes https://github.com/facebook/react-native/pull/13284

Differential Revision: D4827053

Pulled By: ericvicenti

fbshipit-source-id: 380e8f1b32adfeea844bedc11326e5a6a755066a
2017-04-04 10:00:36 -07:00
Beau Smith e91cd2eff7 Make clear that onSlidingComplete is called regardless whether value changes
Summary:
Documentation didn't clearly state when onSlidingComplete callback is called.

No tests necessary… simply changing docs.
Closes https://github.com/facebook/react-native/pull/13282

Differential Revision: D4823866

Pulled By: ericvicenti

fbshipit-source-id: 1c3be6ee4d52b097b7558067edf0388739d3f52e
2017-04-04 09:46:52 -07:00
Jean Lauliac 8755338728 packager: get rid of type `any` in ResolutionRequest
Summary:
One of my changeset broke the "ModuleGraph" code without warning earlier because we are using `any`, that equivalent to having no typing at all. This changeset fixes the types so that `ResolutionRequest` is exactly what it actually is: a class usable for any `Module`-looking class, including the normal one, and the "ModuleGraph" one used for Buck builds. That way, the ModuleGraph's `Module` is typechecked against `Moduleish`.

Concretely this change mostly migrates the `Module` to its generic parameter counterpart `TModule` inside `ResolutionRequest`.

Reviewed By: kentaromiura

Differential Revision: D4826256

fbshipit-source-id: fcd7ca08ac6c35e4e9ca983e2aab260e352bcb4e
2017-04-04 07:15:23 -07:00
Jean Lauliac 03892d1036 packager: GlobalTransformCache: retry 502 and 503 HTTP statuses
Reviewed By: davidaurelio

Differential Revision: D4818997

fbshipit-source-id: b31b004939f9e83c8a3a8c34b07c8b1ae2d4d17e
2017-04-04 04:16:21 -07:00
Spencer Ahrens b12f6db0ef fix crash with onEndReached={null}
Reviewed By: bvaughn

Differential Revision: D4815310

fbshipit-source-id: 69d4a5a6fd247bdf877465a7cd07924a0dd6584b
2017-04-03 19:19:33 -07:00
Pieter De Baets e0bd35f76f Fix order of timers called in the same frame
Reviewed By: mmmulani

Differential Revision: D4802858

fbshipit-source-id: 8d8400c20b7e487aea5a0943f91ac7adc2d23108
2017-04-03 18:48:48 -07:00
Spencer Ahrens ecf4c48966 Add `scrollToLocation` for `SectionList`
Summary:
Basic functionality that takes `itemIndex` and `sectionIndex`

**TestPlan**

Added this to onChangeText:

	this._listRef.getNode().scrollToLocation({itemIndex: 6, sectionIndex: 3, viewOffset: 25});

and saw it scroll to the correct position right under the sticky header.

Reviewed By: bvaughn

Differential Revision: D4821714

fbshipit-source-id: 261e373f9c4af384db5a363df5b0fd9274b1bdfe
2017-04-03 18:48:48 -07:00
Spencer Ahrens 87bdcbde6a propagate getScrollResponder, getScrollableNode
Summary:
so users can call `setNativeProps` and do more compositing.

**Test Plan:**

Added this to `onPress` of `SectionListExample` and `FlatListExample`:

    this._listRef.getNode().getScrollResponder().setNativeProps({scrollEnabled: false});

and saw scroll get disabled. Note the call to `getNode` because we are using the `Animated.createComponent` wrapper.

Reviewed By: achen1, bvaughn

Differential Revision: D4821711

fbshipit-source-id: 8d1f3dd7ccc646524f154721c5c7036620d57132
2017-04-03 18:48:48 -07:00
Spencer Ahrens 128596b311 Fixup comments to indicate sticky headers are now supported
Reviewed By: achen1

Differential Revision: D4822080

fbshipit-source-id: a0f09eedca40ccc72581b7f6e55a09d9e8f3f61f
2017-04-03 18:48:47 -07:00
Spencer Ahrens e8f9c442d6 Fix separator keys for LayoutAnimation
Summary:
Should key separators with their cells.

**Test Plan**

before/after in this video: https://youtu.be/vid1w5x8-58

Reviewed By: achen1

Differential Revision: D4821708

fbshipit-source-id: 261f1bac34dfa9001297a24a44f11128f338e62b
2017-04-03 18:48:47 -07:00
Spencer Ahrens f186cfb9d6 Allow override of `scrollEventThrottle` (in case `useNativeDriver` is not an option)
Reviewed By: achen1

Differential Revision: D4819635

fbshipit-source-id: 9cc7b32e05bf2c573553b9806a17141f1783a1c6
2017-04-03 18:48:46 -07:00
Valentin Shergin bc1ea548d0 Better TextInput: Simplified focus/first-responder management on iOS
Summary:
Pair `reactWillMakeFirstResponder` and `reactDidMakeFirstResponder` was replaced with just `reactFocus` method
which is supposed to incapsulate all "focus" and "focus-later-if-needed" functionality.

Reviewed By: mmmulani

Differential Revision: D4664626

fbshipit-source-id: 8d3b7935ca26d32ba1d1826a585cce0396fcc885
2017-04-03 15:16:16 -07:00
Emil Sjolander beb559d9cf Fix xcode project file
Reviewed By: ericvicenti

Differential Revision: D4821749

fbshipit-source-id: 19730209557c58457e6cc67916e9a8cb944fb963
2017-04-03 14:33:52 -07:00
Tom Clarkson 8a760e0a93 Code analysis bot does not need to comment on merge commits
Summary:
This PR fixes a CI issue that came up on #11304 after merging master into the pr branch.

That created a merge commit with over 1000 changed files. That might have created irrelevant comments, but the github commit api is limited to 300 files, with only the first 294 having the expected diffs included.

I can't think of any reasonable scenario where a merge would have changes that aren't either on master or another commit in the PR, so I've updated it to treat merge commits as having no changes.
Closes https://github.com/facebook/react-native/pull/13260

Differential Revision: D4819805

Pulled By: ericvicenti

fbshipit-source-id: 7b6b51b18bb36503a719a3ba5c9163cd6ef00e17
2017-04-03 11:15:44 -07:00
Pieter De Baets 10cb0f9325 Disable all of RCTRootViewIntegrationTests
Reviewed By: fkgozali

Differential Revision: D4819589

fbshipit-source-id: d23f1892d750ae4e4efaf85a9ec25094009a7a22
2017-04-03 10:23:17 -07:00
David Aurelio a51e9a0704 Adapt interface of node-haste duplicates
Summary: Adapts mocked / duplicated functionality from `node-haste` to match the new synchronous return types in the original.

Reviewed By: jeanlauliac

Differential Revision: D4819137

fbshipit-source-id: 183316adc3fae161ad9999bf72bccb8218ef8941
2017-04-03 10:05:48 -07:00
Lukas Wöhrl 0ec984e69a Optimize log print by using html format
Summary:
See facebook/yoga#453. Optimizes the node log print by generating some enum text via ```enum.py``` and moving printing to new functions to reduce boilerplate code.

Changes the log output to format the nodes in html to be able to copy paste it  into browsers for quick debugging.

Hides all default values.
Closes https://github.com/facebook/yoga/pull/479

Reviewed By: gkassabli

Differential Revision: D4802184

Pulled By: emilsjolander

fbshipit-source-id: 143bd63cbc31fb0755d711062cb4e6a448049ba3
2017-04-03 09:45:47 -07:00
Andrew Ingram dfaa03e1cb Fixes "guesture" typo in PanResponser docs
Summary:
Simple typo fix in docs.
Closes https://github.com/facebook/react-native/pull/13247

Differential Revision: D4819135

Pulled By: ericvicenti

fbshipit-source-id: 64bc597133a31276fdff8f1ef2ee061f2a9bb17d
2017-04-03 09:15:29 -07:00
Jhen d38644eee5 Add Atom Beta to launchEditor
Summary:
Support [the pre-release of Atom](https://github.com/atom/atom/releases/tag/v1.16.0-beta0) for launchEditor in RN packager.

Open the pre-release of Atom and use the following code: (use the built-in [openFileInEditor](292cc82d0e/Libraries/Core/Devtools/openFileInEditor.js) module)

```js
import openFileInEditor from 'openFileInEditor'

openFileInEditor(file, lineNumber)
```
Closes https://github.com/facebook/react-native/pull/13255

Differential Revision: D4819130

Pulled By: ericvicenti

fbshipit-source-id: eb542295ee9489dad0fe9084e51c4141d33f1fbf
2017-04-03 09:15:29 -07:00
David Aurelio b4da59e9c2 Fix file indentation
Reviewed By: jeanlauliac

Differential Revision: D4819078

fbshipit-source-id: 76bdc2381e479396ef11144236817ffd590f1039
2017-04-03 09:03:54 -07:00
Mike Grabowski dcecfa3189 Make CLI executable configurable
Summary:
Follow up to #13248 for iOS.

This pull request allows changing the default path to `cli` when running from Xcode environment. That is especially useful when debugging from a different location or... running `Haul`.

Set `export CLI_PATH=./node_modules/react-native/local-cli/cli.js` and run. Should use new path provided.
Closes https://github.com/facebook/react-native/pull/13264

Differential Revision: D4819059

Pulled By: ericvicenti

fbshipit-source-id: 4a6241823c0bc8f1fa16869bc872bdbe04df510f
2017-04-03 08:45:54 -07:00
Jean Lauliac cc2ec6ff07 packager: TransformCache: use sha1 instead of murmurhash
Reviewed By: davidaurelio

Differential Revision: D4809941

fbshipit-source-id: 33b6c56b4c48eca88d8c1922f52ed29a728d1173
2017-04-03 06:03:17 -07:00
Jean Lauliac 4bd7dc0035 packager: TransformCache: do not rehash transformOptions every single time
Reviewed By: davidaurelio

Differential Revision: D4809963

fbshipit-source-id: 9d3ac907e822596567ee7af4427bcd24f1bac73f
2017-04-03 04:45:00 -07:00
Tim Yung e1466da1eb RN: Options to Preload Bundles on Startup
Reviewed By: achen1

Differential Revision: D4809513

fbshipit-source-id: a9a4196b72b241faf7c788e26b9e6880cecebb3e
2017-04-02 08:46:22 -07:00
Lukas Wöhrl f1371ec24c Don't transfer layout outputs to java for unset edges
Summary:
See facebook/yoga#483. We should not transfer the layout if the layout didn't change. (using ```hasNewLayout```). This also changes that the lock on the java node is only aquired if needed, and it holds the lock only for the time the values are set and not for the time all it's children are set.
Closes https://github.com/facebook/yoga/pull/484

Reviewed By: astreet

Differential Revision: D4802966

Pulled By: emilsjolander

fbshipit-source-id: e8a8f2280ad6b25b98fc68b07eac68e0ec80fe3e
2017-04-01 04:34:17 -07:00
Shruti Malugu edbb48c67a Replacing all instances of [UIApplication sharedApplication] wi…
Summary:
…th RCTSharedApplication()

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
          Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions

> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.

Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension

- [ ] Provide a **test plan** demonstrating that the code is solid.
        I am not sure how to test such that all the features which touch the modified code are tested.

- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
    Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227

Differential Revision: D4816338

Pulled By: javache

fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
2017-04-01 03:34:41 -07:00
Spencer Ahrens 7ff18f290b Fix Warning/Yellow Box so it does not mess up app layout when opened.
Reviewed By: fkgozali

Differential Revision: D4808601

fbshipit-source-id: c15a7aa4514ea21798ceabca075189478596e0a2
2017-03-31 18:34:21 -07:00
Ben Roth 9075fe0618 Fix crash in `RCTJSStackFrame::stackFrameWithDictionary:`
Summary:
Motivation: When logging to RCTRedBox, if any of the stack frames lacks a line number or a column, the application will crash with `[NSNull integerValue]: unrecognized selector sent to instance`.
Closes https://github.com/facebook/react-native/pull/13242

Differential Revision: D4812185

Pulled By: hramos

fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
2017-03-31 13:32:47 -07:00
dlowder-salesforce 92190727d1 Clean up and remove duplicate code in Travis iOS/tvOS test scripts
Summary:
**Motivation**

Remove duplicated lines in objc-test-ios.sh and objc-test-tvos.sh

**Test plan**

Travis CI should continue to work as before.
Closes https://github.com/facebook/react-native/pull/13173

Differential Revision: D4812177

Pulled By: hramos

fbshipit-source-id: 40afe0beab896d741f607f4841df7e9b42f4c17d
2017-03-31 12:46:45 -07:00
Charles Dick 175e77d004 break dependency between JSPackagerClient.RequestHandler and WebSocketListener
Reviewed By: amnn

Differential Revision: D4810406

fbshipit-source-id: a447bc15c6619921edd7adf0b3d1d93ae04e2e43
2017-03-31 11:02:07 -07:00
Viktor Seč ec68c97d72 Add iOS Linking location example to docs
Summary:
Hi, the docs make it seem like `geo:${latitude},${longitude}` is the cross-platform way to link locations on Google/Apple Maps. This is Android-only though.

I did no changes to code.

I noticed that the Appetize.io embed tries to run the [Linking example](https://facebook.github.io/react-native/docs/linking.html) code on iOS, although the example uses Android location scheme. This results in errors. I'd like to fix this as well, but I have no idea how to tell the demo to run on Android.
Closes https://github.com/facebook/react-native/pull/13220

Differential Revision: D4804123

Pulled By: hramos

fbshipit-source-id: 2de85d56476933ec54ea423d76a0fe98ed5132d3
2017-03-31 10:46:55 -07:00