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

24337 Коммитов

Автор SHA1 Сообщение Дата
Phillip Pan 5f2835b14d bump iOS 11.0 to 12.4 in BUCK
Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

Reviewed By: fkgozali

Differential Revision: D34559477

fbshipit-source-id: cc0dc22a4b5158732ee77c224f351634b9a98aed
2022-03-17 17:19:50 -07:00
Andrei Shikov 69e8d3d883 Build Fabric with CMake
Summary:
More CMake configurations mirroring Android.mk in place.

Changelog: [Internal] - Build fabricjni with CMake

Reviewed By: cortinico

Differential Revision: D34927238

fbshipit-source-id: 929763ec79a7c168e300e065709a49e4b373326a
2022-03-17 17:08:24 -07:00
Christoph Purrer 7d527e0fc8 Export bridging header from testlib
Summary:
Export bridging for testlib BUCK target

Changelog:
[General][Fixed] - Export bridging for testlib BUCK target

Reviewed By: appden

Differential Revision: D34866694

fbshipit-source-id: c2dfbdb98d3c32f70192329a8df139f344a847b7
2022-03-17 16:24:09 -07:00
Nicola Corti c418bf4c8f Reduce flakyness of `configureNdkBuild*` tasks by setting an
Summary:
This is a follow up to
21dd646eca
The ABI specific tasks were not involved in this patch, and they're still
failing. I'm fixing them.

Changelog:
[Internal] [Changed] - Reduce flakyness of `configureNdkBuild*` tasks by setting an
explicit dependency on prefab - part 2

Reviewed By: ShikaSD

Differential Revision: D34960946

fbshipit-source-id: 3e4feb93aa59cbe47142dece1d0246117381179d
2022-03-17 05:56:37 -07:00
Tatiana Kapos 2d64d1d693 Fix RawPropsParser for Windows (#33432)
Summary:
Changes in 7cece3423...189c2c895 broke build for Windows because of a conversion from size_t to int. Adds a static cast to int to fix the error and restore windows build

Error Message
```
##[error]node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): Error C2220: the following warning is treated as an error
     3>D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): error C2220: the following warning is treated as an error [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
##[warning]node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): **Warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data**
     3>D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]
```

## Changelog

[General] [Fixed] - Restore Windows build with RawPropsParser.cpp

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

Test Plan: Tested locally and changes pass in the react-native-windows pipeline, change is being merged into the main branch of react-native-windows.

Reviewed By: philIip

Differential Revision: D34907928

Pulled By: javache

fbshipit-source-id: 8b76cbef0b637f2d607a8aefd2998322c3245713
2022-03-17 03:58:57 -07:00
fortmarek b2517c3bdc Automatic update of `RCT-Folly` (#32659)
Summary:
When upgrading `react-native`, the version `RCT-Folly` defined [here](https://github.com/facebook/react-native/blob/main/third-party-podspecs/RCT-Folly.podspec) can change. If that happens, if you run `pod install` after `yarn install`, you will get a similar error to this:
```
[!] CocoaPods could not find compatible versions for pod "RCT-Folly":
  In snapshot (Podfile.lock):
    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)

  In Podfile:
    RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)

    React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) was resolved to 0.66.3, which depends on
      RCT-Folly (= 2021.06.28.00-v2)
```

This error occurs because `Cocoapods` does not update pods that point to a local podspec. Locally, you could resolve this issue by running `pod update RCT-Folly --no-repo-update`. On the CI, you have to do a clean checkout (in case you cache the `Pods` folder which we do). All of this makes upgrading `react-native` painful - for the whole community and for us shopify

There are other users who have struggled with this, such as [here](https://github.com/facebook/react-native/issues/32423). The suggestion there is to delete `Podfile.lock` which is unnecessary - but it shows that users are confused what to do with this error and is something worth fixing.

To mitigate these issues, `react_native_pods.rb` automatically marks `RCT-Folly` as changed in the [detect_changes_with_podfile method](https://github.com/CocoaPods/Core/blob/master/lib/cocoapods-core/lockfile.rb#L289) from `Pod::Lockfile` if the version in `node_modules/react-native/third-party-podspecs/RCT-Folly.podspec` and `Pods/Local Podspecs/RCT-Folly.podspec.json` mismatch.

Instead of automatically updating the local podspec (in `Pods/Local Podspecs` directory) we could also:
a) integrate `RCT-Folly` as a local pod (such as `React-Core` and others)
b) integrate `RCT-Folly` as an external dependency (going through Cocoapods' centralized repository)

I don't have enough context on why `RCT-Folly` is bundled the way it is, so I am open to suggestions here.

## 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 `pod install` when `RCT-Folly` version has been updated.

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

Test Plan:
I have created a [repository](https://github.com/fortmarek/react-native-upgrade-reproduction) where you can reproduce the issue. You can simply:
1) clone the repo (`git clone https://github.com/fortmarek/react-native-upgrade-reproduction`)
2) Run `yarn install && cd ios && pod install`
3) Change `react-native` version in `package.json` to `0.66.3`
4) Run again `yarn install && pod install`
5) Observe error

