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

23510 Коммитов

Автор SHA1 Сообщение Дата
Andrei Shikov 086c967286 Use dispatch unique for events that can be coalesced
Summary:
Event merging or "coalescing" is done on Java side from Android, but Fabric also includes some Cxx logic to merge those events. Although Android doesn't need this logic in particular, it is important to follow this path to ensure these events (e.g. scroll) are dispatched as "continuous", allowing for correct prioritization in Concurrent Mode.

`dispatchModernV2` selects between `dispatch` and `dispatchUnique` based on the `canBeCoalesced` parameter of the event, which is exactly what we need. The logic is only used in the "new" event dispatcher at the moment, so I wrapped it with feature flag to validate it doesn't cause any regressions.

Changelog:
[Android][Internal] - Try dispatching coalescing events as unique to Fabric

Reviewed By: sammy-SC

Differential Revision: D31272585

fbshipit-source-id: 6b67b61bd13fbff019d9eb8c5172bdd814a7b5b8
2021-09-30 22:26:33 -07:00
Andrei Shikov 8491edec28 Remove deprecation from `dispatchModern` in `Event.java`
Summary:
Assuming this method was deprecated to mean experimental.
This execution path is used by overwhelming majority of events and it seems as stable as it can be.

Changelog:
[Android][Changed] Removed experimental deprecation from `dispatchModern`

Reviewed By: cortinico

Differential Revision: D31270721

fbshipit-source-id: 5a7e50455ab2850adf9bc86a248773b170bf0ab9
2021-09-30 22:26:33 -07:00
Ramanpreet Nara 40a367e0a3 Make ClipboardModule TurboModule-compatible
Summary:
We forgot to make ClipboardModule TurboModule compatible. I think this was most likely because our codemods targeted all Java classes that extended ReactContextBaseJavaModule. The ClipboardModule extends ContextBaseJavaModule instead.

There are no other NativeModules that extend ContextBaseJavaModule.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D31291293

fbshipit-source-id: cf5d21898101699f8c349b013a77e8329339a8d3
2021-09-30 20:49:51 -07:00
Kevin Gozali 95187f7ebc OSS: fix up .watchmanconfig file content
Summary:
The latest watchman requires non-empty config file, so `{}` works.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31328467

fbshipit-source-id: fb1e8dee308e4ffeb035d7f9804c20edcb6b915d
2021-09-30 20:25:11 -07:00
Pieter Vanderwerff 30c64a592f Deploy 0.161.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: evanyeung

Differential Revision: D31289144

