Commit Graph

28394 Commits

Author SHA1 Message Date
Dmitry Rykun
75b8b10765 Fix ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode check (#38639)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38639

`ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode` is a function, we should call it.
Changelog: [Internal] - Fix ReactNativeFeatureFlags.enableNativeViewConfigsInBridgelessMode check

Reviewed By: luluwu2032

Differential Revision: D47798910

fbshipit-source-id: 68c75069f400f0a0327b1c3a5dd2b1cbfc2e70c7
2023-07-27 07:28:56 -07:00
evanbacon
e37e53086a fix: use import for event-target-shim to support mjs (#38628)
Summary:
The React Native community almost exclusively adds `mjs` support with something like: `config.resolver.sourceExts.push("mjs");` which causes `js` to be resolved before `mjs`. Mainstream bundlers will do the opposite, resolving `mjs` then `js`, unless bundling for Node.js environments.

`event-target-shim` has a `.js` and `.mjs` entry, when we [attempt to implement _community-standard_ resolution in Metro](https://github.com/expo/expo/pull/23528) the app fails to open on iOS––providing no indication of what failed. The issue here is that the `mjs` exports for `event-target-shim` don't support `module.exports = function() {}`, so we need to update some of the imports in `react-native` (note that one of the imports to `event-target-shim` already uses `import/export`).

### Discovery

For future readers––to discover this bug, I wrote a custom Metro resolver which printed a list of any `mjs` file that was resolved. In a basic app we observe the following:

```
/node_modules/react-native/Libraries/Core/setUpXHR.js > /node_modules/abort-controller/dist/abort-controller.mjs
/node_modules/react-native/Libraries/Network/XMLHttpRequest.js > /node_modules/event-target-shim/dist/event-target-shim.mjs
/node_modules/react-native/Libraries/WebSocket/WebSocket.js > /node_modules/event-target-shim/dist/event-target-shim.mjs
/node_modules/react-native/Libraries/Blob/FileReader.js > /node_modules/event-target-shim/dist/event-target-shim.mjs
/node_modules/abort-controller/dist/abort-controller.mjs > /node_modules/event-target-shim/dist/event-target-shim.mjs
```

In all cases the mjs files are resolved via `react-native` importing third-party packages, specifically `abort-controller` and `event-target-shim`. I modified the custom Metro resolver to ignore mjs resolution in different files until I found the problematic imports. This revealed that the exports were changing in `event-target-shim` between mjs and js.

Further, this was difficult to discover because the code that attempts to invoke an object as a function (error) is happening during the React Native networking setup. Ideally this JS code would be isolated from the user's bundler configuration and therefore impossible to break.

## Changelog:

[GENERAL] [FIXED] - Update `event-target-shim` import to support Metro resolving `mjs` modules before `js`.

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan:
- If you add `mjs` support to the `metro.config.js` file **before** js (`config.resolver.sourceExts.unshift("mjs");`), the project should be capable of starting.
- Usage with the default `metro.config.js` setup works as well.
- https://github.com/expo/expo/pull/23528 works.

Reviewed By: NickGerleman

Differential Revision: D47816854

Pulled By: TheSavior

fbshipit-source-id: ebaf2e7a3ec02ae61effa004058589053601b766
2023-07-26 22:32:54 -07:00
Eric Rozell
bae63d492f Break circular dependency between renderer/core and renderer/components/view (#38637)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38637

ComponentDescriptor and ConcreteComponentDescriptor expose a virtual method to interpolate props for LayoutAnimation. The implementation of this virtual method in ConcreteComponentDescriptor calls ViewPropsInterpolation, creating a circular dependency between react/renderer/core and react/renderer/components/view.

To break this circular dependency, this change lifts the props interpolation functionality out of ComponentDescriptor into LayoutAnimationKeyFrameManager.

Please note, while this is technically a "breaking" change, as component descriptors for 3p components may have overridden this method, it's not supported because LayoutAnimation only works on View props.

## Changelog:
[General] [Breaking] - Remove interpolateProps functionality from ComponentDescriptor to fix circular dependency between react/renderer/core and react/renderer/components/view

Reviewed By: christophpurrer

Differential Revision: D47797967

fbshipit-source-id: 5285da7cc9de29f21ce14c96b850a3c58c579e94
2023-07-26 13:14:59 -07:00
Eric Rozell
3d2fd4bf22 Only apply isHighlighted native prop on iOS (#38642)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38642

isHighlighted is only used for iOS. Even macOS disables it (see https://github.com/microsoft/react-native-macos/pull/1346).

This change ensures that the isHighlighted prop is only updated for iOS.

## Changelog:

[General] [Fixed] - Avoids re-renders during text selection on desktop platforms by limiting native-only `isHighlighted` prop to iOS

Reviewed By: lenaic, sammy-SC

Differential Revision: D47800845

fbshipit-source-id: af109be17027b2fbc9408e2ec9e1b841c709fe35
2023-07-26 12:45:41 -07:00
Nicola Corti
6cd1da94b8 Bump AGP to 8.1.0 (#38638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38638

A new stable version of Android Gradle Plugin has just been released which I'm bumping over here, and applying all the required changes.

Changelog:
[Internal] [Changed] - Bump AGP to 8.1.0

Reviewed By: cipolleschi

Differential Revision: D47798273

fbshipit-source-id: 57672b10444ffb6079aa5881ff09d033d2a5e895
2023-07-26 11:02:05 -07:00
Ruslan Lesiutin
b96d3beb3d refactor[AppContainer]: remove unused hasError (#38623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38623

Changelog: [Internal]

Looks like this field is unused.

Reviewed By: robhogan

Differential Revision: D47758294

fbshipit-source-id: 5bf9f8c11eba07a2074290b2b35f4432c80eaa5d
2023-07-26 10:24:09 -07:00
Lorenzo Sciandra
3c6dbec23b add RNTester-E2E: tests for iOS and Android via Appium, WDIO and Jest (#36267)
Summary:
The motivation is to create an E2E testing solution for the RNTester app that can be used to flag when things break and the release crew can use to validate more of the codebase ahead of a release.

This first PR wants to just showcase the main flow (how tests are made, where the E2E folder lives, how it's used by CircleCI) and then we can build on top of it with subsequent PRs, with the help of an umbrella issue to get the community involved in making more tests!

This work is being done cooperation with Callstack developers (mateuszm22 , adzironman, and others) - reason why the branch [lives in a fork](https://github.com/mateuszm22/react-native/tree/k%2Bm/new-rn-tester-E2E).

### [Read the RFC for more details ](https://github.com/react-native-community/discussions-and-proposals/pull/684)

### Extra notes

We are still on WebDriverIO 7 because during the exploratory phase, WDIO was a bit problematic and the workarounds needed to make it work don't seem very nice - see this PR: https://github.com/kelset/react-native-e2e-jest-appium-webdriverio/pull/4 --- this will be revisited in the future, once there's a better path for upgrading.

### Things that will be handled as follow up work

* upgrade to WDIO 8
* [an automated yarn run-e2e-test script](https://github.com/facebook/react-native/pull/36267#discussion_r1269378065)
* [a small refactoring into a js script](https://github.com/facebook/react-native/pull/36267#discussion_r1272050735)

## Changelog:

[INTERNAL] [ADDED] - Added first working configuration for e2e testing

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

Test Plan:
You can play with this locally by [follow the readme](https://github.com/mateuszm22/react-native/blob/k+m/new-rn-tester-E2E/packages/rn-tester-e2e/README.md).

CircleCI jobs will be added.

Reviewed By: cipolleschi

Differential Revision: D47763012

Pulled By: cortinico

fbshipit-source-id: 6eb9674182b8ee97aea4784158c69bf017f379e5
2023-07-26 07:23:31 -07:00
Nicola Corti
ad91518fed Let check-for-reproducer run only on newly created issues. (#38634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38634

To reduce the noise of the `check-for-reproducer` bot, this restricts the event
that trigger the bot to only the issue creation.

Changelog:
[Internal] [Changed] - Let check-for-reproducer run only on newly created issues

Reviewed By: cipolleschi

Differential Revision: D47792374

fbshipit-source-id: 738a9342899e234022029e94f43b0dccebc21819
2023-07-26 03:53:59 -07:00
Louie Colgan
823b1f467b fix: add signal to Request type (#38536)
Summary:
The `Request` interface provided by `types/react-native` doesn't have a `signal` property when it should as this is something that is accessible on the `Request` object.

![image](https://github.com/facebook/react-native/assets/10697889/f2d75973-61ff-4874-ad8e-2c0898b82d27)

For example, running the following:

#### Without providing a `signal`

```ts
console.log(new Request('https://www.facebook.com'));
```

will result in the following:

```ts
{"_bodyInit": undefined, "_bodyText": "", "bodyUsed": false, "credentials": "same-origin", "headers": {"map": {}}, "method": "GET", "mode": null, "referrer": null, "signal": {}, "url": "https://www.facebook.com"}
```

## Changelog:

[GENERAL] [FIXED] - Fixed missing property `signal` for the `Request` interface

## Reproduce

1. Add `new Request('https://www.facebook.com').signal` to a typescript file
2. TS will error `Property 'signal' does not exist on type 'Request'`

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

Test Plan:
Adding to `global.d.ts` in a file will resolve the problem, demonstrating that this works.

```ts
interface Request {
    readonly signal: AbortSignal | undefined
}
```

Reviewed By: NickGerleman

Differential Revision: D47660506

Pulled By: jacdebug

fbshipit-source-id: ef1459fbaca5d8f31bf8539bd61ac5e447111fec
2023-07-26 03:21:52 -07:00
Riccardo Cipolleschi
0f48e86fed Return NONE accessibility role if null is passed. (#38613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38613

The `value` string of the ReactAccessibilityDelegate's `fromValue` method is marked as `Nullable`, however the `null` case is not handled.

This change handle the `null` case setting the accesssibility role to NONE.

## Changelog:
[Android][Fixed] - Set the accessibility role to `NONE` when a `null` string is passed to `fromValue`

Reviewed By: cortinico

Differential Revision: D47752098

fbshipit-source-id: e8a44bdd8874e996d8127cb2ee29e5135210b196
2023-07-26 00:49:08 -07:00
Luna Wei
c1eec4cc51 Back out "Fix issue#11068 of duplicating characters when replacing letters to lowercase or uppercase in TextInput"
Summary:
Changelog: [Internal] - Back out https://github.com/facebook/react-native/pull/35929 due to https://github.com/facebook/react-native/pull/35929#discussion_r1272857008

Original Phabricator Diff: D47243817

Reviewed By: sunzhaoyuan

Differential Revision: D47785787

fbshipit-source-id: 81598be3f0b4e0e753dfbee4cee781673f900827
2023-07-25 23:44:14 -07:00
Nicola Corti
bae0016dc9 Properly split the "Too Old Version of React Native" message
Summary:
The bot message is split in a wrong way:
https://github.com/facebook/react-native/issues/38603#issuecomment-1648749441
I'm updating it to use `<br/><br/>` instead which renders correctly inside tables.

Changelog:
[Internal] [Changed] - Properly split the "Too Old Version of React Native" message

Reviewed By: NickGerleman

Differential Revision: D47764363

fbshipit-source-id: 7a80f03b4228a3f0c69d718b8eb60ecd4ac60a2b
2023-07-25 21:49:41 -07:00
Pieter Vanderwerff
928eca82ea Update to 0.15.0 across fbsource (#38627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38627

Upgrade hermes parser packages to the latest released versions.

Changelog is here: https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D47763733

fbshipit-source-id: 773da536034a57b540649a91507b4bf278d7e815
2023-07-25 16:01:48 -07:00
Christoph Purrer
3c15b68d56 Remove need for platform overrides to Settings (#38607)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38607

Today, any host platform implementation of React Native must add Settings.platform.js.

- https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Settings/Settings.windows.js

Now they don't have to do it anymore.

For this case, macOS actually wants to share the iOS specific logic > https://github.com/microsoft/react-native-macos/blob/main/Libraries/Settings/Settings.macos.js

Changelog:
[General] [Fixed] - [Settings] Remove need for platform overrides to Settings

Reviewed By: rozele

Differential Revision: D47747018

fbshipit-source-id: 8e4e8d318b3285a9a64e0b4f052f721f6242f871
2023-07-25 15:04:31 -07:00
Christoph Purrer
800ea60393 Remove need for each platform to implement ToastAndroid as UnimplementedView (#38606)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38606

Today, any host platform implementation of React Native must add ToastAndroid.platform.js.

- https://github.com/microsoft/react-native-macos/blob/main/Libraries/Components/ToastAndroid/ToastAndroid.macos.js
- https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Components/ToastAndroid/ToastAndroid.windows.js

Now they don't have to do it anymore.

Changelog:
[General] [Fixed] - ToastAndroid] Remove need for each platform to implement ToastAndroid as UnimplementedView

Reviewed By: rozele

Differential Revision: D47744187

fbshipit-source-id: 510aa7aa00a768ba5a37f3d40246f7ef620e0b58
2023-07-25 14:40:04 -07:00
Christoph Purrer
151f3900de Remove need for each platform to implement DrawerLayoutAndroid as UnimplementedView (#38609)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38609

This file is forked in out of tree platforms as:

- macOS > https://github.com/microsoft/react-native-macos/blob/main/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.macos.js
- Windows > https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.windows.js

The change here removes the need of forking this file

Changelog:
[General] [Fixed] - [DrawerAndroid] Remove need for each platform to implement DrawerLayoutAndroid as UnimplementedView

Reviewed By: rozele

Differential Revision: D47747205

fbshipit-source-id: 67d79243d63a5494963330d6edd06749abe6741b
2023-07-25 14:18:28 -07:00
Christoph Purrer
c02fcca187 Remove need for each platform to implement ProgressBarAndroid as UnimplementedView (#38608)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38608

This file is forked in out of tree platforms as:

- macOS > https://github.com/microsoft/react-native-macos/blob/main/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.macos.js
- Windows > https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.windows.js

The change here removes the need of forking this file

Changelog:
[General] [Fixed] - [ProgressBarAndroid] Remove need for each platform to implement ProgressBarAndroid as UnimplementedView

Reviewed By: rozele

Differential Revision: D47747116

fbshipit-source-id: 8c6d40baf8efc69fc8bf359ab400b6d2eec03839
2023-07-25 13:48:19 -07:00
Christoph Purrer
80f531f9f4 Remove need for platform overrides in SafeAreaView.js (#38601)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38601

This file is forked in out of tree platforms as:

- macOS > https://github.com/microsoft/react-native-macos/blob/main/Libraries/Components/SafeAreaView/SafeAreaView.js#L28-L33
- Windows > https://github.com/microsoft/react-native-windows/blob/0.71-stable/vnext/src/Libraries/Components/SafeAreaView/SafeAreaView.windows.js#L30-L36

The change here removes the need of forking this file

Changelog:
[General] [Fixed] - [SafeAreaView] Remove need for platform overrides in SafeAreaView.js

Reviewed By: NickGerleman

Differential Revision: D47734944

fbshipit-source-id: 84249a3b3e7e3807b3d5ee4bfa4b1cb140541b8b
2023-07-25 12:00:58 -07:00
Rob Hogan
5cf66bda1d Update Babel Flow lib defs (#38515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38515

Regenerate `babel/traverse` and `babel/types` Flow library definitions from the runtime code at the current lockfile versions, using Metro's `yarn update-babel-flow-lib-defs`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D47588687

fbshipit-source-id: 065a741ce4a9d765427455a26d23892ea6401f9a
2023-07-25 11:37:04 -07:00
szymonrybczak
28deaa3a71 Bump NDK to 25 (#37974)
Summary:
Bumps NDK to current LTS Release.

## Changelog:

[Android] [Changed] - Bump NDK to 25

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

Test Plan: CI Green 

Reviewed By: christophpurrer

Differential Revision: D47754763

Pulled By: cortinico

fbshipit-source-id: 24fbca503b3814c28a05aada5223c741e14bda28
2023-07-25 09:57:30 -07:00
Jiaqi Duan
dd1c8a6ba0 Revert D46225747: add RNTester-E2E: tests for iOS and Android via Appium, WDIO and Jest
Differential Revision:
D46225747

Original commit changeset: e5428c439afd

Original Phabricator Diff: D46225747

fbshipit-source-id: b2136b5338a38fc52493f5c9a47dcb806d6a5f52
2023-07-25 09:44:51 -07:00
Alex Hunt
51a63f4a5e Hide JS executor in Dev Menu when unimplemented
Summary:
Fixes exception thrown when `getJavaScriptExecutorFactory()` is not implemented on bridgeless.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D47755422

fbshipit-source-id: 80170db521ab02c4f23c9ddf3c2f5b0381df020b
2023-07-25 09:00:04 -07:00
Lorenzo Sciandra
3c196fb2f5 add RNTester-E2E: tests for iOS and Android via Appium, WDIO and Jest (#36267)
Summary:
The motivation is to create an E2E testing solution for the RNTester app that can be used to flag when things break and the release crew can use to validate more of the codebase ahead of a release.

This first PR wants to just showcase the main flow (how tests are made, where the E2E folder lives, how it's used by CircleCI) and then we can build on top of it with subsequent PRs, with the help of an umbrella issue to get the community involved in making more tests!

This work is being done cooperation with Callstack developers (mateuszm22 , adzironman, and others) - reason why the branch [lives in a fork](https://github.com/mateuszm22/react-native/tree/k%2Bm/new-rn-tester-E2E).

### [Read the RFC for more details ](https://github.com/react-native-community/discussions-and-proposals/pull/684)

### Extra notes

We are still on WebDriverIO 7 because during the exploratory phase, WDIO was a bit problematic and the workarounds needed to make it work don't seem very nice - see this PR: https://github.com/kelset/react-native-e2e-jest-appium-webdriverio/pull/4 --- this will be revisited in the future, once there's a better path for upgrading.

### Things that will be handled as follow up work

* upgrade to WDIO 8
* [an automated yarn run-e2e-test script](https://github.com/facebook/react-native/pull/36267#discussion_r1269378065)
* [a small refactoring into a js script](https://github.com/facebook/react-native/pull/36267#discussion_r1272050735)

## Changelog:

[INTERNAL] [ADDED] - Added first working configuration for e2e testing

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

Test Plan:
You can play with this locally by [follow the readme](https://github.com/mateuszm22/react-native/blob/k+m/new-rn-tester-E2E/packages/rn-tester-e2e/README.md).

CircleCI jobs will be added.

Reviewed By: cipolleschi

Differential Revision: D46225747

Pulled By: cortinico

fbshipit-source-id: e5428c439afd84ed3dd219d6ada538263120d7c6
2023-07-25 07:58:09 -07:00
Intl Scheduler
74a1822cb5 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907928667724
Sandcastle Job Instance ID: 9007200254843019
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47757619

fbshipit-source-id: 73a096ce8946bce00007412b6eb3a6c2570ce1da
2023-07-25 07:37:06 -07:00
Riccardo Cipolleschi
a374fc52ca Remove Ruby 2.7.7 tests from CircleCI (#38611)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38611

For Ruby tests, we are already testing the least recent (2.6.10) and the most recent version (3.2.0).

Testig on 2.7.7 (a minor greater than 2.6.10) was an over-cautious measure we can safely remove now after few months where we saw that no changes broke this specific version of ruby.

## Changelog:
[Internal] - Remove tests on Ruby 2.7.7

Reviewed By: cortinico

Differential Revision: D47715594

fbshipit-source-id: 854b5e0369f390d8801b72f1231fe6ce30069e09
2023-07-25 03:14:56 -07:00
Riccardo Cipolleschi
9bb7afbb41 Remove StaticFrameworks jobs (#38551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38551

I think we can safely remove the StaticFrameworks tests: the DynamicFrameworks are stricter than the static, so if something works in a dynamic frameworks setup, it will work also in the static framework one.

we can safely delete the following tests
- test_ios_template-NewArch-Debug-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-NewArch-Debug-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-NewArch-Release-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-NewArch-Release-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-OldArch-Debug-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-OldArch-Debug-WithoutFlipper-JSC-StaticFrameworks
- test_ios_template-OldArch-Release-WithoutFlipper-Hermes-StaticFrameworks
- test_ios_template-OldArch-Release-WithoutFlipper-JSC-StaticFrameworks
- test_ios_rntester-NewArch-Hermes-StaticFrameworks
- test_ios_rntester-NewArch-JSC-StaticFrameworks
- test_ios_rntester-OldArch-Hermes-StaticFrameworks
- test_ios_rntester-OldArch-JSC-StaticFrameworks

## Changelog
[Internal] - Remove static frameworks tests in CircleCI

Reviewed By: dmytrorykun

Differential Revision: D47669902

fbshipit-source-id: 4888bbf88bb23284e410936910e5f71c969408d0
2023-07-25 03:14:56 -07:00
Sam Zhou
e64756ae5b Deploy 0.213.1 to xplat (#38605)
Summary:
X-link: https://github.com/facebook/relay/pull/4391

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

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D47744471

fbshipit-source-id: 8e2e2e55610020cc6b85cd73d0221bf23c4b7c3b
2023-07-24 20:15:05 -07:00
Mehdi Mulani
fedad15a69 Fix regression with NativeSyntheticEvent and add test. (#38600)
Summary:
With moving the TypeScript declarations into the repo, the NativeSyntheticEvent type was copied incorrectly from DefinitelyTyped.

This was the old one: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-native/v0.70/index.d.ts#L355

## Changelog:

[GENERAL] [FIXED] - Correct the NativeSyntheticEvent type

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

Test Plan: Added a test and ran `yarn test-typescript`

Reviewed By: NickGerleman

Differential Revision: D47739191

Pulled By: lunaleaps

fbshipit-source-id: 0c8b51a62f589a716121e9bfa8ce7e6103f37f6b
2023-07-24 18:47:11 -07:00
Tim Yung
aa474847ec Back out "RN: Adopt Mapped Types in EventEmitter"
Summary:
Currently, `metro-config` does not have `hermes-parser` enabled by default. This is because `hermes-parser` does not yet support parsing all of TypeScript's syntax nodes.

However, this also means we cannot yet utilize any Flow langauge features that require the use of `hermes-parser` (and are unsupported by Babel). Mapped types falls into this category, so we cannot use them.

This backs out a recent change that tried to adopt Flow mapped types in `EventEmitter`, for now. We can revisit after making the necessary changes to `metro-config`.

Changelog:
[Internal]

Reviewed By: pieterv

Differential Revision: D47729818

fbshipit-source-id: ec90b38e113a9c3ad952f33777fabbd82519cffb
2023-07-24 15:01:20 -07:00
Intl Scheduler
f1e3e6debb translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907928272332
Sandcastle Job Instance ID: 31525198392657606
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47736198

fbshipit-source-id: 680439ecbf2dd89d7c5d2902c9d94ddeaf7c8161
2023-07-24 14:56:01 -07:00
Tim Yung
75f458891f RN: Adopt Mapped Types in EventEmitter
Summary:
Migrates `EventEmitter` in React Native to use the newly introduced mapped types in Flow, instead of `$ObjMap`.

Changelog:
[Internal]

Reviewed By: jbrown215

Differential Revision: D47296240

fbshipit-source-id: 435d0a19242dcd13a4a6c7824daf0e894445cfa7
2023-07-24 11:30:39 -07:00
Tim Yung
a7805bb20e RN: Upgrade to hermes-parser@0.14.0 (#38554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38554

@public
Upgrades React Native, Relay, and Metro to use `hermes-parser@0.14.0`.

This also changes the repository's Jest configuration to now use `hermes-parser`.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D47522140

fbshipit-source-id: 207ccd0c4e4489d486731d0c847d8089abc1cc72
2023-07-24 11:30:39 -07:00
Lulu Wu
d3c28d28a9 Migrate RNTester to Bridgeless (#38477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38477

Changelog:
[iOS][Changed] - Migrate RNTester to Bridgeless

Reviewed By: philIip

Differential Revision: D47521323

fbshipit-source-id: db62700cb5cd8d72a6d2ac4ffcd2da91208ae675
2023-07-24 08:13:07 -07:00
Lulu Wu
736dd5a3c0 Re-orgnize BridgelessApple files to keep proper header file include structure (#38322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38322

As title, so that we can keep the format
```#import <ReactCommon/RCTHost.h>```

Changelog:
[iOS][Changed] - ] Re-orgnize BridgelessApple files to keep proper header file include structure

Reviewed By: cipolleschi, dmytrorykun

Differential Revision: D47421732

fbshipit-source-id: af14807d20676e8732c66fa7f792580819c33f33
2023-07-24 08:13:07 -07:00
Lulu Wu
3965158a2d Add JSC for Bridgless (#38107)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38107

This change makes bridgeless build with JSC and with all the frameworks settings.

## Changelog:
[iOS][Added] Support bridgeless with JSC and frameworks

Reviewed By: philIip

Differential Revision: D47025704

fbshipit-source-id: 5779d3ffd9ed037e6f6dee6c64cc65835f370a5b
2023-07-24 08:13:07 -07:00
Lulu Wu
42d67452eb Move .m to .mm to make obj-c and C++ headers compatible (#38135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38135

Changelog:
[iOS][Changed] - Move .m to .mm to make obj-c and C++ headers compatible

Reviewed By: RSNara

Differential Revision: D47140743

fbshipit-source-id: 1f1fb24571f5154b17992d6a71587803407b9dd1
2023-07-24 08:13:07 -07:00
Lulu Wu
b06c2d7050 Add pods for bridgeless (#38020)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38020

 Add pods for bridgeless

bypass-github-export-checks

Changelog:
[iOS][Added] - Add pods for bridgeless

Reviewed By: cipolleschi

Differential Revision: D46847632

fbshipit-source-id: d472c7b3bd790bb4565aa2c929116c74346e7913
2023-07-24 08:13:07 -07:00
Dmitry Rykun
4960fe1352 Add /.cpplsp.buckd to react-native-github/.gitignore
Summary:
Something keeps creating these cpp lsp files in react-native-github, which is annoying.
{F1056848131}
This diff adds `.gitignore` section to ignore them.
Changelog: [Internal] - Add /.cpplsp.buckd to react-native-github/.gitignore

bypass-github-export-checks

Reviewed By: cortinico, cipolleschi

Differential Revision: D47716855

fbshipit-source-id: 78d2008f69c230d746546afad80c9114d27c9026
2023-07-24 07:21:05 -07:00
Riccardo Cipolleschi
16fe8dafaa Honor custom name when TM is registered with the legacy mode. (#38547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38547

Before this change, when a turbomodule was registered using the `RCT_EXPORT_MODULE()` function using a custom name, the TM was not found in the registry.

With this change, we are adding a fallback that looks in the list of registered TM, asking for the name used by the user to register it.

This fallback is executed only if no other method was successful before as it is more expensive.

## CHANGELOG
[iOS][Fixed] - Honor the custom name choosen by the user to register the module.

Reviewed By: philIip

Differential Revision: D47666848

fbshipit-source-id: 545855de1c398726b9449a0d77af7f1756cca233
2023-07-24 02:54:14 -07:00
Islam
4aa53d241d Fix typo App.test.tsx (#38524)
Summary:
There was a typo in App.test.tsx, that I noticed when tried to upgrade from 0.71 to 0.72

## Changelog:

Fixed small typo from *shiped* to *shipped*

Pick one each for the category and type tags:

[GENERAL] [FIXED]

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

Reviewed By: cortinico

Differential Revision: D47695088

Pulled By: NickGerleman

fbshipit-source-id: 9f74c7f891927be6c0c0f522f0cd51b022fb54f1
2023-07-24 02:46:46 -07:00
Phillip Pan
2b93491779 cleanup RCTDidSetupModuleNotification (#38543)
Summary:
Changelog: [iOS][Breaking]

no one is observing this, delete

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

Reviewed By: cipolleschi

Differential Revision: D47620724

Pulled By: philIip

fbshipit-source-id: 9e8932b6bee25497770d8a7600940178b746857e
2023-07-22 23:21:22 -07:00
Phillip Pan
659ecd47ba cleanup isMainQueueExecutionOfConstantToExportDisabled (#38542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38542

Changelog: [Internal]

never shipped, also seems not relevant after shipping TM

bypass-github-export-checks

Reviewed By: mdvacca, cipolleschi

Differential Revision: D47620463

fbshipit-source-id: 8d9120c6cfec60e2b0b25badc46d4e35b18cfc61
2023-07-22 23:21:22 -07:00
Phillip Pan
74feb4cf6c cleanup installJSBindingWithRuntimeExecutor (#38541)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38541

Changelog: [iOS][Breaking]

we can just delete this, replacing the callsite w/ `installJSBindings` is straightforward

Reviewed By: mdvacca, cipolleschi

Differential Revision: D47620027

fbshipit-source-id: 8bb651dc14c6120f06a61326c63b15d1e3d68e9b
2023-07-22 23:21:22 -07:00
Intl Scheduler
89ff3ac6cd translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907927247222
Sandcastle Job Instance ID: 13510799882411639
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47701997

fbshipit-source-id: 7af8badb3e8f6ccfff2dc02bfeeea91f3b7cf436
2023-07-22 21:01:00 -07:00
Riccardo Cipolleschi
e6dd22c628 Fix RCTBaseTextInputView for iOS 17
Summary:
The change in D47554161 is breaking builds for iOS 17 as the `addEntriesFromDictionary` method returns void and the code tries to assign the returned value to another dictionary.

## Changelog:
[iOS][Fixed] - Use `addEntriesFromDictionary` properly in RCTBaseTextInputView.

Reviewed By: sammy-SC

Differential Revision: D47696854

fbshipit-source-id: 49e01fdc63b3f0478762994d5cafdceb16830c74
2023-07-22 11:57:46 -07:00
Sam Zhou
fc8ad8c659 Deploy 0.213.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D47685569

fbshipit-source-id: 2563ee5268b8225c22fec4c2611d2616a6023712
2023-07-21 17:54:49 -07:00
Nicola Corti
ccc50ddd2d Fabric Interop - Properly dispatch integer commands (#38527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38527

This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching.
(See https://github.com/terrylinla/react-native-sketch-canvas/issues/236)

The problem is that libraries that were receiving commands as ints with:
```
public void receiveCommand(
      int surfaceId, int reactTag, int commandId, Nullable ReadableArray commandArgs) {
```

would not receive command with the Fabric Interop for Android.

The problem is that with Fabric, events are dispatched as string always.
cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.

The logic is, if the event is dispatched as a string that represents a number (say `"42"`) and the user has Fabric Interop enabled, then we dispatch the event as `int` (so libraries will keep on working).

Changelog:
[Android] [Fixed] - Fabric Interop - Properly dispatch integer commands

Reviewed By: cipolleschi

Differential Revision: D47600094

fbshipit-source-id: c35f0509e6c6c0cddc7090a069882f92dd95532e
2023-07-21 10:17:31 -07:00
Lorenzo Sciandra
8f4542d65c fix: remove old command for align packages versions (#38548)
Summary:
While working on a couple things, me Riccardo and Nicola noticed that in main for some reason the old `align-package-versions` command in the root package.json was still there in main branch.

This was "merged into" `bump-all-updated-packages` by hoxyq all the way back in March; here's the commit for 0.72 branch -> a469927c16

We are not sure why, but for some reason the same commit in main was borked in some way, and didn't actually remove the command: PR (https://github.com/facebook/react-native/pull/36568) and commit (04df252aa7)

So this commit just takes care of that.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [REMOVED] - remove old command for align packages versions

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

Test Plan: N/A - it's a removal

Reviewed By: cipolleschi

Differential Revision: D47669016

Pulled By: cortinico

fbshipit-source-id: aa651b69433171219dbc235d947ceed4f88b602a
2023-07-21 09:17:58 -07:00
kacperkapusciak
3f78fa953a Fix checkForReproducer action not adding Missing Repro comment (#38531)
Summary:
This PR fixes a bug where GitHub Actions bot didn't add a comment when "Needs: Repro" label was present in an issue.

When a maintainer adds the label manually the bot comments with "Missing Reproductible Example" as normally.

It seems like the problem occurred because of a difference in a sandbox repository and the proper facebook/react-native repo environment.

My sandbox that I used to test https://github.com/facebook/react-native/pull/38338 had an "bot" account with Personal Access Token setup to reply to issues. Turns out that bots using PAT have more permissions and can trigger one action from the other.

**The solution is to send the comment directly from the `checkForReproducer` action.** This won't collide with other actions but sadly will duplicate the sending logic into two actions.

This PR also makes the bot respect when a maintainer removes and adds a label by hand and won't alter the maintainer decision.

Related to ☂️ https://github.com/facebook/react-native/issues/35591

## Changelog:

[INTERNAL] [FIXED] - Message

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

Test Plan: ![image](https://github.com/facebook/react-native/assets/39658211/b956416f-9834-4c61-981f-fe6c17a5eec5)

Reviewed By: cipolleschi

Differential Revision: D47666922

Pulled By: cortinico

fbshipit-source-id: 4a6a471cb11c6ed9b48263d18bf8e283577a14bb
2023-07-21 08:46:03 -07:00
Riccardo Cipolleschi
f6197cd846 Download artifacts from CI to speed up testing (#37971)
Summary:
Testing releases takes a lot of time because we have to build locally several configurations.
However, the artifacts that we build locally are also built in CI.

The goal of this PR is to implement a mechanism to download those artifacts from the CI instead of build locally, so that testing the release locally can take much less time.

As an example, the full test cycle can take more than 2 hours given that we need to repackage and rebuilt the app from the template.

My plan is to add a table with the time saved once the PR is done

### TODO:
- [x] Download Hermes tarball for RNTester iOS
- [x] Download Hermes APK for RNTester Android
- [x] Download JSC APK for RNTester Android
- [x] Download Packaged version of React Native to create a new app
- [x] Use the downloaded React Native to initialize an app from the template
- [x] Download Maven Local prebuilt in CI and use it for Template Android app

### Time Savings

| Setup | Before [s] | After [s] | Notes |
| --- | --- | --- | --- |
| iOS RNTester Hermes | 339.68 | 194.86 | Time saved by downloading Hermes rather then building it |
| iOS RNTester JSC | 129.80 | 123.35 | Not significant, expected as this workflow did not change
| Android RNTester Hermes | 1188.82 | 5.28 | Huge improvement: we download the APK rather then build |
| Android RNTester JSC | 103.10  | 6.28 | Huge improvement: we download the APK rather then build  |
| Creating the RNTestProject | 2074.82  | 191.16 | We download Maven, the packaged version of RN and Hermes instead of building from scratch |

## Changelog:
[Internal] - Speed up Release testing by downloading the CircleCI artifacts

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

Test Plan: - Tested the script locally

Reviewed By: cortinico, dmytrorykun

Differential Revision: D46859120

Pulled By: cipolleschi

fbshipit-source-id: 8878ebaccf6edb801f8e9884e2bf3946380aa748
2023-07-21 07:15:53 -07:00