Commit Graph

12270 Commits

Author SHA1 Message Date
David Vacca e51ff0b6e6 Refactor ReactHost to implement ReactHostInterface
Summary:
Refactor ReactHost to implement ReactHostInterface

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D46770421

fbshipit-source-id: d7d6dc361ef89b3478e882a3334059c6440f1edf
2023-06-15 22:34:36 -07:00
David Vacca 582951eca6 Create ReactHostInterface
Summary:
Introduce ReactHostInterface interface

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D46746516

fbshipit-source-id: 6c0c84761fbfd2009d72b1bf138648e1b31b4730
2023-06-15 22:34:36 -07:00
Intl Scheduler e66c906454 translation auto-update for i18n/twilight.config.json on master
Summary:
Chronos Job Instance ID: 1125907900414465
Sandcastle Job Instance ID: 13510799855734354
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46788752

fbshipit-source-id: ca4f179c658c3d1239ab5d48d09e44c266c2103d
2023-06-15 20:50:08 -07:00
Ramanpreet Nara 7bc2b730a8 Interop: Introduce Bridge proxy
Summary:
The TurboModule interop layer on iOS will ship with a Bridge proxy.

The Bridge proxy is an object that will try to simulate the Bridge's APIs, whenever possible, by delegating to Bridgeless abstractions.

## Changes
This diff introduces the Bridge proxy.
This diff starts attaching the Bridge proxy on legacy native module objects.

## How did we polyfill the APIs
The polyfills can be classified into these categories:
- implemented
- custom warning
- custom error
- default error
- deleted

