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

1384 Коммитов

Автор SHA1 Сообщение Дата
Genki Kondo 27bbb5ef37 Add RTL option to FlatList example
Summary:
Followup task for S271544.

There were no tests covering RTL on FlatLists, which would have prevented the above SEV. Adding an RNTester example for this.

Changelog:
[Internal] - Added RNTester example FlatList with RTL

Reviewed By: lunaleaps, javache

Differential Revision: D36601583

fbshipit-source-id: 054ac4eee876a514152f83ecc0522c62337cfea5
2022-05-25 13:24:13 -07:00
Riccardo Cipolleschi ad76eb368e Avoid installing Flipper in CI (#33899)
Summary:
This PR speeds up the build in CircleCI by avoiding adding Flipper dependency when running in CI.

The savings are:
* ~ 13/15% for `test_ios`
* ~ 30/40% for `test_rntester`
* ~50% for `test_ios_template`~

**Edit after review**: We do actually want to have Flipper in the `test_ios_template` to check that it builds correctly.

## Changelog
[iOS] [Changed] - Do not add Flipper when running in CI.

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

Test Plan:
CircleCI passing with these stats:

| BEFORE | AFTER |
| ---- | ---- |
| <img width="663" alt="FlipperCI-Before" src="https://user-images.githubusercontent.com/11162307/170006493-2651b000-0421-47c3-90e9-153474c15a95.png"> | <img width="652" alt="FlipperCI-After" src="https://user-images.githubusercontent.com/11162307/170006557-34e53601-66b4-4054-a156-0e2349f48dc2.png"> |

Reviewed By: cortinico

Differential Revision: D36625117

Pulled By: cipolleschi

fbshipit-source-id: 9de9db27552a7637551cd5bb623b10cb4aebb1eb
2022-05-25 09:00:38 -07:00
Scott Kyle c006722e6c Fix nullability lost on readonly types
Summary:
This fixes an issue where nullability was lost on readonly types in TurboModules specs. The "outside" nullability would be ignored in favor of only respecting the "inside" nullability (i.e. `?$ReadOnly<{}>` vs `$ReadOnly<?{}>`). It now ensure either is propagated correctly.

Changelog:
[General][Fixed] Fix nullability lost on readonly types in TurboModule specs

Reviewed By: RSNara

Differential Revision: D36615346

fbshipit-source-id: 42408d9298703f4c382657f573480d2574d6c973
2022-05-24 19:35:29 -07:00
Scott Kyle 3c569f546c Support mixed types only for C++
Summary:
There are cases where we want to pass arbitrary types to a TurboModule, which may then handle the values appropriately, but we haven't supported this use case. Since C++ TurboModules can accept any `jsi::Value` (unlike Java/ObjC) and we have real-world need for this (otherwise we must require JSON serialization), this now allows `mixed` (`unknown` in TypeScript) for C++-only TurboModules.

Changelog:
[General][Added] C++ TurboModule methods can now use mixed types

Reviewed By: RSNara

Differential Revision: D36611299

fbshipit-source-id: bbf29dfcc6aed67e213bb3eab06537c18c7db1fe
2022-05-24 19:35:29 -07:00
Vincent Riemer b2aa41578e Add basic platform testing framework for RNTester
Summary: Changelog: [RNTester][Internal] - Add experimental platform testing framework for RNTester

Reviewed By: lunaleaps, kacieb

Differential Revision: D36633708

fbshipit-source-id: 0f2f7642bc6db31e148a2a214c17fe39656612fd
2022-05-24 19:14:11 -07:00
Nicola Corti 1ee7a0a67e Attempt to fix test_android by adding a react-native.config.js inside rn-tester (#33901)
Summary:
`test_android` is now red because I had to specify a root for RN tester.
The job is now failing as it fails to find the correct platforms for the bundler command.
This PR fixes it.

## Changelog

[Internal] - Attempt to fix test_android by moving react-native.config.js

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

Test Plan: Tested locally + will wait for a CI result

Reviewed By: cipolleschi

Differential Revision: D36625857

Pulled By: cortinico

fbshipit-source-id: 01852cc966e611c6724ba528ea351a17011d62e2
2022-05-24 05:55:40 -07:00
Franco Meloni 0bd5239553 Move `use_flipper` logic inside `use_react_native` and simplify the Flipper dependencies logic (#33882)
Summary:
This PR tries to simplify the `use_flipper` logic:
- makes `use_flipper` a configuration inside `use_react_native`'s options
- uses the already present `production` flag in the `use_react_native`'s options to decide if add or not the Flipper pods
- Simplifies the logic to download the flipper dependencies

This PR also adds a workaround for https://github.com/facebook/react-native/issues/33764

## 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] - Move `use_flipper` logic inside `use_react_native` and simplify the Flipper dependencies logic

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

Test Plan: Executed a pod install with and without flipper and with isProduction true

Reviewed By: cipolleschi

Differential Revision: D36592338

Pulled By: f-meloni

fbshipit-source-id: 3c3f773151513e27e251f18865986e942a96ffd9
2022-05-24 04:37:46 -07:00
Nicola Corti 5f3c5aa529 Extend the React Native Gradle plugin to accept a config from package.json
Summary:
This extends the Gradle plugin to allow configuration for `codegenConfig` from the
`package.json` that lives in one of the root folder.

There are a couple of points open for discussion. The most important one
is that now we're moving from absolute paths to relative paths, from the
package.json location. I'm not entirely sure this will work correctly
for users in monorepos, so we might consider this carefully.

Moreover, I've moved the `codegenJavaPackageName` to be `android.javaPackageName`.
Happy to discuss this further.

Changelog:
[Android] [Added] - Extend the React Native Gradle plugin to accept a config from package.json

Reviewed By: cipolleschi

Differential Revision: D36374475

fbshipit-source-id: fe669ebd5bc92abbbe57677c1995d0e01f2400d7
2022-05-23 07:58:41 -07:00
Luna Wei 3369a29bda PointerEvents: RNTester make example easier to specify what events you want to listen to
Summary: Changelog: [Internal] - Make it easier to specify what events to listen to on each `EventfulView`. This is helpful for testing future optimizations to event dispatch filtering. Also removed the switches for triggering events -- the idea being that we're using these examples with Metro and we can just remove the relevant props when we want to not fire any events.

Reviewed By: kacieb

Differential Revision: D36530066

fbshipit-source-id: 3ff45c263bdcacedde8d2720e156ab8156424c53
2022-05-20 11:13:36 -07:00
Franco Meloni ca8174e15f Create script to automatically set CLANG_CXX_LANGUAGE_STANDARD on the client project (#33863)
Summary:
Currently this [section](https://reactnative.dev/docs/next/new-architecture-app-intro#ios-enable-c17-language-feature-support) of the Playbook tells us to set CLANG_CXX_LANGUAGE_STANDARD = "c++17" in the main app target for the new architecture to work.
Would be nice to be able to automate that instead

## 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] [Added] - Cocoapods function to add the `CLANG_CXX_LANGUAGE_STANDARD` to all the targets if needed

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

Test Plan:
I've created some unit tests for the newly added function.
I've executed pod install and the ruby tests locally.

Reviewed By: cipolleschi

Differential Revision: D36484366

Pulled By: f-meloni

fbshipit-source-id: 553b092e747bef11d82195619ae1058985fdc325
2022-05-19 14:57:04 -07:00
Riccardo Cipolleschi 05aaba9514 Align Codegen between iOS and Android (#33864)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33864

This Diff aligns the way in which iOS and Android codegen the modules and components.
Android takes all the JS in the project root folder and creates components starting from there.
iOS used to required to specify a specific path for each component, within a JSON field called `libraries`. This Diff let iOS work in the same way as android does

**Backward compatibility:** This diff still support the old way for iOS, but we are deprecating it.

## Changelog
[iOS][Added] - Support codegen from a single folder

Reviewed By: cortinico

Differential Revision: D36473005

fbshipit-source-id: 1e8cf0f9764f529c02e948984c74d1982a84030b
2022-05-19 05:52:40 -07:00
Pieter De Baets 5451f890a1 Cache method IDs in JavaTurboModule
Summary:
Codegen a static field for every caller of `invokeJavaMethod` to cache the jmethodID that should be used for the method, which saves us a string-based name lookup at invocation time.

Changelog: [internal]

Reviewed By: genkikondo

Differential Revision: D36376056

fbshipit-source-id: 298430746a8f25a5337aba05b56876ba789e2344
2022-05-18 09:12:10 -07:00
Nicola Corti d51534ae01 Fix broken AndroidConfigurationTest.kt on main
Summary:
The bump of AGP to 7.2 caused the tests inside `AndroidConfigurationTest.kt` to fail.

As we're now running `buildAll` both on Sandcastle and on CircleCI, this is now failing
on both CIs. The issue is that AGP 7.2 change the way to introspect resValues and
requires now to specify a type when querying for a value. I'm updating the tests here.

Changelog:
[Internal] [Fixed] - Fix broken AndroidConfigurationTest.kt on main

Reviewed By: cipolleschi

Differential Revision: D36437875

fbshipit-source-id: 58f457a78eae861e86808e58c23f5d04fb196d45
2022-05-17 02:04:05 -07:00
Nicola Corti 4994b8b5de Setup a top level buildAll Gradle task (#33838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33838

The idea behind this diff is to set a top level `buildAll` task that will be responsible
of invoking all the tasks we want to verify both in the internal and in the external CI.

This should ideally remove the breakages of the External CI happening from internal changes.

Changelog:
[Internal] [Changed] - Setup a top level buildAll Gradle task

Reviewed By: cipolleschi

Differential Revision: D36376384

fbshipit-source-id: d810b59577340628bb49562bfedf28440bd0f792
2022-05-16 09:27:54 -07:00
Ken Tominaga c73e021a4b Remove iOS 11 deprecation warnings around SafeArea (#32851)
Summary:
We don't have to check or emulate the safe area for iOS 11 above. I deleted the unnecessary check for the safe area.

This is a continuation pull request of these iOS 11 availability check.
* [Remove iOS 11 version check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32151 · facebook/react-native](https://github.com/facebook/react-native/pull/32151)
* [Remove iOS 11 availability check by ken0nek · Pull Request https://github.com/facebook/react-native/issues/32488 · facebook/react-native](https://github.com/facebook/react-native/pull/32488)

-----

- Stop using layout guide (`topLayoutGuide`, `bottomLayoutGuide`)
- Refactor `RCTSafeAreaView`
- Delete `emulateUnlessSupported` property

Docs PR: https://github.com/facebook/react-native-website/pull/2919

## 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] [Removed] - Remove `emulateUnlessSupported`

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

Reviewed By: philIip, sammy-SC

Differential Revision: D33586023

Pulled By: cortinico

fbshipit-source-id: 75fc1037141f71d9340c7b875a6bf86f9cfd6a02
2022-05-16 09:27:43 -07:00
Dulmandakh c274456e5b Bump Android Gradle Plugin to 7.2.0 (#33817)
Summary:
Bump Android Gradle Plugin to 7.2.0 (May 2022), which supported by latest Android Studio (Chipmunk). See https://developer.android.com/studio/releases/gradle-plugin#7-2-0

## Changelog

[Android] [Changed] - Bump Android Gradle Plugin to 7.2.0

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

Test Plan: Everything builds and runs as expected

Reviewed By: hramos

Differential Revision: D36379964

Pulled By: cortinico

fbshipit-source-id: ea35cbea0b1a27bceafddd06ed91711d74e281e9
2022-05-16 07:25:03 -07:00
Dulmandakh 99e7373dd2 Bump Gradle to 7.4.2 (#33823)
Summary:
Bump Gradle to 7.4.2

## Changelog

[Android] [Changed] - Bump Gradle to 7.4.2

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

Test Plan: Everything builds and runs as expected.

Reviewed By: sshic

Differential Revision: D36350288

Pulled By: cortinico

fbshipit-source-id: e883d53d170439054a58dfcf31568fb33cadd042
2022-05-13 07:26:00 -07:00
Pieter De Baets 3337add547 Pass string by ref in TurboModule lookup path
Summary:
Avoid unnecessary string copies

Changelog: [internal]

Reviewed By: nlutsenko

Differential Revision: D36312750

fbshipit-source-id: caf0985f988eb497de3be3c0526809593b01a9e2
2022-05-13 07:12:48 -07:00
Nicola Corti 2e49332609 Bump React to 18.0.0 inside repo-config (#33805)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33805

When we synced react to 18, we haven't updated repo-config and rn-tester
to also use version 18. I'm updating them here as this is creating confusion
and duplicated entries in the yarn.lock file.

Changelog:
[Internal] [Changed] - Bump React to 18.0.0 inside repo-config

Reviewed By: robhogan

Differential Revision: D36249888

fbshipit-source-id: a89ba1b5592f46987c5a70b707fe9ec57c4fe0ff
2022-05-11 16:49:47 -07:00
Riccardo Cipolleschi 2e720c3610 Remove USE_CODEGEN_DISCOVERY flag (#33791)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33791

This flag is used as a duplication for the `RCT_NEW_ARCH_ENABLED` flag. There is a [spot](d96806bbc6/scripts/react_native_pods.rb (L31)) in the code where, if `RCT_NEW_ARCH_ENABLED`, then the `USE_CODEGEN_DISCOVERY` is set to true as well.

Maintain two different flags for similar reasons is cumbersome and error-prone. This diff removes the `USE_CODEGEN_DISCOVERY` in favor of the `RCT_NEW_ARCH_ENABLED` flag.

## CHANGELOG
[iOS][Removed] - Remove USE_CODEGEN_DISCOVERY flag

Reviewed By: cortinico

Differential Revision: D36244618

fbshipit-source-id: 8e8979268b7aa25b895236b0c3a86fb57c6f2ea6
2022-05-10 04:17:25 -07:00
Genki Kondo 7c581f3d30 Move ScrollView's contentOffset to common props
Summary:
ScrollView's contentOffset prop was assumed to be iOS only, but in reality it is supported on Android as well: https://fburl.com/code/nuxpjpth

Changelog:
[General] - Move ScrollView's contentOffset to common props

Reviewed By: yungsters

Differential Revision: D36219604

fbshipit-source-id: f41679fd2ce7971a30129e0d91ae9f32b9cf756e
2022-05-09 13:05:16 -07:00
Nicola Corti 2a274c1a08 Bump React Native Codegen to 0.70.0
Summary:
I'm updating the versioning schema of `react-native-codegen` to use minor instead of patch versions.

Historically we used to use a version as `0.0.15` and incrementally bump it.
Today, we had to do released a patched version of `react-native-codegen` for React Native 0.68.

Therefore, we're moving to use a versioning scheme as `0.<RN-VERSION>.x` which gives more flexibility and allows us to follow-up on specific version of the codegen for every RN version, should we need to.

`react-native-codegen` 0.70 is essentially a re-publishing of 0.0.16 from `main`

Changelog:
[General] [Changed] - Bump React Native Codegen to 0.70.0

Reviewed By: motiz88

Differential Revision: D36244307

fbshipit-source-id: 475615e5dbc4e6bc850f64110c060a1c87544292
2022-05-09 09:23:20 -07:00
Anandraj Govindan 883a93871c Working around Long paths limitation on Windows (#33784)
Summary:
Cherry picking https://github.com/facebook/react-native/pull/33707 to main branch

This change is extending the changes made by alespergl to reduce the file paths and command lengths of ndk build commands
Essentially we are shortening the length of the source files by using relative paths instead of absolute paths as enumerated by the wildcard expression
This commit is extending the fix by including all the new modules introduced into RN for the new architecture, including the generated modules.
We are also reverting the ndk bump as ndk23 is crashing frequently when building RN with new arch. The reduced file paths lengths ensures the ndk bump is not required for relatively short application paths.

Fix building RN with new architecture on Windows boxes by using relative paths for C++ sources

## Changelog

Fix building RN with new architecture on Windows boxes by using relative paths for C++ sources

[CATEGORY] [TYPE] - Message

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

Test Plan: Verified building on windows box

Reviewed By: javache

Differential Revision: D36241928

Pulled By: cortinico

fbshipit-source-id: 1ce428a271724cbd3b00a24fe03e7d69253f169b
2022-05-09 04:42:53 -07:00
Sam Zhou 23a160ebf6 Lock down constrain writes in some directories
Summary: Changelog: [internal]

Reviewed By: gkz

Differential Revision: D36214426

fbshipit-source-id: 8498ef0f646d8a38e5d523f4fd2deacf1b649fd2
2022-05-06 15:53:13 -07:00
Evan Yeung 73a43901b4 Deploy 0.177.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D36141544

fbshipit-source-id: 7e322faa6f902547bb68997d02a50352c525d543
2022-05-06 10:51:36 -07:00
Pieter De Baets 9d3d5e13f0 Switch buck schema codegen to yarn_workspace_binary (#33773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33773

I noticed this was a very slow part of my build because each instance of the binary would run its own yarn install. Instead use the yarn_workspace approach to share a single yarn setup.

Changelog: [Internal]

Reviewed By: d16r

Differential Revision: D36164350

fbshipit-source-id: 5290587010fe6021b758bda98bf01995fdf14acd
2022-05-06 04:31:37 -07:00
George Zahariev 20d9d3aa6a Fixes to non-product code (e.g React Native)
Summary:
We are working on making the empty object literal `{}` have the type `{}` - i.e. exact empty object - rather than being unsealed.

Some manual fixes, in particular to React Native code, which is used and can be synced to other repos (e.g. WWW).

With these changes, error diff in Xplat is down to ~1990 errors

Note that after I roll out `exact_empty_objects`, I'll codemod all the `{...null}` (the only way to get an exact empty object currently) back to `{}`

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D36142838

fbshipit-source-id: 054caf370db230f42a4c5f5706c88979ef246537
2022-05-04 16:13:07 -07:00
Sam Zhou 7e7cf24200 Add annotations to unannotated variable declarations
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D36114983

fbshipit-source-id: 2622e13ba19a372592967670b7d615688c0e9fd6
2022-05-04 14:17:28 -07:00
Matin Zadeh Dolatabad 2596b2f695 fix: remove deprecated removeListener methods (#33580)
Summary:
Remove old deprecated modules that cause annoying warnings. This can be a breaking change for some third-party modules.

## Changelog

[General] [Removed] - Remove deprecated removeListener methods

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

Test Plan: See `flow-check` and `build-arvr-js-flow` succeed in Sandcastle.

Reviewed By: cortinico

Differential Revision: D35549719

Pulled By: yungsters

fbshipit-source-id: 0495e36de19db434362d5de56463d9c1ad6edd73
2022-05-04 11:32:51 -07:00
Nicola Corti b9bb30b1ad Bump React Native Codegen to 0.0.16 (#33749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33749

Yet another bump of the Codegen to ship new features for RN 0.69

Changelog:
[Internal] [Changed] - Bump React Native Codegen to 0.0.16

Reviewed By: cipolleschi

Differential Revision: D36096803

fbshipit-source-id: 46e118f633eff2abf636737e69718e8fcb3608ed
2022-05-04 04:04:10 -07:00
Riccardo Cipolleschi e4d0153a67 Update CodeGen to leverage the `outputDir` as suggested in diff review (#33729)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33729

This PR addresses [this comment](https://www.internalfb.com/diff/D35820848?dst_version_fbid=496290878846487&transaction_fbid=355967423221044).

It makes the CodeGen to the `outputDir` as base directory for the codegen.

Finally, it updates the unit tests accordingly.

## Changelog
[iOS][Changed] - use `outputDir` as base directory for the codegen and remove the possibility to customize the intermediate path. The generated code requires specific paths in the `#include` directive.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D35935282

fbshipit-source-id: a9ad4e296efb042cf34b20db5eebb59614beb5f6
2022-05-04 04:04:10 -07:00
Riccardo Cipolleschi 6718500eaa Support the `type == all` properly
Summary:
This Diff introduces some changes in the CodeGen to properly generate the types in the right folder.

## Issue
The codegen on iOS defines the output folder once, before creating the generated code.
When the code we have to generate is just a TurboModule (TM) or a Fabric Component (FC), this mechanism works properly.

However, if a library has to generate both TM and FC, actually using the library type `all`, all the code is generated using the TurboModules' output folder.
(**Note:** Android only works in this way)

This generates invalid code because all the FC's `#import` directives assumes that the code is generated in the FC output path which, in this case, is not.

## Solution

The adopted solution moves the responsibility to decide where the files has to be generated to the CodeGen step instead of in the preparatory phases.

The two paths are precomputed in the `generate-artifacts.js` script (the entry point for the CodeGen) and they are passed to all the scripts that requires them.

Once they reach the `RNCodegen.js` file, the generators creates the files and save them in the proper paths.

## Changelog
[iOS][Changed] - CodeGen now supports the `"all"` library type.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D35820848

fbshipit-source-id: ce7f5393936e2ae17f8b2c970f6a011d27f641f2
2022-05-04 04:04:10 -07:00
George Zahariev e7d9e4dbb5 Collapse object initialization in Xplat
Summary:
Collapse multiline object initialization into one single object literal (as much as possible).

Run codemod (requires temporary xplat task runner config changes), then manual fixes.

```
./scripts/typedjs/flow/runner codemod lti/collapseObjectInitialization ~/fbsource/xplat/js/
```

- Announcement: [post](https://fb.workplace.com/groups/flowlang/posts/903386663600331)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)

drop-conflicts

Format:
```
arc f
```
Sort imports
```
hg l -n | xargs js1 lint --fix --rule 'fb-tools/sort-requires'
```

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D36112168

fbshipit-source-id: 23db87c3bd8ffe693019ffeb5ac8300ec46c8532
2022-05-03 21:55:01 -07:00
George Zahariev 0337a2981d Add annotations to empty objects that look like indexers in Xplat
Summary:
We are working on making the empty object literal `{}` have the type `{}` - i.e. exact empty object - rather than being unsealed.
Making this change exposes a variety of errors. We can prevent these errors by annotating what we want the type of the empty object to be.

Reduces Xplat error diff to 2.3k

- Announcement: [post](https://fb.workplace.com/groups/flowlang/posts/903386663600331)
- Support group: [Flow Support](https://fb.workplace.com/groups/flow)

drop-conflicts

Format:
```
arc f
```
Sort imports
```
hg l -n | xargs js1 lint --fix --rule 'fb-tools/sort-requires'
```

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D36086696

fbshipit-source-id: 90447279f2e6e38f44189b74ec0297719f7adf58
2022-05-03 19:59:28 -07:00
Moti Zilberman 598c2e02fd Use Flow type inference for interpolation outputRange
Summary:
Changelog:
[Internal]

Cleans up unnecessary type casts / suppressions throughout the codebase following D35869725.

Reviewed By: javache

Differential Revision: D35870027

fbshipit-source-id: eefcb544b19ba93587011cdfd4046d18dddb246e
2022-05-03 12:04:02 -07:00
Nicola Corti 208422fe8e Bump React Native Codegen to 0.0.15
Summary:
For RN 0.69, we want to ship all the changes we have on master
for React Native Codegen.

Changelog:
[Internal] [Changed] - Bump React Native Codegen to 0.0.15

Reviewed By: cipolleschi

Differential Revision: D35964934

fbshipit-source-id: d6b6c36a9a077cb53113907ea59da3148e18e5cd
2022-04-28 04:18:28 -07:00
Nicola Corti 63acead781 Remove the unused JavaGenerator from the React Native Gradle Plugin.
Summary:
I'm removing the Java generation as we're not using it for now, and we're not maintaining it.
Moreover is not feature complete, and still needs `react-native-codegen` to generate the Makefile/CMake/C++ code.
We can still resort it if we decide to switch to AST based generation.

Changelog:
[Internal] [Changed] - Remove the unused JavaGenerator from the React Native Gradle Plugin

Reviewed By: cipolleschi

Differential Revision: D35930746

fbshipit-source-id: 624c411cdc678b270a647efc3cc8236b50018bef
2022-04-28 02:34:07 -07:00
Sam Zhou 0c4c6ca319 Add annotations to unannotated variable declarations [manually-modified]
Reviewed By: panagosg7

Differential Revision: D35948108

fbshipit-source-id: 7d286c9dd66dbd25281e2d831691f8bb34504b5d
2022-04-27 19:15:55 -07:00
Nicola Corti fbe72cf348 Bump React Native Gradle plugin to 0.0.7
Summary:
In order to release RN 0.69, we need to Bump React Native Gradle plugin to
the latest stable.

Changelog:
[Internal] [Changed] - Bump React Native Gradle plugin to 0.0.7

Reviewed By: cipolleschi

Differential Revision: D35964705

fbshipit-source-id: 0893fe092cfddffd5e79b70fc069f7c59ce33845
2022-04-27 09:41:11 -07:00
Nicola Corti c11785b90d Update the hermesc output to be inside the $buildDir
Summary:
Currently, we build Hermes by specifying the Cmake flag `-B ./hermes`. That means
that the output out the build is going to be placed along side the source code.

This is fine, as long as the user doesn't use the `REACT_NATIVE_OVERRIDE_HERMES_DIR`,
which is used inside the Hermes CI. In that case, the source location of Hermes can be
changed, leading to scenarios where `hermesc` can't be found.

Here I'm changing the flag to be `-B $buildDir/hermes`. Therefore the build output
will always be located within the `./ReactAndroid/hermes-engine/build` folder.
This is a more robust solution as the build output will be encapsulated within the
`build/` folder.

Changelog:i
[Internal] [Changed] - Update the hermesc output to be inside the $buildDir

Reviewed By: cipolleschi

Differential Revision: D35964402

fbshipit-source-id: aa7e0775b282897d5a99c1c46265884d19c5f289
2022-04-27 09:41:11 -07:00
Riccardo Cipolleschi ecf3293985 Back out "Remove AsyncStorage from rn-tester and fix InternalSettings Example"
Summary:
This diff breaks the RNTester app at runtime and it prevents us from cutting RN 0.69.

Original commit changeset: a879787d8683

Original Phabricator Diff: D35435562 (f4c4f446e4)

## Changelog
[General][Fixed] - Revert change which breaks RNTester

Reviewed By: cortinico, kacieb

Differential Revision: D35936298

fbshipit-source-id: c4ec92002fde9c1de691bcda17ebc5d0747914f6
2022-04-27 01:10:18 -07:00
Kacie Bawiec ca5e3b1dc9 Fix sendAccessibilityEvent_unstable Example in RNTester
Summary:
# First issue - incorrect ref
In this example, `AccessibilityInfo.setAccessibilityFocus_unstable` is being called on the Button ref. This fails because Button is not a HostComponent and does not accept a forwarded ref.

Since the button needs to be focused in order to click on it, I don't think the intention of this example actually makes sense. Since even if it worked, it would just reset the focus in the same place.

Instead, I alter this to set accessibility focus on the preceding Text element, which makes it more clear that setAccessibilityFocus is working.

# Second Issue - focus after closing Alert doesn't work
I am not sure why this is the case, but removing the alert causes focus to work correctly. i'm guessing the set focus command is conflicting with Alert's default resetting focus behavior.

# Minor Fix
I also quickly cleaned this up to be a function component because class components make refs more confusing (to me).

Changelog:
[Genera] Fix sendAccessibilityEvent_unstable Example in RNTester

Reviewed By: p-sun

Differential Revision: D35725018

fbshipit-source-id: f5a1dbbcf2635f038c41db9ef2a0b31389d2c745
2022-04-26 12:44:42 -07:00
Nicola Corti 8ae9c2cff6 Lazily resolve the hermesc path rather than eagerly
Summary:
This commit moves the resolution of the hermesc inside the TaskAction block of the
HermesBinaryTask. Therefore the hermesc path will be investigated only during the
execution of the task, and not when the task is created.

Changelog:
[Internal] [Changed] - Lazily resolve the hermesc path rather than eagerly

Reviewed By: motiz88

Differential Revision: D35930548

fbshipit-source-id: a517dda0fa9b10f53c25cd256ceb68d37d533d3b
2022-04-26 08:25:03 -07:00
Nicola Corti e51e19ecc1 Add event listeners to Scheduler
Summary:
Minimal set of changes to intercept events in external modules. Current intended use-case is for Reanimated to handle events for the Animated properties.

Changelog: [Added] Add listeners to allow intercepting events in C++ core.

Reviewed By: cipolleschi

Differential Revision: D35312534

fbshipit-source-id: ec924b57fd0c0dabf7be7b886dbef23bf3170d6c
2022-04-26 05:11:05 -07:00
Nicola Corti 6563c99c49 Honor the REACT_NATIVE_OVERRIDE_HERMES_DIR variable when searching for `hermesc`
Summary:
When searching for the `hermesc` path, we should also honor the `REACT_NATIVE_OVERRIDE_HERMES_DIR` variable.

Changelog:
[Internal] [Changed] - Honor the REACT_NATIVE_OVERRIDE_HERMES_DIR variable when searching for `hermesc`

Reviewed By: neildhar

Differential Revision: D35903601

fbshipit-source-id: 31e1255a558eece8cd84669861328db72e9ed17b
2022-04-25 12:15:41 -07:00
Carmi Grushko 4f855c8a2a @allow-large-files [MSDK] Update ktfmt component on FBS:master
Reviewed By: strulovich

Differential Revision: D35774317

fbshipit-source-id: ce59de8c38e385827a9ee62473b57a1791f18d27
2022-04-25 03:08:51 -07:00
Chaoshuai Lu d70d7fd0b3 Adopt UIGraphicsImageRenderer API
Summary:
Apple suggested to this new API on iOS 10+.

> // Any new bitmap drawing code is encouraged to use UIGraphicsImageRenderer in lieu of this API.

WWDC18 Reference: https://developer.apple.com/videos/play/wwdc2018/219/
> Use UIGraphicsImageRenderer to create and draw to an image buffer
Supports Wide Color, unlike UIGraphicsBeginImageContext()
Combine with UIImageView for efficient offscreen rendering

Per https://nshipster.com/image-resizing/#performance-benchmarks, the new API runs even faster than the C version, probably due to more smart context reuses/management.

Changelog:
[iOS][Changed] - Adopt UIGraphicsImageRenderer API

Reviewed By: philIip

Differential Revision: D35699584

fbshipit-source-id: 7a1e2109d5e121fb396c1014f4ed0a892211b0cc
2022-04-22 17:02:51 -07:00
John Wang ffaa5d69bc Add @Nullable to WritableMap and WritableArray for Android Java spec generator
Summary:
We're adding a native module that returns a Nullable type. This makes the Java spec and the implementation to be the same.

Changelog:
[Android][Added] - Generate `Nullable` for optional objects and arrays in module codegen.

Reviewed By: yungsters

Differential Revision: D35651333

fbshipit-source-id: d73c87340e33cf79831915ce6892e457ef369175
2022-04-22 16:55:29 -07:00
Luna Wei 6958bbb28c Fix up lint errors under react-native-github (#33622)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33622

Changelog: [Internal] Clean up eslint errors

Reviewed By: yungsters

Differential Revision: D35599445

fbshipit-source-id: bbb9061a3cf9df32daacad9a9b44eba94d3ce48c
2022-04-22 16:25:25 -07:00
Nicola Corti aeac6ab677 Gradle: extend the algoritm to find hermesc paths.
Summary:
This diff extends the Gradle algo used to search for `hermesc`.
Currently we look into `node_modules/hermes-engine/%OS-BIN%/hermesc`

With this change the algo will look into:
- A user provided path to hermesc
- Built from source version of hermesc (for users of New Architecture)
- Bundled version of hermesc inside react-native
- hermesc from the hermes-engine NPM package

I've added tests for the new algo. I also realized our tests were broken
(since they stopped running on CI), I fixed them as well.

Changelog:
[Android] [Changed] - Gradle: extend the algoritm to find hermesc paths

Reviewed By: ShikaSD

Differential Revision: D35649911

fbshipit-source-id: d4bcbe06a6bfa8d98b91c1612fc28b300de91661
2022-04-21 07:19:28 -07:00
Riccardo Cipolleschi 8ac8439e0d Prepare AppDelegate to enable Concurrent Root on iOS (#33671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33671

With React 18, we now need to allow users on Fabric to opt-in for Concurrent Root.

This commit adds a new method that can be customized in the AppDelegate to turn the feature on and off.
The flag is passed as an initialProps to the rootView.

## Changelog:
[iOS][Added] - Prepare a method in the AppDelegate to control the concurrentRoot.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D35757833

fbshipit-source-id: 192cf74c796554cba39366aa90c53c191f960c20
2022-04-21 06:59:17 -07:00
Riccardo Cipolleschi 705c6f57d6 Export REACT_NATIVE_PATH and fix find-node-for-xcode.sh fallback behavior (#33674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33674

## Issue
In D35317070 (0480f56c5b) we introduced a way to configuring the Xcode environment via he `.xcode.env`, falling back to the old `find-node-for-xcode.sh` behavior in case of a misconfiguration.

Unfortunately, there were an issue with the new architecture for which the pods were not able to locate the `find-node-for-xcode.sh`, crashing while building the new architecture.

## Solution
This Diff solves the issue in two steps:
1. it exposes to the project the REACT_NATIVE_PATH like Android does here: D35451821 (f8d7e0a968)
2. it leverages this new variables to reach the script

## Changelog
[iOS][Changed] - Fixed the fallback behavior when the `.xcode.env` file is missing, actually using the old `find-node-for-xcode.sh` script

Reviewed By: dmitryrykun

Differential Revision: D35779165

fbshipit-source-id: 393ef9a0b98d32d9cf226f7d109fdefd772e5120
2022-04-21 06:59:17 -07:00
Héctor Ramos c6daadcab4 Bump CocoaPods to 1.11.3 and Ruby to 2.7.5 in tests/cache (#33654)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33654

In D35116757 (2c87b7466e) we bumped the Circle CI macOS executor to use the Xcode 13.3.0 machine image, which has CocoaPods 1.11.3 installed. The RNTester Gemfile and CocoaPods cache is updated to reflect this change.

In D35116757 (2c87b7466e) the Ruby version was bumped to 2.7.5, so we update the Sandcastle tests to reflect this change as well.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D35679327

fbshipit-source-id: e6b5f9af13e95d335e0f89ebd7e1778a56bba601
2022-04-20 15:13:49 -07:00
Luna Wei 3c2fb72541 Bump version of @react-native-community/eslint-plugin to 1.2.0
Summary:
Changelog: [Internal] Bump react-native-community/eslint-plugin

It looks like we `*` version on the package.json so no updates needed, published 1.2.0: https://www.npmjs.com/package/react-native-community/eslint-plugin

Reviewed By: cortinico, neildhar

Differential Revision: D35590075

fbshipit-source-id: 11402cedea3067018c03e7b59202a48dc3a6b084
2022-04-20 13:19:43 -07:00
Nicola Corti d7b64b8d4b Expose an API to enable Concurrent Root on Android (#33645)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33645

With React 18, we now need to allow users on Fabric to opt-in for Concurrent Root.

This commit adds a new method that can be called on the ReactActivityDelegate
that can be used to set the `concurrentRoot` flag on the `initialProps` on the Render.

Changelog:
[Android] [Added] - Expose an API to enable Concurrent Root on Android

Reviewed By: mdvacca

Differential Revision: D35614879

fbshipit-source-id: 2de83e8115d3748c0346cdec6f31b2ab1f899478
2022-04-20 08:03:21 -07:00
Moti Zilberman a12959546a Revert D34518929: TalkBack support for ScrollView accessibility announcements (list and grid)
Differential Revision:
D34518929 (dd6325bafe)

Original commit changeset: 410a05263a56

Original Phabricator Diff: D34518929 (dd6325bafe)

fbshipit-source-id: 114d0910970c5f5caefb98c378722faba283f2a1
2022-04-20 06:48:19 -07:00
fabriziobertoglio1987 dd6325bafe TalkBack support for ScrollView accessibility announcements (list and grid) (#33180)
Summary:
This issue fixes [30977][17] . The Pull Request was previously published by [intergalacticspacehighway][13] with [31666][19].
The solution consists of:
1. Adding Javascript logic in the [FlatList][14], SectionList, VirtualizedList components to provide accessibility information (row and column position) for each cell in the method [renderItem][20] as a fourth parameter [accessibilityCollectionItem][21]. The information is saved on the native side in the AccessibilityNodeInfo and announced by TalkBack when changing row, column, or page ([video example][12]). The prop accessibilityCollectionItem is available in the View component which wraps each FlatList cell.
2. Adding Java logic in [ReactScrollView.java][16] and HorizontalScrollView to announce pages with TalkBack when scrolling up/down. The missing AOSP logic in [ScrollView.java][10] (see also the [GridView][11] example) is responsible for announcing Page Scrolling with TalkBack.

Relevant Links:
x [Additional notes on this PR][18]
x [discussion on the additional container View around each FlatList cell][22]
x [commit adding prop getCellsInItemCount to VirtualizedList][23]

## Changelog

[Android] [Added] - Accessibility announcement for list and grid in FlatList

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

Test Plan:
[1]. TalkBack announces pages and cells with Horizontal Flatlist in the Paper Renderer ([link][1])
[2]. TalkBack announces pages and cells with Vertical Flatlist in the Paper Renderer ([link][2])
[3]. `FlatList numColumns={undefined}` Should not trigger Runtime Error NoSuchKey exception columnCount when enabling TalkBack. ([link][3])
[4]. TalkBack announces pages and cells with Nested Horizontal Flatlist in the rn-tester app ([link][4])

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050452894
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050462465
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1032340879
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050618308
[10]:1ac46f932e/core/java/android/widget/AdapterView.java (L1027-L1029) "GridView.java method responsible for calling setFromIndex and setToIndex"
[11]:https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1042518901 "test case on Android GridView"
[12]:https://github.com/fabriziobertoglio1987/react-native-notes/issues/6#issuecomment-1050452894 "TalkBack announces pages and cells with Horizontal Flatlist in the Paper Renderer"
[13]:https://github.com/intergalacticspacehighway "github intergalacticspacehighway"
[14]:80acf523a4/Libraries/Lists/FlatList.js (L617-L636) "FlatList accessibilityCollectionItem"
[16]:5706bd7d3e/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java (L183-L184) "logic added to ReactScrollView.java"
[17]: https://github.com/facebook/react-native/issues/30977
[18]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/6
[19]: https://github.com/facebook/react-native/pull/31666
[20]: https://reactnative.dev/docs/next/flatlist#required-renderitem "FlatList renderItem documentation"
[21]: 75147359c5 "commit that introduces fourth param accessibilityCollectionItem in callback renderItem"
[22]: https://github.com/facebook/react-native/pull/33180#discussion_r826748664 "discussion on the additional container View around each FlatList cell"
[23]: d50fd1a681 "commit adding prop getCellsInItemCount to VirtualizedList"

Reviewed By: kacieb

Differential Revision: D34518929

Pulled By: blavalla

fbshipit-source-id: 410a05263a56162bf505a4cad957b24005ed65ed
2022-04-19 19:45:10 -07:00
Rob Hogan 47d742ae58 Update `graceful-fs`->`^4.2.4`, `micromatch`->`^4.0.4`
Summary:
A couple of semver-minor/patch dependency bumps to reduce the number of distinct requirements across the repo.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D35748473

fbshipit-source-id: 270c9a1b828aba20e03ac27600eb3a6e4ce2f0ec
2022-04-19 18:56:51 -07:00
J.T. Yim f4c4f446e4 Remove AsyncStorage from rn-tester and fix InternalSettings Example
Summary:
Changelog:
[**General**][**Removed**] - Removed AsyncStorage usage from RNTester

As part of the "Lean Core" efforts (see https://github.com/react-native-community/discussions-and-proposals/issues/6) to remove outdated and/or unused components (status: https://gist.github.com/Simek/88a9f1a014a47c37f4fce3738864d2e1), this diff removes usage of the deprecated AsyncStorage API from RNTester.

RNTester is intended as a reference to showcase various components and APIs. The implications of the replacement of AsyncStorage in RNTester with in-memory management of state is a tradeoff of persistance to a lighter weight implementation and user predictable behavior.

1. Removed AsyncStorage from rn-tester
  - removed Navigation and bookmark persisting from reducer
  - moved JS Stalls and tracking to application state with context and reducer
2. Fixed InternalSettings Example bugs

Reviewed By: lunaleaps

Differential Revision: D35435562

fbshipit-source-id: a879787d8683a1c452e5b6b75a9e01f3ceadfe5d
2022-04-19 15:34:40 -07:00
Vincent Riemer 32c704c30f Add gated option to use w3c pointer events for Pressibility's hover callbacks
Summary: Changelog: [Internal] - Add gated option to use w3c pointer events for Pressibility's hover callbacks

Reviewed By: p-sun

Differential Revision: D35596600

fbshipit-source-id: f9e4b71497efd0dbb09dbc1872694fc93a6e1f2e
2022-04-18 15:47:55 -07:00
Vincent Riemer 64034f3976 Put W3C PointerEvents RNTester examples behind a feature flag
Summary: Changelog: [Internal] - Put W3C PointerEvents RNTester examples behind a feature flag

Reviewed By: lunaleaps, p-sun

Differential Revision: D35684411

fbshipit-source-id: c69c12c5ed7ee7acc925d4ca8932e8bd8b6d4eee
2022-04-18 15:47:55 -07:00
Scott Kyle 3c1a814465 Fix visibility of C++ TM spec library when focusing
Summary:
This fixes an oversight where focusing fails if a C++ TurboModule is in the build graph. See line 391 in `rn_codegen_components` that does the same thing.

Changelog:
Internal

Reviewed By: mdvacca

Differential Revision: D35663755

fbshipit-source-id: d7d2e0109fd536586292d333b7d53b7b2e948d86
2022-04-15 11:08:31 -07:00
Mike Hardy 41cfd2f976 chore(typo): fix spacing typo in gradle plugin message (#33619)
Summary:
There is a simple typo - a missing space in to string concatenation in a deprecation message, the message pops up in a newly initialized RN68 project so seems worth fixing

## 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] - Fix typo in gradle plugin deprecation message

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

Test Plan:
Fixed via visual inspection (adding a single space character is luckily easy like that, yes that's perhaps over-confident but if you see the diff you will probably agree?)

cortinico

Reviewed By: cortinico

Differential Revision: D35577039

Pulled By: GijsWeterings

fbshipit-source-id: 84dc28ca0d0dcce89e1ca0c39ab0357b59396073
2022-04-12 06:34:30 -07:00
Luna Wei de09bd3b84 Dispatch enter/leave for ancestor hit path
Summary: Changelog: [Internal] - Fix pointer event dispatch to also fire enter/leave for ancestors in the hit path. Compared the event order with web on the RNTester W3C pointer example

Reviewed By: appden

Differential Revision: D35403076

fbshipit-source-id: 726e45e49a901b1d97ad3e20f5898701fd1f763b
2022-04-11 17:17:10 -07:00
Riccardo Cipolleschi 0480f56c5b Introduce .xcode.env configuration file to source `node` (#33546)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33546

This Diff does 2 things:
1. Removes all the remnant of the `find-node.sh` script. This allows React Native to stay agnostic from any other node manager
2. Introduces a way for the developers to specify which `node` executable they want to use, through a simple `.env` file.

## Changelog
[iOS][Changed] - This PR removes the `find-node.sh` scripts and replaces it with an `.xcode.env` file that is sourced by the script phases that needs it. The `.xcode.env` file is versioned: to customize a local environment, an unversioned `.xcode.local.env` can be used.

Reviewed By: cortinico

Differential Revision: D35317070

fbshipit-source-id: 4b400ba56aa2d574db563fa67b2008e1ddde1c59
2022-04-11 02:50:57 -07:00
Vincent Riemer 179c24e255 Emit touch-equivalent W3C pointer events on iOS
Summary: Changelog: [Internal] Emit touch-equivalent W3C pointer events on iOS

Reviewed By: lunaleaps

Differential Revision: D35295104

fbshipit-source-id: 1c1d5a4159bbfed92df151f7e12a4973ec44e970
2022-04-07 14:07:58 -07:00
Vincent Riemer cf2d05c4fe Add W3CPointerEvent example to RNTester iOS
Summary: Changelog: [Internal] Add W3CPointerEvent example to RNTester iOS

Reviewed By: kacieb

Differential Revision: D35220349

fbshipit-source-id: 240fe78c32a0cb4190fdc1e8395577b5f94b8f07
2022-04-07 14:07:58 -07:00
Nicola Corti 4befd2a29c Improve support for Android users on M1 machine (#33588)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33588

Currently users on M1 machine can't use the New Architecture correctly as they will get build failures when building the native code.

This Diff fixes it by automatically recognizing the host architecture and switching to NDK 24 if user is runnign on `aarch64`

Changelog:
[Android] [Fixed] - Improve support for Android users on M1 machine

Reviewed By: mdvacca

Differential Revision: D35468252

fbshipit-source-id: b73f5262b9408f04f3ae4fd26458a4d17c1ec29a
2022-04-07 10:55:32 -07:00
Nicola Corti 9573d7b84d Bump React Native Gradle plugin to 0.0.6 (#33581)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33581

We currently have some code on the RN Gradle Plugin that we need to ship.
There are both bugfixes needed for RN 0.68.1 and for the current nightly
(therefore needed for RN 0.69).

I've verified that this works on a fresh RN 0.68.0 install with `npm pack`
and triggering a build on a fresh setup from app template, with newArchEnabled set to true.

Changelog:
[Android] [Changed] - Bump React Native Gradle plugin to 0.0.6

Reviewed By: rubennorte

Differential Revision: D35439444

fbshipit-source-id: 662b2211c44b261e3e3c9cddc946107cfb495c79
2022-04-07 05:17:39 -07:00
Chris Olszewski daa105aba5 Fixup typo in pfh labels
Summary:
Now that the PFH node has been renamed this updates the pfh label.

Produced via `xbgs -l -e '"pfh:ReactNative_CommonInfrastructurePlaceholde"' | xargs sed -i 's/"pfh:ReactNative_CommonInfrastructurePlaceholde"/"pfh:ReactNative_CommonInfrastructurePlaceholder"/'`

Reviewed By: jkeljo

Differential Revision: D35374087

fbshipit-source-id: 61590f69de5a69ec3b8a0478f6dd43409de3c70b
2022-04-05 12:15:05 -07:00
Pieter De Baets 6e5cefe604 Codemod arvr to use onPointer* instead of onEnter/onExit/onMove
Summary: Changelog: [Internal] Improve experimental support for pointer event dispatching support in JS

Reviewed By: mdvacca

Differential Revision: D35216647

fbshipit-source-id: 212f038115e4713097db05847a9638efe0a25bed
2022-04-05 07:11:10 -07:00
Scott Kyle c7380ba113 Support function return types
Summary:
This adds the option for a TurboModule spec to use a "Cxx" suffix to unblock additional capabilities. This extends the pattern where TurboModules can have an "Android" or "IOS" suffix to exclude codegen for the other platform. When in `cxxOnly` mode, the parser will allow function return types (and additional features will be added over time).

Changelog:
[General][Added] C++ TurboModule methods can return functions

Reviewed By: christophpurrer

Differential Revision: D35364346

fbshipit-source-id: 768eb0ec2a1cbe3e458466064247d7e7f01135ff
2022-04-05 00:37:53 -07:00
Danilo Bürger d5da70e17e Replaced windowsAwareYarn with windowsAwareCommandLine for node calls (#33530)
Summary:
It is not necessary to call node via yarn. Instead with this commit node is called directly (windows aware). This enables builds on systems that don't have yarn installed.

Fixes https://github.com/facebook/react-native/issues/33525

## Changelog

[Android] [Fixed] - Don't require yarn for codegen tasks

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

Test Plan:
1. react-native init test
2. cd test
3. enable newArchEnabled=true (gradle.properties)
4. enable enableHermes: true (build.gradle)
5. react-native run-android (when the yarn is not installed on the system)

(I have not tested or verified if this works on windows build machines)

Reviewed By: sshic

Differential Revision: D35279376

Pulled By: cortinico

fbshipit-source-id: 430e4a7bcdec7d5377efac747f6b935d634451cc
2022-04-04 05:53:19 -07:00
Héctor Ramos 72dfc2725c Print logs to differentiate JSC and Hermes builds
Summary:
Print logs during `pod install` to clarify when Hermes is being used with RNTester and/or iOS React Native apps.

This changeset should not result in any change to the behavior of `pod install`, other than adding logs to CocoaPods' stdout.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D35294993

fbshipit-source-id: 55b6115d9f49c311c34ad3cb07346b2f97adcbf9
2022-04-02 00:02:11 -07:00
Scott Kyle 6e0fa5f15e Support optional types for C++ TurboModules
Summary:
Update C++ TurboModule codegen to wrap nullable types in `std::optional` whereas before the conversion would cause a crash.

Changelog:
Internal

Reviewed By: mdvacca, nlutsenko

Differential Revision: D35299708

fbshipit-source-id: 7daa50fe8b16879c5b3a55a633aa3f724dc5be30
2022-04-01 16:58:52 -07:00
Joe Frambach 8650220cf9 Fix ESLint and Typescript-ESLint disagreeing about function spacing (#33453)
Summary:
Fixes https://github.com/facebook/react-native/issues/33452 by replacing deprecated no-spaced-func ESLint rule and adding related TypeScript.

Changelog: [General][Fixed] - Update function spacing linting rules

See https://github.com/facebook/react-native/issues/33452 - Existing function spacing linting should pass as expected.

## 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
-->

[CATEGORY] [TYPE] - Message

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

Reviewed By: lunaleaps, cortinico

Differential Revision: D35011944

Pulled By: GijsWeterings

fbshipit-source-id: 441650045d89a01a9114103da0c080643f9cb82c
2022-04-01 06:49:02 -07:00
William Candillon 864a8c11b2 ⬆️ Upgrade package to work with ESLint 8 (#33448)
Summary:
This are the two package upgrade required for this package to run with ESLint 8

## Changelog

[JavaScript] [Changed] `react-native-community/eslint-config` to work with ESLInt 8

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

Test Plan: Try the package with ESLint 8

Reviewed By: yungsters

Differential Revision: D35012075

Pulled By: GijsWeterings

fbshipit-source-id: 7de68c770fb31fe8ec06c805afea9b5f3a7a7294
2022-04-01 06:44:42 -07:00
Nicola Corti 34628ac12a react-native-gradle-plugin should not depend on react-native-codegen NPM package
Summary:
This adds an unnecessary dependency between two NPM package which can be avoided. See https://github.com/reactwg/react-native-releases/discussions/17#discussioncomment-2452813
for context.

Changelog:
[Internal] [Changed] - react-native-gradle-plugin should not depend on react-native-codegen NPM package

Reviewed By: dmitryrykun

Differential Revision: D35279729

fbshipit-source-id: f18f79809f115f28203ac0a843fafead63528904
2022-03-31 04:33:30 -07:00
Luna Wei 4ce3914727 Add absolute child example to RNTester - W3CPointerEvents
Summary: Changelog: [Internal] Add another example for testing out the pointer events spec

Reviewed By: vincentriemer

Differential Revision: D35116565

fbshipit-source-id: 5f0cfeb871ae55071549c2289782401807f55515
2022-03-30 19:12:42 -07:00
Luna Wei 50070ec7c6 Add W3CPointerEvent example to RNTester Android
Summary:
Changelog: [Internal]
Add an example demonstrating pointer events

Reviewed By: vincentriemer

Differential Revision: D34422438

fbshipit-source-id: da378b4aaae8548f1114c1b23351527db6a6db69
2022-03-30 19:12:42 -07:00
Chris Olszewski ceae48c0f7 Add pfh labels to targets
Summary:
While it would be better to be able to do all of the ownership metadata at the Buck macro level, that proved to be more work than expected.

This diff adds the corresponding pfh label to all targets in `xplat/js/react-native-github` that have a Supermodule label. Once the migration is complete the Supermodules labels will be able to be removed.

Reviewed By: cortinico

Differential Revision: D35221544

fbshipit-source-id: d87d5e266dfb5e6ee087251dc34dff5db299bbaf
2022-03-30 14:37:03 -07:00
Wei Han 0353852297 fix //xplat/js/react-native-github:codegen_rn_components_schema_rncore (#33518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33518

Changelog: [Internal]

When building with buck2, `setup_env_vars.sh` cannot be found. exporting setup_env_vars.sh and adding it as a dep to `write_to_json` fixes it.

Reviewed By: d16r

Differential Revision: D35188154

fbshipit-source-id: e1e1be4c83a57e443a181efaf1af3e6c8e6452f9
2022-03-30 14:12:50 -07:00
Chris Olszewski 75edd288cb Backout feature args
Reviewed By: jkeljo

Differential Revision: D35203884

fbshipit-source-id: 87d50b138aaa3dd16a24b5ff2795910c3644d418
2022-03-30 06:53:44 -07:00
fabriziobertoglio1987 7b5b114d57 Making links independently focusable by Talkback (#33215)
Summary:
This issue fixes [32004][23]. The Pull Request was previously published by [blavalla][10] with [31757][24].
>This is a follow-up on [D23553222 (b352e2da81)][18], which made links functional by using [Talkback's Links menu][1]. We don't often use this as the sole access point for links due to it being more difficult for users to navigate to and easy for users to miss if they don't listen to the full description, including the hint text that announces that links are available.
The Implementation of the functionality consists of:

Retrieving the accessibility links and triggering the TalkBack Focus over the Text
1. nested Text components with accessibilityRole link are saved as [ReactClickableSpan][17] instances in Android native [TextView][20] ([more info][19])
1. If the TextView contains any [ClickableSpans][15] (which are [nested Text][14] components with role link), set a view tag and reset the accessibility delegate.
3. Obtain each link description, start, end, and position relative to the parent Text (id) from the Span as an [AccessibilityLink][16]
4. Use the [AccessibilityLink][16]  to display TalkBack focus over the link with the `getVirtualViewAt` method (more [info][13])

Implementing ExploreByTouchHelper to detect touches over links and to display TalkBack rectangle around them.
1. ReactAccessibilityDelegate inherits from [ExploreByTouchHelper][12]
2. If the [ReactTextView][21] has an accessibility delegate, trigger ExploreByTouchHelper method [dispatchHoverEvent][22]
3.  Implements the methods `getVirtualViewAt` and `onPopulateBoundsForVirtualView`.
     The two methods implements the following functionalities  (more [info][13]):
    * detecting the TalkBack onPress/focus on nested Text with accessibilityRole="link"
    * displaying TalkBack rectangle around nested Text with accessibilityRole="link"

## Changelog

[Android] [Added] - Make links independently focusable by Talkback

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

Test Plan:
[1]. User Interacts with links through TalkBack default accessibility menu ([link][1])
[2]. The nested link becomes the next focusable element after the parent element that contains it. ([link][2])
[3]. Testing accessibility examples in pr branch ([link][3])
[4]. Testing accessibility android examples in pr branch ([link][4])
[7]. TalkBack focus moves through links in the correct order from top to bottom (PR Branch with [link.id][25]) ([link to video test][7]) ([discussion][26])
[8]. TalkBack focus does not move through links in the correct order from top to bottom (PR Branch without [link.id][25]) ([link to video test][8]) ([discussion][26])

Test on main branch
[5]. Testing accessibility examples in main branch ([link][5])
[6]. Testing accessibility android examples in main branch ([link][6])

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1045593386
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1045593164
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054900872
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054918634
[5]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054888278
[6]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1054891828
[7]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1060073165
[8]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1060098381

[10]: https://github.com/blavalla "blavalla github profile"
[12]: 1ac46f932e/core/java/com/android/internal/widget/ExploreByTouchHelper.java (L48) "com/android/internal/widget/ExploreByTouchHelper.java#L48"
[13]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/9#issuecomment-1046384200 "explanation of getVirtualViewAt and onPopulateBoundsForVirtualView"
[14]: 1ac46f932e/core/java/android/text/Spannable.java (L3) "core/java/android/text/Spannable.java#L3"
[15]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextViewManager.java (L70-L71) "react/views/text/ReactTextViewManager.java#L70-L71"
[16]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java (L680-L685) "react/uimanager/ReactAccessibilityDelegate.java#L680-L685"
[17]: 561266fc18/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java (L126-L129) "react/views/text/TextLayoutManager.java#L126-L129"
[18]: b352e2da81
[19]: https://github.com/facebook/react-native/issues/30375#issuecomment-781494859 "explanation on how nested Text are converted to Android Spans"
[20]: 1ac46f932e/core/java/android/widget/TextView.java (L214-L220) "core/java/android/widget/TextView.java#L214-L220"
[21]: 485cf6118b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactTextView.java (L577) "dispatchHoverEvent in ReactTextView"
[22]: 1ac46f932e/core/java/com/android/internal/widget/ExploreByTouchHelper.java (L120-L138) "dispatchHoverEvent in ExploreByTouchHelper"
[23]: https://github.com/facebook/react-native/issues/32004
[24]: https://github.com/facebook/react-native/pull/31757
[25]: 485cf6118b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactAccessibilityDelegate.java (L648) "setting link.id in the AccessibilityLink constructor"
[26]: 485cf6118b (r820014411) "comment on role of link.id"

Reviewed By: blavalla

Differential Revision: D34687371

Pulled By: philIip

fbshipit-source-id: 8e63c70e9318ad8d27317bd68497705e595dea0f
2022-03-29 13:36:24 -07:00
CodemodService Bot 590ffad018 Annotate targets with feature xplat/js/react-native-github/ReactCommon/react/renderer/mapbuffer/BUCK -> xplat/js/tools/metro/packages/metro-runtime/src/polyfills/BUCK
Reviewed By: jkeljo

Differential Revision: D35178571

fbshipit-source-id: b8b6fcd49459e37152c02db8c7a6cfed167248a9
2022-03-28 13:22:38 -07:00
Mike 199ac680c7 build(deps): Bump dependencies version for eslint-plugin (#32800)
Summary:
Add cached yarn deps

Seeing the message below during development, packages are outdated

```
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.1.0

YOUR TYPESCRIPT VERSION: 4.5.4

Please only submit bug reports when using the officially supported version.

=============
```

Update packages below to "5.8.0" should fix this
- typescript-eslint/eslint-plugin
- typescript-eslint/parser

## 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] - Bump dependencies version for eslint-plugin

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

Test Plan: `yarn lint` with no error

Reviewed By: cortinico, yungsters

Differential Revision: D33331050

Pulled By: charlesbdudley

fbshipit-source-id: 27bf9b9b0536545ebfe4614ed210255df65aa2cd
2022-03-28 10:44:33 -07:00
Genki Kondo 19cf70266e VirtualizedList optimization - avoid lambda creation in CellRenderer onLayout prop
Summary:
Problem:
All CellRenderers rerender every time the containing VirtualizedList is rerendered. This is due to the following:
- Lambda is created for each CellRenderer's onLayout prop on every VirtualizedList render (fixed in this diff)
- CellRenderer's parentProps prop changes on every VirtualizedList render

Changelog:
[Internal] - VirtualizedList optimization - avoid lambda creation in CellRenderer onLayout prop

Reviewed By: javache

Differential Revision: D35061321

fbshipit-source-id: ab16bda8418b692f1edb4bce87e25c34f6252b56
2022-03-24 08:28:01 -07:00
Héctor Ramos 12ad1fffe8 Build Hermes from source by default on iOS
Summary:
Remove BUILD_HERMES_SOURCE gate and default to building Hermes from source on iOS when Hermes is enabled.

Changelog:
[iOS][Changed] - When Hermes is enabled, the Hermes Engine will be built from source instead of using the pre-built `hermes-engine` CocoaPod.

Reviewed By: cortinico

Differential Revision: D34911987

fbshipit-source-id: 9d6d49498a23f6dae0b97c9f80c689b654db11bd
2022-03-23 16:53:47 -07:00
Nicola Corti 94d0afe6e3 Bump codegen to 0.0.14 (#33475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33475

To unblock the broken iOS circle ci, I'm bumping codegen to 0.0.14

Changelog:
[General] [Changed] - Bump codegen to 0.0.14

Reviewed By: ShikaSD

Differential Revision: D35079748

fbshipit-source-id: 703773ec2a5fd864b9c9a2f8d29359a4046c18a4
2022-03-23 11:50:27 -07:00
Nicola Corti 4d91f40fbd Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package. (#33467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33467

We can now change the `hermes-engine` dependency to be consumed by the `react-native` NPM package
and not anymore from the standalone `hermes-engine`. This will allow for a better stability
as the `hermes-engine` and the `react-native` were built from source at the same instant in time.

Changelog:
[Android] [Changed] - Update template/android and RN Tester to use `hermes-engine` from the `react-native` NPM package.

Reviewed By: hramos

Differential Revision: D34213795

fbshipit-source-id: 29e54b37db0103f72e9983976ef9147fe69116e7
2022-03-23 04:50:12 -07:00
Erich Graham 45e2941367 Remove folly import in GenerateModuleObjCpp
Summary:
Changelog:

[iOS][Changed]
Replaced folly::Optional with std::optional from C++17 in Objc module generator.

Reviewed By: philIip

Differential Revision: D32367103

fbshipit-source-id: f0d254c4add7d6d2e0bdbceb09a852b4a01ea8c7
2022-03-22 17:10:18 -07:00
Pieter Vanderwerff 83ab3615c5 Land suppressions ahead of 0.174.1 release [v2]
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D35035872

fbshipit-source-id: 74daf0685e976459119061a3fca467277f0dc4ac
2022-03-22 11:42:16 -07:00
Andrei Shikov ca090ac977 Place CONFIGURE_DEPENDS in a right place for generated CMakeLists.txt
Summary:
In the previous template, configure depends was placed after the globbing expression, causing CMake warning.

Changelog: [Internal] - Correct globbing for CMake config in the codegen

Reviewed By: cortinico

Differential Revision: D35044874

fbshipit-source-id: 4f022bfaaec3a84141f4be7de96c56a545639e56
2022-03-22 06:11:36 -07:00
Nicola Corti 5b1ac6fb3b Use `findByName` instead of `named` when applying Gradle task dependencies
Summary:
When using Android Studio, an active ABI gets selected which is resulting in failing to open the project as some of the tasks can't be found. I'm fixing this.

Changelog:
[Internal] [Changed] - Use `findByName` instead of `named` when applying Gradle task dependencies

Reviewed By: ShikaSD

Differential Revision: D35044870

fbshipit-source-id: 44bfaee320bce84c992610325c13daf71934a38b
2022-03-22 04:48:52 -07:00
Abishek Sethuraman ecc63daf4b Revert D35016384: Land suppressions ahead of 0.174.1 release
Differential Revision:
D35016384 (2fab97fde5)

Original commit changeset: 78ab1b4822c0

Original Phabricator Diff: D35016384 (2fab97fde5)

fbshipit-source-id: 82d9672798fdb77313a35be40d0c0aebb0cace64
2022-03-21 15:24:39 -07:00
Pieter Vanderwerff 2fab97fde5 Land suppressions ahead of 0.174.1 release
Summary: Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D35016384

fbshipit-source-id: 78ab1b4822c0a3aeab63d615b81b6063a883fe54
2022-03-21 14:24:38 -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
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
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
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
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
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
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
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
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
Scott Kyle 6a9497dbbb Move some classes to new bridging library (#33413)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33413

This moves `CallbackWrapper` and `LongLivedObject` into a new "bridging" library. This library is mostly intended for use by the native module system, but can also be used separately to "bridge" native and JS interfaces through higher-level (and safer) abstractions than relying JSI alone.

Changelog:
Internal

Reviewed By: christophpurrer

Differential Revision: D34723341

fbshipit-source-id: 7ca8fa815537152f8163920513b90313540477e3
2022-03-11 12:47:51 -08:00
Kudo Chien a6c2846b37 Fix ios build error when use_frameworks is on and fabric is off (v2) (#33409)
Summary:
alternative solution for https://github.com/facebook/react-native/issues/33379

> when `use_frameworks!` is on, there are errors like:
> ```
> 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
> #import <FBReactNativeSpec/FBReactNativeSpec.h>
> ```
> this error may come from from https://github.com/facebook/react-native/commit/f7e4c07c84b6 regression.
>
> when `use_frameworks!` is on, xcode will search headers from framework directories, the correct imports would be `#import <React_Codegen/FBReactNativeSpec/FBReactNativeSpec.h>` (xcode will transform dash to underscore, so it is `React_Codegen` but not `React-Codegen`). in the other hand, when `use_frameworks!` is off, the correct import is `#import <React-Codegen/FBReactNativeSpec/FBReactNativeSpec.h>`.
>
>
> this fix is specific for old architecture (fabric is off).
>
> when fabric is on, there are other errors from duplicated headers when copying to build folder. [the reason is that framework build would try to flatten headers](https://mkonrad.net/2015/03/29/xcode-static-libraries-preserving-header-directory-structure.html). we have `primitives.h` in different folders and they would be flattened into `React_Fabric.framework/Headers`. to be honest, i don't know how to deal with the problem in the meantime,  maybe subspecs are not enough, we should separate them from subspecs to dedicated podspecs so that we can have these targets as different frameworks.

in this alternative fix, i try to add `React-Codegen/React_Codegen.framework/Headers` into header search paths and make original `#import <FBReactNativeSpec/FBReactNativeSpec.h>` reachable.

[this change](7a0398c331) in the pr is just a workaround to solve breaking in latest main branch and this is not important to the `use_frameworks!` fix at all. this breaking was coming from 1804951595.

## Changelog

[iOS] [Fixed] - Fix iOS build error when Podfile `use_frameworks!` is on and Fabric is off

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

Test Plan:
verify with rn-tester
1. change `fabric_enabled` to false in `packages/rn-tester/Podfile`
2. `USE_FRAMEWORKS=1 pod install`
3. build rn-tester in xcode

Reviewed By: dmitryrykun

Differential Revision: D34817041

Pulled By: cortinico

fbshipit-source-id: 4d1a610e99a807793eb3f64461e0d735c0a9ca9c
2022-03-11 09:08:07 -08:00
Mike Hardy 2a5265dff7 fix(ios, flipper): update flipper sub-pods to support macCatalyst (#33406)
Summary:
Flipper-DoubleConversion and Flipper-Glog iOS pods received a build optimization
a few versions back that pre-compiled the pods and references the xcframework slices

Unfortunately, the pre-compile did not include macCatalyst slices, so this disabled support
for flipper on macOS for react-native >0.65

lblasa has re-compiled the pods with the macCatalyst slices added

See https://github.com/facebook/flipper/issues/3117

## 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] - update Flipper pods to support re-enable macCatalyst

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

Test Plan:
- [ ] The Flipper repo has a react-native test that appeared to work with these versions, CI should work here
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on arm64
- [ ] Prove there is no regression, a flipper-enabled build test should work for simulator iOS target on x86_64 mac
- [ ] Prove there is no regression, a flipper-enabled build test should work for real device iOS target
- [ ] To prove the issue is resolved, a build should be attempted for a macCatalyst target, and it should work.

Reviewed By: cortinico

Differential Revision: D34789654

Pulled By: lblasa

fbshipit-source-id: 466803dd07b5820220512b7d7d760b94b8aa65f7
2022-03-11 02:47:27 -08:00
Nick c34ef5841c Fix: Android react.gradle VmCleanup when packaging as library (#33179)
Summary:
When packaging a react app as an android library with the enableVmCleanup flag not set to false, an error occurs since the "package${targetName}" task can not be found. This PR adds a simple null check, similar to what is being done for the sTask and mTask just below it to prevent the error.

## 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] - Fixes android build error when compiling as library

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

Test Plan:
Compile project as library (com.android.library), and should not trigger and error with these changes.

Would also like to have this fix cherry-pick'd to release 0.67 after merging.

Reviewed By: ShikaSD

Differential Revision: D34475934

Pulled By: cortinico

fbshipit-source-id: ce6ce43960c4b388c4b1da49a9a6e21fd3bf8e16
2022-03-08 13:35:28 -08:00
caioagiani 8200063ac6 fix: typos (#33040)
Summary:
Fix typos in:

- `Libraries/Renderer/implementations/ReactFabric-dev.js`: transfered -> **transferred**
- `Libraries/Renderer/implementations/ReactNativeRenderer-dev.js`: transfered -> **transferred**
- `ReactAndroid/src/main/java/com/facebook/react/modules/network/ProgressiveStringDecoder.java`: remainderLenght -> **remainderLength**
- `ReactAndroid/src/main/jni/first-party/yogajni/jni/ScopedGlobalRef.h`: Transfering -> **Transferring**
- `ReactCommon/react/renderer/graphics/Transform.h`:  tranformation -> **transformation**
- `packages/rn-tester/js/examples/ToastAndroid/ToastAndroidExample.android.js`: occured -> **occurred**

## 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 typos

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

Test Plan: Considering this only changes code comments, I don’t think this pull request needs a test plan.

Reviewed By: cortinico, pasqualeanatriello

Differential Revision: D34003812

Pulled By: dmitryrykun

fbshipit-source-id: 5c8699f8efcc4354854190a9aade30dbc5c90fdb
2022-03-08 03:58:58 -08:00
Scott Kyle ceeb8ec8b1 Remove need to copy JSI arguments
Summary:
Since the generated functions move JSI arguments as rvalues into these methods, using const lvaue references doesn't provide any benefit, and in fact hinders our ability to *move* arguments somewhere else and instead requires having to confusingly copy them instead (which JSI makes more difficult).

Changelog:
Internal

Reviewed By: nlutsenko

Differential Revision: D34704455

fbshipit-source-id: 520a358d8a7adeb848e7d7eb204f7154f8f4b58d
2022-03-07 19:21:51 -08:00
Scott Kyle 269fa37bb8 Indent C++ method declarations
Summary:
This moves the `indent` function into a `Utils` module so it can be also used to properly indent the abstract methods declarations in a C++ TurboModule spec.

Changelog:
Internal

Reviewed By: nlutsenko

Differential Revision: D34704456

fbshipit-source-id: 88a3a672e4860927b5dd1f5107f40da7b5a83e51
2022-03-07 19:21:51 -08:00
Diego Pasquali 7b05b091fd Integrated iOS-only `accessibilityLanguage` prop (#33090)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/30891

This PR is going to add an `accessibilityLanguage` prop to all the available components. This props is currently working only on iOS and should follow the [guidelines of the relative configuration](https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage).

I'm in no way an expert on native programming (especially Objective-C) so I'm open to changes / improvements 🙂

## 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] [Added] - Integrated the `accessibilityLanguage` prop to all the available components. The prop is available for any platform but it will work only on iOS.

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

Test Plan:
This has been tested using both the Simulator, checking for the `Language` attribute, and using a physical device with the Voice Over enabled.

<img width="1083" alt="Screenshot 2022-02-11 at 13 17 32" src="https://user-images.githubusercontent.com/5963683/153590415-65fcb4ff-8f31-4a0f-90e5-8eb1aae6aa3d.png">

Reviewed By: philIip

Differential Revision: D34523608

Pulled By: rh389

fbshipit-source-id: b5d77fc0b3d76ea8ed8f30c8385459ba98122ff6
2022-03-07 09:43:30 -08:00
Danilo Bürger 42b01a32a1 Use relative installation root instead of absolute to avoid embedding absolute paths in pods project (#33187)
Summary:
Use relative installation root instead of absolute to avoid embedding absolute paths in pods project
Also removes a leading space from each path.

Before:

<img width="799" alt="155846827-94c474b7-8a79-45fc-a900-8860a94fb318" src="https://user-images.githubusercontent.com/996231/155847731-de128759-bff5-4d1f-a59a-377298055d85.png">

After:

<img width="745" alt="Screenshot 2022-02-26 at 15 58 32" src="https://user-images.githubusercontent.com/996231/155847739-b783debc-a805-4ce7-a88a-33f764dc5985.png">

## 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] - Remove absolute paths from pods project

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

Test Plan: Pod install and view in Xcode FBReactNativeSpec -> Build Phases -> [CP-User] Generate Specs

Reviewed By: ShikaSD

Differential Revision: D34549541

Pulled By: dmitryrykun

fbshipit-source-id: 2926b093fb87f50ef9988e23fce593348f00077d
2022-03-07 06:44:25 -08:00
Scott Kyle 402ad82027 Don't crash from wrong types
Summary:
The `get*` methods will assert and thus crash if JS passes a value by the wrong type. Although we have type checking, we should strive to never crash the app if an incorrect value slips by. The `as*` variants will throw an error back into JS instead.

Changelog:
Internal

Reviewed By: christophpurrer

Differential Revision: D34630900

fbshipit-source-id: 5ec55ca08ca7a1f43b2d9bfbb1d4e6fa89146e12
2022-03-04 08:02:17 -08:00
Samuel Susla c2e4ae39b8 Add support for C++17 in OSS
Summary: changelog: Add support for C++17

Reviewed By: cortinico

Differential Revision: D34612257

fbshipit-source-id: 88a0307a750f2e0793a639b7a2b670a4571332fe
2022-03-04 07:25:59 -08:00
Ramanpreet Nara f47082be11 Generate Props C++ structs on all platforms
Summary:
The props generator assumes that Props are used only on iOS. (i.e: the generator doesn't generate the props code if the iOS platform is excluded). However, Props are also used on Android. So, this diff makes us generate Props for all platforms.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D34559900

fbshipit-source-id: 0c25835dd57aa55a094152c147a9f952b9bc6850
2022-03-01 16:27:52 -08:00
Paige Sun 3eae11e72f Migrate dev method codegenNativeComponent to be Bridgeless compatible
Summary: Changelog: [Internal] Migrate dev method codegenNativeComponent to be Bridgeless compatible

Reviewed By: RSNara

Differential Revision: D34513074

fbshipit-source-id: d71fbf066453ac8c407d0cf41c2dc7fa80c87688
2022-03-01 13:30:55 -08:00
Ian Childs ff568b0b1f Add label to run genrule locally
Summary: Changelog: [Internal]

Reviewed By: ndmitchell

Differential Revision: D34552708

fbshipit-source-id: 06e1950676713a95622c4ec38be87c9944dadb29
2022-03-01 10:18:40 -08:00
Scott Kyle a0a2958cda Expose C++ TurboModule codegen
Summary:
This adjusts the previously unused (but fully working!) `rn_codegen_cxx_modules` rule to be consistent with the other codegen rules and calls it from the `rn_codegen` with the "JSI" suffix to not conflict with the other rules, and to match the convention established by hand-written C++ TurboModules.

Changelog:
Internal

Reviewed By: RSNara

Differential Revision: D34451208

fbshipit-source-id: 4d779b068dfa4f7fd73fd3bca354fffe86d01f73
2022-02-28 17:08:03 -08:00
Andrei Shikov 964e816752 Update usages of default ReactNativeConfig (#33196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33196

Fixes compilation of Android template and renames the field according to Java guidelines.

Changelog: [Android][Changed] - Rename field with default values for ReactConfig to DEFAULT_CONFIG

Reviewed By: cortinico

Differential Revision: D34523356

fbshipit-source-id: 46ed703e7ca8ab5e05879dd93e8e4d2d816c2d03
2022-02-28 14:45:09 -08:00
Andres Suarez 75348acbfc Fix unnecessary LICENSELINT suppressions
Reviewed By: zsol

Differential Revision: D34526295

fbshipit-source-id: f511370dc3186bc396d68a2e6d5e0931facbeb42
2022-02-28 11:53:40 -08:00
David Vacca 858ccfc9c8 Refactor to reuse EmptyReactNativeConfig from ReactNativeConfig
Summary:
Quick refactor to reuse EmptyReactNativeConfig from ReactNativeConfig

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D34283060

fbshipit-source-id: 32400d5ed6defd9f82953dc49ae365598db71bbc
2022-02-27 22:23:48 -08:00
David Vacca 5c9c901d0c Introduce DefaultValuesReactNativeConfig constant
Summary:
Introduce DefaultValuesReactNativeConfig constant that represents a ReactNativeConfig that always return default values

I also use this constant in all the apps using fbaric that don't have a custom Mobile Config

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D34160478

fbshipit-source-id: 5730054fd4cc87e1fe5dc8247cc237194bf48981
2022-02-27 22:23:48 -08:00
Paige Sun 94b1b8a573 1/5 Refactor CxxBridge: Introduce RCTBridgeModuleDecorator to attach @synthesize ivars to RCTTurboModules, in Bridge mode
Summary:
Changelog: [iOS][Internal] Refactor CxxBridge: Introduce RCTBridgeModuleDecorator to attach synthesize ivars to RCTTurboModules, in Bridge mode

This doesn't change any logic. RCTBridgeModuleDecorator was created to consolidate several nearly identical implementations of the `attachInteropAPIsToModule` method to one place.

Most importantly, it allows us to attach interop APIs in RCTBridgeModuleDecorator to RCTViewManagers in diff 4/4, using  `attachInteropAPIsToModule`. Before this stack, these four synthesize ivars in RCTViewManagers are nil in Bridgeless mode, and point to instances in Bridge mode.

# Context
These are used in RCTBridgeModules to access APIs for view managers. These APIs are necessary and compatible with Bridgeless mode.

*  synthesize viewRegistry_DEPRECATED
*  synthesize bundleManager
*  synthesize callableJSModules
*  synthesize moduleRegistry

Reviewed By: RSNara

Differential Revision: D34437802

fbshipit-source-id: b773d511cf877d4896436fabf4893c978e5f8dd9
2022-02-25 08:50:34 -08:00
Andrei Shikov 13b0b06522 Remove lint restricting properties on `DynamicColorIOS` (#33182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33182

This information can be checked by the type system + `DynamicColorIOS` supports other properties now.

Changelog: [Removed][iOS] - Removed lint restricting `DynamicColorIOS` to only two properties

Reviewed By: cortinico

Differential Revision: D34475985

fbshipit-source-id: c4190adad05e68b0a38a6ec89862372d9af55894
2022-02-25 06:46:14 -08:00
Ian Childs 22ac11a580 Mark some RN genrules as using local filesystem paths
Summary: Changelog: [Internal]

Differential Revision: D34380030

fbshipit-source-id: f444f176b56a7fd93f69936fdae2c81f26b310fe
2022-02-23 09:23:21 -08:00
Andrei Shikov b1a779392d Enable Kotlin build in OSS (#33160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33160

Enables Kotlin build in RNAndroid, while adjusting the package structure to help with path/package inconsistency.

Moves `react/uimanager/interfaces` files into `react/uimanager` to make sure package name matches with file location and updates Buck configuration to still include it as a separate target.

Changelog: [Android][Changed] - Moved `com/react/facebook/uimanager/interfaces` files into `com/react/facebook/uimanager` to enable Kotlin build

Reviewed By: cortinico

Differential Revision: D34381179

fbshipit-source-id: 252588d9c7f62b8019bdfcce66197628d63e63a1
2022-02-22 10:22:52 -08:00
Ian Childs bb8ddd6c12 Use realpath instead of readlink
Summary:
Changelog: [Internal]

Generated with:

```
python3 codemod.py -d xplat/js --extensions=sh 'THIS_DIR=\$\(cd -P "\$\(dirname "\$\(readlink "\${BASH_SOURCE\[0\]}"' 'THIS_DIR=$(cd -P "$(dirname "$(realpath "${BASH_SOURCE[0]}"'```

Reviewed By: motiz88

Differential Revision: D34379955

fbshipit-source-id: c60521cd6508b203f48ca8c890c450319991c2d4
2022-02-22 02:23:02 -08:00
Riccardo Cipolleschi 4ec2d6cf0b Update RNTester documentation for Mac M1
Summary:
This Diff updates the RNTester README to support Mac M1 laptops.

## Changelog
[General][Changed] - Updated `rn-tester/README.md` to include instructions for Mac M1 users

Reviewed By: cortinico

Differential Revision: D34376951

fbshipit-source-id: 7195bddefb6e202261fef9b5f5225484c506fd9b
2022-02-21 09:22:52 -08:00
Gabriel Donadel Dall'Agnol 200488e87c build: Bump AGP to 7.1.1 and fix bundle inclusion in release mode (#33057)
Summary:
Upgrade Android Gradle to 7.1.0 on template and fix a bug where the bundle was not getting included when building the app in release mode

Closes https://github.com/facebook/react-native/issues/33002
Closes https://github.com/facebook/react-native/issues/33018
Closes https://github.com/facebook/react-native/issues/33046
Potentially fixes https://github.com/facebook/react-native/issues/33029

## Changelog

[Android] [Changed] - Bump AGP to 7.1.0 and fix bundle inclusion in release mode

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

Test Plan:
1. Run `./scripts/test-manual-e2e.sh`
2. Select `A new RN app using the template` and `Android`
3. Test app on the emulator
4. Open Android studio build the app using release variant
4. Check the release apk using Android studio "Analyze APK" tool and ensure the bundle is included

![image](https://user-images.githubusercontent.com/11707729/152700410-3bcb80b0-35b6-4bdc-bf57-98a42a29e5a6.png)

Reviewed By: ShikaSD

Differential Revision: D34076884

Pulled By: cortinico

fbshipit-source-id: da4392af37e08e22dbcafba38476fd712141474a
2022-02-21 06:23:31 -08:00
Nicola Corti 42272211e4 Release react-native-gradle-plugin 0.0.5
Summary:
Time to release a new version of the Gradle plugin and bump it to 0.0.5
This version includes a deprecation of `reactRoot` and a warning message
to migrate to `root`/`reactNativeDir`.

Changelog:
[Android] [Changed] - Release react-native-gradle-plugin 0.0.5

Reviewed By: ShikaSD

Differential Revision: D34339272

fbshipit-source-id: c03495bda7c4185d674761e58a94fde8612f2941
2022-02-18 14:23:24 -08:00
Nicola Corti 8bc324fd34 Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir` (#33142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33142

The `reactRoot` property was confusing as we were using it for both the root of the project
and the react-native NPM Package root. I'm deprecating it and splitting it in two.

I've added several warning in the codebase to tell the people how to migrate away from it.
Moreover this is specifying default values that are more user-friendly. Users won't have to
configure anything unless they are in a monorepo.

Changelog:
[Android] [Changed] - Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir`

Reviewed By: ShikaSD

Differential Revision: D34277050

fbshipit-source-id: fc7f45017452b086726516a9586cacd9a661c287
2022-02-18 04:32:40 -08:00
Yann Pringault 2db1bca952 Remove prettier from dependencies (#33125)
Summary:
`prettier` should not be declared in dependencies in the ESLint config because it can trigger issues when a different version is installed on the client app.

`prettier` is already declared as `peerDependencies` and in the [README](https://github.com/facebook/react-native/blob/main/packages/eslint-config-react-native-community/README.md), it's explicitly asked to install it:

```
yarn add --dev eslint prettier react-native-community/eslint-config
```

## 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] - Remove prettier from dependencies in eslint-config

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

Test Plan: - Install the package `react-native-community/eslint-config` and ensure everything works the same as before

Reviewed By: yungsters

Differential Revision: D34305118

Pulled By: ShikaSD

fbshipit-source-id: 65a3a79008cd5e28cc6aa93ef4a5032990b4e9f8
2022-02-17 09:18:55 -08:00
Paige Sun f8158f8a03 Replace DummyUIManager with BridgelessUIManager. Log errors for deprecated methods in Bridgeless.
Summary:
Changelog: [Internal]

* Rename DummyUIManager to BridgelessUIManager
* Cleanup `RCTVirtualText` & `RCTShimmeringView` since the native changes from T107747313 are already in production, so these two will components always return a viewConfig in prod.

- `console.error` when deprecated Bridge UIManager method are being accessed.
- Make sure new BridgelessUIManager.js has the same method definition as [NativeUIManager.js](https://www.internalfb.com/code/fbsource/[e80c98b816183dcdfde1e81de01ba99aa6e30ed2]/xplat/js/react-native-github/Libraries/ReactNative/NativeUIManager.js?lines=15)

Reviewed By: RSNara

Differential Revision: D34203081

fbshipit-source-id: 99aafc2372b118d0c8cc41f7376e136dabae9bd5
2022-02-14 16:31:15 -08:00
Phillip Pan 7cece34233 test RCTView with c swizzling example
Summary:
writing a test that has an example of c swizzling in oss. testing this:

https://www.internalfb.com/code/fbsource/[c58818169205f1e0fa816968efdb4c3fac8333e9]/xplat/js/react-native-github/React/Views/RCTView.m?lines=452-454%2C460-468

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D31949237

fbshipit-source-id: f16c98ec1a736f3f2152d1e411b693083519a7b9
2022-02-11 13:46:02 -08:00
Genki Kondo 1aec881958 Add Animated Color example
Summary:
Changelog:
[Internal] - Add an example to demo Animated colors with both JS and native drivers

Reviewed By: mdvacca

Differential Revision: D34153047

fbshipit-source-id: 9b61fd4e5f597b0440bed7ff1a33716e50ec34e5
2022-02-10 21:08:01 -08:00
Genki Kondo 49f3f47b1e Support color animation with native driver for iOS
Summary:
Adds support for Animated.Color with native driver for iOS. Reads the native config for the rbga channel AnimatedNodes, and on update(), converts the values into a SharedColor.

Followup changes will include support for platform colors.

Ran update_pods: https://www.internalfb.com/intern/wiki/React_Native/Preparing_to_Ship/Open_Source_Pods/

Changelog:
[iOS][Added] - Support running animations with AnimatedColor with native driver

Reviewed By: sammy-SC

Differential Revision: D33860583

fbshipit-source-id: 990ad0f754a21e3939f2cb233bcfa793ef12eb14
2022-02-10 11:18:39 -08:00
Nicola Corti 327c4d7a08 Place Android.mk dependencies on separate lines for codegen.
Summary:
That's a really nit change, but when we moved the Makefile deps to be on separate
lines, we havent' done the same for the codegen. Here I'm doing it.

Changelog:
[Internal] [Changed] - Place Android.mk dependencies on separate lines for codegen

Reviewed By: ShikaSD

Differential Revision: D34144715

fbshipit-source-id: be9d5fb75b6b93c0b2bb479145053ae6f201e1fc
2022-02-10 09:40:52 -08:00
Nicola Corti 3d8a7fe14a Set Java source/target compatibility for react-native-gradle-plugin to 8
Summary:
This is necessary otherwise when building from source on JVM < 11, the `compileJava`
task of the Gradle Plugin will fail with `invalid source: 11`.
Essentially the Gradle build will not even start because of this. Instead we delegate
to a better formatted warning from either AGP or from our plugin.

Changelog:
[Internal] [Changed] - Set Java source/target compatibility for react-native-gradle-plugin to 8

Reviewed By: ShikaSD

Differential Revision: D34111799

fbshipit-source-id: 57ab11fe6c4532576776b586f75e8fcb5c71adcd
2022-02-09 12:06:54 -08:00
Muhammad Numan 4e947ecb2d fix: jvm 11 error message from ReactPlugin.kt and react.gradle (#33048)
Summary:
you can see discussion here: https://github.com/reactwg/react-native-releases/discussions/13#discussioncomment-2069527
we were getting this error message when we build Gradle with other than 11 JVM
```
> Task :react-native-gradle-plugin:compileJava FAILED
2 actionable tasks: 2 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-gradle-plugin:compileJava'.
> invalid source release: 11
```
this solution is suggested by mikehardy

after this PR, now the error is like this
```
**************************************************************************************************************

ERROR: requires JDK11 or higher.
Incompatible major version detected: '8'

**************************************************************************************************************
```

## 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] - jvm 11 error message

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

Test Plan: install other than 11 java version and just run `./scripts/test-manual-e2e.sh` this command at the root of RN repo than this error will appair `invalid source release: 11`

Reviewed By: ShikaSD

Differential Revision: D34110990

Pulled By: cortinico

fbshipit-source-id: c142a363c7cec0db65d5ab9da858fd25866c7c49
2022-02-09 10:23:27 -08:00
Ramanpreet Nara 971ba5c26b Re-introduce {eventName}: true ViewConfig ValidAttributes in Static ViewConfigs
Summary:
# Problem
I removed the {eventName}: true entries from ViewConfigs validAttributes in D33303950 (ca5aaa7663). These entries were iOS-only. I removed them to achieve platform-consistency in native ViewConfigs.

This change broke the onLayout event for all React Native components. So, I reverted D33303950 (ca5aaa7663) for native ViewConfigs server-side. But I never got around to reverting D33303950 (ca5aaa7663) for static ViewConfigs.

# Changes
This diff reverts D33303950 (ca5aaa7663) for Static ViewConfigs, with server-side gating.

Now, these {eventName}: true ViewConfig validAttribute will be inserted into all view configs (static and native) **by default**.

Calling RCTDisableViewConfigEventValidAttributes(YES) on iOS will remove {eventName}: true ViewConfig ValidAttributes entries from Static ViewConfigs. (Previously, this method only removed the entries from native ViewConfigs).

https://www.internalfb.com/code/fbsource/[6615b0675bdf]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=344

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D33933403

fbshipit-source-id: 17823ed99f97d7851f04e5cdab9c95667df13253
2022-02-08 19:11:08 -08:00
Pieter De Baets b0bae21249 Improve error when using mutable object as prop
Summary:
I was trying to add an object property to my ViewManager and got a really opaque error (and I almost thought Objects weren't supported by the codegen) until I realized it expected the object to wrapped in a $ReadOnly type.

Changelog: [Internal] Improved error in codegen

Reviewed By: mdvacca

Differential Revision: D34006557

fbshipit-source-id: b3ab15a40cb66fdcd377f4e68df92060498e8e7f
2022-02-07 09:06:31 -08:00
Gabriel Donadel Dall'Agnol f185d42619 chore(LinkingExample): Update external URLs description (#33023)
Summary:
Update LinkingExample "Open external URLs" description to mitigate confusion about opening custom schemes in the simulator when testing, as suggested by Luna here https://github.com/facebook/react-native/issues/32962#issuecomment-1026018822

## Changelog

[Internal] [Changed] - Update LinkingExample "Open external URLs" description

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

Test Plan:
1. Build RNTester iOS app
2. Head to the APIs example, Linking -> "Open external URLs"

https://user-images.githubusercontent.com/11707729/152087644-7e95692c-5180-465b-9fc8-2a637a091deb.mov

Reviewed By: cortinico

Differential Revision: D33941963

Pulled By: dmitryrykun

fbshipit-source-id: 5f58d7f71aee61518b0b8fd92d7b78ac8bff4d4b
2022-02-02 07:17:42 -08:00
Kuba Holuj 50c8e973f0 Update StatusBar for Android 11+ (#32975)
Summary:
Android 11 (API 30) introduced a new interface for changing the appearance of the status bars with [`WindowInsetsController#setSystemBarsAppearance`](https://developer.android.com/reference/kotlin/android/view/WindowInsetsController#setsystembarsappearance) and deprecated using the `WindowManager#systemUiVisibility` properties.

Apparently, once you call `setSystemBarsAppearance` Android will no longer respect `systemUiVisibility` and if anyone, such as the Android 12 Splash Screen library, happens to call it, it will break status bars.

This PR augments the RN StatusBarModule to use the new interface on Android 11+.

Also updated the rn-tester app, see video.

https://user-images.githubusercontent.com/1124321/151321561-8202e237-cf7d-45ce-b957-18b5bafd17c4.mov

## 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] [Changed] - Use new StatusBar API on Android 11 (API 30)+

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

Reviewed By: cortinico

Differential Revision: D33814853

Pulled By: ShikaSD

fbshipit-source-id: c0f2651015dddb4871a3e3b26642f76a46da2a76
2022-01-31 11:32:51 -08:00
Paige Sun ab843c5736 Disable static ViewConfigs in bridge mode & enable for bridgeless mode - for codegenNativeComponent
Summary:
Changelog: [Internal]

Since DummyUIManager.getViewManagerConfig() & hasViewManagerConfig() are the same, it's safe to ship this before the native changes in this stack lands.

Reviewed By: RSNara

Differential Revision: D33832926

fbshipit-source-id: c0f0a169d02397e0f9125bb45d95d395c8bbc492
2022-01-28 23:39:38 -08:00
Moti Zilberman 7db294d6d5 Create @fb-tools-support/yarn package
Summary:
Creates a new package called `fb-tools-support/yarn` and moves the `getWorkspacesFromYarn` function (currently duplicated almost verbatim in two places) into that shared location.

Also, gets `yarn postinstall` to work again and runs it in `xplat/js` - this materialises some new BUCK files that weren't added when their respective Yarn workspaces were created.

Reviewed By: rh389

Differential Revision: D33826945

fbshipit-source-id: 02e2db8b210303ed4f6d24a777a2e0094022bd5d
2022-01-28 08:22:17 -08:00
Gabriel Donadel Dall'Agnol b897db0a61 fix: Add missing intents to RNTester AndroidManifest (#32986)
Summary:
Partially resolves https://github.com/facebook/react-native/issues/32962 by adding required intents to RNTester AndroidManifest.

As [we're now using SDK 31](d3a0c4129d/packages/rn-tester/android/app/build.gradle (L166-L166)) as the `targetSdkVersion` for `RNTester` we must manually specify the intents for the schemes we want to handle due to changes in Package visibility on Android 11.

This PR updates RNTester `AndroidManifest` in order to support `canOpenURL` with the url types:
 - http/https urls
 - phone numbers
 - geolocation
 - facebook app uri

## Changelog

[Internal] [Fixed] - Add missing intents to RNTester AndroidManifest

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

Test Plan:
1. Run `./scripts/test-manual-e2e.sh`, choose Android and then Hermes
2. Head to the APIs example, Linking -> "Open external URLs"

https://user-images.githubusercontent.com/11707729/151486852-1a2d571d-da9f-4cb5-999a-b111eb9bca29.mov

Reviewed By: ShikaSD

Differential Revision: D33843166

Pulled By: cortinico

fbshipit-source-id: 6473b88149fcb72a30ae402ca3e8c290a6cfe0ee
2022-01-28 05:12:26 -08:00
Luna Wei bcd2d0f1a9 Bump Hermes version to 0.11.x
Summary:
Hermes 0.11.0 has been cut and released.

Changelog: [Internal]

allow-large-files

Reviewed By: neildhar

Differential Revision: D33831150

fbshipit-source-id: 666ff1000d83a4092ded65e114b9a7e169366773
2022-01-28 02:27:54 -08:00
Pieter De Baets 988fefc44d Enable react/no-unstable-nested-components rule
Summary:
Dynamic nested components can cause tricky performance issues in React, as the reconciler will not be able to reuse the previously mounted component tree.

Changelog: [General] [Added] Added linter warning config for unstable nested components

Reviewed By: motiz88

Differential Revision: D33767283

fbshipit-source-id: 869ece99dc63cc3a150bae882d26df8541e8db59
2022-01-26 04:23:14 -08:00
Marshall Roch 851e87a1a6 make Easing an object, not a class
Summary:
`Easing` only has static properties and is never constructed or subclassed, so there doesn't seem to be any reason for it to be a class instead of an object.

as a class, Flow errors about `method-unbinding` on every single use of it.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33774944

fbshipit-source-id: c0bd2e3d7a78e538f95b88b2b1b12d301c8f590c
2022-01-25 15:23:46 -08:00
Paige Sun 63605323b0 2/4 Fix RNHostListComponentListRoute to validate SVCs with NVCs
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33715385

fbshipit-source-id: d8d31e92dd934648f8431a508a78e2813c462f8f
2022-01-25 15:23:46 -08:00
MaeIg 8b5a5d4645 Fix capitalize Text style on IOS (#32774)
Summary:
On my project, I realized that capitalize style doesn't work with dates on IOS. I found [this issue](https://github.com/facebook/react-native/issues/32697) and tried to solve it.

(code example: https://snack.expo.dev/maelg/capitalize-demo)
| Android | IOS | Web |
| ------------- | ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146158714-c658a83e-d8f3-41c9-92c8-4fc1f722f942.png) | ![image](https://user-images.githubusercontent.com/40902940/146159059-3cec1f7b-9bc7-4060-8164-79c47694b86b.png) | ![image](https://user-images.githubusercontent.com/40902940/146158095-0f94f25f-f245-4e45-9191-73520a0f6568.png) |

As we can see, the behavior is different on IOS, Android and web:
- **Android**: Capitalize the first letter of each word, unless it begins with a number. And put the rest in lowercase.
- **IOS**: Capitalize the first letter of each word, ~~unless it begins with a number~~. And put the rest in lowercase.
- **Web**: Capitalize the first letter of each word, unless it begins with a number. ~~And put the rest in lowercase.~~

This PR aims to unify behavior on Android and Ios. I am not changing the behavior which differs from the web because I don't know if it is desirable to align with the web.

## Changelog

[IOS] [Changed] - Don't capitalize the first letter of a word that is starting by a number

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

Test Plan:
I manually tested my changes on a POC app (same code: https://snack.expo.dev/maelg/capitalize-demo) on react-native v0.66.4 and react-native main branch.

You can see the result here:
| Android | IOS |
| ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146191361-e2de26d1-3915-47dc-8707-480504af24d6.png) | ![image](https://user-images.githubusercontent.com/40902940/146161660-c869202a-104e-4d16-8f5e-db1c72b2ea5e.png) |

~~I tried to use rn-tester but it was not taking my code. I think it is because fabric was enabled so it was using other code.
I tried to disable fabric but I was not able to build the app on my IOS simulator anymore:~~

On rn-tester:
<image src="https://user-images.githubusercontent.com/40902940/146457851-864b2962-5e9c-4c7e-83fd-7686e27cb996.png" width=50% height=50% />

Reviewed By: philIip

Differential Revision: D33165963

Pulled By: yungsters

fbshipit-source-id: c3bf32bf33d2f109a119798eefdbb9077e904252
2022-01-25 09:08:18 -08:00
AKB48 d0f0234656 Bump Kotlin version to 1.6.10 (#32936)
Summary:
Bump Kotlin version to 1.6.10 with changes:

https://kotlinlang.org/docs/whatsnew16.html

Primarily:

- stabilization to several language features
- various type inference improvements
- support for annotations on class type parameters

## Changelog

[Android] [Changed] - Bump Kotlin version to 1.6.10

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

Reviewed By: ShikaSD

Differential Revision: D33708397

Pulled By: cortinico

fbshipit-source-id: a09b4504c194676d18a749c5e297b7598e5f32b4
2022-01-21 07:46:30 -08:00
Dmitry Rykun 37e5cc966f Bump to version 0.0.13
Summary:
Bump react-native-codegen version to include new fixes and improvements.
Changelog: [internal] Updated react-native-codegen version

Reviewed By: cortinico

Differential Revision: D33684175

fbshipit-source-id: bfc6cb627659c7cdfca2676894bece5f02aff767
2022-01-21 07:30:41 -08:00
Nicola Corti 50057158ca Bump Flipper to 0.125.0 (#32923)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32923

As our Flipper version is quite old, let's bump it to one of the latest stable: 0.125.0
This required to update also the following:
- Flipper-Folly to 2.6.10 - This was needed as I aligned the versions to https://github.com/facebook/flipper/blob/v0.125.0/react-native/ReactNativeFlipperExample/ios/Podfile
- OpenSSL-Universal to 1.1.1100 - This was required with the `pod update` command

I've picked 0.125.0 as 0.127.x and following are crashing on Android
and will potentially require a bump of the NDK to r23:
See: https://github.com/facebook/flipper/issues/3245

Changelog:
[General] [Changed] - Bump Flipper to 0.125.0

allow-large-files

Reviewed By: mdvacca

Differential Revision: D33583090

fbshipit-source-id: 2a2020c3213273087ec4a152076f846e35e275c5
2022-01-21 06:54:21 -08:00
Sota Ogo ad14eb4bd3 Refine RNTester documentation to disable fabric
Summary:
Changelog: [Internal] Update the documentation to disable fabric in RN Tester.

RNTester build would fail if you previously built with fabric_enabled. This documentation adds the instruction to clean up before runing pod install.

In the future, we'd want to detect and do the clean up so that it doesn't fail in an obscure way.

Reviewed By: cortinico, dmitryrykun

Differential Revision: D33173173

fbshipit-source-id: a396eb71edc7bf174d0eb392799f45ae74274b76
2022-01-20 14:57:24 -08:00
Lorenzo Sciandra ac206aa814 removing unused Detox (#32907)
Summary:
I realized while checking for a few other things that Detox's presence in the repo is actually not really motivated - since Jul 2020 the few tests that were using it were disabled 120ff7ccde never to be reactivated since.

I noticed this while attempting to updating the Detox version to latest... which made me notice that the repo is still on a 16.x version while latest is 19.x (there are like 10 pages of releases between them: https://github.com/wix/Detox/releases) and I came to the conclusion that it's probably easier to just remove the old dusty code and eventually reintroduce it in the future if we ever consider it necessary.

## 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] [Removed] - Removing Detox from CI.

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

Test Plan: CI - nothing breaks.

Reviewed By: lunaleaps

Differential Revision: D33623199

Pulled By: cortinico

fbshipit-source-id: 7d8d133629b62b66959b309f2ca21852d396c9fc
2022-01-20 08:51:47 -08:00
Gabriel Donadel Dall'Agnol b276b736f8 fix: Screen reader event name on RNTester AccessibilityExample (#32926)
Summary:
Fix an issue in the AccessibilityExample on RNTester where the `Screen Reader` item would listen for the `reduceMotionChanged` event instead of the `screenReaderChanged` event

## Changelog

[General] [Fixed] - Fix screen reader event name on RNTester AccessibilityExample

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

Test Plan:
1. Build iOS app
2. Navigate to the Accessibility page
3. Switch over to settings and change VoiceOver at `Settings>Accessibility>VoiceOver>VoiceOver`
4. Switch back to the app and see the results

https://user-images.githubusercontent.com/11707729/150266745-6a9eb547-00a7-4b94-bf19-b8d6e6f76122.mp4

Reviewed By: kacieb

Differential Revision: D33681780

Pulled By: cortinico

fbshipit-source-id: fbd4f3d9ef63997f2b4a40afc8a5adfe6172e525
2022-01-20 08:38:01 -08:00
Nicola Corti 574a773f8f Do not remove libjscexecutor.so from release builds (#32932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32932

As the title says, we dont' want to remove `libjscexecutor.so` when
baking release builds and having JSC enable as this leads to instacrashes.

Fixes #32928
Fixes #32927

Changelog:
[Android] [Fixed] - Do not remove libjscexecutor.so from release builds

Reviewed By: ShikaSD

Differential Revision: D33681932

fbshipit-source-id: 5b59fd1fb76c80c191198d65c916bbbd9232c75b
2022-01-20 04:20:14 -08:00
Paige Sun 5fa3807c34 Fix SnapshotExample in rn-tester
Summary:
Changelog: [General][Fix] Fix SnapshotExample in rn-tester

Before this diff, the <Image> has no height. You can tell because the backgroundColor of <Image> is black but it doesn't show up on this surface.

Reviewed By: RSNara

Differential Revision: D33649085

fbshipit-source-id: 1b0fa0a82bce29923afee000d0828cbd90845abf
2022-01-19 16:28:40 -08:00
Brad Zacher c0e489b729 remove duplicate class members
Summary:
Flow currently allows duplicate members on classes. At runtime the "last" member wins out and all previous values for the member are discarded.
This diff manually removes duplicate members, and fixes resulting flow errors by converting methods to arrow function properties.

Reviewed By: pieterv

Differential Revision: D33664966

fbshipit-source-id: 0f712ac96af4df593c0918fcbadd70624ddde4a6
2022-01-19 15:35:57 -08:00
Paige Sun b13e41d98e Migrate ScreenshotManager from NativeModule to TurboModule
Summary:
Changelog: [JS] Migrate ScreenshotManager from NativeModule to TurboModule. Fix SnapshotExample in rn-tester.

`const ScreenshotManager = NativeModules.ScreenshotManager;` makes all of RNTesterAppRoute render blank in Bridgeless, because we throw a jsi::JSError when JS calls `NativeModule.get` while in Bridgeless.

Reviewed By: RSNara

Differential Revision: D33640935

fbshipit-source-id: 124a3b43e1440a7ca0071c95c4388350d2e4affa
2022-01-19 14:19:13 -08:00
Michaël De Boey c279a186fa chore(deps): update `jscodeshift` (#32905)
Summary:
This will include https://github.com/facebook/jscodeshift/pull/473, which will fix the problems with the `colors` package (see https://github.com/facebook/jscodeshift/issues/474)

## 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] [Security] - update `jscodeshift`

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D33623209

Pulled By: yungsters

fbshipit-source-id: 38f366cb2e004cca55cd921c61a9e88439c8e784
2022-01-19 10:54:15 -08:00
Nicola Corti 450967938a Do not include Facebook license on users codegen'd code (#32840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32840

Closes #31516
I've cherry-picked the original PR that had merge conficts + updated all
the headers as the one for the TurboModule generators were not handled.

Original Commit Message from acoates

The codegen generates a Facebook copyright notice at the top of the generated files.

While this might make sense on the core files, this codegen will be run on external components too.
The notice also refers to a LICENSE file in the root of this project, which might not be there if this is run on another project.
I did a quick look at some of the codegen that we ship within windows dev tools, and it looks like we normally just have comments
saying the file was codegen'd and so the file shouldn't be manually edited.
Open to suggestions on what the comment header should say.

Changelog:
[General] [Changed] - Do not include Facebook license on users codegen'd code

Reviewed By: ShikaSD

Differential Revision: D33455176

fbshipit-source-id: b247e72efb242e79d99b388c80e4126633e5234d
2022-01-19 08:07:35 -08:00
Paige Sun 7f69325e94 (Easy) Remove usage of already-removed CrashyCrash from RNTester
Summary:
`const {CrashyCrash} = NativeModules` makes all of RNTesterAppRoute render blank in Bridgeless.

Remove this test example because the CrashyCrash has not existed since 2019, and no similar module exists in open source. [[github]](8ec7e0966c)

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D33644122

fbshipit-source-id: ed10e8bf8ea9af9d5904afc2a7d9c2b3b3606978
2022-01-18 18:51:21 -08:00
Andrei Shikov 3cf0291008 Configure plugin repositories to use Gradle Portal last
Summary:
Gradle Plugin Portal proxies jcenter which is quite unstable these days. This change updates plugin repositories to look into maven central and google first and use gradle plugin repo only as a fallback.

Changelog: [Internal] - Prioritize maven central for Gradle plugins

Reviewed By: cortinico

Differential Revision: D33550827

fbshipit-source-id: b436b05b0fd07865b56dd3e442d8399678dfff85
2022-01-13 06:02:44 -08:00
Nicola Corti 72d949e254 Bump gradle-plugin to 0.0.4
Summary:
I'm bumping the Gradle Plugin to the latest stable. That's needed as the newest
plugin now specifies a Maven `group` and can leverage implicit dependency substitution.

Changelog:
[Internal] [Changed] - Bump gradle-plugin to 0.0.4

Reviewed By: ShikaSD

Differential Revision: D33530286

fbshipit-source-id: 904f0a6585b468322f611ed82c57cee7025305d7
2022-01-12 09:38:14 -08:00
Ramanpreet Nara 76613ec4cd Generate one Bubbling/Direct event entry when custom top name is provided
Summary:
## Context
Inside native ViewConfigs, events are declared using these bubbling/direct EventType maps:
```
{
  uiViewClassName: '...',
  bubblingEventTypes: {
    topFoo: {
      registrationName: "onFoo"
    }
  },
  directEventTypes: {},
  validAttributes: {
  },
}
```

**Pattern:** Note that the top name (i.e: topFoo) is just the registration name (i.e: onFoo) but with "on" replaced with "top".

On Android, registration names and top names don't have to follow this pattern. The top name can be **anything.** See ReactionsDockView:

https://www.internalfb.com/code/fbsource/[c430d46ed69a03a9d9f40cefa335a6d8bb92f8ec]/fbandroid/java/com/facebook/feedback/reactions/ui/overlay/react/ReactionsDockViewManager.java?lines=26-28%2C32-34%2C38

Here, ReactionDismissedEvent.EVENT_NAME is "topDismiss"

https://www.internalfb.com/code/fbsource/[c9f92314a5c46e561a831100dab82164808b05d0]/fbandroid/java/com/facebook/feedback/reactions/ui/overlay/react/ReactionDismissedEvent.java?lines=10-11%2C26

And so to provide you the flexibility to specify a custom topName, the codegen supports a customTopName in the direct/bubbling event types:

```
onDismissWithFeedbackReaction: DirectEventHandler<Event, 'topDismiss'>,
```

This generates the two bubbling event type entries in ReactionsDockView:
```
{
  uiViewClassName: '...',
  bubblingEventTypes: {
    // custom top name
    topDismiss: {
      registrationName: "onDismissWithFeedbackReaction"
    },
    // what the top name should actually be
    topDismissWithFeedbackReaction: {
      registrationName: "onDismissWithFeedbackReaction"
    }
  },
  directEventTypes: {},
  validAttributes: {
  },
}
```

**The Problem:** The entry created for "topDismissWithFeedbackReaction" is not necessary. This additional entry creates a discrepancy between ReactionsDockView's static ViewConfig and native ViewConfig. Therefore, this diff removes the second unnecessary entry.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D33418730

fbshipit-source-id: 3988ff6906ad1b2e1ef988a19c64d1e042381ab1
2022-01-11 14:22:14 -08:00
Nicola Corti bd7caa64f5 Use side-by-side NDK for Android (#32848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32848

If we leverage the side-by-side configuration of the NDK
(see https://developer.android.com/studio/projects/configure-agp-ndk#agp_version_41)
we will not have to specify the NDK Path or Version at all.

We will automatically pick the best NDK version selected by AGP.

Changelog:
[Android] [Changed] - Use side-by-side NDK for Android

Reviewed By: ShikaSD

Differential Revision: D33475818

fbshipit-source-id: 16aa4acfc44b94e2f92df89d71e104bf46d7f162
2022-01-11 10:00:54 -08:00
Nicola Corti 0fccbd53af Leverage Gradle implicit dependency substitution for Gradle Plugin
Summary:
Previously we asked users to specify a dependency substitution
rule to properly use the React Native Gradle Plugin.

Here I'm updating the Gradle Plugins setup to allow to use implicit
dependency substitution. This requires to specify a Maven Group and Artifact
Name (through the project name).

This is backward compatible as users will still be allowed to specify a
dependency substitution rule if they wish.

Changelog:
[Android] [Changed] - Leverage Gradle implicit dependency substitution for Gradle Plugin

Reviewed By: ShikaSD

Differential Revision: D33404948

fbshipit-source-id: 3323f8e0738fd579ce8ae344cbdc0e4356e7dbd8
2022-01-11 07:23:54 -08:00
grgr-dkrk 36037fa81b feat: add `accessibilityLabelledBy` props (#32470)
Summary:
related: https://github.com/facebook/react-native/issues/30846, https://github.com/facebook/react-native/issues/26739

Added `accessibilityLabelledBy` props to find the nativeID of the associated label, it mainly for` <TextInput> `.

The reason for implementing it as `labelledBy` instead of `labelFor` is as follows.
- It was difficult to find a component with `labelFor` because the `<Text>` component does not add the `labelFor` received from her Props to the View's tag.
- The use case looks like the HTML `aria-labelledby`, which is intuitive for web developers. It also seems easy to convert to a web platform.

## 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] [Added] - add `accessibilityLabelledBy` props

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

Test Plan:
I checked it with RNTester using an Android11.

https://user-images.githubusercontent.com/40130327/138666856-891d9f4d-52cf-4181-a81f-13b033037db4.mp4

Reviewed By: lunaleaps, kacieb

Differential Revision: D31897112

Pulled By: ShikaSD

fbshipit-source-id: 66361735679560c01834b3a4483adf264098b3e3
2022-01-11 06:51:39 -08:00
Paige Sun 7c63e0d5bc 3/5 For codegenNativeComponent, with SVC enabled, use UIManager hasViewManagerConfig instead of getViewManagerConfig
Summary:
With SVC enabled for codegenNativeComponent, use `UIManager.hasViewManagerConfig(viewManagerName)` instead of `UIManager.getViewManagerConfig(viewManagerName)` to check for whether the native component is in the app BUCK binary.

This is safe because `global.__fbStaticViewConfig` is gated with MC, and the purpose of SVCs is to stop using `getViewManagerConfig` to get view configs from the Paper view managers. Currently no QEs have SVCs enabled.

Changelog:
[Fabric][JS] For codegenNativeComponent, with SVC enabled, use UIManager hasViewManagerConfig instead of getViewManagerConfig

Reviewed By: RSNara

Differential Revision: D33511365

fbshipit-source-id: 58c7020903137e2b5c80ef34a956be04de51628b
2022-01-10 17:26:37 -08:00
Ramanpreet Nara ca5aaa7663 Remove {eventName}: true from ViewConfig validAttributes
Summary:
For every direct and bubbling event, RCTComponentData (iOS-only) creates a {eventName}: true entry in the component's ViewConfig validAttributes. This entry is unnecessary, and creates a discrepancy between ViewConfigs on iOS vs Android.

This diff removes this entry for all events to:
1. Reduce bloat in native ViewConfigs
2. Create consistency betweeen Android and iOS.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D33303950

fbshipit-source-id: 870c8a2a6d41156ac89bd8554eb09f292bb6108e
2022-01-06 19:09:53 -08:00
Nicola Corti cd4c6659d3 Bump Gradle, AGP and Download plugins
Summary:
Let's keep our Gradle infra deps up to date.
I'm bumping Gradle to 7.3.3 which fixes several Log4j CVEs,
AGP to 7.0.4 and the Download Task plugin to 4.1.2

Changelog:
[Android] [Changed] - Bump Gradle to 7.3.3 and AGP to 7.0.4

Reviewed By: mdvacca

Differential Revision: D33430789

fbshipit-source-id: b8f260beb4a9cc962ea3743610bfb4ead004d6cb
2022-01-06 10:37:28 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Luna Wei 679e131972 Fix remaining CircleCI eslint warnings
Summary: Changelog: [Internal] Fix up remaining eslint warnings

Reviewed By: TheSavior

Differential Revision: D33259372

fbshipit-source-id: 5032e64d16a67297068fb8aa8899a07382e944cd
2021-12-21 12:34:28 -08:00
Kevin Gozali fb39d45ed5 C++ - better => butter
Summary:
Renaming the `better` utilities to `butter`:
- to prevent claims that this library is superior to others - it really depends on use cases
- to indicate ease of use throughout the codebase, easily spread like butter

Changelog: [C++][Changed] Renaming C++ better util to butter, used by Fabric internals

Reviewed By: JoshuaGross

Differential Revision: D33242764

fbshipit-source-id: 26dc95d9597c61ce8e66708e44ed545e0fc5cff5
2021-12-20 22:25:14 -08:00
Charles Dudley 821382b9f7 TypeScript Module Tests
Summary:
Tests for Native Modules. Fixtures, Failures and the e2e tests were copied from the flow parser, modified for TypeScript and then the snapshots were diff'ed to ensure the parsers generated the same schema given the same (in spirit, different in syntax) input.

Changelog:
[General][Add] - Tests for TypeScript support for Native Module Codegen spec parsing

Reviewed By: RSNara

Differential Revision: D33081127

fbshipit-source-id: 3d7270dddd568090ec93d475a08a6a6011dad63c
2021-12-20 14:20:22 -08:00
Charles Dudley f9e512e8fe TypeScript Component Tests
Summary:
Tests for Native Components. Fixtures, Failures and the e2e tests were copied from the flow parser, modified for TypeScript and then the snapshots were diff'ed to ensure the parsers generated the same schema given the same (in spirit, different in syntax) input.

Changelog:
[General][Add] - Tests for TypeScript support for Native Component Codegen spec parsing

Reviewed By: RSNara

Differential Revision: D33080789

fbshipit-source-id: ae71d384f6d93da6b89eeb179c4ba7ebcd6ae03d
2021-12-20 14:20:22 -08:00
Charles Dudley f4e32ac5bf Copy Flow parser tests to prepare TypeScript Parser
Summary:
These files are directly copied from the flow parser to aid in reviewing the next two Diffs: D33080789 and D33081127.

The only things that were changed during the copy are the import/require paths to ensure this diff could ship independently. (For this diff, these tests will still test the flow parser instead of importing the typescript parser).

Changelog:
[Internal][Add] - Copy Flow parser tests to aid in Diff review

Reviewed By: RSNara

Differential Revision: D33136296

fbshipit-source-id: 007e18618c9eba13728d19e4e342fbe9642adacc
2021-12-20 14:20:22 -08:00
Charles Dudley 078f6310ba Choose parser based on file extension
Summary:
This adds the main entry point for the TypeScript parser as well as adds the logic to use the new parser if the spec file's extension is `.ts`

`js/react-native-github/packages/react-native-codegen/src/parsers/typescript/index.js` is mostly a direct copy from the flow parser.

Changelog:
[General][Add] - Choose Flow or WIP TypeScript Codegen parser based on spec's file extension

Reviewed By: RSNara

Differential Revision: D33081296

fbshipit-source-id: 267823685e6723e3c1f19752bbbe692e895c075b
2021-12-20 14:20:21 -08:00
Charles Dudley 0d3036abde TypeScript Modules
Summary:
Similar to D33080623, this is the logic for parsing Native Modules and the files were copied from the flow parser and updated for TypeScript. The logic and code path is almost identical to the flow parser.

Also, like D33080623, while there is considerable duplication to the flow parser, I decided there are enough subtle differences to warrant keeping this logic separate.

Changelog:
[General][Add] - Add WIP TypeScript support for Native Module Codegen spec parsing

Reviewed By: RSNara

Differential Revision: D33081035

fbshipit-source-id: 5a196e4693df73c0fb88abafe2b4e6be032ea7ed
2021-12-20 14:20:21 -08:00
Charles Dudley a9632c5ec5 Copy Flow parser modules logic to prepare TypeScript parser
Summary:
These files are directly copied from the flow parser to aid in reviewing the next Diff, D33081035

Changelog:
[Internal][Add] - Copy Flow parser module logic to aid in Diff review

Reviewed By: RSNara

Differential Revision: D33134982

fbshipit-source-id: 9afea2ce15404338fd2c920a8b7eafe980f18688
2021-12-20 14:20:21 -08:00
Charles Dudley 7615bde023 TypeScript Components
Summary:
This is the logic for parsing Native Components. The files were copied from the flow parser and updated for TypeScript specific types and differences in the shape of the AST. The logic and code path is almost identical to the flow parser.

While there is considerable duplication to the flow parser, I decided there are enough subtle differences to warrant keeping this logic separate.

Changelog:
[General][Add] - Add WIP TypeScript support for Native Component Codegen spec parsing

Reviewed By: RSNara

Differential Revision: D33080623

fbshipit-source-id: a68c8d4c4570e65a88a97dcea3cd18a6976c53c7
2021-12-20 14:20:21 -08:00
Charles Dudley c532fcff90 Copy Flow parser components logic to prepare TypeScript parser
Summary:
These files are directly copied from the flow parser to aid in reviewing the next Diff, D33080623

Changelog:
[Internal][Add] - Copy Flow parser component logic to aid in Diff review

Reviewed By: RSNara

Differential Revision: D33130222

fbshipit-source-id: ba7233b17d698793559da8b81bb7e1a78654e614
2021-12-20 14:20:21 -08:00
Charles Dudley 114d5a8a17 TypeScript parser foundation
Summary:
These are utility functions that the TypeScript parser uses and are copied from and follows the same logic as the flow parser with some TypeScript specific changes.  Also added dependency of `babel/parser` as the parsing engine we're using for TypeScript.

Changelog:
[General][Add] - Add foundation for WIP TypeScript parser for Codegen

Reviewed By: RSNara

Differential Revision: D33080527

fbshipit-source-id: d4bd515af549a41f07a2e3ee1a16b5ed678180b2
2021-12-20 14:20:21 -08:00
Charles Dudley 165dfbcc87 Copy Flow parser foundation for TypeScript parser
Summary:
This is a direct copy of the following files from the flow parser:

```
react-native-codegen/src/parsers/flow/errors.js
react-native-codegen/src/parsers/flow/utils.js
```

Changelog:
[Internal][Added] - Copy flow parser foundation files to aid in diff review

Reviewed By: RSNara

Differential Revision: D33137685

fbshipit-source-id: 1345c8bb0785c90b2bd64d4e6e2447f3fdb0ae6b
2021-12-20 14:20:21 -08:00
Ubax 3e6902244a fix: Removes interface only check from third party components GenerateThirdPartyFabricComponentsProvider (#32779)
Summary:
Currently the codegen does not include component with field `interfaceOnly` set to `true` in the `ThirdPartyFabricComponentsProvider`.

These components need to be added to this file, so that non-core components can be used in fabric.

## Changelog

[General [Fixed] - Fixes GenerateThirdPartyFabricComponentsProvider

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

Test Plan:
Run codegen with component outside of core on iOS.

Check if components with and without `interfaceOnly` are added to `RCTThirdPartyFabricComponentsProvider`

Reviewed By: cortinico

Differential Revision: D33235363

Pulled By: ShikaSD

fbshipit-source-id: e7224d2123e4da0da912fe677dae32d3aaea2ec8
2021-12-20 11:45:44 -08:00
Phillip Pan 0912ee179c remove fallbackResource from RCTBundleURLProvider api
Summary:
if you xgbs for `fallbackResource:`, you'll find only one place is actually passing a non-nil value to this parameter.

https://www.internalfb.com/code/fbsource/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactSourceLoaderProd.mm?lines=79

but if we look at the implementation, `@"main"` is the fallback value...

https://www.internalfb.com/code/fbsource/[cd930f5f15cca0feb732317147de318ce6aa1db3]/xplat/js/react-native-github/React/Base/RCTBundleURLProvider.mm?lines=224

let's just simplify this api and get rid of this parameter.

Changelog: [Internal]

Reviewed By: raedle

Differential Revision: D32641476

fbshipit-source-id: 637a8c0f7bea834bfecd804a521155f41aaaff7e
2021-12-16 00:46:14 -08:00
Sota Ogo 8ec0e6919c Add turbo module support in the default app template (#32752)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32752

Changelog: [internal] Add an optional support for Turbomodule. Define RCT_TM_FABRIC_ENABLED to enable the new architecture.

Reviewed By: philIip

Differential Revision: D33052777

fbshipit-source-id: 6d32790586bb51f9c9244344522c95245c912114
2021-12-15 18:14:35 -08:00
Sota Ogo 9827b4adcf Refactor script_phases script out of react_native_pods.rb (#32764)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32764

Changelog: [Internal] This diff refactors react_native_pods.rb so that it's a bit more readable/maintainable.

With the intorduction of the codegen discovery script, we have two script phases that shares some code. I've factored it out of the main file and wrote a snapshot test so that it's easier to see the output script file.

Reviewed By: cortinico

Differential Revision: D33045541

fbshipit-source-id: 9c80b5d7e11862cc44275e36882487a7d63e8125
2021-12-15 16:23:29 -08:00
Charles Dudley 3a01dc41e6 Flow parser cleanup
Summary:
This diff stack enables codegen to parse TypeScript spec files and generate an identical schema to our current Flow parser.

This first diff is a small cleanup of our current flow parser.

Changelog:
[General][Fixed] - Fix typo in error string and improve consistency in Codegen's flow parser tests

Reviewed By: sota000

Differential Revision: D33080423

fbshipit-source-id: 7bf817761a7704d807a0b809c9f2270354b5c6fa
2021-12-15 15:59:38 -08:00
Samuel Susla d902a89b40 Move surface registry code out of UIManagerBinding
Summary:
changelog: [internal]

Just moving code that doesn't belong to UIManagerBinding out of the class.

Reviewed By: philIip

Differential Revision: D33060412

fbshipit-source-id: 2d54929072cef14fd1fa6b70bde382ae21ecff45
2021-12-15 10:52:15 -08:00
Sota Ogo 2098c89502 Add babel-plugin-codegen to babel.config.js for fabric (#32756)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32756

Changelog: [internal] Add babel-plugin-codegen to babel.config.js for the new architecture support.

Reviewed By: motiz88

Differential Revision: D33053216

fbshipit-source-id: 97a1fd9c64972ac4831461b1b62d3a83aa3207cb
2021-12-14 19:28:41 -08:00
Sota Ogo ad9eabe033 Trigger codegen discovery script when building an app. (#32731)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32731

Changelog: [internal] Trigger codegen discovery script when building React-Codegen so that users won't have to run pod install every time modifying fabric / turbomodule library.

Reviewed By: cortinico

Differential Revision: D32979871

fbshipit-source-id: 18550b6b010a9a2b8b7513aaa3b6a7322ea83eff
2021-12-14 10:15:50 -08:00
Sota Ogo 24e07bc979 Move use_react_native_codegen_discovery to use_react_native! (#32749)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32749

Changelog: [Internal] Move the use_react_native_codegen_discovery call to use_react_native.

Found out that pre_install doesn't get invoked until all podspecs are read. This wouldn't work because I want use_react_native_codegen_discovery to generate React-Codgen podspecs.

I also think it's better to have less logic in Podfiles as it's hard to update once users set it up.

Reviewed By: cortinico

Differential Revision: D33054318

fbshipit-source-id: 6d62be454610c8a1d55988fe376ee3f187510a36
2021-12-13 18:27:31 -08:00