Граф коммитов

16559 Коммитов

Автор SHA1 Сообщение Дата
John Shelley 691f2f9d02 Android - Add a ReactFragment (#12199)
Summary:
React Native on Android has currently been focused and targeted at using an [Activity](https://developer.android.com/reference/android/app/Activity.html) for its main form of instantiation.

While this has probably worked for most companies and developers, you lose some of the modularity of a more cohesive application when working in a "brown-field" project that is currently native. This hurts more companies that are looking to adopt React Native and slowly implement it in a fully native application.

A lot of developers follow Android's guidelines of using Fragments in their projects, even if it is a debated subject in the Android community, and this addition will allow others to embrace React Native more freely. (I even assume it could help with managing navigation state in applications that contain a decent amount of Native code and would be appreciated in those projects. Such as sharing the Toolbar, TabBar, ViewPager, etc in Native Android)

Even with this addition, a developer will still need to host the fragment in an activity, but now that activity can contain native logic like a Drawer, Tabs, ViewPager, etc.

**Test plan (required)**
* We have been using this class at Hudl for over a couple of months and have found it valuable.
* If the community agrees on the addition, I can add documentation to the Android sections to include notes about the potential of this Fragment.
* If the community agrees on the addition, I can update one or more of the examples in the `/Examples` folder and make use of the Fragment, or even create a new example that uses a native layout manager like Drawer, Tabs, Viewpager, etc)

Make sure tests pass on both Travis and Circle CI.

_To Note:_
* There is also talk of using React Native inside Android Fragment's without any legit documentation, this could help remedy some of that with more documentation included in this PR https://facebook.github.io/react-native/releases/0.26/docs/embedded-app-android.html#sharing-a-reactinstance-across-multiple-activities-fragments-in-your-app
* Others have also requested something similar and have a half-baked solution as well http://stackoverflow.com/questions/35221447/react-native-inside-a-fragment

[ANDROID][FEATURE][ReactAndroid/src/main/java/com/facebook/react/ReactFragment.java] - Adds support for Android's Fragment system. This allows for a more hybrid application.
<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/12199

Differential Revision: D14590665

Pulled By: mdvacca

fbshipit-source-id: b50b708cde458f9634e0c14b3952fa32f9d82048
2019-04-04 00:23:28 -07:00
Christoph Nakazawa e62cfc0f72 Fix crash in RCTText in open source RNTester
Summary: See https://github.com/facebook/react-native/issues/24288

Reviewed By: sahrens

Differential Revision: D14765625

fbshipit-source-id: f7275f3735691e1f0c87e682f6dd675e5ba5a7c0
2019-04-03 18:55:36 -07:00
David Vacca da44010b59 Implement AxialGradientView in Fabric Android
Summary: This diff integreates AxialGradientView in Fabric Android

Reviewed By: shergin

Differential Revision: D14631690

fbshipit-source-id: 54785466ab4cd7251c6667c8dc12d69d9d194832
2019-04-03 17:57:24 -07:00
David Vacca 2777c6572a Pre-allocate Fabric views even when React is running in the UI Thread
Summary: Before D14297477, the pre-allocation of views was ONLY necessary when react was running in the JS Thread, this is because the batch of mount items used to contain mount items for creation of views. After D14297477, views are only created during pre-allocation, that means that pre-allocation of views need to be trated the same way independently the thread where it is running.

Reviewed By: shergin

Differential Revision: D14714933

fbshipit-source-id: 7bd19cd33b624a5b0daaafabb476bb06707eea17
2019-04-03 17:31:37 -07:00
Craig_Martin 6f4239b37c Add scrollToOverflowEnabled prop to ScrollView (#24296)
Summary:
ScrollView's scrollTo behavior on iOS was recently changed to limit the offset to the content size plus any content inset (see #23427). This departure from the old behavior created UI issues for anyone that is using the over-scroll ability for the purpose of positioning elements at specific coordinates on the screen. Examples include using this behavior to position TextInputs above the virtual keyboard programmatically when focused or moving drop down elements positioned near the bottom of the content toward the top of the screen when selected to show a larger absolutely positioned item list. Default behavior does not change and this is an "opt-in" type of prop to re-enable the old behavior.

[iOS] [Added] - Added scrollToOverflowEnabled prop to ScrollView
Pull Request resolved: https://github.com/facebook/react-native/pull/24296

Differential Revision: D14762619

Pulled By: cpojer

fbshipit-source-id: d2a552b5cb321d52e8ea4116327bf9ec647a3aae
2019-04-03 16:21:08 -07:00
Kevin Gozali 1e2e07da2c TM Android: fixed up JSCallInvoker creation
Summary: A previous commit changed the signature of the Instance (the arg to JSCallInvoker) to be a weak ref, so this callsite needs updating.

Reviewed By: mmmulani

Differential Revision: D14757188

fbshipit-source-id: 1a8663e56a42b26c6202881c57a7caafa71da2ab
2019-04-03 13:23:51 -07:00
Aditya Sharat 99ec3dc845 Add YogaNode.cloneWithoutChildren
Summary: Adding flat clone method back to YogaNode for reconciliation.

Reviewed By: davidaurelio

Differential Revision: D14683019

fbshipit-source-id: 08ed2ffbb16052cb11aa464f67a7ba9a64297985
2019-04-03 12:43:05 -07:00
PIYUSH GUPTA 59e50237bf fixed touchable longpress (#24238)
Summary:
This diff fixes a bug in TouchableNativeFeedback where a long press is not registered.

cause of the bug is _touchableHandleResponderMove_ being invoked **regardless** of a moving gesture ( even when movedDistance is 0) in some devices ( including OnePlus5t ), which was eventually clearing out  the long-press timeout.

fix is to prevent _touchableHandleResponderMove_ from Implementing if the state of touchable is RESPONDER_INACTIVE_PRESS_IN.

[General] [Fixed] - Touchable onLongPress fix.
Pull Request resolved: https://github.com/facebook/react-native/pull/24238

Reviewed By: cpojer

Differential Revision: D14712986

Pulled By: rickhanlonii

fbshipit-source-id: e85a66a7e8b61e0a33146b2472e2e055726a0e93
2019-04-03 10:45:35 -07:00
Héctor Ramos 8443487ad5 Avoid failing Obj-C tests when xcpretty is not installed (#24173)
Summary:
Fixes an issue where `scripts/objc-test-ios.sh` would fail if `xcpretty` is not installed. As this tool is not bundled with macOS, and it's not explicitly called out in our docs on testing, the script should not fail if it's not present.

In a related change, JUnit reports are written to a more sensible location when the script is run outside of Circle CI.

[iOS] [Fixed] - Fixed test script failure when xcpretty is not present
Pull Request resolved: https://github.com/facebook/react-native/pull/24173

Differential Revision: D14726101

Pulled By: hramos

fbshipit-source-id: 9f3081a75a4a262f55aef8498241fe7d1e04b931
2019-04-03 10:45:35 -07:00
Kacper Wiszczuk 81b87e458a Rename ios project name with new template (#24292)
Summary:
With new `init` implementation we replace all occurrences of the project name (`HelloWorld`) inside `ios` and `android` directories. For some reason, a product name field in `ios` was named wrongly. This shouldn't impact initialization using `global-cli`

[iOS] [Fixed] - Change productName in iOS in new init.
Pull Request resolved: https://github.com/facebook/react-native/pull/24292

Differential Revision: D14749249

Pulled By: cpojer

fbshipit-source-id: aaf4294ab23180770aac3075789d3ffb4d5a4f3f
2019-04-03 10:45:35 -07:00
Dulmandakh 6a26cb4bea bump fresco to 1.13 (#24274)
Summary:
Bump Fresco to 1.13, which uses libc++ and many improvements.

[Android] [Changed] - Bump Fresco to 1.13
Pull Request resolved: https://github.com/facebook/react-native/pull/24274

Differential Revision: D14750275

Pulled By: cpojer

fbshipit-source-id: 3c040fccd4cb484e31d9c6e849ec285666f140c7
2019-04-03 10:45:34 -07:00
Dulmandakh e02f711ccd fix gradle wrapper in template (#24275)
Summary:
Fix Gradle wrapper in template

[Android] [Changed] - fix Gradle wrapper in template
Pull Request resolved: https://github.com/facebook/react-native/pull/24275

Differential Revision: D14750280

Pulled By: cpojer

fbshipit-source-id: 9aadb1a674503f3fbbdf6cc03a8f8e3d9d2692aa
2019-04-03 10:45:34 -07:00
Michał Pierzchała 7e23c7c565 Make Jest transform @react-native-community packages by default (#24294)
Summary:
Currently, `react-native` Jest preset will not automatically transpile extracted Lean Core modules (all under `react-native-community` org), so maintainers will likely need to update their docs on how to do that (it's a common pain in RN testing story).

We can make it easier for users and maintainers by adding RNC modules to the `transformIgnorePatterns` whitelist we have in Jest preset. Some of them are not necessary to transpile, but I'd say it's a small sacrifice to make (having first test run possibly slower) for having less friction around migrating to extracted modules.

[General] [Added] - make Jest transform react-native-community/ packages by default
Pull Request resolved: https://github.com/facebook/react-native/pull/24294

Differential Revision: D14748962

Pulled By: cpojer

fbshipit-source-id: 36300ee021f03b8c13275a6e0cf28d988ee5beba
2019-04-03 09:25:56 -07:00
David Aurelio b015b99fce Move `YGSetUsedCachedEntries` to internal header
Summary:
@public

In order to get out of pre-releases again, we move `YGSetUsedCachedEntries` from `Yoga.h` to `Yoga-internal.h`.
This way, it’s obvious that the function is not public, and we can remove it from future versions without breaking semver contracts.

Reviewed By: SidharthGuglani

Differential Revision: D14726029

fbshipit-source-id: 8d7e747e843bf5c4b5e1d4cfbfa37ca9d240dffb
2019-04-03 08:45:39 -07:00
Nurzhan Bakibayev f00d1b8518 Change default Inspector Proxy port to 8081
Summary: Change default Inspector Proxy port to 8081

Reviewed By: cwdick

Differential Revision: D14745974

fbshipit-source-id: f4b3b158f55c6f5f1b3d9cc2528c5ddb59774a8b
2019-04-03 08:39:08 -07:00
Rick Ratmansky 7f6ab5068c Removing unused and very old versions of the support library resources
Summary: TSIA

Differential Revision: D14727969

fbshipit-source-id: 1c73534dea7225f2d952ef0f20ea602894d78f04
2019-04-03 07:58:40 -07:00
Pieter De Baets 9895d01137 Remove experimental gating for LayoutAnimation on Android
Reviewed By: sahrens

Differential Revision: D14658087

fbshipit-source-id: 378ef4a5c5336d428b5045772d094a297b2767c7
2019-04-03 04:42:15 -07:00
Pieter De Baets f571c62ddf Implement completion callback for LayoutAnimation on Android
Summary: All animations are scheduled by the UIManager while it processes a batch of changes, so we can just wait to see what the longest animation is and cancel+reschedule the callback.

Reviewed By: mdvacca

Differential Revision: D14656733

fbshipit-source-id: 4cbbb7e741219cd43f511f2ce750c53c30e2b2ca
2019-04-03 04:42:14 -07:00
Pieter De Baets a333c2b202 Remove legacy AnimationManagerModule
Summary: This code was shipped as part of the initial open-source release but was never used.

Reviewed By: sahrens

Differential Revision: D14649389

fbshipit-source-id: 0c068ca69b91d275008f4a7af77a23a4f1470c18
2019-04-03 04:42:14 -07:00
Luna Wei d9711e2693 Log uri for guessContentTypeFromName exceptions
Summary: Add additional logging around the exception to figure out what kind of uris are causing the exception for `getContentTypeForFileName`

Reviewed By: PeteTheHeat

Differential Revision: D14715917

fbshipit-source-id: 46299d2ff3f1f06991d7800784a025a85815ae8c
2019-04-02 18:38:39 -07:00
Emily Janzer 15b2f994ce Guard against content view being null in onOverScrolled
Summary:
It seems that the content view can sometimes be null when onOverScrolled is called (presumably when the scrollview gets unmounted while it's in the middle of scrolling?).

Changelog: [Android][fixed] - Guard against content view being null in onOverScrolled.

Reviewed By: mdvacca

Differential Revision: D14737534

fbshipit-source-id: e88ec6f585e50517b734a8809fc3843c0b22df10
2019-04-02 18:15:42 -07:00
Kevin Gozali 71a8944b39 TM iOS: Use weak_ptr to pass around Instance to avoid unreleased refs
Summary:
There is a timing issue when reloading the bridge (in dev mode) and the tear down of the TurboModules. This causes `Instance` to never get freed, hence the "bridge" isn't cleaning up properly. The side effect can be bogus error saying that it's unable to find a module.

To address this, JSCallInvoker should just take in weak_ptr<Instance>.

Reviewed By: RSNara

Differential Revision: D14739181

fbshipit-source-id: f9f2a55486debaeb28d3d293df3cf1d3f6b9a031
2019-04-02 18:11:18 -07:00
Daniel Andersson 2387d7d255 Make it possible to run JSBigString tests
Summary: Add a target for JSBigString tests that can be run with a normal `buck test` invocation. Also fix an issue in the test when `getenv` returns null by defaulting to `/tmp`.

Reviewed By: ridiculousfish

Differential Revision: D14716270

fbshipit-source-id: f2eb6d3aab93c32a4b41f5786aedd04a70468d75
2019-04-02 16:42:56 -07:00
Mehdi Mulani 17dbf98884 Move iOS Geolocation code out from the repo
Summary:
@public
This resolves the iOS side of #20879.

Reviewed By: natestedman, cpojer

Differential Revision: D14712066

fbshipit-source-id: 88dd0ff80d3467b314cacb9349029dadca4ddf19
2019-04-02 15:36:10 -07:00
Avik Chaudhuri 380ed5581f @allow-large-files xplat flow 0.96 upgrade
Summary:
bypass-lint
allow_many_files

Reviewed By: panagosg7

Differential Revision: D14727932

fbshipit-source-id: 66b2fce7753450204c5daa131ffe43dcd4736539
2019-04-02 13:44:19 -07:00
Dulmandakh d9f5a9dc16 bump gradle to 5.2.1 (#23879)
Summary:
Bump Gradle to 5.2.1, includes many bug fixes and improvements, especially improved Kotlin DSL support.

[Android] [Changed] - bump Gradle to 5.2.1
Pull Request resolved: https://github.com/facebook/react-native/pull/23879

Reviewed By: hramos

Differential Revision: D14486430

Pulled By: cpojer

fbshipit-source-id: 3476516352ff2c947d65103cff6f37e27d888c2d
2019-04-02 12:07:10 -07:00
Christoph Nakazawa 1ca9a95537 Move WebView Android files to FB internal
Summary: This moves the Java files to FB internal and updates all the buck files

Reviewed By: TheSavior

Differential Revision: D14622521

fbshipit-source-id: a8d293e9f9e08868cca3ed2986a08d0db16dec15
2019-04-02 11:19:47 -07:00
Sunny Luo 556aa93ed7 Prevent crash when setting underlineColorAndroid (#24183)
Summary:
Try to prevent the crash described in https://github.com/facebook/react-native/issues/17530

There seems to be a bug in `Drawable.mutate()` in some devices/android os versions even after you check the constant state. This error is hard to reproduce and to fix, so just try to catch the exception to prevent crash.

[Android][Fixed] Prevent random crash when setting underlineColorAndroid
Pull Request resolved: https://github.com/facebook/react-native/pull/24183

Differential Revision: D14710484

Pulled By: cpojer

fbshipit-source-id: 3af20a5cb0ecd40839beaf85118c0f5aa6905414
2019-04-02 09:41:16 -07:00
gengjiawen 4478e50520 add ram bundle to android template (#24264)
Summary:
I plan to do this for a long time :)
Still a little surprised so much people not know it https://twitter.com/geekykaran/status/1112756026611257344

[Android] [Feature] - add ram bundle to android template
Pull Request resolved: https://github.com/facebook/react-native/pull/24264

Differential Revision: D14725396

Pulled By: cpojer

fbshipit-source-id: b8e424f0be81978465259c82024f206d232acb55
2019-04-02 08:29:46 -07:00
Kacper Wiszczuk 6df2edeb2a Bump react-native version in template in release script (#24262)
Summary:
Since template has a fixed version in `template/package.json`, we want to automate this process.

[General] [Added] - Bump react-native in `template/package.json`
Pull Request resolved: https://github.com/facebook/react-native/pull/24262

Differential Revision: D14724831

Pulled By: cpojer

fbshipit-source-id: 164d13001a889941398f3db3b9b96eb9d5114cc3
2019-04-02 08:14:56 -07:00
A C SREEDHAR REDDY 90c51a8b6f update url for apk-splits user-guide (#24253)
Summary:
Changed apk-splits user-guide url.

[ANDROID] [CHANGED] - Apk tools url.
Pull Request resolved: https://github.com/facebook/react-native/pull/24253

Differential Revision: D14724834

Pulled By: cpojer

fbshipit-source-id: 8e9e21ebdcb0d585f1f262640e259ccf71112adb
2019-04-02 08:07:06 -07:00
Adam Comella a2285b1790 Android: Enable views to be nested within <Text> (#23195)
Summary:
Potential breaking change: The signature of ReactShadowNode's onBeforeLayout method was changed
  - Before: public void onBeforeLayout()
  - After:  public void onBeforeLayout(NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer)

Implements same feature as this iOS PR: https://github.com/facebook/react-native/pull/7304

Previously, only Text and Image could be nested within Text. Now, any view can be nested within Text. One restriction of this feature is that developers must give inline views a width and a height via the style prop.

Previously, inline Images were supported via FrescoBasedReactTextInlineImageSpan. To get support for nesting views within Text, we create one special kind of span per inline view. This span is called TextInlineViewPlaceholderSpan. It is the same size as the inline view. Its job is just to occupy space -- it doesn't render any visual. After the text is rendered, we query the Android Layout object associated with the TextView to find out where it has positioned each TextInlineViewPlaceholderSpan. We then position the views to be at those locations.

One tricky aspect of the implementation is that the Text component needs to be able to render native children (the inline views) but the Android TextView cannot have children. This is solved by having the native parent of the ReactTextView also host the inline views. Implementation-wise, this was accomplished by extending the NativeViewHierarchyOptimizer to handle this case. The optimizer now handles these cases:
  - Node is not in the native tree. An ancestor must host its children.
  - Node is in the native tree and it can host its own children.
  - (new) Node is in the native tree but it cannot host its own children. An ancestor must host both this node and its children.

I added the `onInlineViewLayout` event which is useful for writing tests for verifying that the inline views are positioned properly.

Limitation: Clipping
----------

If Text's height/width is small such that an inline view doesn't completely fit, the inline view may still be fully visible due to hoisting (the inline view isn't actually parented to the Text which has the limited size. It is parented to an ancestor which may have a different clipping rectangle.). Prior to this change, layout-only views had a similar limitation.
Pull Request resolved: https://github.com/facebook/react-native/pull/23195

Differential Revision: D14014668

Pulled By: shergin

fbshipit-source-id: d46130f3d19cc83ac7ddf423adcc9e23988245d3
2019-04-01 19:55:23 -07:00
Kacper Wiszczuk 770da3ac67 Improvement: Adjust template to match new init command (#24138)
Summary:
Adjusting template to new init command (https://github.com/react-native-community/react-native-cli/pull/241).

PR with new init command needs to be merged before we land this.

[General] [Changed] - Adjust template to match new init command
Pull Request resolved: https://github.com/facebook/react-native/pull/24138

Differential Revision: D14617568

Pulled By: cpojer

fbshipit-source-id: f4b90920d47d3e0d2b08470e0eaad1abd733e4cc
2019-04-01 16:25:48 -07:00
Christoph Nakazawa 9834c580af Move Geolocation JS code to FB internal
Summary: This removes the JS parts of Geolocation from React Native open source.

Reviewed By: yungsters

Differential Revision: D14693179

fbshipit-source-id: 1da5b7ec0e3e9d21d2019b7ee43e5f85661795b4
2019-04-01 15:21:59 -07:00
Joshua Gross 1b51cd488a Fix retain cycle in RCTDevMenu
Summary: A retain-cycle regression was added by D14162776 and detected here: T41208740. Fix should be trivial.

Reviewed By: shergin

Differential Revision: D14709784

fbshipit-source-id: bad6ab31a5170e9320c4432cbd20d02ec6164f38
2019-04-01 13:45:09 -07:00
Héctor Ramos 2a80a42d40 Revert D14423742: Use of TraceCompat
Summary:
D14423742 introduced a regression on OSS test_android due to androidx.core.os not being available. I spent some time investigating a fix forward this morning, with no success. Reverting.

Changelog:

[Android] [Changed] - Revert 92f019c666

Reviewed By: cpojer

Differential Revision: D14668728

fbshipit-source-id: c7542992805551dc4302626e1536759794efaa82
2019-04-01 13:09:07 -07:00
Junhui Park fe9d21f6fa Fix setting the contentOffset value when refresh ends (#24191)
Summary:
It closes #24170.
I opened the issue yesterday, and I think I found the way how to resolve it. So, I'm opening this PR directly without any comment on the issue.

In the `endRefreshProgrammatically` of `RCTRefreshControl.m`, the comment says that " The contentOffset of the scrollview MUST be greater than 0". However, if the `contentInset` prop is set for the `FlatList`, I think `contentOffset` can be a negative value after refreshing and should be greater than `-contentInset.top`.

As I reported the bug in that issue, If I am using `contentInset` prop to the `FlatList`, making `contentOffset` value be always 0 when refreshing ends causes something wrong situation.

[iOS] [Fixed] - Fix setting the contnetOffset when refreshing ends
Pull Request resolved: https://github.com/facebook/react-native/pull/24191

Differential Revision: D14710987

Pulled By: sahrens

fbshipit-source-id: 03f06df9a93a2a46a7cc0b56269091778805917e
2019-04-01 12:54:36 -07:00
Jakob Krigovsky 169ef78e64 Harmonize spacing after colons (#24186)
Summary:
Harmonizes the spacing after colons to have a more consistent coding style.
Pull Request resolved: https://github.com/facebook/react-native/pull/24186

Differential Revision: D14668167

Pulled By: cpojer

fbshipit-source-id: 8f1ba71eec186b3a2221d1f4fac851e51afc52cc
2019-04-01 12:22:40 -07:00
Gábor Siffel 9ddef77b1d Add the ability to customize webview response to client cert requests
Summary:
Add the ability to set a custom handler on ReactWebViewManager to handle client certificate challenges during TLS authentication.

[Android][Added] - Public method setCustomClientCertRequestHandler to the native com.facebook.react.views.webview.ReactWebViewManager, that allows using a custom response for client certificate challenges.

Reviewed By: mjhu

Differential Revision: D14609697

fbshipit-source-id: 567c95458af638d1f8233fc3ca0d9cefc061c2bf
2019-04-01 11:16:54 -07:00
Valentin Shergin b10da79fb4 Fabric: Introspection (self testing in debug mode) in ShadowTree
Summary:
We suspect that we have some error in diffing algorithm that cause some crashes in mounting layer, so we decided to write a comprehensive unit tests for that.

Writing them we realized that it would be cool to also enable that for normal app run in the debug more, so we can catch the problem in real environment when/if it happens.

Reviewed By: mdvacca

Differential Revision: D14587123

fbshipit-source-id: 6dcdf451b39489dec751cd6787de33f3b8ffb3fd
2019-04-01 10:50:50 -07:00
Valentin Shergin 3e4a8e35fe Fabric `ShadowTree` (and co) was moved to `mounting` module
Summary: Because it's kinda more logical and we will rely on this in comming diffs.

Reviewed By: mdvacca

Differential Revision: D14587124

fbshipit-source-id: 94ae9410b4ffeffd0fcb4da4a0518f0bb0d2ba63
2019-04-01 10:50:50 -07:00
Christoph Nakazawa 45bd2b514b Remove navigator.geolocation, use Geolocation
Summary: This is the first diff in an effort to remove Geolocation from React Native. This diff removes the globally injected navigator.geolocation feature and instead requires explicit importing of `Geolocation`. When using Web APIs, people will need to patch `navigator.geolocation` on their own from now on.

Reviewed By: sahrens

Differential Revision: D14692386

fbshipit-source-id: c57b290b49728101250d726d67b1956ff23a9a92
2019-04-01 09:09:54 -07:00
Dulmandakh 11ac06fda4 fix typo in DatePickerAndroidTypes.js (#24234)
Summary:
fix typo in DatePickerAndroidTypes.js, fixes https://github.com/facebook/react-native/issues/24137

[Android] [Changed] - fix typo in DatePickerAndroidTypes.js
Pull Request resolved: https://github.com/facebook/react-native/pull/24234

Differential Revision: D14705691

Pulled By: cpojer

fbshipit-source-id: 0d4aee045f7ec36b0cfcd5b4ce5a2cd47cee9ec5
2019-04-01 08:41:45 -07:00
Eli White ec3adae99a Turn on react-hooks/exhaustive-deps in FBSource
Summary: Looks like there are already a bunch of issues in the codebase because this wasn't on.

Reviewed By: cpojer

Differential Revision: D14701084

fbshipit-source-id: 09ff8e0d905b81fbe08c41d4f58758479b38187b
2019-04-01 08:20:18 -07:00
Sidharth Guglani 11e93cdc1f added flag for useBatchingForLayoutOutputs experiment
Summary:
Using a config flag to switch between different implementations of transferring layout outputs
- YogaNodeJNI uses multiple access of java fields to pass all properties like width, height, margin etc...
- YogaNodeJNIBatching uses a float array to pass all the data in one java field access

Reviewed By: davidaurelio

Differential Revision: D14378301

fbshipit-source-id: 0da5b28e6a67ad8fd60eb7efe622d9b2deaf177f
2019-04-01 06:16:36 -07:00
Sidharth Guglani 9bbca7c531 Added implementation for YogaNodeJNIBatching and logic for passing array from c++ to java
Summary: This diff adds the logic to transfer layout outputs using a float array

Reviewed By: davidaurelio

Differential Revision: D14368120

fbshipit-source-id: d1f22283bcea051d15657f42c15b90edaa0a8a7a
2019-04-01 06:16:36 -07:00
Sidharth Guglani 5ad752079c added test for reset method in YogaNodeJNI to verify all layout outputs are reset properly
Summary: This diff adds a test for reset method in YogaNodeJNI to verify all layout outputs are reset properly

Reviewed By: davidaurelio

Differential Revision: D14643926

fbshipit-source-id: fffbcd07ccb6d2df83fc0bf187d992ef194f3bd0
2019-04-01 06:16:36 -07:00
Sidharth Guglani c378be490f moved all the properties used for layout outputs to YogaNodeJNI
Summary:
Moved layout outputs transfer logic from YogaNodeJNIBase to YogaNodeJNI.
This change set is for adding experiment for layout outputs batching using a float array

Reviewed By: davidaurelio

Differential Revision: D14642995

fbshipit-source-id: 5d0bc7fa18c1985be7e216d7351f5eab2e03861d
2019-04-01 06:16:35 -07:00
Ram N 0b62ff0b94 Move Android code for Geolocation out
Reviewed By: cpojer

Differential Revision: D14692916

fbshipit-source-id: 6bcfda8aa8c7d22dce36828dae9f57068815ce20
2019-03-31 22:52:36 -07:00
Alfred Zien ff66600224 Use constructor attribute instead of +load objc method (#24155)
Summary:
Xcode 10.2 forbids creating categories for swift class that uses `+load` method. In react-native categories like this are used to register swift classes as modules (macro `RCT_EXTERN_MODULE`) This PR changes it to use `__attribute__((constructor))` instead of objc `+load` method.

I introduced new macro for this purpose, `RCT_EXPORT_MODULE_NO_LOAD`, it expands in something like:
```
void RCTRegisterModule(Class);

+ (NSString *)moduleName {
  return @"jsNameFoo";
}

__attribute__((constructor)) static void initialize_ObjcClassFoo{
  RCTRegisterModule([ObjcClassFoo class]);
}
```

Functions marked with `__attribute__((constructor))` are run before main and after all `+load` methods, so it seems like correct thing to do.

Fixes https://github.com/facebook/react-native/issues/24139
Doc about loading order https://developer.apple.com/documentation/objectivec/nsobject/1418815-load?language=objc

[iOS] [Fixed] - Fix runtime crash in xcode 10.2 when using RCT_EXTERN_MODULE for swift classes.
Pull Request resolved: https://github.com/facebook/react-native/pull/24155

Reviewed By: javache

Differential Revision: D14668235

Pulled By: shergin

fbshipit-source-id: 0c19e69ce2a68327387809773848d4ecd36d7461
2019-03-31 22:40:59 -07:00