When there was a sane implementation (e.g: the API belonged to [RCTCallableJSModules](https://www.internalfb.com/code/fbsource/[534223aa13d33b595edcb777189618efe20dd167]/xplat/js/react-native-github/React/Base/RCTCallableJSModules.m?lines=11), [RCTModuleRegistry](https://www.internalfb.com/code/fbsource/[9a3ba2b3176b6d1a1f161e33cec51bf892815311]/xplat/js/react-native-github/React/Base/RCTModuleRegistry.m?lines=13), [RCTBundleManager](https://www.internalfb.com/code/fbsource/[91fa1f7f49731a16aedbcd5a6740647dc21ff727]/xplat/js/react-native-github/React/Base/RCTBundleManager.m?lines=13), or [RCTBundleManager](https://www.internalfb.com/code/fbsource/[91fa1f7f49731a16aedbcd5a6740647dc21ff727]/xplat/js/react-native-github/React/Base/RCTBundleManager.m?lines=13)), it was implemented.

When it was safe to no-op the API (e.g: loading), it emit a custom warning.

When it was unsafe to call (i.e: we didn't want people calling the API) (e.g: RCTCxxBridge start), it emit a custom error.

All other APIs emit default errors.

Some APIs cannot emit errors because doing so makes the app not render: I put warnings and nooped those APIs.

I think we will have to tune these polyfills based off production crashes/results.

Reviewed By: mdvacca

Differential Revision: D46084318

fbshipit-source-id: c02535073956597a4bf91c14b1980f653cb6d3df
2023-06-15 18:05:55 -07:00
Adrian Hartanto 3e3032636d Remove okhttp internal util usage (#37843)
Summary:
Remove okhttp internal `Util` usage so it can be compatible with [okhttp 5.0.0 alpha](https://square.github.io/okhttp/changelogs/changelog/#version-500-alpha7).

## Changelog:

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

Pick one each for the category and type tags:

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

[ANDROID] [CHANGED] - Remove okhttp3 internal util usage

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

Test Plan: None, the implementation is based on okhttp internal util

Reviewed By: NickGerleman

Differential Revision: D46764363

Pulled By: cortinico

fbshipit-source-id: e46770625f19057fa7374be15e92903d7966f880
2023-06-15 16:34:40 -07:00
Vojtech Novak ca65d97d60 fix: foreground ripple crash on api < 23 (#37901)
Summary:
The Pressable component supports the `foreground` option for ripple. However, using it on old android api levels (e.g. android 5) crashes with

```
Error while updating property
nativeForegroundAndroid' of a view managed by:
RCTView
null
No virtual method setForeground(Landroid/ graphics/drawable/Drawable;)V in class Lcom/ facebook/react/views/view/ReactViewGroup; or its super classes
```

TouchableNativeFeedback.js has a check to make sure this does not happen [as seen here](https://github.com/facebook/react-native/blob/b0485bed0945061becace5af924fa60b17ab295f/packages/react-native/Libraries/Components/Touchable/TouchableNativeFeedback.js#L158)

I also want to point out that this PR can be closed https://github.com/facebook/react-native/pull/30466 as it's already implemented

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - foreground ripple crashed on api < 23

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

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

Test Plan: tested locally on [another project](https://github.com/react-navigation/react-navigation/pull/11386) because I wasn't able to get RN tester running

Reviewed By: rshest

Differential Revision: D46747310

Pulled By: NickGerleman

fbshipit-source-id: 4ee9062f821f5d629a1a0151c2fef61d836d09a4
2023-06-15 15:23:40 -07:00
Alex Hunt 8b1bf058c4 Re-enable direct debugging with JSC on iOS 16.4+ (#37914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37914

Restores https://github.com/facebook/react-native/pull/37874 (reverted earlier today), with fix for `JSCRuntime.cpp` build on Android.

Changelog: None

Reviewed By: cortinico

Differential Revision: D46762984

fbshipit-source-id: 6d56f81b9d0c928887860993b2b729ed96c0734c
2023-06-15 12:27:32 -07:00
tarunrajput 24f7707418 add emitObjectProp in parser primitives (#37904)
Summary:
This is a follow up PR to https://github.com/facebook/react-native/issues/37872 as it was not merged correctly.

## 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][Changed]: Add emitObjectProp in parser primitives

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

Test Plan: `yarn test react-native-codegen`

Reviewed By: cipolleschi

Differential Revision: D46753690

Pulled By: rshest

fbshipit-source-id: a1d0a727222066f3721f62427a51ee0317e06f13
2023-06-15 11:47:37 -07:00
Samuel Susla 1561d2906e Make React-utils its own pod (#37659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37659

changelog: [internal]

To better align with how BUCK is setup internally, let's make React utils its own pod.

Reviewed By: dmytrorykun

Differential Revision: D46358021

fbshipit-source-id: c2a48a18e9839a508a87d54685115883975f3979
2023-06-15 11:44:26 -07:00
Grégoire Van der Auwermeulen abc6e1cbf4 feat: allow custom assignment of rootView to rootViewController (#37873)
Summary:
To use a native Drawer on iPad, I can override `createRootViewController` to create a `UISplitViewController` instead of a `UIViewController`, but I then need to assign the rootView with
```objective-c
[splitViewController setViewController:mainVC forColumn:UISplitViewControllerColumnSecondary];
```
which I can currently only do by copy pasting the entire `didFinishLaunchingWithOptions` and only replacing the assignment
```objective-c
    rootViewController.view = rootView;
```

In an attempt of making it easier for developers to use a native drawer in iOS, being able to override the assignment would make it easier.

bypass-github-export-checks

## Changelog:
[iOS] [ADDED] - added override method with default implementation

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

Test Plan: Tested on iPad iOS 16 simulator

Reviewed By: cortinico

Differential Revision: D46761919

Pulled By: cipolleschi

fbshipit-source-id: c3ece0170d732133edc08f220a2f9a67da93815a
2023-06-15 08:58:24 -07:00
Pieter Vanderwerff dc2037c0f1 Switch xplat prettier config to hermes plugin (#37915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37915

Enable the `prettier-plugin-hermes-parser` in xplat. This plugin enables the use of `hermes-parser` which is significantly faster than the current flow parser prettier bundles (improves formatting time by ~50%) and also brings support for the latest Prettier 3.0.0 printing logic for JS. This upgrade is required in order to enable upcoming Flow features that add new syntax.

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D46748891

fbshipit-source-id: 3775ef9afa7c04e565fa4fcf8ca5b410f49d35a1
2023-06-15 08:23:06 -07:00
louiszawadzki 54a5ff9745 Set iOS AppState to inactive when app is launching (#37690)
Summary:
When an iOS app launches, the current `AppStateStatus` that is returned is `"unknown"`.
However, `RCTSharedApplication().applicationState` returns `UIApplicationStateInactive` - which makes sense since the app is still showing its launch screen.
I suggest to return `"inactive"` instead of `"unknown"`, since it makes more sense and `"unknown"` is not mentioned in the [official documentation](https://reactnative.dev/docs/appstate).

I also edited the annotation for the `"inactive"` status type to make it more accurate.

bypass-github-export-checks

## Changelog:

[IOS] [CHANGED] - Set initial AppState status to "inactive" instead of "unknown"

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

Test Plan:
I played a bit with the `rn-tester` app to display the `AppStateExample` [component](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/AppState/AppStateExample.js). I did not manage to display its content, but I managed to render it and log from [its render function](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/AppState/AppStateExample.js#L84).
This is what I log in the `render` function:
![image](https://github.com/facebook/react-native/assets/8973379/76212f48-6d2e-4b14-b2a4-72c58e39bf3d)

Here is the log I saw before the change:
![image](https://github.com/facebook/react-native/assets/8973379/f3c56047-dfca-4bad-b676-0fc79b990dd9)

and after the change:
![image](https://github.com/facebook/react-native/assets/8973379/8de84b31-69a7-4547-b251-483ddde68e25)

Reviewed By: cortinico

Differential Revision: D46729548

Pulled By: cipolleschi

fbshipit-source-id: 18d2d606e0b77306811bd898b28858746c713e12
2023-06-15 07:45:30 -07:00
Riccardo Cipolleschi 09c95413dd Use fileExists in replace_hermes script (#37911)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37911

Thanks to [adrianha](https://github.com/adrianha) for spotting a bug in the script that replace the Hermes engine.
I miscopied the variable to check when there is no previous build file.

This change uses the right variable and improves also the messages printed to the user.

## Changelog:
[Internal] - Fix replace_hermes_version script using the right `fileExists` variable

Reviewed By: dmytrorykun

Differential Revision: D46762041

fbshipit-source-id: fdf3da6a598ecc657ee9313a2fa41e71c01d14ce
2023-06-15 07:27:57 -07:00
Riccardo Cipolleschi e6a2b2093c Revert D46719890: Re-enable direct debugging with JSC on iOS 16.4+
Differential Revision:
D46719890

Original commit changeset: 7fa5ae244577

Original Phabricator Diff: D46719890

fbshipit-source-id: 1e5478d0fd0d09a678111b133cc46c4bdc8fc282
2023-06-15 05:58:21 -07:00
Saad Najmi 5cf8f43ab1 Re-enable direct debugging with JSC on iOS 16.4+ (#37874)
Summary:
See: https://webkit.org/blog/13936/enabling-the-inspection-of-web-content-in-apps

As of iOS 16.4 and above, JSContexts are no longer inspectable by default. Without this, we cannot attach Safari Web Inspector to the JSContext, AKA, we can no longer direct debug. This is a simple change to re-enable that. I decided to extend the `availability` check to macOS and tvOS as I'm certain both out of tree platform forks will want this fix as well.

## Changelog:

[IOS] [FIXED] - Re-enable direct debugging with JSC on iOS 16.4+

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

Test Plan: I launched RNTester in an iOS 15, and iOS 16.4 simulator. I then verified that we can attach Safari Web inspector to both simulators' JSContexts.

Reviewed By: cortinico

Differential Revision: D46719890

Pulled By: huntie

fbshipit-source-id: 7fa5ae244577b7dbf3c9c16e65ad530cfc3e9cbd
2023-06-15 02:32:51 -07:00
Pieter Vanderwerff 894b62ce90 Fix component type references in xplat (#37903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37903

The name "component" in a function type contexts will be banned in future versions of Flow (the same other keywords like typeof are today). This diff renames the offending usages in xplat files.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D46748791

fbshipit-source-id: b8a51f63faad3b85232bd17a4bbe6ee7b0e4120f
2023-06-14 21:18:55 -07:00
Genki Kondo 8c9e37561f Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader (#37867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37867

No longer needed with D46574511.

Changelog:
[Internal] - Remove usage of passthroughAnimatedPropExplicitValues in ScrollViewStickyHeader

Reviewed By: rshest

Differential Revision: D46703731

fbshipit-source-id: 8c0f767083aa5f3791541f5ec05b5b1b625ab61f
2023-06-14 19:22:05 -07:00
Phillip Pan 0f688dc677 test runtime lifecycle callback (#37897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37897

Changelog: [Internal]

adding unit test for `instance:didInitializeRuntime`

Reviewed By: cipolleschi

Differential Revision: D46704036

fbshipit-source-id: 6418bae56ae465f6ed9addde75d4de5719f402bb
2023-06-14 17:14:02 -07:00
Phillip Pan 066d52b7a9 test host error callback (#37894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37894

Changelog: [Internal]

as title

Reviewed By: cipolleschi

Differential Revision: D46672582

fbshipit-source-id: b37f6840c2fa505a33988cbb4b89f66698b0c66c
2023-06-14 17:14:02 -07:00
Phillip Pan 1cac95d076 push error handling c++ parsing down (#37893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37893

Changelog: [Internal]

i just noticed we can push more C++ code down into RCTInstance, so let's do that! will make everything easier to test as well

Reviewed By: cipolleschi, RSNara

Differential Revision: D46672345

fbshipit-source-id: fcb878698ebc9a19714ba6ff94a5760efc830958
2023-06-14 17:14:02 -07:00
Phillip Pan 7d69cd5640 test callFunctionOnJSModule (#37898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37898

Changelog: [Internal]

as title

Reviewed By: cipolleschi

Differential Revision: D46672230

fbshipit-source-id: 8180f9dc26b44d50530fc440602acbafcf24df2f
2023-06-14 17:14:02 -07:00
Phillip Pan cc7da26f44 test RCTHost doesn't leak memory (#37896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37896

Changelog: [Internal]

example usage of the memory test utilities

Reviewed By: cipolleschi

Differential Revision: D46625917

fbshipit-source-id: 379a76e59fb58cc4e5972195df167c52170f5e4c
2023-06-14 17:14:02 -07:00
Phillip Pan e822056618 add test helpers for memory (#37895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37895

Changelog: [Internal]

i'm adding these helpers so we can test that our objects aren't leaking memory

Reviewed By: cipolleschi

Differential Revision: D46625916

fbshipit-source-id: d811336ae3b0ac420b81832c258d5573c20a5bc7
2023-06-14 17:14:02 -07:00
Phillip Pan 75d34407c1 test RCTInstance invalidation on RCTHost restart (#37899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37899

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D46547012

fbshipit-source-id: 9b157678c474120aeca3896942e368678cb5b8eb
2023-06-14 17:14:02 -07:00
Genki Kondo b0485bed09 Return final animation values to JS when animation completes (#37886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37886

When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect

**This diff:**
- Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`.

Changelog:
[iOS][Changed] - return animated values to JS for natively driven animations

Reviewed By: rshest

Differential Revision: D46709214

fbshipit-source-id: f16f36a05cd052d1120ba6e04ec6dd72eb4a98e5
2023-06-14 13:32:50 -07:00
Riccardo Cipolleschi 875f6a7086 Restore installing DevSupport to all the config
Summary:
CircleCI was broken because we changed how the `React-Core/DevSupport` pod is installed.

## Changelog:
[Internal] - Restore the installation of React-Core/DevSupport

Reviewed By: cortinico

Differential Revision: D46734714

fbshipit-source-id: 9b8c28837f0485ed0df2f94e417f89b5f0077c7d
2023-06-14 12:03:26 -07:00
tarunrajput 202b965fed add emitObjectProp in parser primitives (#37872)
Summary:
Part of https://github.com/facebook/react-native/issues/34872
> Create a function emitObjectProp(name: string, optional: boolean) in parser-primitives.js. Factor out the code from [Flow](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/flow/components/events.js#L84-L93) and [TypeScript](https://github.com/facebook/react-native/blob/d8ced6f8953cd896471983714e722caf50783960/packages/react-native-codegen/src/parsers/typescript/components/events.js#L87-L96) into that function. Use that function in the original call site.

## 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][Changed]: Add emitObjectProp in parser primitives

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

Test Plan:
```shell
yarn test react-native-codegen
```

Reviewed By: cipolleschi

Differential Revision: D46715634

Pulled By: rshest

fbshipit-source-id: 6c58002df132bc5b05a10a19f8611819d7179cb1
2023-06-14 11:53:02 -07:00
Ruslan Shestopalyuk 44755726ed Performance.measure: handle the case with a single startMark argument correctly (#37888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37888

# Changelog:
[Internal] -

There was one particular permutation of input arguments to `Performance.measure` that wasn't handled correctly on the native side, namely when there is only the start mark argument present, but not the end time/mark, e.g.:
```
Performance.measure('myMeasure', 'someStartMark');
```

In this case, [according to the standard](https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure), the end time should be taken as the current one:
> The end timestamp is one of:
> ...
>  -the value returned by Performance.now(), if no end mark is specified or can be determined from other values.

It was taken as 0 instead, making the total duration negative and consequently getting it filtered out by the default `durationThreshold` of 0.

I've added a corresponding missing clause in the native unit tests. This also required a slight extension to the `PerformanceObserver` API to allow for mocking the current timestamp provider.

Reviewed By: rubennorte

Differential Revision: D46728261

fbshipit-source-id: bd904d9c93707fa04c1a0ddb30802691e253c106
2023-06-14 11:20:10 -07:00
Pranav Yadav 377a8b70ee Add README to RN Template App, added when npx react-native@latest init <AppName> (#37521)
Summary:
[skip-ci]
I noticed that; when a _new_ RN App is created using RN CLI there is ***NO*** *README* file added to the project.
Having a simple README file explaining what type of project it is, for example how other web projects do it, such as long lived `create-react-app`, now widely used `create-next-app`, etc.

Why not for React Native App then?

This PR; Adds README file to RN Template App , which should be added to the project when a new project is created using RN CLI.

### Website PR: https://github.com/facebook/react-native-website/pull/3732 🚀😇

bypass-github-export-checks

## Changelog:

[INTERNAL] [ADDED] - Add README to RN Template App 

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

Test Plan: - The README file should be included in the newly created RN App using RN CLI

Reviewed By: NickGerleman

Differential Revision: D46075719

Pulled By: cipolleschi

fbshipit-source-id: efcccc09d72c57a065b36de6e787594082000e15
2023-06-14 10:33:23 -07:00
Riccardo Cipolleschi daa99fe5e7 Cleanup, remove the PRODUCTION flag (#37882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37882

After some progressive changes, we can finally remove the PRODUCTION flag from the codebase.

## Changelog:
[iOS][Removed] - Remove PRODUCTION flag from iOS build logic

Reviewed By: cortinico, dmytrorykun

Differential Revision: D46726208

fbshipit-source-id: 407268779be8de32c5a6c15ba220a60b7cb9ced7
2023-06-14 10:10:16 -07:00
Riccardo Cipolleschi 332be0f0c8 download hermes-engine when the configuration change (#37850)
Summary:
Currently, we ask users to reinstall the pods using the `PRODUCTION` flag when they want to either profile their app or prepare a release.

This way of working with the Release mode is not standard. One of the reason why we introduced it was to provide a different binary for Hermes and reinstalling the pods was the quickest way.

With this change, we are deferring the decision on when Hermes should be installed for apps to the moment where the app is actually build by the system.

These changes are not applied to Nightlies, when a specific tarball is passed to the cocoapods using the `HERMES_ENGINE_TARBALL_PATH` env var, and when hermes is built from source as in these scenarios we are usually not interested in building for Release.

The system is also smart enough not to redownload the tarball if the configuration does not change. It assumes that the default configuration when the pods are installed for the first time is Debug.

## Changelog:

[IOS] [CHANGED] - Download the right `hermes-engine` configuration at build time.

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

Test Plan:
- CircleCI green for the Release template jobs
- Tested locally modifying the `hermes-utils` to force specific versions.
- Tested locally with RNTestProject

Reviewed By: dmytrorykun

Differential Revision: D46687390

Pulled By: cipolleschi

fbshipit-source-id: 375406e0ab351a5d1f5d5146e724f5ed0cd77949
2023-06-14 10:10:16 -07:00
Ruslan Shestopalyuk b3cc19ce64 Add @Nullable annotations to ViewUtils (#37877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37877

# Changelog:
[Internal] -

A quick follow-up to https://github.com/facebook/react-native/pull/37851

There was a suggestion to add `Nullable` annotations, but the change had already landed at that point, so putting up another one.

Reviewed By: cortinico

Differential Revision: D46721095

fbshipit-source-id: 7361dec852160126c861ee2b22db240e586cc452
2023-06-14 09:47:52 -07:00
Riccardo Cipolleschi de6bfec82a Disable bitcode from Hermes (#37868)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37868

Thanks to the help of the community, we discovered that we can safely disable the bitcode setting in Hermes.

Community testing reported that the tarball size get reduced from ~500 Mb to ~25 Mb, a x20 reduction

## Changelog:
[iOS][Changed] - Disabled bitcode for Hermes prebuilts

Reviewed By: dmytrorykun

Differential Revision: D46704633

fbshipit-source-id: a6624110f27eb9f18e6b57ed28aa2f86804d45e7
2023-06-14 07:46:07 -07:00
Ethan Gill af99a6890b Update TODO task numbers for Binding.cpp (#37844)
Summary:
Changelog: [Internal]

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

T132338609 (open) is the Android equivalent of T130208323 (closed)

Reviewed By: javache, luluwu2032

Differential Revision: D46682202

fbshipit-source-id: 8fb5061367af8b62d2889ccbd5f3e90824d9302d
2023-06-14 05:21:49 -07:00
Intl Scheduler 168f8a526a translation auto-update for i18n/anna.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722124

fbshipit-source-id: 7f205866265c1a0fdf738a6ea64dc909293b6f85
2023-06-14 04:52:51 -07:00
Intl Scheduler 406fb0edcf translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722119

fbshipit-source-id: 4377e640f5e8337ac67734b4d6bf244a22c9c24e
2023-06-14 04:52:51 -07:00
Intl Scheduler 2eb6e975e1 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722111

fbshipit-source-id: 867dec5275f09c568c8de2ea54ce7ceb5441c73e
2023-06-14 04:52:51 -07:00
Intl Scheduler 994547a9f4 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722128

fbshipit-source-id: 18b2bfef14410db7655c9af8dfd102feafc395eb
2023-06-14 04:52:51 -07:00
Intl Scheduler d1f158b103 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722113

fbshipit-source-id: 2c9ccb5614b51bc33f9915b441a4731b0cec4979
2023-06-14 04:52:51 -07:00
Intl Scheduler 7caa327643 translation auto-update for i18n/portal_workplacelive_on_portal.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722126

fbshipit-source-id: cbdaa8940a1743482f38e05d24b93371551cebd1
2023-06-14 04:52:51 -07:00
Intl Scheduler 06b2c7eb55 translation auto-update for i18n/oculus-mirage.config.json on master
Summary:
Chronos Job Instance ID: 1125907899375459
Sandcastle Job Instance ID: 36028797991662582
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46722114

fbshipit-source-id: 9259e4403318f1cecd3fc1cf4ac145e7eaec3b63
2023-06-14 04:52:51 -07:00
jaroslawmichalik af4a0336e9 Convert JavaOnlyArrayTest to Kotlin (#37855)
Summary:
Part of https://github.com/facebook/react-native/issues/37708

## Changelog:
[Internal] [Changed] - Convert JavaOnlyArrayTest to Kotlin

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

Reviewed By: cortinico

Differential Revision: D46697501

Pulled By: rshest

fbshipit-source-id: edc3906c41af4936eacdeb95502cc62f80ae89c8
2023-06-14 02:07:53 -07:00
Intl Scheduler b03c5affdb translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907899298431
Sandcastle Job Instance ID: 974117684
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D46712473

fbshipit-source-id: 59819cf17e00294b9ca34f71a5a8675458f7795c
2023-06-13 20:27:17 -07:00
Genki Kondo c870a529fe Trigger rerender on animation complete (#37836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37836

When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect.

Prior diffs ensure that upon completion of natively driven animations, the final values are synced to the JS side AnimatedValue nodes. In this diff, on completion of a natively driven animation, AnimatedProps.update() is called, which in turn calls the value update callback on AnimatedProps, which [triggers a rerender (via setState)](https://www.internalfb.com/code/fbsource/[566daad5db45807260a8af1f85385ca86aebf894]/xplat/js/react-native-github/packages/react-native/Libraries/Animated/useAnimatedProps.js?lines=80) which has the effect of pushing the latest animated values to Fabric.

Alternative considered was using setNativeProps, but that approach was dropped as setNativeProps was only introduced to make migration easier and should not be used for new code, as per sammy-SC.

Changelog:
[General][Fixed] - When animating using native driver, trigger rerender on animation completion in order to update Pressability responder regions

Reviewed By: javache

Differential Revision: D46655246

fbshipit-source-id: b008c24f9d016be4b145ba799fffae5f55fab787
2023-06-13 18:33:55 -07:00
David Vacca 0c520e0f43 Back out "Move BridgelessReactPackage to com.facebook.react package"
Summary:
Original commit changeset: ac172d22a6d7

Original Phabricator Diff: D46408934

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D46699758

fbshipit-source-id: aa428924eff28e188f963c84c5b7d3a036b9ccf7
2023-06-13 17:00:20 -07:00
Vincent Riemer 9e50185d97 Back out "Add plumbing/boilerplate for an iOS implementation of the gotpointercapture and lostpointercapture events" (#37861)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37861

Changelog: [Internal] - Back out of "Add plumbing/boilerplate for an iOS implementation of the `gotpointercapture` and `lostpointercapture` events"

Original commit changeset: c9da5691d399

Original Phabricator Diff: D44977499

This diff appears to be causing issues as reported on T155721480 related to the file `RawPropsKeyMap.cpp` which, while I haven't figured out exactly why this is occurring, confirmed that this diff is causing the issue. In order to buy myself some more time as I diagnose this I'm backing the changes out in this diff.

Reviewed By: adanoff

Differential Revision: D46691035

fbshipit-source-id: 383b46732a3fad24a50e18ab948c96ce9bfe429e
2023-06-13 16:39:08 -07:00
Rubén Norte a53e81ead9 Define FabricUIManager as an interface instead of as an object (#37849)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37849

The typing for `FabricUIManager` makes more sense as an interface (the same way we type native modules) than as an object, as the underlying implementation used to be a host object where properties were actually not enumerable, etc. This replaces that with a definition more aligned with how we actually use it.

This also allows us to extend the mock with testing specific methods more easily (like in D45278720).

Changelog: [internal]

Reviewed By: javache

Differential Revision: D46684044

fbshipit-source-id: 379cc3f95a7cbae733ed6a3a57e68b33efd21d34
2023-06-13 16:36:04 -07:00
Rubén Norte b46992de8a Type mock.contexts correctly in Jest (#37847)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37847

Jest supports accessing the contexts used to call mock functions (the `this` value) but we're not typing that correctly in the definitions in React Native. This changes that.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D46684043

fbshipit-source-id: ff121e0726748788591e7d061a39fde238c1ddbe
2023-06-13 16:36:04 -07:00
Aymane Missouri 1e332b8630 convert HeaderUtilTest to kotlin (#37829)
Summary:
This PR converts HeaderUtilTest.java to Kotlin as requested in https://github.com/facebook/react-native/issues/37708.

## Changelog:

[INTERNAL] [CHANGED] - Convert HeaderUtilTest to Kotlin

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

Test Plan:
Run ./gradlew :packages:react-native:ReactAndroid:test.
All tests should pass.

Reviewed By: mdvacca

Differential Revision: D46647152

Pulled By: cortinico

fbshipit-source-id: a05108c4cae28526ac55f4f273673221e3ff4cf1
2023-06-13 16:20:02 -07:00
Nick Gerleman a7e5c96a3d Localize Talkback strings (#37856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37856

These strings are spoken to the user when using an ascessibility role or state not natively supported by Talkback.

We can enable these for translation by removing flags to disable localization, and adding descriptions to each string. These are derived from MDN for ARIA (used for iOS strings), along with Android and iOS documentation.

Note that this was explicitly disabled as part of D15087192 because of creating spam which was hitting the GitHub repo, but when translation was enabled for the dev menu, this ended up being a non-issue after initial translation. And we really do want these to be localized.

Changelog:
[Android][Fixed] - Localize Talkback strings

Reviewed By: cortinico

Differential Revision: D46692127

fbshipit-source-id: 6da4a181e03f46bad850e4385b94155695a142a8
2023-06-13 15:50:01 -07:00