fbshipit-source-id: 636b95fe7dca6ac4df3db7a809a4dca26d1d6804
2021-09-30 16:28:03 -07:00
Michael Neeley 6334ac35ac Fixes Global Node Prefix Error (#31740)
Summary:
Some users have `node` installed globally which sets a `PREFIX` by default (so it knows where to put pkgs). We are looking for the "right" node on the next step anyway and if the user is using `nvm`, `PREFIX` breaks it.

closes https://github.com/facebook/react-native/issues/31181

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Ignores global npm prefix

Pull Request resolved: https://github.com/facebook/react-native/pull/31740

Test Plan:
`yarn ios` now works, even if there's a `usr/local/bin/npm`

<img width="493" alt="Screen Shot 2021-06-17 at 10 14 08 AM" src="https://user-images.githubusercontent.com/2659478/122413946-c2f57200-cf54-11eb-817c-bd3c07ac50bf.png">

Reviewed By: yungsters

Differential Revision: D31237363

Pulled By: charlesbdudley

fbshipit-source-id: 4ee9c04f8b8ab4e815bafbe2d02e589d621577b4
2021-09-30 15:02:27 -07:00
Joshua Gross 5c12a84c77 Fix simple typo in comment
Summary:
Fix simple typo in comment.

Changelog: [Internal] comment typo fix

Differential Revision: D31251299

fbshipit-source-id: 210d52f236b00ed4edbd969a715d91eb2ad712a7
2021-09-30 13:11:36 -07:00
Joshua Gross bf1a5ca8f1 Emit all touch events to PerformanceEventEmitter
Summary:
Pressability previously was filtering which events get forwarded through the PerformanceEventEmitter, but this causes issues for native telemetry systems which won't know which events Pressability has skipped (or why).

Also, the "delay ms" no longer has any meaning because the native timestamps and Date.now() have a different time-basis entirely.

Changelog: [Internal]

Differential Revision: D31251300

fbshipit-source-id: f097047ac150e8dddb0f3857d9f375bae2318681
2021-09-30 13:11:36 -07:00
Nicola Corti 1ee16fc2f3 Back out "Make react-native depend on react-native-gradle-plugin"
Summary:
Original commit changeset: ab1e842b60c5

Changelog:
[Internal] [Changed] - Back out "[RN][Android] Make react-native depend on react-native-gradle-plugin"

Reviewed By: fkgozali

Differential Revision: D31310547

fbshipit-source-id: 46c4c1e41b0f5432bc24975f754e0852e7180769
2021-09-30 12:32:36 -07:00
David Vacca 2feca00797 Toggle ScrollView.snapToAlignment behavior using ReactFeatureFlag.enableScrollViewSnapToAlignmentProp
Summary:
This diff enables/disables ScrollView.snapToAlignment behavior using ReactFeatureFlag.enableScrollViewSnapToAlignmentProp

changelog: [internal] internal

Reviewed By: motiz88

Differential Revision: D31308300

fbshipit-source-id: 26c01a342cac822f21d83e3474b529bea154aba6
2021-09-30 10:17:07 -07:00
David Vacca 3cffe352b5 Create FeatureFlag to control ScrollView.snapToAlignment prop
Summary:
This diff creates a FeatureFlag to control ScrollView.snapToAlignment prop

changelog: [internal] internal

Reviewed By: motiz88

Differential Revision: D31308301

fbshipit-source-id: 41b41e4e7d2a6c29c405151b2379e15df6eafc8f
2021-09-30 10:17:07 -07:00
Nicola Corti 80e24834ba Make react-native depend on react-native-gradle-plugin
Summary:
Similarly to what we did for react-native-codegen, I'm introducing
a dependency between RN and the Gradle plugin, to be processed upon OSS bumps.

Changelog:
[General] [Added] - Make react-native depend on react-native-gradle-plugin

Reviewed By: fkgozali

Differential Revision: D31206303

fbshipit-source-id: ab1e842b60c51d0dce272892a30be2e27350f9bb
2021-09-30 09:07:43 -07:00
Gustavo Sverzut Barbieri 51bf557948 Feat/ios m1 improvements (#32296)
Summary:
* Remove left over from a1c445a39c (commitcomment-57240925)
* Add a warning if running with Rosetta2 as per https://github.com/facebook/react-native/pull/32284#issuecomment-929680784

## Changelog

[iOS] [Fixed] - Removed __apply_Xcode_12_5_M1_post_install_workaround
[iOS] [Changed] - Warn if Rosetta2 is being used (x86_64 on arm64)

Pull Request resolved: https://github.com/facebook/react-native/pull/32296

Test Plan: Build on macOS Apple devices without any warnings during `pod install`

Reviewed By: RSNara

Differential Revision: D31291567

Pulled By: fkgozali

fbshipit-source-id: 65e54507dedcdba39c1b441aad85e940eedc8b52
2021-09-29 18:15:25 -07:00
Tim Yung 4fdbc44ab5 RN: Disable `collapsable` for Animated Components
Summary:
When we were iterating on the Fabric renderer, animated components went through some iteration to ensure that animated shadow nodes were not flattened away. At the time, `collapsable` was not supported on iOS, even in Fabric, because the legacy renderer would not publish the `collapsable` prop on the view config.

This has since been fixed and `collapsable` is supported on both Android and iOS. We no longer need the `nativeID` workaround to prevent view flattening.

For use cases of the JavaScript driver and legacy renderers, this change will cause views which used to be flattened to no longer be flattened. This seems like an appropriate change considering the direction that we are moving (in which everything is eventually transitioned to using the Fabric renderer).

Changelog:
[Android][Changed] - Native views backing Animated.View (w/ JavaScript-driven animations) will no longer be flattened; this should be a transparent change.

Reviewed By: lunaleaps, mdvacca

Differential Revision: D31223031

fbshipit-source-id: 48dc63471eef406f4c215bfea0b3ef82a05d4b24
2021-09-29 17:22:21 -07:00
Su Min Kim c9c14ef687 Add switch example (#30611)
Summary:
Add examples for Switch component in RN Tester app for:
- ios_backgroundColor
- onChange

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Added] - Added examples to Switch component

Pull Request resolved: https://github.com/facebook/react-native/pull/30611

Test Plan: ![SwitchExample](http://g.recordit.co/FvniuL2yLl.gif)

Reviewed By: lunaleaps

Differential Revision: D25680480

Pulled By: sota000

fbshipit-source-id: 91202a0d8699554b0535f1a91875fd9fc664d54d
2021-09-29 14:50:14 -07:00
Héctor Ramos 2d2de744bb Build release package on stable oss release branches
Summary:
Expands the building of npm tarballs to include branches that match the /^(\d+)\.(\d+)-stable$/ regexp.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31272377

fbshipit-source-id: a536a0b5e14812ece8266f3c83497071405a164a
2021-09-29 11:02:22 -07:00
Samuel Susla dd99475032 Fix view preallocation during cloning
Summary:
changelog: [internal]

This code assured that view preallocation is only triggered if ShadowNode is cloned from revision 0 to revision 1 (first time ShadowNode is cloned).
Node can go from virtual to view forming in subsequent clones, not just the first one. This is more of a case in Concurrent React where the node can be cloned many times before it is first mounted.

Reviewed By: mdvacca

Differential Revision: D31237719

fbshipit-source-id: 13fe6d10fdc815dbdae785d1d9d86d1c8fd36be4
2021-09-29 08:02:22 -07:00
Andrei Shikov 155a1a8ac9 Set event category for touch events on Android
Summary:
Updates event category deduction to match iOS implementation.
The event priority is used by concurrent mode to prioritize certain events, where Cxx part already assigns the correct priority based on the `ContinuousStart` -> `ContinuousEnd` spans. These spans can be deduced from the touch events, which we do in this implementation.

All events that can be "coalesced" (dispatched through `invokeUnique`) are assigned `Continuous` by default in Fabric core, so scroll/slider change events will never be discrete.

Changelog:
[Internal] Add category deduction to Android touch events

Reviewed By: mdvacca

Differential Revision: D31233233

fbshipit-source-id: f5b039aa137f1b4d2e2b15578bfc29ab6903a081
2021-09-29 06:53:49 -07:00
Andrei Shikov bf4c6b3606 Expose RawEvent::Category to Java callsites
Summary:
For iOS, event category deduction is done from the C++ code, but the touch events are handled on Java layer in Android. This change exposes the category parameter through the `EventEmitterWrapper` called from Java, allowing to define category for events in the future.

Changelog:
[Internal] - Expose event category through JNI

Reviewed By: mdvacca

Differential Revision: D31205587

fbshipit-source-id: f2373ce18464b01ac08eb87df8f421b33d100be2
2021-09-29 06:53:49 -07:00
Moti Zilberman a0c3c85879 Move metro-babel-register into repo-config (devDependencies)
Summary:
Removes `metro-babel-register` as a runtime dependency of the `react-native` package, where it is only used as a dev dependency (in the Jest preprocessor).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D31177424

fbshipit-source-id: bf7b7216116744a3234beea089d0028c0bfe4d1e
2021-09-29 05:12:46 -07:00
Cristiano Coelho 900210cacc Fix Image defaultSource not showing on iOS (#32172)
Summary:
Fix Image defaultSource not showing on iOS.

This bug was introduced somewhere between RN 0.63 and 0.65. On iOS, defaultSource does not show while the image is being downloaded, only if it fails or there's no internet.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Fix Image defaultSource not showing on iOS

Pull Request resolved: https://github.com/facebook/react-native/pull/32172

Test Plan: Ran both debug and release builds on an iPhone 12 pro (iOS 14.6)

Reviewed By: sammy-SC

Differential Revision: D30822805

Pulled By: lunaleaps

fbshipit-source-id: c4ef18723a8311ef3be1d7ae25ff3c205e8fff62
2021-09-29 01:56:56 -07:00
David Vacca 04184ef851 Extend ScrollView.snapToAlignments in RN Android to reach feature parity with RN iOS
Summary:
This diff extends the current implementation of ScrollView.snapToAlignments from RN Android to reach feature parity with RNiOS

changelog: [Android][Changed] Implement ScrollView.snapToAlignments in RN Android

Reviewed By: javache

Differential Revision: D31206398

fbshipit-source-id: b6534965c476a0a4745ac98b419cbe05dc5c746e
2021-09-29 01:47:45 -07:00
David Vacca e774c037bc Implement snapToAlignment in vertical ScrollView
Summary:
This diff implements the SnapToAlignment functionality in ReactScrollView for RN Android.
In order to use SnapToAlignment, the pagingEnabled prop should be set
Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)
I still need to verify how different RNiOS and RN Android behaviors are
changelog: [Android][Added] Implement SnapToAlignment in ReactScrollView

Reviewed By: JoshuaGross

Differential Revision: D31182786

fbshipit-source-id: a9b55d9c00326ae21ca9b89575e79c60bf9edcca
2021-09-29 01:47:45 -07:00
David Vacca c6e5640e87 Add snapToAlignment to ReactScrollViewManager
Summary:
This diff adds the new snapToAlignment into ReactScrollViewManager
changelog: [Android][Added] Implement snapToAlignment into ReactScrollViewManager

Reviewed By: JoshuaGross

Differential Revision: D31182787

fbshipit-source-id: 8049ceb462461a11f184dbc1b40ca8079a3e8b60
2021-09-29 01:47:45 -07:00
David Vacca d97a1a52c5 Fix warning in ScrollView classes
Summary:
EZ diff to fix warning in ScrollView classes

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D31175085

fbshipit-source-id: 2aebcf6b53b82f8d96aadf40db3f459652c69fb2
2021-09-29 01:47:45 -07:00
David Vacca b12256394e Implement SnapToAlignment in ReactHorizontalScrollView
Summary:
This diff implements the SnapToAlignment functionality in ReactHorizontalScrollView for RN Android.

In order to use SnapToAlignment, the pagingEnabled prop should be set

Based on the documentation the behavior implemented in this diff is more "advanced" than the one implemendted in RNiOS, because it let you snap without specifying any interval nor offset (it calculates the intervals in real time based on the size of its content)

I still need to verify how different RNiOS and RN Android behaviors are

changelog: [Android][Added] Implement SnapToAlignment in ReactHorizontalScrollView

Reviewed By: JoshuaGross

Differential Revision: D31174544

fbshipit-source-id: 204a82f55e3b7598124ce2528d8ad7d854c0ac77
2021-09-29 01:47:45 -07:00
David Vacca deec1db9fd Add snapToAlignment to ReactHorizontalScrollViewManager
Summary:
This diff adds the new snapToAlignment into ReactHorizontalScrollViewManager

changelog: [Android][Added] Implement snapToAlignment into ReactHorizontalScrollViewManager

Reviewed By: JoshuaGross

Differential Revision: D31174545

fbshipit-source-id: c56bfca207980428be98dd21a5387a0ff6bcd296
2021-09-29 01:47:45 -07:00
David Vacca a54cfb9e57 Add snapToAlignment to ScrollView.js Android implementation
Summary:
Update ScrollView.js to support snapToAlignment in RN Android

changelog: [Android][Added] Implement snapToAlignment in ReactHorizontalScrollView

Reviewed By: JoshuaGross

Differential Revision: D31174546

fbshipit-source-id: 480e990793ced74121c6aa1875f2695a70d1f804
2021-09-29 01:47:44 -07:00
Héctor Ramos b29b05fa98 bump-oss-version: Add -v / --to-version argument and use it when bumping nightly releases (now at 20:00 UTC)
Summary:
Add a new -v or --to-version argument to the bump-oss-version script.

When the bump-oss-version script runs, it will use the version string that is passed in, instead of trying to infer it from the current commit. This fixes a bug in the last nightly release where the bump script used a different version string than what the publish script expected.

Nightlies now run at 20:00 hours UTC.

Changelog: [Internal]

Reviewed By: fkgozali, TheSavior

Differential Revision: D31261829

fbshipit-source-id: a9341f93c3c7bf0379aa3c5e7f345182df70f846
2021-09-29 00:11:32 -07:00
Héctor Ramos c6907ee488 Bump Xcode to 13.0.0 and CocoaPods to 1.11.2
Summary:
Bump the version of Xcode used in internal and external iOS tests, as well as the CocoaPods version used in RNTester (and therefore, the internal CocoaPods offline mirror).

New versions used:
* Xcode 13.0.0
* CocoaPods 1.11.2

See Circle CI Xcode 13.0.0 macOS Container Software manifest: https://circle-macos-docs.s3.amazonaws.com/image-manifest/v6052/index.html
* Xcode 13.0 Build version 13A233
* CocoaPods	1.11.2

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31253170

fbshipit-source-id: c85f3ee12fa708d9e54fef1200f3124810211d2f
2021-09-28 22:28:06 -07:00
James Donald f09beeabeb Merge base AppleTVOS flags into base Apple flags (take #5)
Summary:
Previous iterations of this diff that were reverted: D30678341 (800945982f), D30868627 (abd0f387cd),
D31024459 (0a46e5efad), D31147242 (92c1bee5f9).

With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.

Changelog: [Internal]

skip-frl-buck-targeting

Reviewed By: mzlee

Differential Revision: D31216242

fbshipit-source-id: 93ee2afda41af06fe210ba6a4a5459a438d6c3f8
2021-09-28 21:05:03 -07:00
Gustavo Sverzut Barbieri a1c445a39c Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284)
Summary:
Since Apple released its own silicon M1, an ARM64, the react-native build is broken or at least not as effective as it should.

This PR stops excluding `arm64` simulator (this is not needed on the M1 neither on Intel devices) and removes the problematic `$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)` from `LIBRARY_SEARCH_PATHS`, since on Xcode 12.5 and 13.0 this folder contains only `i386/x86_64` binaries and will fail compilation.

Instead this PR forces `$(SDKROOT)/usr/lib/swift` while it removes the incorrect directory. Ideally we could just remove `LIBRARY_SEARCH_PATHS` altogether if `$(inherited)` and `$(SDKROOT)/usr/lib/swift` were the only entries, but it would require us a **newer CocoaPods**, since that was fixed with `1.11` (see  6985cbf7de). Since we don't enforce that, lets keep the `$(SDKROOT)/usr/lib/swift` and call it done.

Last but not least, deprecate the `__apply_Xcode_12_5_M1_post_install_workaround()` as it's not needed anymore, at least with recent versions of the dependencies, no patching is required with RCT-Folly, neither we need to force `IPHONEOS_DEPLOYMENT_TARGET=11.0`

## Changelog

[iOS] [Fixed] - Xcode 12.5+ build of iPhone Simulator on Apple M1
[iOS] [Changed] - Do not exclude the arm64 iphonesimulator
[iOS] [Deprecated] - __apply_Xcode_12_5_M1_post_install_workaround()

Pull Request resolved: https://github.com/facebook/react-native/pull/32284

Test Plan:
* Build `packages/rn-tester` on M1 and see it still works properly
* Run `pod install` on x86_64 and arm64 (m1) and see the `project.pbxproj` is not changed

## References:
* Closes https://github.com/facebook/react-native/issues/31480
* The initial fix ac4ddec542
* Upgrading CocoaPods to 1.11 would bring us 6985cbf7de and we could avoid adding `$(SDKROOT)/usr/lib/swift` ourselves

Reviewed By: lunaleaps

Differential Revision: D31248460

Pulled By: fkgozali

fbshipit-source-id: 5a0d69593e889e296a2ba2e7b4387ecbd56fc08d
2021-09-28 17:05:24 -07:00
fabriziobertoglio1987 132d1d00f8 nested text onPress not working on last character (#30928)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/22747 nested text does not allow you to press on the last character.

The method reactTagForTouch filters touches based on coordinates x and y. Nested Texts are converted into Spans on Android
28fb41a0ab/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java (L111-L112)
https://developer.android.com/guide/topics/text/spans

reactTagForTouch iterates over the span and triggers the onPress handler if the x,y coordinates correspond to one of the span characters.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Nested Text Android onPress does not work with last character

Pull Request resolved: https://github.com/facebook/react-native/pull/30928

Test Plan:
This changes fix the Java API which can not be tested as explained in commit 709a441ecf
The java TextTest was excluded from the test suite in commit 709a441ecf as they need the Yoga libraries to run

**<details><summary>TEST - Clicking on the last letter triggers the callback</summary>**
<p>

Clicking on the last letter does not invoke the onPress callback (in this case a console.warn)

| **BEFORE** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107537789-9060f480-6bc3-11eb-8ad1-1152e466f830.gif" width="700" height="" /> |

Clicking on the last letter does invoke the onPress callback (in this case a console.warn)

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107538263-11b88700-6bc4-11eb-9a48-139e053aa68b.gif" width="700" height="" /> |

</details>
</p>

**<details><summary>TEST - Adding and removing Text</summary>**
<p>

<video src="https://user-images.githubusercontent.com/24992535/107541305-48dc6780-6bc7-11eb-8d57-a8aeb57a6879.mp4" />

</details>
</p>

**<details><summary>TEST - Different type of languages</summary>**
<p>

<video src="https://user-images.githubusercontent.com/24992535/107541683-affa1c00-6bc7-11eb-8630-22c2ba4d0973.mp4" />

</details>
</p>

**<details><summary>TEST - Testing other Examples that use onPress handler</summary>**
<p>

<video src="https://user-images.githubusercontent.com/24992535/107541972-f9e30200-6bc7-11eb-9759-6ff9d52bba15.mp4" />

</details>
</p>

**<details><summary>TEST - Text with Inline Images</summary>**
<p>

| Inline View | Inline Image is clipped |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107542187-357dcc00-6bc8-11eb-9eed-eefbd8be339f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/107542193-37478f80-6bc8-11eb-8ab3-fa1282dc3fd3.png" width="300" height="" /> |

</details>
</p>

Reviewed By: yungsters

Differential Revision: D31061832

Pulled By: charlesbdudley

fbshipit-source-id: 3034b4f35d4042bfcf1e899a59d5b2f73a990f31
2021-09-28 16:45:53 -07:00
Héctor Ramos 6b86c834ae Circle CI: Build a release on pull-request commits
Summary:
Package a npm tarball for react-native on pull-request commits, for ease of testing during development.

Ensure npm/github secrets are not exposed on pull-request builds (e.g. Circle CI will only grab the CIRCLE_NPM_TOKEN and GITHUB_TOKEN on jobs triggered by tagged commits or commits on main)

Renames Circle CI `publish_npm_package` job to `build_and_release_npm_package`, and uses `build_npm_package` for dry runs (e.g. commitlies).

Changelog: [internal]

Reviewed By: fkgozali

Differential Revision: D31243726

fbshipit-source-id: 2907febac3286a1504984c2f14e84dec1d819858
2021-09-28 16:30:35 -07:00
Genki Kondo 3db4046f64 Remove unused viewmanagers
Summary:
Removes unused viewmanagers' *Delegate and *Interface classes.

Changelog: [Internal]

Reviewed By: mgoovaer

Differential Revision: D31242317

fbshipit-source-id: f1c8b04707289182ac9548d8cf688ae736bfbe1d
2021-09-28 16:25:40 -07:00
Xin Chen 652cb541a5 Adding interface to wrap surface interactions for LogBox
Summary:
This diff introduces a new interface named `SurfaceDelegate`. The interface abstracts the API for interacting with a surface, which is required for platforms other than mobile to implement how it wants to show and hide a surface. For existing Mobile use cases, the `LogBoxDialogSurfaceDelegate` is provided as a fallback solution so everything still works.

Changelog:
[Android][Added] - Add SurfaceDelegate abstraction to support interaction in multiple platforms and provide default implementation in LogBoxModule

Reviewed By: mdvacca

Differential Revision: D31132285

fbshipit-source-id: 13315a8bc5b7bcaee9b5e53ef5c6f6cc8cb01f31
2021-09-28 14:57:37 -07:00
Adnan Irfan f2eecae63d Fix typo (#31295)
Summary:
Fixed typo in Share component docs

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Fixed] - Fix typo in Share component docs

Pull Request resolved: https://github.com/facebook/react-native/pull/31295

Test Plan: N/A

Reviewed By: yungsters

Differential Revision: D31152173

Pulled By: charlesbdudley

fbshipit-source-id: 831252f24876986fd053ff5e9875fef1132fa957
2021-09-28 14:50:41 -07:00
Sota Ogo 8595f3f22c Back out "Feature: ScrollView `automaticallyAdjustKeyboardInsets`"
Summary:
Original commit changeset: 9ccfb4b6d477 / D30015799 (6e903b07fa)

The diff caused a redbox/error in some products. Reverting now and will try it again.

Changelog: Backing out PR: 31402

Differential Revision: D31238961

fbshipit-source-id: b2ccd3d3ab9d7e764e41fb54d8a7e60882d1405f
2021-09-28 14:05:00 -07:00
Héctor Ramos 2254d95cdb Releases: tag nightlies with commit and timestamp
Summary:
Nightlies will be tagged with the commit they are based off and a timestamp.

> Example: `react-native-0.0.0-084a8b5f0-20210928-054053`

Commitlies now use the proper name on Circle CI for their job: `build_commit_package`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31224640

fbshipit-source-id: d1742a1d475aaf60d7b4c0708e30a5c5b205182d
2021-09-28 13:53:17 -07:00
Anderson Mesquita f3fe7a0fb5 Quote --sourcemap-output argument during ios build (#31587)
Summary:
Scheme names may contain whitespace characters is used as path of the
path for various files during build time. This means any path that
includes the scheme name in it needs to be surrounded by quotes.

You can see the generated command below for a project with a scheme
called `Some Scheme`:

    node ./node_modules/react-native/cli.js bundle \
      --entry-file index.js \
      --platform ios \
      --dev false \
      --reset-cache \
      --bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \
      --assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \
      --sourcemap-output ./ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map

`--bundle-output` and `--assets-dest` are properly quoted, but
`--sourcemap-output` is not.

This changes `$EXTRA_ARGS` to an array of strings so that we can
propertly quote `$PACKAGER_SOURCEMAP_FILE` when passing it to the
`--sourcemap-output` argument. When running the bundle command, this
array is unwrapped and all its elements passed as individual arguments.

It also applies the same unwrapping to `$EXTRA_PACKAGER_ARGS` so that
users can also pass an array of options when arguments containing spaces
are needed.

It's important to note that these changes ARE backwards compatible: if
`$EXTRA_PACKAGER_ARGS` is defined as a simple string, instead of an
array of strings, the command won't break, as it will still expand
correctly.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[iOS] [Fixed] - Source map path for schemes containing whitespaces

Pull Request resolved: https://github.com/facebook/react-native/pull/31587

Test Plan:
With the new change, the generated command becomes:

    node ./node_modules/react-native/cli.js bundle \
      --entry-file index.js \
      --platform ios \
      --dev false \
      --reset-cache \
      --bundle-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle' \
      --assets-dest './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app' \
      --sourcemap-output './ios/derivedDataBuild/Build/Intermediates.noindex/ArchiveIntermediates/Some Scheme/BuildProductsPath/Release-iphoneos/Some Scheme.app/main.jsbundle.map'

Reviewed By: yungsters

Differential Revision: D30911631

Pulled By: charlesbdudley

fbshipit-source-id: 0c2d98746b365285fe693bcc867a24d3fc649f50
2021-09-28 11:14:44 -07:00
PastLeo 3e7c310b1d add asdf-vm support in react-native-xcode.sh (#30111)
Summary:
About asdf-vm: https://asdf-vm.com/

This PR add [asdf-vm](https://asdf-vm.com/) support to `find-node.sh` for `scripts/react-native-xcode.sh` in `Bundle React Native code and images` build phrase and potentially other scripts using `find-node.sh` to get executable nodejs

## Changelog

[iOS] [Added] - add asdf-vm support in find-node.sh

Pull Request resolved: https://github.com/facebook/react-native/pull/30111

Test Plan: Xcode is able to complete `Bundle React Native code and images` build phrase without errors when node is installed by asdf-vm

Reviewed By: yungsters

Differential Revision: D31064080

Pulled By: charlesbdudley

fbshipit-source-id: aa73620fc39027c58c9cdfbb554cd5698b917850
2021-09-28 10:55:09 -07:00
fabriziobertoglio1987 8bef3b1f11 compute correct Keyboard Height with Notch (#30919)
Summary:
fixes https://github.com/facebook/react-native/issues/27089 fixes https://github.com/facebook/react-native/issues/30191 fixes https://github.com/facebook/react-native/issues/26296 fixes https://github.com/facebook/react-native/issues/24353
Related https://github.com/facebook/react-native/issues/30052 https://github.com/facebook/react-native/issues/28004 https://github.com/facebook/react-native/issues/26536

The keyboard height of event keyboardDidShow is computed as the difference of two variables:

- The screen height excluding the Android Notch
DisplayMetricsHolder.getWindowDisplayMetrics().heightPixels returns the screen height excluding the Android Notch
- The Visible Area excluding the Keyboard, but including the Android Notch
getWindowVisibleDisplayFrame() which returns the visible area including the Android Notch

The computation of the keyboard height is wrong when the device has an Android Notch.
This pr adds the Android Notch computation for API levels 28+

More info at https://github.com/facebook/react-native/issues/27089#issuecomment-775821333

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Compute Android Notch in keyboardDidShow height calculation API 28+

Pull Request resolved: https://github.com/facebook/react-native/pull/30919

Test Plan:
adding a ReactRootViewTest for keyboardDidShow verifying correct functionality on API < 28

**<details><summary>TEST CASE - BEFORE FIX</summary>**
<p>

**WITHOUT NOTCH**
- The black view on the bottom is visible
- The keyboard height is 282

| **Full Screen** | **Keyboard Did Show** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107212700-a1fd9d00-6a07-11eb-9248-26f9c4d92ae3.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/107212590-7975a300-6a07-11eb-89f4-891a37a7c406.png"  width="300" height="" /> |

**WITH NOTCH**
- The black view on the bottom is **not** visible. The black view is not visible because keyboardDidHide is sending the wrong keyboard height value.
- The keyboard height changes to 234. The keyboard height is the same from the previous test, but the value sent from keyboardDidHide changed for the Notch.

| **Full Screen** | **Keyboard Did Show** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107212619-81cdde00-6a07-11eb-9630-7e7c8c34d798.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/107212707-a4f88d80-6a07-11eb-9134-f077059c83a6.png"  width="300" height="" /> |

</p>
</details>

**<details><summary>TEST CASE - AFTER FIX</summary>**
<p>

**WITH NOTCH**
- The black view on the bottom is visible
- The keyboard height is 282

| **Full Screen** | **Keyboard Did Show** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/107212619-81cdde00-6a07-11eb-9630-7e7c8c34d798.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/107349053-0d0ea880-6ac8-11eb-9695-33128080b6b8.png"  width="300" height="" /> |

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D31207989

Pulled By: cortinico

fbshipit-source-id: 0955a3884201122166c5c0ae2aca988a0ed4af53
2021-09-28 10:42:36 -07:00
Samuel Susla ea3e244668 Add option to use RuntimeScheduler in TurboModules
Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D31145372

fbshipit-source-id: b1d9473d5006d055d1116f71f65899293fb85c56
2021-09-28 09:23:57 -07:00
CodemodService FBSourceKtfmtLinterBot 3516090174 Daily `arc lint --take KTFMT`
Reviewed By: zertosh

Differential Revision: D31225996

fbshipit-source-id: bf4c27edf42c86d3e71b3ae734307025a5203ce9
2021-09-27 20:20:27 -07:00
Nick Vlug 1927ceb552 Update README.md (#32277)
Summary:
Update the showcase url to the right url.

When I did check out the repository and I was about to navigate to showcase. I found out the url was wrong.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - Changed the showcase URL

Pull Request resolved: https://github.com/facebook/react-native/pull/32277

Reviewed By: lunaleaps

Differential Revision: D31206326

Pulled By: cortinico

fbshipit-source-id: a4092e9bb74d9a9cc68d7252aa131083dd38b6ca
2021-09-27 18:55:05 -07:00
Moti Zilberman 268efb1022 Use deep require instead of Haste for NativeComponentRegistry
Summary:
Changelog: [Internal]

Some environments that use codegen don't have Haste enabled, breaking the `require('NativeComponentRegistry')` call in generated view configs. Here we change it to reference an explicit path relative to `react-native`.

Reviewed By: JoshuaGross

Differential Revision: D31166063

fbshipit-source-id: cebc23d0d95b5cde76d0f8473eabc03ca82a862e
2021-09-27 13:47:28 -07:00
James Donald 6ea3df0507 Revert D31147242: Merge base AppleTVOS flags into base Apple flags (take #4)
Differential Revision:
D31147242 (92c1bee5f9)

Original commit changeset: deef1f1b39eb

fbshipit-source-id: d4d3c7546e4e2bcf59a72c7c865ee7d9218ab0d6
2021-09-27 13:35:25 -07:00
Alex Malyshev 92c1bee5f9 Merge base AppleTVOS flags into base Apple flags (take #4)
Summary:
Previous iterations of this diff that were reverted: D30678341 (800945982f), D30868627 (abd0f387cd),
D31024459 (0a46e5efad).

With the power of selects, we can move the base AppleTVOS flags into the regular
base Apple flags.

Changelog: [Internal]

Reviewed By: mzlee

Differential Revision: D31147242

fbshipit-source-id: deef1f1b39eb21772ab7ddd2ef1f19814e1f72d5
2021-09-27 13:18:31 -07:00
Nicola Corti 9db0fbb697 Add a README before publishing this package
Summary:
Before we can publish `0.0.1` of `react-native-gradle-plugin`, we
need to write a README file for it.

Changelog:
[Internal] [Changed] - Add a README before publishing the react-native-gradle-plugin

Reviewed By: ShikaSD

Differential Revision: D31206204

fbshipit-source-id: 0168298d04d4619dde931eb75d9555982f50fffe
2021-09-27 09:23:33 -07:00
Nicola Corti 25573db4b9 Renamed Gradle Plugint to `React`
Summary:
Removing the App postfix from the plugin as that is
a result of the merging. This aligns the plugin ID to the plugin
class name.

Changelog:
[Internal] [Changed] - Renamed Gradle Plugint to `React`

Reviewed By: ShikaSD

Differential Revision: D31205318

fbshipit-source-id: 23cd24c91fa8526137045e8537f03f560be939cb
2021-09-27 08:22:44 -07:00