Commit Graph

38536 Commits

Author SHA1 Message Date
Nick Gerleman 3982a2c6bd Log Abnormal Closes to Metro Websocket
Summary:
We are running into a group seeing frequent disconnects from Metro in a specific office. These are surfaced (at least on iOS) as websocket closures, without a prior websocket error. WebSocket closure can be for a variety of reasons, and the spec for a CloseEvent is to include fields `wasClean`, `code`, and `reason`, with `code` having the most well-defined meaning.

This change makes it so that we emit extra context when the websocket is closed. That should help inform developers the reason behind any close that may be abnormal.

Changelog:
[General][Added] - Log Abnormal Closes to Metro Websocket

Reviewed By: motiz88

Differential Revision: D40660765

fbshipit-source-id: ef606d8d809af1c697a78eb00cc5666c29a8bca3
2022-10-26 20:09:32 -07:00
Andre 279cfec55f feat: make RCTBlobManager TurboModule-compatible (#35047)
Summary:
Currently, RCTBlobManager (the native module for Blob support) cannot be loaded on iOS when the new architecture is enabled.

## Changelog

[General] [Added] - `BlobModule` to `RCTCoreModulesClassProvider`

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

Test Plan:
The snippet below can be used to test Blob support with the new architecture enabled.

```
// App.tsx
import { useEffect } from 'react';
import { View } from 'react-native';
function uriToBlob(uri: any) {
  return new Promise((resolve, reject) => {
    const xhr = new XMLHttpRequest();
    xhr.responseType = 'blob';
    xhr.onload = () => {
      const blob = xhr.response;
      resolve(blob);
    };
    xhr.onerror = err => {
      reject(err);
    };
    xhr.open('GET', uri);
    xhr.send();
  });
}

export default function App() {
  useEffect(() => {
    uriToBlob('https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png');
  });
  return <View />;
}

```

Related issue: https://github.com/facebook/react-native/issues/35042

Reviewed By: NickGerleman

Differential Revision: D40716048

Pulled By: cipolleschi

fbshipit-source-id: 17643d230fa7ea83baee363d137d51f87818baa8
2022-10-26 19:59:28 -07:00
Nicola Corti 92d41c5e96 Remove the --dry-run gate from publishing to Sonatype
Summary:
This remove a flag to effectively go publishing to Sonatype.
The idea was to protect us against accidentally publishing a nightly as a stable release.
We need to remove this before RC0

Changelog:
[Internal] [Changed] - Remove the --dry-run gate from publishing to Sonatype

Reviewed By: cipolleschi

Differential Revision: D40687038

fbshipit-source-id: e6821905f41899430813f9575f17a5068b05a9bb
2022-10-26 13:05:23 -07:00
Nicola Corti 2df63e52f4 RNGP - Use the File Api to specify cliPath and remove ComposeSourceMap path (#35092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35092

As we're close to the cut of the 0.71 branch, I'll take the opportunity to polish
our Gradle public API.
We're exposing a mixture of Path (String) and File (java.io.File or RegularFileProperty).
Here I've moved everything to use File as it's more configurable for the users,
specifically if they're using monorepos or other setup.

This also allows us to remove the resolution logic for the cliPath.

Changelog:
[Internal] [Changed] - RNGP - Use the File Api to specify cliPath and remove ComposeSourceMap path

Reviewed By: cipolleschi

Differential Revision: D40710595

fbshipit-source-id: a17095eebae5123b70fd2b8e3d512656817006ca
2022-10-26 13:05:03 -07:00
Nicola Corti 1069841837 Make it easier for user to toggle only Fabric or TurboModules in New Architecture (#35091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35091

This diff refines the DefaultNewArchitectureEntryPoint to make it easier for user to
either turn on Fabric, TurboModules or both.

Changelog:
[Internal] [Changed] - Make it easier for user to toggle only Fabric or TurboModules in New Architecture

Reviewed By: cipolleschi

Differential Revision: D40710596

fbshipit-source-id: 236060b2ebccb1bf25e7f5c0fc15f54c5ce5f608
2022-10-26 13:03:33 -07:00
Nick Gerleman 51d14b9dbd Revert D40333083: Support persisted settings in Android + iOS
Differential Revision:
D40333083 (https://github.com/facebook/react-native/commit/0fac9817df403e31d8256befe52409c948614706)

Original commit changeset: f3816e3bd7de

Original Phabricator Diff: D40333083 (https://github.com/facebook/react-native/commit/0fac9817df403e31d8256befe52409c948614706)

fbshipit-source-id: 1a52a06b057c4c0ea6e3e4c3315ba73a883e3579
2022-10-26 12:28:44 -07:00
ankit-tailor 7a19af7fb6 fix: add mixed to aria-checked typings (#34633)
Summary:
`aria-checked` prop should accept `mixed` as value as given [here](https://www.w3.org/WAI/GL/wiki/Using_WAI-ARIA_aria-checked%3Dmixed) and also [accessibilityState.checked](https://reactnative.dev/docs/accessibility#accessibilitystate) accepts mixed to represent checkboxes. This change refers to issue https://github.com/facebook/react-native/issues/34424 and PR https://github.com/facebook/react-native/pull/34524

## Changelog

[General] [Added] - Added `mixed` value for `aria-checked`.

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

Test Plan:
```js
<TouchableOpacity
  accessibilityRole="checkbox"
  aria-checked="mixed"
  accessibilityHint="click me to change state">
  <Text>Checkbox example</Text>
</TouchableOpacity>
```

Reviewed By: lunaleaps

Differential Revision: D39382158

Pulled By: necolas

fbshipit-source-id: fa026274111305cc0bcbb42ed974ca1be7d779a5
2022-10-26 11:47:58 -07:00
Luna Wei fae770b9fe InputAccessoryView
Summary: Changelog: [Internal] Flow InputAccessoryView

Reviewed By: yungsters

Differential Revision: D39855166

fbshipit-source-id: 9c389854e6d76a0c0e881190cd1808088de324fd
2022-10-26 11:24:16 -07:00
Nicola Corti 2ff08e8bd8 RNGP - Do the .so cleanup using pickFirst and exclude (#35093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35093

It turns out that using the Artifacts API to manipulate the APK to remove
.so has unintended side effects and is causing the `installDebug` and `installRelease`
commands to fail.

I've resorted to register a packaging option for each variant to make sure we include only
the correct artifacts we want.

This should fix the current startup crash that is experienced on main.

Changelog:
[Android] [Fixed] - RNGP - Do the .so cleanup using pickFirst and exclude

Reviewed By: cipolleschi

Differential Revision: D40722285

fbshipit-source-id: 982e1e9c474522fc4419c969ede5ee14e5404f3a
2022-10-26 10:46:39 -07:00
Nicola Corti 7d61b9d81a RNGP - Remove enableCodegenInApps and infer it from package.json (#35083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35083

We don't need to `enableCodegenInApps` keys but we can instead rely on the
existence of the `codegenConfig` key inside the `package.json` to decide if
Codegen should run in App modules or not.

Changelog:
[Internal] [Changed] - RNGP - Remove enableCodegenInApps and infer it from package.json

Reviewed By: cipolleschi

Differential Revision: D40687079

fbshipit-source-id: cd4a6c67caa19c1d199ae75388a0551339f876a0
2022-10-26 10:41:02 -07:00
youedd 0627cd69cd Refactor translate UniontypeAnnotation (#35050)
Summary:
Part of https://github.com/facebook/react-native/issues/34872
> [Assigned to youedd] This task is more advanced than the others Create a function to unify the [unionType](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L372-L396) and the [TSUnionType](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L407-L431). This task may share some logic from the previous task. The function should accept a ParserType parameter to implement the proper logic to extract the memberType variable. Ideally, we should create a couple of supporting functions to implement those logics.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - Refactor translate UniontypeAnnotation

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

Test Plan:
`yarn jest react-native-codegen`
![image](https://user-images.githubusercontent.com/19575877/197334084-2daeed7e-8e87-4140-b8c3-07f2de3f0496.png)

Reviewed By: cortinico

Differential Revision: D40637299

Pulled By: cipolleschi

fbshipit-source-id: 1490001a3398c3af79d465c40de3c3687f058523
2022-10-26 10:02:01 -07:00
dhruvtailor7 cba56eadd2 Extract getConfigType function to parsers/utils.js (#35035)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872.
This PR contains two changes, extracting the visitor object and then factoring out the `getConfigType()` function to the `parsers/utils.js` file. Then we can reuse the same function in both flow and typescript by passing the extracted visitor object.

## Changelog

[Internal] [Changed] - Extract visitor object in the same file and factor out `getConfigType()` to `parsers/utils.js`.

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

Test Plan: Output of `yarn jest react-native-codegen` ensures all passed test cases

Reviewed By: cortinico

Differential Revision: D40548855

Pulled By: cipolleschi

fbshipit-source-id: 310b8565322a4e4800a3fffc67479a9dfa45d620
2022-10-26 10:02:01 -07:00
Samuel Susla 925e81ab86 Rewrite of ScrollViewStickyHeader for concurrent rendering
Summary:
changelog:
[general][Added] - Concurrent rendering safe implementation of ScrollViewStickyHeader

This is a re-land of ScrollViewStickyHeader from Kacie Bawiec.

Reviewed By: yungsters

Differential Revision: D40380217

fbshipit-source-id: 60dc86086a4d9d97eef71c4ed2e26536f7e72889
2022-10-26 08:17:49 -07:00
Benny Singer cf5addf423 Revert D40716713: chore(deps): add wanted dependencies to remove yarn warnings
Differential Revision:
D40716713 (https://github.com/facebook/react-native/commit/8422c5315caf5cf696791a5ad49ed0fbd37ef9df)

Original commit changeset: eeb95a91c6cd

Original Phabricator Diff: D40716713 (https://github.com/facebook/react-native/commit/8422c5315caf5cf696791a5ad49ed0fbd37ef9df)

fbshipit-source-id: e85f111e7da0381e09f8a23d3bd0d553b3a7c4a9
2022-10-26 07:22:28 -07:00
Lorenzo Sciandra 8422c5315c chore(deps): add wanted dependencies to remove yarn warnings (#35088)
Summary:
I wanted to start working on a thing but this barrage of warnings was very annoying so ended up doing this instead: a very small PR to take care of some warnings during yarn install.

It doesn't change anything (the versions are the ones already used all around the repo), just makes yarn happier.

Also, while doing that I found a dependency that was lying there unused for 2 years so took care of it.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Fixed] - add wanted dependencies to remove yarn warnings

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

Test Plan:
### Before

<img width="1920" alt="Screenshot 2022-10-26 at 10 53 32" src="https://user-images.githubusercontent.com/16104054/197996489-f463be29-b35b-45cc-9d9c-2d176579fb7d.png">

### After

<img width="947" alt="Screenshot 2022-10-26 at 10 52 19" src="https://user-images.githubusercontent.com/16104054/197996505-3d60b319-006b-45ab-83bf-2f431272fdcd.png">

Reviewed By: jacdebug

Differential Revision: D40716713

Pulled By: robhogan

fbshipit-source-id: eeb95a91c6cdf37edfe868fefe4ba04aebe500ec
2022-10-26 06:42:50 -07:00
Christoph Purrer d0599ac56b Back out "Add enum example to Android/iOS rn-tester TurboModule" (#35089)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35089

Changelog:
[General][Fixed] - Back out "Add enum example to Android/iOS rn-tester TurboModule"

This broke the rn-tester adding due to an invalid flow-enum setup. Needs further investigation

Reviewed By: cipolleschi

Differential Revision: D40714320

fbshipit-source-id: 9831276762f90df0ffaca3304382fe5925009343
2022-10-26 06:30:14 -07:00
Marco Fiorito c868d5b26c refactor(rn tester app): change activity indicator to hooks (#35071)
Summary:
This pull request migrates the activity indicator example to using React Hooks.

## Changelog
[General] [Changed] - RNTester: Migrate ActivityIndicator to hooks

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

Test Plan: The animation works exactly as it did as when it was a class component

Reviewed By: jacdebug

Differential Revision: D40698379

Pulled By: NickGerleman

fbshipit-source-id: 08b275fcc4e3a10b5872e0031fa2ecce5360a7b9
2022-10-26 03:21:04 -07:00
Nick Gerleman b655e69bad Fix RCTLoggingTests in OSS (#35085)
Summary:
fd91748146 added a condition not to pump an extra message when we didn't see symbolication warnings (which do not seem to show up in a stock internal build), but I missed that the test specific to RCTLogLevelError checked for string containment instead of equality, and the last assertion we process on log level is incorrect in OSS as a result.

Changelog:
[Internal][Fixed] - Fix RCTLoggingTests in OSS

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

Test Plan:
`test_ios-Hermes` passes again in OSS: https://github.com/facebook/react-native/pull/35085 (JSC and Android failures look unrelated)

RCTLoggingTests still pass running `buck test //xplat/js/react-native-github/packages/rn-tester:RNTesterIntegrationTests`

Reviewed By: rshest

Differential Revision: D40699773

Pulled By: NickGerleman

fbshipit-source-id: 5acc8ec2b26a1f9acac2f070b85f1d65ee15a011
2022-10-26 01:43:19 -07:00
Robert Balicki 0fac9817df Support persisted settings in Android + iOS (#34964)
Summary:
* Add a DevToolsSettingsManager, which has android and iOS variants, which uses a new TM (Android) or takes advantage of the Settings TM (iOS) to get/set console patch settings
* This is backed by either the existing Settings module (iOS) or a new Java TM, which uses the SharedPreferences AP

## Testing

Manual testing

## Changelog

[General] [Added] - Add DevToolsSettingsManager

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

Test Plan: * Extensive manual testing

Reviewed By: NickGerleman

Differential Revision: D40333083

Pulled By: rbalicki2

fbshipit-source-id: f3816e3bd7dea3086f6f2269c3a099af14aebb3b
2022-10-25 21:01:25 -07:00
Héctor Ramos adaa4fe71e trivial: display target name in CocoaPods output
Summary:
Without this, the CocoaPods output would display multiple "Building RNTester..." logs. With these changes, we make it clear that these are separate targets that are being configured.

Changelog: [internal]

Reviewed By: mdvacca, cipolleschi

Differential Revision: D40656813

fbshipit-source-id: a317112e804d08b9e64e2d62e8b27e4045b317b0
2022-10-25 16:25:20 -07:00
Christoph Purrer 02e4fcd825 Add enum example to Android/iOS rn-tester TurboModule
Summary:
Add enum example to Android/iOS rn-tester TurboModule

Changelog:
[General][Added] - Add enum example to Android/iOS rn-tester TurboModule

Reviewed By: javache

Differential Revision: D40619020

fbshipit-source-id: a113c5c78bcff3275e80d11bce8d0e6421b0b97d
2022-10-25 14:40:08 -07:00
Nick Gerleman fd91748146 Fix deadlock in RCTLoggingTests
Summary:
Some portions of continuous test runs RNTesterIntegrationTests will hang for an hour when running in Sandcastle without outputting anything. Locally debugging, I see a deadlock waiting on a semaphore, where the test assumed an extraneous symbolication warning would be fired.

This change makes it so that we only look for the extraneous messages if we haven't already seen the target message, since they do not seem to show up in local testing. I also added assertions per semaphore that the log statement is propagated within a still very gracious 10 seconds. This means we still can see what tests are running/failing if this test has issues, instead of a deadlocked test runner with no output.

Changelog:
[Internal][Fixed] - Fix deadlock in RCTLoggingTests

Reviewed By: cipolleschi

Differential Revision: D40667275

fbshipit-source-id: ab78f3c2ef47e2fd740b1dad2a65912e9542301d
2022-10-25 14:15:42 -07:00
Nicola Corti 8b8a5e06ce Bump the Android Docker image to 6.0 (for NDK 23) (#35079)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35079

This bumps the Docker image for React Native Android to 6.0
shipping the NDK 23 with it, finalizing all the work needed
to support NDK 23.

Changelog:
[Internal] [Changed] - Bump the Android Docker image to 6.0 (for NDK 23)

Reviewed By: cipolleschi

Differential Revision: D40675449

fbshipit-source-id: 5fb53080ce796263cd592dbc489743e6295060ba
2022-10-25 13:20:03 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075

This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab

Changelog:
[Android] [Changed] - Update the template to use RNGP

Reviewed By: cipolleschi

Differential Revision: D40673732

fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
2022-10-25 13:13:14 -07:00
Christoph Purrer 1d6b732496 react-native bridging > Add support for std::set
Summary:
There are use cases in which we want to pass a set of unique elements from C++ to JS and back. We can do this simple by re-using a plain JS array for these purposes.

Changelog:
[Internal][Added] react-native bridging > Add support for std::set

Reviewed By: cipolleschi

Differential Revision: D40668244

fbshipit-source-id: d06603440569e5f760c2859a54cf6e4232c7d97a
2022-10-25 12:32:30 -07:00
Ethan Zhu 3b0c65583d Suppress useNativeDriver is not supported warning
Summary:
Changelog:
[Internal] - Suppress unnecessary warning for native module in jest tests

Reviewed By: yungsters

Differential Revision: D40653968

fbshipit-source-id: ff3d894c36a18943a7b3fd061f52b65685a481a6
2022-10-25 11:45:17 -07:00
Nicola Corti af6aafff90 Deprecate react.gradle
Summary:
With RNGP we can now deprecate react.gradle
I'll create a page on the website to describe what is the migration strategy here,
but users should be fine by just replacing `apply from react.gradle` with
`apply plugin: com.facebook.react`.

Changelog:
[Android] [Removed] - Deprecate react.gradle

Reviewed By: cipolleschi

Differential Revision: D40675546

fbshipit-source-id: a50348791d669df1ed9e0470a6664e291c1a4584
2022-10-25 11:29:40 -07:00
Marshall Roch 68983b6631 fix some flow reference-before-declaration errors
Summary:
The `typeof X` type annotation now respects the initialization state of `X`: if `X` hasn't been declared it will be an error to get its type.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D40638870

fbshipit-source-id: 57459dec30ec5b87397365a709f2d846c87e378a
2022-10-25 11:07:40 -07:00
Christoph Purrer 745f3ee8c5 react-native-code-gen Add Enum Type support for iOS/Android TurboModules
Summary:
Adding enum support to Android/iOS generated code

Changelog:
[General][Added] - react-native-code-gen Add Enum Type support for iOS/Android TurboModules

Reviewed By: javache

Differential Revision: D38967241

fbshipit-source-id: d8bb3019dab198e16905a6422e877cd751119122
2022-10-25 08:27:47 -07:00
Samuel Susla e9b89b5ff2 Respect prop Text.allowFontScaling when sizing text
Summary:
changelog:
[iOS][Fixed] Fix Text.allowFontScaling prop in the new architecture

Reviewed By: javache

Differential Revision: D40643536

fbshipit-source-id: 1fb77b226089ce5e9ffc642b1d9a3de266d202c3
2022-10-25 05:51:25 -07:00
Riccardo Cipolleschi 5940d25cc1 Create the Parser interface (#35036)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35036

This diff is the base to create a polimorphic behavior for TypeScript and Flow parser. This type will allow to share a lot of code between the parsers and also to keep their differences a part.

It will be the base diff/PR for further tasks in the Codegen umbrella Issue

## Changelog:
[General][Added] - Parser interface to divide parser logic.

Reviewed By: cortinico

Differential Revision: D40548707

fbshipit-source-id: e632ba52b00b43e50306e3a792a841e72e8c07f4
2022-10-25 05:01:19 -07:00
Nicola Corti c419b4fa0c Bump react-native-gradle-plugin to 0.71.5
Summary:
Bumping RNGP to make sure all the changes are available for 0.71

I've also removed the caret from react-native's package.json as
I don't want .5 to be used by template tests yet.
The Android template needs to be updated in order to use
that version of the Gradle plugin.

Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.5

Reviewed By: cipolleschi

Differential Revision: D40642114

fbshipit-source-id: 70359efc3d2300e9c04c1b361c45061fd1c2931b
2022-10-25 03:24:38 -07:00
Nicola Corti 6a3bfa7a62 Bump NDK to 23 and fbjni to 0.3.0 (#35066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35066

This just bumps the NDK version used inside the template to be 23.
We can't merge this as it is but we have to wait for a bump of the Docker image for Android.

Changelog:
[Android] [Changed] - Bump NDK to 23

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D40637103

fbshipit-source-id: e637140cbe6052e94a6efedf12f4b5b81b90a7eb
2022-10-25 02:31:10 -07:00
Jan Kassens 428feb2f76 fix crash when converting symbol or BigInt to dynamic
Summary:
Throws a JS error instead of crashing Hermes with an invariant when trying to convert a JS symbol or BigInt to a folly::dynamic value.

Changelog:
[General][Fixed] - Fixed crash when converting JS symbol to folly::dynamic

Reviewed By: javache

Differential Revision: D40444164

fbshipit-source-id: 37df8059b2eb425563f30cf1e9c0436e8d665b34
2022-10-24 20:16:57 -07:00
Phillip Pan 1bb5cca72d fix typo in LeakChecker
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D40654731

fbshipit-source-id: c72c217244d4a0d4a0467085ff604460219ade60
2022-10-24 17:49:41 -07:00
Héctor Ramos 2b348fe009 Update RNTester bundle identifier
Summary:
Change RNTester bundle identifier to match Meta's provisioning profiles.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D40532706

fbshipit-source-id: efcd524eb1630a522bcb8a4875a3eed02b5b5e13
2022-10-24 15:52:42 -07:00
Jonathan Keljo cd020bd7f4 supermodule:xplat/default/public.hermes
Reviewed By: jsendros

Differential Revision: D40368129

fbshipit-source-id: 6d33c06be2ed14f80f45c1945358428eac8a32e7
2022-10-24 14:15:15 -07:00
Riccardo Cipolleschi c63882238b Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_2nd_batch00" (#35065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35065

Original commit changeset: ac76ea701e3d

Original Phabricator Diff: D40611860 (https://github.com/facebook/react-native/commit/860b4d914407ef11d0d5de80e5add275f83de3fd)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40637084

fbshipit-source-id: 2be7296f859412210afe981adf500ab6540f7ee8
2022-10-24 10:44:39 -07:00
Riccardo Cipolleschi 52d37aa403 Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10" (#35064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35064

Original commit changeset: 0fb0db845c04

Original Phabricator Diff: D40610875 (https://github.com/facebook/react-native/commit/d941940b4ce7ed9030be4f72980fb45d9b62365d)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40635873

fbshipit-source-id: 79ebd4db0972520fcca6ccb8c1725657a8ef7949
2022-10-24 10:44:39 -07:00
Rui Ying f8cd9f187d Fix ReactAndroid not found in rn-tester build (#35058)
Summary:
I tried to build the source locally to test changes with `rn-tester`. However, the gradle build failed due to "./ReactAndroid/gradle.properties (No such file or directory)". I believe this error was introduced by https://github.com/facebook/react-native/commit/3d05bac5872b42a5f412ec9042ce5be0b5d5b8d3.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Fixed] - Fix ReactAndroid not found in rn-tester build

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

Test Plan:
- Clone the react-native repo.
- Run `cd packages/rn-tester`.
- Run `yarn install-android-jsc` and encounter the error.
- Apply the fix.
- Run `yarn install-android-jsc` and build succeeds.

Reviewed By: cipolleschi

Differential Revision: D40639856

Pulled By: cortinico

fbshipit-source-id: 58b51bcad0af7a21cac032c98484c5942a203e4c
2022-10-24 10:43:02 -07:00
Nicola Corti 421bf983ed Unbreak test_android by passing the correct file to hermesc (#35067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35067

I accidentally broke test_android by landing a diff without waiting for
the full CI output.

Changelog:
[Internal] [Fixed] - Unbreak test_android by passing the correct file to hermesc

Reviewed By: cipolleschi

Differential Revision: D40638239

fbshipit-source-id: 1d03106f3b144f537265910df095a6023b181d85
2022-10-24 09:24:44 -07:00
Donald Webster 9a43e53a06 Revert D40613108: 4/n Display a RedBox with the JS stack (instead of native stack) when an unhandled JS exceptions occurs - Try 2
Differential Revision:
D40613108 (https://github.com/facebook/react-native/commit/5449148482271d60c87f6e5fa4483e69d4410320)

Original commit changeset: f36c3b39a216

Original Phabricator Diff: D40613108 (https://github.com/facebook/react-native/commit/5449148482271d60c87f6e5fa4483e69d4410320)

fbshipit-source-id: 079deac137610eeebd231bd97930efda6b284fff
2022-10-24 08:56:55 -07:00
Gabriel Donadel Dall'Agnol 20718e6b8c feat: Add role prop to Text component (#34976)
Summary:
As pointed out by necolas on https://github.com/facebook/react-native/issues/34424#issuecomment-1261482517 we forgot we add the `role` prop mapping to the `Text` component. This PR adds a new `role` prop to `Text`, mapping the web `role` values to the already existing `accessibilityRole` prop and moves the `roleToAccessibilityRoleMapping` to a common file that can be imported by both the `Text` and `View` components as requested on https://github.com/facebook/react-native/issues/34424. This PR also updates the RNTester AcessebilityExample to include a test using this new prop.

## Changelog

[General] [Added] - Add role prop to Text component

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

Test Plan:
1. Open the RNTester app and navigate to the Accessibility Example page
2. Test the `role` prop through the `Text with role = heading` section

Reviewed By: yungsters

Differential Revision: D40596039

Pulled By: jacdebug

fbshipit-source-id: f72f02e8bd32169423ea517ad18b598b52257b17
2022-10-24 08:38:47 -07:00
Nicola Corti 8ad86c70b6 RNGP - Add Variant Support (#35063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35063

This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm add Variant support to RNGP via the Variant API from AGP 7.x

A short summary of changes:
- I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
- I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
- I've introduced only a `debuggableVariants` to make all the decisions for the bundling and minification which should be sufficient for users
- I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.

Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)

Reviewed By: cipolleschi

Differential Revision: D40335028

fbshipit-source-id: d9ac1437de8a27db2e93df15b13772b221e036b2
2022-10-24 07:00:36 -07:00
Nicola Corti 2cc2ca1d1c RNGP - Automatically Configure Dependencies for ReactNative & Hermes
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

I'm extending RNGP to do autoconfiguration of dependencies for React Native and Hermes Engine using the Utils classes which were introduced before.

Changelog:
[Internal] [Changed] - RNGP - Automatically Configure Dependencies for ReactNative & Hermes

Reviewed By: cipolleschi

Differential Revision: D40633487

fbshipit-source-id: d4240987a9400fff2ec2aff2d13afc5b24778598
2022-10-24 07:00:36 -07:00
Nicola Corti 56d8c23f7b RNGP - Introduce enableCodegenInApps
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Historically we used to enable the codegen only for library modules. This is not working well for apps like RN Tester which don't have library modules but are running the codegen.

Therefore I'm introducing the `enableCodegenInApps` that is allowing apps to turn off the codegen if needed.

Changelog:
[Internal] [Changed] - RNGP - Introduce enableCodegenInApps

Reviewed By: cipolleschi

Differential Revision: D40633106

fbshipit-source-id: dc2ae9bbfe5b7940f9e9fe505ab2198a42c8a3f6
2022-10-24 07:00:36 -07:00
Nicola Corti 41fec07e20 RNGP - Top level property enableHermes -> hermesEnabled
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm renaming the top level property to enable hermes from `enableHermes` to `hermesEnabled`. We have a bunch of other properties which are called *Enabled. This one was following a different convention.

I'm retaining the backward compatibility for users using `project.ext.react.enableHermes` so this is not going to be a breakign change.

Changelog:
[Internal] [Changed] - RNGP - Top level property enableHermes -> hermesEnabled

Reviewed By: cipolleschi

Differential Revision: D40633109

fbshipit-source-id: 9d7efad6cb3bb382d1beb56966795a3f42bdaae6
2022-10-24 07:00:36 -07:00
Nicola Corti 074e3f0009 RNGP - Introduce the BundleAndHermesCTask
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm creating a new task BundleAndHermesCTask that is variant-aware.
Historically we had problems with the Bundle and the Hermes task being separated and overriding their own output. Consolidating those two steps in a single one will make it easier to support seaprate variants.

I'm going to use this task in a subsequent diff.

Changelog:
[Internal] [Changed] - RNGP - Introduce the BundleAndHermesCTask

Reviewed By: cipolleschi

Differential Revision: D40633108

fbshipit-source-id: 89f6d32ef219626ed5d4c5a0b8ac804c6704b2d6
2022-10-24 07:00:36 -07:00
Pieter De Baets 9a87db266a Remove initialProps handling for legacy createAnimatedComponent
Summary: Changelog: [Internal] Remove additional Animated logic under Fabric that's no longer required

Reviewed By: jehartzog

Differential Revision: D40513977

fbshipit-source-id: 1e96366377ca4c3bf032d830b5641ab658462ce8
2022-10-24 05:58:05 -07:00
Paige Sun 880e889380 Drop using namespace in .h files
Summary:
using namespace in header file is a bad practice due to many reasons as well as discouraged by -Wheader-hygiene compiler flag which is default for many apps
https://stackoverflow.com/questions/5849457/using-namespace-in-c-headers
https://stackoverflow.com/questions/223021/whats-the-scope-of-the-using-declaration-in-c

Changelog:
[Internal] Drop `using namespace` in .h files.

Reviewed By: christophpurrer

Differential Revision: D40628064

fbshipit-source-id: 8a032f3ab0321a531e26bd88656ad9a65b6d5154
2022-10-24 04:35:28 -07:00