To test the fix, you can then:
1) copy-paste the `react_native_pods.rb` file from this branch to `react-native-upgrade-reproduction/node_modules/scripts/react_native_pods.rb`
2) run `pod install` again

This time, the `pod install` command should succeed.

Reviewed By: sota000

Differential Revision: D32720758

Pulled By: cortinico

fbshipit-source-id: 940db9c9f0530f896e47b676dec46bc93cea0085
2022-03-17 03:52:57 -07:00
Phillip Pan c71e6efbcd bump iOS and tvOS from 11.0 to 12.4 in pbxproj
Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

Reviewed By: sammy-SC

Differential Revision: D34548360

fbshipit-source-id: e1a90fd6c1fc6b680ea6e53b7434fd7f5c3d6ee4
2022-03-16 21:08:01 -07:00
Phillip Pan 982ca30de0 bump iOS and tvOS from 11.0 to 12.4 in cocoapods
Summary:
Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D34547333

fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718
2022-03-16 21:08:01 -07:00
Phillip Pan 126873f63d get rid of weird nil check on CGFloat
Summary:
Changelog: [Internal]

this doesn't really make any sense, first of all CGFloat is a primitive data type so comparing it against nil only will return true if it's 0. but that won't catch cases where CGFloat is uninitialized bc it will be holding junk in memory.

the error checking of the value is already handled in the accessibility manager, so just remove it here.

Reviewed By: p-sun

Differential Revision: D34909365

fbshipit-source-id: 483f9c100433f8533edd784622523c5469c616c2
2022-03-16 21:03:36 -07:00
Phillip Pan 9b4bb54fdf add error logs for nil moduleRegistry
Summary:
Changelog: [Internal]

for the last 6 months or so, we've been getting this task where the moduleRegistry in RCTDeviceInfo is nil. in this change, i add some logs to see what might be setting this to nil.

 in all honestly, i don't really think this is happening, but it would be good to verify.

Reviewed By: sshic

Differential Revision: D34908902

fbshipit-source-id: d375285467a87453605ba0fecfc124bc3bff6e63
2022-03-16 21:03:36 -07:00
Andrei Shikov bc53279a56 Rename String.h to AString.h in bridging module
Summary:
String.h conflicts with system headers in cocoapods build, causing build error.

Changelog: [Internal]

Reviewed By: appden

Differential Revision: D34936511

fbshipit-source-id: 4c25f7e755e53dec736ac7ed6217f6cd111d9288
2022-03-16 15:30:58 -07:00
Andrei Shikov cd60ffdb62 Bump Flipper-Glog to 0.5.0.4
Summary:
Updates Flipper-Glog to address failing assertion in `mutex.h`

Changelog: [iOS][Updated] - Updated Flipper-Glog to 0.5.0.4

Reviewed By: bvanderhoof

Differential Revision: D34935757

fbshipit-source-id: 6e2dc5bf5608eb0d4cd89418fe1e04b8780bca16
2022-03-16 15:30:58 -07:00
Xin Chen 9527ab1584 Add null check for context in redbox surface delegate
Summary:
The context could be null or is finishing when we create the redbox surface content view. This diff adds the null check and delegate the message in log when context is not available.

Changelog:
[Android][Fixed] - Adding null check for context in redbox surface delegate

Differential Revision: D34930595

