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

23541 Коммитов

Автор SHA1 Сообщение Дата
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
enniel 6f126740fa gradle vm cleanup fix (#32257)
Summary:
This patch remove unused .so files for reduce android .apk and .aab

## Changelog

- [Android] [Fixed] - Exclude unused .so files for reduce android .apk and .aab

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

Test Plan:
I have created a repository for testing:
https://github.com/enniel/react-native-invalid-build-example

That lines includes patch for fix bug:
f195ecdbea/android/app/react.gradle (L331-L385)

```sh
git clone https://github.com/enniel/react-native-invalid-build-example
cd react-native-invalid-build-example
npm i
```

debug, hermes disabled, without patch
```sh
git switch hermes-disabled-without-patch
npm run build:android:debug:apk
```
open android/app/build/outputs/apk/debug/app-debug.apk in android studio

![debug-hermes-disabled-without-patch](https://user-images.githubusercontent.com/19760944/134640636-1505cfa4-0be9-4bb8-8130-74af01ebfd94.png)

debug, hermes enabled, without patch
```sh
git switch hermes-enabled-without-patch
npm run build:android:debug:apk
```
open android/app/build/outputs/apk/debug/app-debug.apk in android studio

![debug-hermes-enabled-without-patch](https://user-images.githubusercontent.com/19760944/134640743-f5730fbe-433f-45eb-a87c-e0e2eadb056b.png)

debug, hermes disabled, with patch
```sh
git switch hermes-disabled-with-patch
npm run build:android:debug:apk
```
open android/app/build/outputs/apk/debug/app-debug.apk in android studio

![debug-hermes-disabled-with-patch](https://user-images.githubusercontent.com/19760944/134640895-36f294ae-36fb-40b7-a767-f6b421fdbabd.png)

debug, hermes enabled, with patch
```sh
git switch hermes-enabled-with-patch
npm run build:android:debug:apk
```
open android/app/build/outputs/apk/debug/app-debug.apk in android studio

![debug-hermes-enabled-with-patch](https://user-images.githubusercontent.com/19760944/134641040-f4f08755-5234-4567-849d-0b815d58bc15.png)

release, hermes disabled, without patch
```sh
git switch hermes-disabled-without-patch
npm run build:android:release:apk
```
open android/app/build/outputs/apk/release/app-release.apk in android studio

![release-hermes-disabled-without-patch](https://user-images.githubusercontent.com/19760944/134641255-da3ccc5f-91e2-4b12-b0b2-1590fa13e5ce.png)

release, hermes enabled, without patch
```sh
git switch hermes-enabled-without-patch
npm run build:android:release:apk
```
open android/app/build/outputs/apk/release/app-release.apk in android studio

![release-hermes-enabled-without-patch](https://user-images.githubusercontent.com/19760944/134641396-f2ca3178-4225-4de7-b1f7-b741edba1877.png)

release, hermes disabled, with patch
```sh
git switch hermes-disabled-with-patch
npm run build:android:release:apk
```
open android/app/build/outputs/apk/release/app-release.apk in android studio

![release-hermes-disabled-with-patch](https://user-images.githubusercontent.com/19760944/134641675-b967df44-af1b-4070-9f84-a2f029381a39.png)

release, hermes enabled, with patch
```sh
git switch hermes-enabled-with-patch
npm run build:android:release:apk
```
open android/app/build/outputs/apk/release/app-release.apk in android studio

![release-hermes-enabled-with-patch](https://user-images.githubusercontent.com/19760944/134641737-aa4a435a-1fe2-4107-8bbd-8dadda24aebd.png)

Reviewed By: cortinico

Differential Revision: D31167423

Pulled By: ShikaSD

fbshipit-source-id: 4026df818c57fa699526ca1c31c1d1a68d58baef
2021-09-27 06:54:32 -07:00
Samuel Susla 8d0a2e7921 Stop subview clipping recursion at RCTScrollViewComponentView component
Summary:
changelog: [internal]

Prevent `RCTScrollViewComponentView`'s children from being clipped by stopping clipping recursion.

Reviewed By: fkgozali

Differential Revision: D31196948

fbshipit-source-id: 09548ade9cf993730784f544b565b9fde77a6ee4
2021-09-26 12:15:38 -07:00
Samuel Susla 18697adec4 Add option to use RuntimeScheduler in TurboModules
Summary: changelog: [internal]

Reviewed By: RSNara

Differential Revision: D31108093

fbshipit-source-id: 941abf334cc89391641131475725a3eeb790b822
2021-09-25 15:31:21 -07:00
Héctor Ramos 5bc9d91b10 Circle CI: (FIX) Build release package outside of publish-npm.js
Summary:
The version of npm available in Circle CI is 6.x, which does not support the `--pack-destination` argument. As a result, `npm pack --pack-destination build` was interpreted as a request to package the 'build' directory for distribution.

Since we need to make sure the output of `npm pack` is consumed by Circle CI's `store_artifacts` directive, we move the commitlies release packing logic to the Circle CI job config itself as to reduce coupling between `publish-npm.js` and the Circle CI config.

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D31183635

fbshipit-source-id: f0e0baae4ae31941dbb78dd1fec689f0f3398b52
2021-09-25 10:06:04 -07:00
Héctor Ramos 667cfb2302 Make react-native-codegen a dependency for releases
Summary:
We only need to ensure `react-native-codegen` is a direct dependency of `react-native` in open source releases. Otherwise, we can use the package from source at `packages/react-native-codegen`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D31190817

fbshipit-source-id: 527b1c370a35c3efad2448b510172a87c7345ee2
2021-09-25 08:14:03 -07:00
Marc Rousavy 6e903b07fa Feature: ScrollView `automaticallyAdjustKeyboardInsets` (#31402)
Summary:
Currently, ScrollViews provide the prop `keyboardDismissMode` which lets you choose `"interactive"`. However when the keyboard is shown, it will be rendered above the ScrollView, potentially blocking content.

With the `automaticallyAdjustKeyboardInsets` prop the ScrollView will automatically adjust it's `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) props to push the content up so nothing gets blocked.

* The animation curve and duration of the Keyboard is exactly matched.
* The absolute position of the ScrollView is respected, so if the Keyboard only overlaps 10 pixels of the ScrollView, it will only get inset by 10 pixels.
* By respecting the absolute position on screen, this automatically makes it fully compatible with phones with notches (custom safe areas)
* By using the keyboard frame, this also works for different sized keyboards and even `<InputAccessoryView>`s
* This also supports `maintainVisibleContentPosition` and `autoscrollToTopThreshold`.
* I also fixed an issue with the `maintainVisibleContentPosition` (`autoscrollToTopThreshold`) prop(s), so they behave more reliably when `contentInset`s are applied. (This makes automatically scrolling to new items fully compatible with `automaticallyAdjustKeyboardInsets`)

## Changelog

* [iOS] [Added] - ScrollView: `automaticallyAdjustKeyboardInsets` prop: Automatically animate `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) to avoid the Keyboard. (respecting absolute position on screen and safe-areas)
* [iOS] [Fixed] - ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews)

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

Test Plan:
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708680-9700aa80-a370-11eb-8016-e75d81a92cd7.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708699-9b2cc800-a370-11eb-976f-c4010cd96d55.MP4

</td>
</table>

### "Why not just use `<KeyboardAvoidingView>`?"

<table>
<tr>
<th>Before (with <code>&lt;KeyboardAvoidingView&gt;</code>)</th>
<th>After (with <code>automaticallyAdjustKeyboardInsets</code>)</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708749-abdd3e00-a370-11eb-8e09-a27ffaef12b8.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708777-b3044c00-a370-11eb-9b7a-e040ccb3ef8c.MP4

</td>
</table>

> Also notice how the `<KeyboardAvoidingView>` does not match the animation curve of the Keyboard

### Usage

```jsx
export const ChatPage = ({
  flatListProps,
  textInputProps
}: Props): React.ReactElement => (
  <>
    <FlatList
      {...flatListProps}
      keyboardDismissMode="interactive"
      automaticallyAdjustContentInsets={false}
      contentInsetAdjustmentBehavior="never"
      maintainVisibleContentPosition={{ minIndexForVisible: 0, autoscrollToTopThreshold: 100 }}
      automaticallyAdjustKeyboardInsets={true}
    />
    <InputAccessoryView backgroundColor={colors.white}>
      <ChatInput {...textInputProps} />
    </InputAccessoryView>
  </>
);
```

## Related Issues

* Fixes https://github.com/facebook/react-native/issues/31394
* Fixes https://github.com/facebook/react-native/issues/13073

Reviewed By: yungsters

Differential Revision: D30015799

Pulled By: sota000

fbshipit-source-id: 9ccfb4b6d477da192a96db4cfa07c31a2d2cefcb
2021-09-24 18:46:00 -07:00
Marshall Roch c6deb903d0 Deploy 0.160.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D31171581

fbshipit-source-id: 98b6dab5c50e5067361ac838d45c65add5ea826d
2021-09-24 18:38:28 -07:00
Joshua Gross 04f746d372 Touch events should have same timestmap as native Android MotionEvent
Summary:
When TouchEvent is created in RN, we're currently using System.currentTimeMillis - but this can differ from the MotionEvent timestamp by a few milliseconds.

This difference is very minor but makes it challenging to implement touch telemetry. It's easy and should be zero-impact otherwise to align the timestamps.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31183733

fbshipit-source-id: 5b275ee534658dc429beb1d3cec0c83a779b5ea3
2021-09-24 18:11:33 -07:00
Joshua Gross f58a3b9ef4 Back out "Send UNIX timestamp along with JS touch events, instead of systemUptime"
Summary:
Original commit changeset: 0f2db726048f

This original change was made in D26705430 (b08362ade5) and D26705429 (69feed518d). The intention was to change the timestamp definition to make touch telemetry easier, but this is (1) unnecessary and (2) causes other issues.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D31183732

fbshipit-source-id: ddc6aafe95dd45fe847524eb65b8a00852381f6d
2021-09-24 18:11:33 -07:00
Joshua Gross 10fe09c456 Back out "Send unix timestamp for touch events instead of systemUptime"
Summary:
Original commit changeset: 2acd52ae5873

This original change was made in D26705430 (b08362ade5) and D26705429 (69feed518d). The intention was to change the timestamp definition to make touch telemetry easier, but this is (1) unnecessary and (2) causes other issues.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D31183734

fbshipit-source-id: 6af669bb5696896b43fa4508af1171446d62c6d6
2021-09-24 18:11:33 -07:00
Sota Ogo 499274b99d Add a quick documentation about how to disable Fabric in RNTester
Summary:
OSS uses old architecture and being able to use RNTester as a test ground for non-fabric components.

Changelog: [internal]

Reviewed By: hramos

Differential Revision: D31186468

fbshipit-source-id: d5e7fb679b8ce28ba3050f83cd2d61d42cb4a122
2021-09-24 17:08:52 -07:00
Phillip Pan 99f706e5df introduce RCTComputeScreenScale
Summary:
Changelog: [Internal]

in this diff, we add a function that allows us to retrieve screen scale. enforcing thread safety will be dependent on the consumer to make sure it's used on main thread.

i'd like for this to be a more temporary solution, i think we should have a more scalable screen solution for consumers to handle the gambit of uiscreen use cases.

Reviewed By: sammy-SC

Differential Revision: D31163909

fbshipit-source-id: 78104e9ef982b47c60697461141afb4b06eede72
2021-09-24 16:59:29 -07:00
Phillip Pan c744528da1 fix inaccurate comment for RCTScreenSize()
Summary:
Changelog:
[iOS][changed] - fixed inaccurate comment

while looking around, i saw this comment for RCTScreenSize that says it's called on app start - i looked around and also put a breakpoint here, and this assumption doesn't seem accurate anymore. just updating the comment for clarity.

Reviewed By: sammy-SC

Differential Revision: D31136182

fbshipit-source-id: 5f02a1a9fd95e16495bb79b3645b5f4e3bc1d9c9
2021-09-24 16:59:29 -07:00
Héctor Ramos c0b46f3487 Circle CI: Package a release on every commit, but do not publish it
Summary:
Otherwise known as "commitlies," these are per-commit releases that do not get published to npm. They can be downloaded from Circle CI's artifacts pane on the relevant "build_npm_package" job.

If `--dry-run` flag is passed to `publish-npm.js`, it will perform the same steps as a `--nightly` but it will stop short of publishing the nightly to npm. The tarball for the release will be available in the `build/` directory.

Commitlies are implemented by triggering a `--dry-run` publish step on any commit that is not tagged as an open source release (e.g. `/v[0-9]+(\.[0-9]+)*(\-rc(\.[0-9]+)?)?/`).

Changelog:
[Internal]

Reviewed By: sota000

Differential Revision: D31177828

fbshipit-source-id: 7d4f79e1ed15718a177d2cb8fc620d5fb860ccf9
2021-09-24 13:49:16 -07:00
Andrei Shikov 4090195122 Ensure elevated views are not changing drawing order
Summary:
Uses `enableZ` trick to ensure that Skia doesn't try to reorder the views based on elevation. Unfortunately, it only helps for some cases, but the proper fix would require reimplementing `ViewGroup` completely to remove its internal logic of reordering based on Z coordinate.

Changelog: [Android][Fixed] Ensure elevated views are behind sticky header in FlatList

Reviewed By: cortinico

Differential Revision: D30700566

fbshipit-source-id: d2c59b22332922c610f4f2d415df34e81f5a33c5
2021-09-24 10:05:12 -07:00
Amy Nichol 4e8da9b28f Back out "Fix - ReconnectingWebSocket race condition mClosed"
Summary:
Changelog:[Internal]
Original commit changeset: 48793bd3bea9

Reviewed By: ShikaSD

Differential Revision: D31170947

fbshipit-source-id: cb460e3261fdc2a0df6e3a4597c61bd879ecf38f
2021-09-24 09:44:32 -07:00
Nicola Corti 9cf4bb73c0 Removed extra missing script from package.json
Summary:
The generate script file was removed but the package.json file was never update.
I'm doing it here.

Changelog:
[Internal] [Changed] - Removed extra missing script from package.json

Reviewed By: ShikaSD

Differential Revision: D31171736

fbshipit-source-id: 5b9474651d10374ccbb0b06f2c83bc34da01a179
2021-09-24 09:32:23 -07:00
Nicola Corti 3a41131913 Setup a package inside `react-native-gradle-plugin`.
Summary:
This diff adds a `package.json` inside `react-native-gradle-plugin`
so it can be distributed and used inside the `template/` project
similarly to what we do with the `react-native-codegen` package.

Changelog:
[Internal] [Added] - Setup a package inside `react-native-gradle-plugin`

Reviewed By: fkgozali

Differential Revision: D31081980

fbshipit-source-id: 9a9ad696ee6db01666bae75255616fd20aadd243
2021-09-24 09:27:59 -07:00
Nicola Corti 5b8da02296 Fix GenerateCodegenArtifactsTask calling two generators with Java enabled
Summary:
This diff fixes a bug with `GenerateCodegenArtifactsTask` that was causing
two generators to be called one after the other (first the JS and then the Java one).
Now they're mutually exclusive.

Changelog:
[Internal] [Changed] -  Fix GenerateCodegenArtifactsTask calling two generators with Java enabled

Reviewed By: ShikaSD

Differential Revision: D31169379

fbshipit-source-id: 668d8e440ad6b3f06654f29c5cbc344ef82c4b9c
2021-09-24 08:19:17 -07:00