fbshipit-source-id: 91508ded7821033abcd893f70bcfe3cc9ee5b5c2
2022-03-16 15:13:53 -07:00
Nicola Corti 8200f91598 Disable prefab publishing if REACT_NATIVE_HERMES_SKIP_PREFAB is set. (#33439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33439

This allows us to toggle the publishing of prefab if the `REACT_NATIVE_HERMES_SKIP_PREFAB`
env variable is set. With this we can control how big is the .aar of hermes-engine, reducing
the size from ~200Mb right now to 8Mb.

Changelog:
[Internal] [Changed] - Disable prefab publishing if REACT_NATIVE_HERMES_SKIP_PREFAB is set

Reviewed By: ShikaSD

Differential Revision: D34929265

fbshipit-source-id: eb710b72ee4e17ac04c2924ffdac7a542928e9f8
2022-03-16 12:24:55 -07:00
Genki Kondo b2454f9e66 Add feature flag for spannable cache
Summary:
sSpannableCache is a significant user of Java heap memory - up to 0.22MB is retained by sSpannableCache.

It turns out sSpannableCache was never hitting as hashCode is different for the same attributedString contents. attributedString.getInt("hash") provides the expected hash code.

This indicates removing spannableCache will not affect perf. Will gate just in case though.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D34900414

fbshipit-source-id: 7563cde6ba9dc153072e7aebede99389ce3153e7
2022-03-16 10:38:50 -07:00
Andrei Shikov e5874d90e2 Folly_runtime for CMake
Summary:
Ports improvements from Android.mk setup to CMake, replacing folly_json and futures with runtime where plausible

Changelog: [Internal] - CMake folly_runtime setup

Reviewed By: cortinico

Differential Revision: D34854295

fbshipit-source-id: fa882a9cd0b78feb20f8abcc9350c27702375def
2022-03-16 08:10:55 -07:00
Danilo Bürger 9e7d91f2fc Re-apply: Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33427)
Summary:
This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger

The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```
## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

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

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: cortinico

Differential Revision: D34890926

Pulled By: dmitryrykun

fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea
2022-03-16 05:25:28 -07:00
Nicola Corti 10d2e4cf2e Fix a typo in the hermes-engine srcSet folder
Summary:
There is a typo in the hermes-engine resulting in hermes-engine not picking up the Intl
Java source code. I'm fixing it.

Changelog:
[Internal] [Changed] - Fix a typo in the hermes-engine srcSet folder

Reviewed By: motiz88

Differential Revision: D34922477

fbshipit-source-id: a144f7a2f75702bc8ddea73fa8b48c71d8fcd499
2022-03-16 04:59:47 -07:00
Nicola Corti 0fba8fa443 Reduce stale range from 365 days to 180 days
Summary:
We have a lot of stale issues that are receiving essentially no traffic. Previously we used to use `stalebot` which had an interval of 90 days but was somehow unreliable. Now we moved to the state GH actions but with an interval of 365 days which I believe is potentially too high.

Changelog:
[Internal] [Changed] - Reduce stale range from 365 days to 180 days

Created from CodeHub with https://fburl.com/edit-in-codehub

Reviewed By: GijsWeterings

Differential Revision: D34831199

fbshipit-source-id: 70f3f6cc97ac4add625061577e53cc80da987c7a
2022-03-16 03:04:41 -07:00
Andrei Shikov 6c5bd6d790 Hermes executor migration to CMake
Summary:
Adds CMake files to configure hermes-executor build, with the same setup as we have in Android.mk

Changelog: [Internal] - CMake build config for hermes executor

Reviewed By: cortinico

Differential Revision: D34811909

fbshipit-source-id: 2df6dbaf46131db87a25e26c83b38ba44f29d1d3
2022-03-16 01:47:05 -07:00
Andrei Shikov a6095d43cd Include CMakeLists.txt into third-party setup
Summary:
Includes `CMakeLists.txt` describing build of third-party libraries into "prepared" folders

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D34882968

fbshipit-source-id: 071cd9f2316b571c0ae007679ce85ba287904291
2022-03-15 20:23:51 -07:00
Andrei Shikov 062a6169ce Generate CMakeLists.txt for codegen modules
Summary:
Generates `CMakeLists.txt` for the codegen the same way as we generate Android.mk

Changelog: [Internal] - CMakeLists.txt for codegen targets

Reviewed By: cortinico

Differential Revision: D34821864

fbshipit-source-id: 0cbe7a450a4a064e2285890253ae152fb03267c2
2022-03-15 19:32:22 -07:00
Moti Zilberman bbeb50e8b7 Upgrade Metro dependencies to 0.69.1
Summary:
Upgrade React Native's direct dependencies on Metro packages from 0.69.0 to 0.69.1.

Changelog:
[Internal]

Reviewed By: arushikesarwani94

Differential Revision: D34898033

fbshipit-source-id: 267821ec6cb926f371c4029bd6f09984c6f7334b
2022-03-15 13:55:56 -07:00
Genki Kondo 67af1b8218 Add RNTester example for nested text
Summary:
Existing RNTester examples for text did not contain a case where text with color was nested inside of another with text at both ends. This would have caught T113767991

Changelog:
[Internal] - Add RNTester example for nested text

Reviewed By: mdvacca

Differential Revision: D34874080

fbshipit-source-id: cda91cde9c7449abb677ae9fa936a61e396ffbd3
2022-03-15 12:06:58 -07:00
Genki Kondo 289c7f7180 Emit scroll events on overscroll and fix sticky header
Summary:
Sticky headers (via OCScrollTrackerStickyHeader) did not work with RN because overscroll does not trigger onScroll events.

This diff adds a listener to overscroll, which then emits scroll events.

Changelog:
[Internal][Changed] - Changed ScrollEvent's scrollX and scrollY to float

 ---

# Context

GamingActivity headers are part of the FlatList; on overscroll (when you scroll up when you're already at the top of the FlatList), the header is translated via Animated's native event. The problem on RN is that onScroll is not fired during overscroll (due to how overscroll-decor works - it merely applies a translation on the scroll view itself).

Scroll events propagate to the native animated events as follows:
- ReactScrollView.onScrollChanged -> ReactScrollViewHelper.updateStateOnScrollChanged -> ReactScrollViewHelper.emitScrollEvent -> EventDispatcher.dispatchEvent -> NativeAnimatedNodesManager.onEventDispatch

# Approaches

Two approaches were considered to fix sticky headers:
- [Implemented in this diff] Attach a listener on OverScrollDecor and fire onScroll events. I ran into 2 main issues with this:
  - The header clips as the scroll view is translated down. This is fixed via setting clipChildren.
- Move headers out of FlatList, and translate the header only for positive scroll offsets.
  - Requires product-side code changes
  - Hover outline is cut off by the header
  - Click-drag to scroll does not work on the header

Reviewed By: javache

Differential Revision: D34696042

fbshipit-source-id: 15450f31a7042ce67cdffc74614f4f7b9684d0ca
2022-03-15 10:55:08 -07:00
Krisztiaan 5d560ca99f fix: `cliPath` should handle absolute paths (#32983)
Summary:
Avoid breaking tools relying on absolute path for `cliPath`

## Changelog

[Android] [Fixed] - Enable cliPath to have an absolute path value

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

Test Plan:
declare `cliPath` from `expo`:
```groovy
cliPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/cli.js",
```
and run an android build

Reviewed By: ShikaSD

Differential Revision: D33843275

Pulled By: cortinico

fbshipit-source-id: 65f55a5e07a4ec0a6205d5f06f150377708c30cc
2022-03-15 09:24:22 -07:00
Nicola Corti 0d2ee7c17c Re-apply main changes to CMake files
Summary:
This Diff re-applies some of the changes that landed on main
to the CMake files we currently landed so far.

Changelog:
[Internal] [Changed] - Re-apply main changes to CMake files

Reviewed By: ShikaSD

Differential Revision: D34859685

fbshipit-source-id: 772a3aed05f56b6fbb2942bf9d1a5bd4581b48d5
2022-03-15 08:14:07 -07:00
Ken Tominaga f001d091b1 Add scripts to debug the `rn-tester` project easier (#33386)
Summary:
This pull request simplifies and makes it easy to debug the `rn-tester` project and switch configurations within the project.

- `yarn start` : Start packager
- `yarn install-android-jsc` : Build with `installJscDebug`.
- `yarn install-android-hermes` : Build with `installHermesDebug`.
- `yarn clean-android` : Clean up the Android build files.
- `yarn setup-ios-jsc` : Install dependencies to use JSC.
- `yarn setup-ios-hermes` : Install dependencies to use Hermes.
- `yarn clean-ios` : Clean up the build files and Pods.

## 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] [Changed] - Add scripts to debug `rn-tester` easier

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

Test Plan:
<details><summary>Log</summary>
<p>

```sh
// packages/rn-tester

$ yarn setup-ios-jsc

yarn run v1.22.17
$ yarn install && bundle install && bundle exec pod install
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
success Already up-to-date.
Using rexml 3.2.5
Using CFPropertyList 3.0.5
Using concurrent-ruby 1.1.9
Using i18n 1.9.1
Using minitest 5.15.0
Using tzinfo 2.0.4
Using zeitwerk 2.5.4
Using activesupport 6.1.4.4
Using public_suffix 4.0.6
Using addressable 2.8.0
Using httpclient 2.8.3
Using json 2.6.1
Using algoliasearch 1.27.5
Using atomos 0.1.3
Using bundler 2.1.4
Using claide 1.1.0
Using fuzzy_match 2.0.4
Using nap 1.1.0
Using netrc 0.11.0
Using ffi 1.15.5
Using ethon 0.15.0
Using typhoeus 1.4.0
Using cocoapods-core 1.11.2
Using cocoapods-deintegrate 1.0.5
Using cocoapods-downloader 1.5.1
Using cocoapods-plugins 1.0.0
Using cocoapods-search 1.0.1
Using cocoapods-trunk 1.6.0
Using cocoapods-try 1.2.0
Using colored2 3.1.2
Using escape 0.0.4
Using fourflusher 2.3.1
Using gh_inspector 1.1.3
Using molinillo 0.8.0
Using ruby-macho 2.5.1
Using nanaimo 0.3.0
Using xcodeproj 1.21.0
Using cocoapods 1.11.2
Bundle complete! 2 Gemfile dependencies, 38 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Building RNTester with Fabric enabled.
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Building RNTester with Fabric enabled.
[Codegen] Skipping React-Codegen podspec generation.
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Building RNTester with Fabric enabled.
[Codegen] Skipping React-Codegen podspec generation.
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
Analyzing dependencies
[Codegen] Found FBReactNativeSpec
[Codegen] Found rncore
[Codegen] Found ScreenshotmanagerSpec
Downloading dependencies
Installing FBLazyVector 1000.0.0
Installing FBReactNativeSpec 1000.0.0
Installing RCTRequired 1000.0.0
Installing RCTTypeSafety 1000.0.0
Installing React 1000.0.0
Installing React-Core 1000.0.0
Installing React-CoreModules 1000.0.0
Installing React-Fabric 1000.0.0
Installing React-RCTActionSheet 1000.0.0
Installing React-RCTAnimation 1000.0.0
Installing React-RCTBlob 1000.0.0
Installing React-RCTFabric 1000.0.0
Installing React-RCTImage 1000.0.0
Installing React-RCTLinking 1000.0.0
Installing React-RCTNetwork 1000.0.0
Installing React-RCTPushNotification 1000.0.0
Installing React-RCTSettings 1000.0.0
Installing React-RCTTest 1000.0.0
Installing React-RCTText 1000.0.0
Installing React-RCTVibration 1000.0.0
Installing React-callinvoker 1000.0.0
Installing React-cxxreact 1000.0.0
Installing React-graphics 1000.0.0
Installing React-jsi 1000.0.0
Installing React-jsiexecutor 1000.0.0
Installing React-jsinspector 1000.0.0
Installing React-logger 1000.0.0
Installing React-perflogger 1000.0.0
Installing React-rncore 1000.0.0
Installing React-runtimeexecutor 1000.0.0
Installing ReactCommon 1000.0.0
Installing Yoga 1.14.0
Generating Pods project
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig
[DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig
React-Core
Integrating client project
Pod installation complete! There are 65 dependencies from the Podfile and 53 total pods installed.
  Done in 8.68s.
```

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D34835086

Pulled By: cortinico

fbshipit-source-id: 83649f42e8ac77efd8617601e18f15bfcf8f1f61
2022-03-15 07:10:21 -07:00
Nicola Corti 21dd646eca Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab.
Summary:
I've noticed that `test_android` and the Test Android Docker image jobs fails sometime with a missing
`libhermes.so` file. That is happening because the `configureNdkBuild*` tasks are executing
before the prefab for Hermes is ready. I'm adding an explicit dependency here that will prevent this
kind of situations from happening.

Changelog:
[Internal] [Changed] - Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab.

Reviewed By: ShikaSD

Differential Revision: D34859961

fbshipit-source-id: e4dc4b22c808359018ec952287b2d8a7094f0698
2022-03-15 06:39:40 -07:00
Nicola Corti 68fde3b35b Allow to override Hermes source location with REACT_NATIVE_OVERRIDE_HERMES_DIR
Summary:
This commit allows to specify a custom location for Hermes sources with the
`REACT_NATIVE_OVERRIDE_HERMES_DIR` environment variable.

This can be useful during local development if you wish to build against a local
clone of facebook/hermes.

Changelog:
[Internal] [Changed] - Allow to override Hermes source location with REACT_NATIVE_OVERRIDE_HERMES_DIR

Reviewed By: ShikaSD

Differential Revision: D34858893

fbshipit-source-id: 4fad3d1c8e99f1f1880b5633e596b67f5dfcc264
2022-03-15 06:29:25 -07:00
Pieter De Baets 6c9de5543e Cleanup ScriptTag helpers on Instance
Summary:
We were opening the file multiple times just to read the same couple of bytes.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D34835972

fbshipit-source-id: 9de899f37a9193db4ab72e69e02e8d41e5515da0
2022-03-15 05:58:52 -07:00
Pieter De Baets be0ff779b1 Fix parseTypeFromHeader for Hermes bytecode
Summary: Changelog: [Internal] Fix bug where Hermes bytecode bundles were not always recognized

Reviewed By: motiz88

Differential Revision: D34718511

fbshipit-source-id: 5bbebe49962d098988d99153b0938fbb5d449ae6
2022-03-15 05:58:52 -07:00
Tommy Nguyen 4b6c0b92c0 Remove `@babel/plugin-transform-regenerator` from RN Babel preset (#789)
Summary:
## Summary

Hermes added support for generators in 0.2.0, and JSC is ES6 feature complete since r202125.

NOTE: This is a combined Metro + React Native commit. For React Native, the only change here is adding `babel/plugin-transform-regenerator` to `repo-config` ( = `devDependencies`), so the tests no longer implicitly consume it via Metro.

Changelog: [Internal]

X-link: https://github.com/facebook/metro/pull/789

Reviewed By: rh389

Differential Revision: D34819044

Pulled By: motiz88

fbshipit-source-id: fe27b2c2af0281d5309d4c16f95762d4d4935eba
2022-03-15 05:19:58 -07:00
Nicola Corti e12bc9cf62 Setup Globbing with CONFIGURE_DEPENDS inside CMake files.
Summary:
This Diff moves from specifying a list of files to use file(GLOB) with
CONFIGURE_DEPENDS on several CMakefiles.
I've updates those where we use globbing also inside buck.

Changelog:
[Internal] [Changed] - Setup Globbing with CONFIGURE_DEPENDS inside CMake files

Reviewed By: ShikaSD

Differential Revision: D34826311

fbshipit-source-id: 8fc654626c897cdc4cdd79c699ce19f1e5e1212f
2022-03-15 01:55:27 -07:00
Evan Yeung 75de6d46e3 Deploy 0.173.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: bradzacher

Differential Revision: D34691988

fbshipit-source-id: f9c73d99d09440718cc05318ea415492652ff818
2022-03-14 13:15:22 -07:00
Oleg Kot 06f504b8b2 Revert D34784966: Consider relative to pwd installation root when looking for files in rn module via cocoapods
Differential Revision:
D34784966 (2f813f873a)

Original commit changeset: d6d5e71bc2fc

Original Phabricator Diff: D34784966 (2f813f873a)

fbshipit-source-id: edaf38cb26187f0bd08e1efb7fc086233cf094c8
2022-03-14 10:31:18 -07:00
Xin Chen 145fd041c7 Fix crash on empty snapToOffsets prop to ScrollView
Summary:
When the `snapToOffsets` prop is empty array, the scroll view would crash unexpectly. This diff fixed that by treating empty array prop as null value for `snapToOffsets`.

Changelog:
[Android][Fixed] - Fix crash on empty snapToOffsets array

Reviewed By: makovkastar

Differential Revision: D34802022

fbshipit-source-id: af330512e444081b0cb02b65288ec5cd2bd14205
2022-03-14 10:25:00 -07:00
Danilo Bürger 2f813f873a Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33399)
Summary:
The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root.

This fixes usage of cocoapods with the `--project-directory` flag like

```bash
bundle exec pod install --project-directory=ios
```

## Changelog

[iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch

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

Test Plan:
1) Enable the new arch
2) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

3) It will fail with

```
[!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen..
```

4) Apply the patch
5) Execute from the projects root dir

```bash
bundle exec pod install --project-directory=ios
```

6) It will succeed

Reviewed By: ShikaSD

Differential Revision: D34784966

Pulled By: dmitryrykun

fbshipit-source-id: d6d5e71bc2fcd32f2cd60a498f39e6f772fc9005
2022-03-14 09:00:37 -07:00
Moti Zilberman c1e9aa9a27 Deprecate jest/preprocessor.js
Summary:
Changelog:
[General][Deprecated] Deprecate the use of `react-native/jest/preprocessor.js` by external projects

The supported method of using Jest in React Native projects is using the [Jest preset](https://jestjs.io/docs/tutorial-react-native) shipped as part of the `react-native` package. Some projects are directly using `preprocessor.js` which is part of the testing setup for the React Native repo itself.

In a future release of React Native, we will stop publishing this file to npm and require projects to switch to the supported preset (or a custom Jest config if necessary).

Reviewed By: GijsWeterings

Differential Revision: D34820086

fbshipit-source-id: 197c33726639e66c6916a244117252e6af11f2f6
2022-03-14 07:40:05 -07:00
Andrei Shikov 5ea50fd549 Fix Hermes Android release build (#33420)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33420

Hermes executor release dependency was incorrectly merged.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D34853948

fbshipit-source-id: b4d41d2a9ad850c042049b6d945ee1d2bb32ebd7
2022-03-14 07:00:07 -07:00
Gijs Weterings b633cc1305 Remove console.disableYellowBox support
Summary:
We're replacing console.disableYellowBox (untyped, global hack, only warnings) with LogBox.ignoreAllLogs() (typed, local method, handles errors and warnings). rickhanlonii made the initial deprecation of this >2 years ago in 87f1e22434 . This diff finally removes the support of `console.disableYellowBox`. Users of LogBox should be using `LogBox.ignoreAllLogs`. This removal also allows us to move LogBox to strict mode flow.

Changelog: [BREAKING] [Removed] Removed console.disableYellowBox in favor of LogBox.ignoreAllLogs.

Reviewed By: rickhanlonii, yungsters

Differential Revision: D34689343

fbshipit-source-id: 3b2865a4918de703e47cd722e3f396475254c65a
2022-03-14 05:33:40 -07:00
Andrei Shikov 5d5addd661 Separate folly into runtime + folly_futures specific for hermes inspector
Summary:
Rearranges folly_futures configuration into a static library only required for `hermes-inspector` + `folly_runtime` which merges `folly_json` and mutex-related implementations `folly_futures` was used for. As `hermes-executor-debug` is removed by `vmCleanup` configurations later, it allows to shave additional 300KB from the release APK size.

Changelog: [Internal] - Rearrange folly build to reduce APK size

Reviewed By: cortinico

Differential Revision: D34342514

fbshipit-source-id: b646680343e6b9a7674019506b87b96f6007caf2
2022-03-13 15:15:21 -07:00
Andrei Shikov 0a004927ad Extract mapbuffer from reactutils module
Summary:
`MapBuffer` is not used in RN utils for anything shared for now, so we can remove it from the build config by reordering methods, shaving 20KB in APK size for each architecture.

Also applies clang-tidy rules to `MapBuffer`/`folly::dynamic` configurations.

Changelog: [Internal] - Remove `mapbuffer` dependency from `Android.mk` of reactutilsjni

Reviewed By: javache, cortinico

Differential Revision: D34620455

fbshipit-source-id: ad3717448f5c20fd071f71d436bb9dd00efe7eb0
2022-03-12 11:19:57 -08:00
Danilo Bürger 75105e692c Start surface after setting the delegate (#33402)
Summary:
When starting the surface, _propagateStageChange is called. This checks the delegate to call surface:didChangeStage: on it.

When initWithSurface:sizeMeasureMode: is called after start, then the delegate will be nil and thus not be called.

This turns it around so a delegate is present for the surface to propagate its state to.

This fixes RCTContentDidAppearNotification not getting posted otherwise.

## Changelog

[iOS] [Fixed] - Post RCTContentDidAppearNotification with new arch

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

Test Plan:
I found it best to set a breakpoint in XCode to where RCTContentDidAppearNotification is being posted.

Prior to the patch that breakpoint will not be called. After applying the patch, it will be called.

Reviewed By: philIip

Differential Revision: D34753329

Pulled By: ShikaSD

fbshipit-source-id: cc44a4c3a787d49e22e9d0c3a82c0f11ed281a0a
2022-03-12 08:32:09 -08:00
Janic Duplessis ae756647c9 Fix babel-plugin-codegen crash when export init is null (#33387)
Summary:
It is possible that `init` is null when using the following code.

```js
export var a;
```

The typescript compiler actually generates something like this for enums so a lot of third party libraries triggered this issue.

For example in expo-apple-authentication/build/AppleAuthentication.types.js

```js
export var AppleAuthenticationScope;
(function (AppleAuthenticationScope) {
    AppleAuthenticationScope[AppleAuthenticationScope["FULL_NAME"] = 0] = "FULL_NAME";
    AppleAuthenticationScope[AppleAuthenticationScope["EMAIL"] = 1] = "EMAIL";
})(AppleAuthenticationScope || (AppleAuthenticationScope = {}));
```

This simply adds a null check.

## Changelog

[General] [Fixed] - Fix babel-plugin-codegen crash when export init is null

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

Test Plan: Tested that this fixed the crash in an app.

Reviewed By: javache

Differential Revision: D34687271

Pulled By: philIip

fbshipit-source-id: 7a7e0fe1bb6a7a21a5b442af26b221a263d4173d
2022-03-11 23:24:22 -08:00
Gabriel Donadel Dall'Agnol 64ebe5bbdd feat: Add dismissActionSheet method to ActionSheetIOS (#33189)
Summary:
This PR adds a `dismissActionSheet` method to `ActionSheetIOS` in order to allow dismissing an ActionSheet programmatically. This is especially useful in apps where a user has the ability to open an ActionSheet and then open a push notification that will redirect them to another screen which usually leads to scenarios where the presented ActionSheet has no relation with the current screen.

#### TODO
- [ ]  Submit react-native-website PR updating ActionSheetIOS documentation.

## Changelog

[iOS] [Added] - Add dismissActionSheet method to ActionSheetIOS

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

Test Plan:
1. Open the RNTester app and navigate to the ActionSheetIOS page
2. Test `dismissActionSheet` through the `Show Action Sheet and automatically dismiss it` example

https://user-images.githubusercontent.com/11707729/155867546-c6770a49-9b09-45e3-a6b1-4f7645d67dbf.mov

Reviewed By: lunaleaps

Differential Revision: D34518952

Pulled By: cortinico

fbshipit-source-id: 912a9b83ee078f791b42efddf5abb7e1cd09d520
2022-03-11 16:33:17 -08:00
Lulu Wu 1042a8012f Encode params in URLSearchParams
Summary:
URL params are not encoded which could cause a security risk, for more details pls see https://fb.workplace.com/groups/react.technologies.discussions/permalink/3184249088473474/

Changelog:
[General][Security] - Encode URL params in URLSearchParams.toString()

Reviewed By: yungsters

Differential Revision: D34415119

fbshipit-source-id: 83c29df9427ad0adc9b6a2b4d0ff5494247aa5cb
2022-03-11 16:26:48 -08:00
Nicola Corti a3d9892ed9 Build Hermes from Source (#33396)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33396

This commit fully unplugs the `ReactAndroid` from using hermes from the NPM package and plugs the usage of Hermes via the `packages/hermes-engine` Gradle build.

I've used prefab to share the .so between the two builds, so we don't need any extra machinery to make this possible.

Moreover, I've added a `buildHermesFromSource` property, which defaults to false when RN is imported, but is set to true when RN is opened for local development. This should allow us to distribute the `react-native` NPM package and users could potentially toggle which source to use (but see below).

Changelog:
[Android] [Changed] - Build Hermes from Source

Reviewed By: hramos

Differential Revision: D34389875

fbshipit-source-id: 107cbe3686daf7607a1f0f75202f24cd80ce64bb
2022-03-11 15:23:36 -08:00
Vegas Murphy d34a75e9e5 Fix layout in casting screen
Summary:
Changelog:
[Android][Fixed] - Fix StatusBar not updating to use translucent values when set to the same value across different activities

With native nav we open routes in a new activity. Each activity has its own StatusBar configured so we need to ensure it is configured properly.
Currently since the statusBar RN component avoids changing the StatusBar if the value hasn't changed it never gets updated and doesn't become translucent this results in all our padding being off since we add padding to account for the status bar

Reviewed By: yungsters

Differential Revision: D34810143

fbshipit-source-id: 5e382026fb89542fe0c8f6ab396f2fbeedee7a05
2022-03-11 14:07:33 -08:00
Scott Kyle 31f0796237 Add codegen for C++ TurboModule automatic type conversions
Summary:
This adds the *option* for C++ TurboModules to use a `*CxxSpec<T>` base class that extends the existing (and unchanged) corresponding `*CxxSpecJSI` base class with code-generated methods that use `bridging::calFromJs` to safely convert types between JSI and C++. If a type conversion cannot be made, then it will fail to compile.

Changelog:
[General][Added] - Automatic type conversions for C++ TurboModules

Reviewed By: christophpurrer

Differential Revision: D34780512

fbshipit-source-id: 58b34533c40652db8e3aea43804ceb73bcbe97a5
2022-03-11 12:47:51 -08:00