Commit Graph
27900 Commits
Author SHA1 Message Date
Luna Wei 31eb235a6a Fix set-rn-version (#37854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37854

Changelog: [Internal] - Fix `saveFiles` in set-rn-version, incorrect function invoke

Reviewed By: NickGerleman

Differential Revision: D46582168

fbshipit-source-id: 944e182a88a1aa79bbf47d36ef8395c21dfefb24
2023-06-14 07:44:51 -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
Nick Gerleman 75a5ec05bd Descriptive CocoaPods error if CMake is not installed (#37839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37839

The CocoaPods build assumes that a `cmake` command is present during `pod install`. It acts gracefully if it is not and propagates an empty string path, leading to a confusing error during the build, and requiring a `pod deintegrate` after CMake is installed because of when the binary is set.

This replaces the usage with `Pod::Executable::which!`, the built-in CocoaPods method of finding an executable from `PATH` which errors out the build if not found. This will cause a failure during `pod install`, when we are looking for the command, and specify that `cmake` is the missing executable.

This branch is only taken for source builds, so this will not show up in the cases where we do not need CocoaPods.

Changelog:
[iOS][Fixed] - Descriptive Cocoapods Error if CMake is not installed

Reviewed By: cipolleschi

Differential Revision: D46670007

fbshipit-source-id: d508743d51f9b99e1bce7d4d3cef6395d5abf46d
2023-06-13 14:38:13 -07:00
Phillip Pan a4dae044df test RCTInstance initialization (#37860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37860

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D46547013

fbshipit-source-id: 2b1593799ce2b5d29e7ea6df4373ff6c92b51065
2023-06-13 14:24:12 -07:00
Phillip Pan be2b0e2d8a lift out ShimRCTInstance to RCTTestUtils (#37859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37859

Changelog: [Internal]

as title

Reviewed By: cipolleschi

Differential Revision: D46547014

fbshipit-source-id: ca89d659d24fa0fcef1c39fc47fc758cee34f7d8
2023-06-13 14:24:12 -07:00
Phillip Pan 03c978d2cc add unit test for start method on RCTHost (#37858)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37858

Changelog: [Internal]

in this diff, i add a test that runs `start` validates that the lifecycle `hostDidStart:` is called as a result.

notably, i created a custom shim for `RCTInstance` to completely stub out its behavior.

Reviewed By: cipolleschi

Differential Revision: D46508066

fbshipit-source-id: e815aee64d06b160f2cbdc52720a8e698d11c680
2023-06-13 14:24:12 -07:00
Luna Wei d631e0d9e9 test-e2e-local dont launch emulator if device connected (#37862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37862

Changelog: [Internal] - Don't launch android emulator if you already have a device connected.

Reviewed By: cortinico

Differential Revision: D46688735

fbshipit-source-id: 1256792f96ef6989465e7cbe43385469502b46fe
2023-06-13 13:28:12 -07:00
Ruslan Shestopalyuk 922681f15b Add getTestId into views/common (#37851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37851

## Changelog
[Internal] -

The `testId` value in practice can be used for other things than e2e tests - e.g. there is already a use case for Accessibility, but also we may want to log it as an extra data point with e.g. performance metrics.

This exposes a helper function to extract a `testId` from a view.

Differential Revision: D46684365

fbshipit-source-id: 17602307c468a906ef4d0679e826dbcd1eb651b7
2023-06-13 11:54:54 -07:00
Nick Gerleman 09d357c0df Fix undefined symbols _FBcoreLocalexxHash48 and _RCTLocalizedStringFromKey in OSS (#37838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37838

We see a linker failure in the OSS build because our header exports C-style functions (not ObjC), that Objective C will assume are C ABI, but we build them as C++ functions.

Internally these are all marked as `extern "C"`, so to not deviate I did the same here to expose these always as plain C functions.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D46671506

fbshipit-source-id: 5b3005074303763d55801c4d24ac9250b96d45ba
2023-06-13 08:06:24 -07:00
Gabriel Donadel b5f52216b0 Add getObjectProperties function to Parser (#37789)
Summary:
[Codegen 128] This PR add a `getObjectProperties` function to the Parser interface, which returns the properties of an object represented by a type annotation as requested on https://github.com/facebook/react-native/issues/34872

## Changelog:

[INTERNAL] [ADDED] - Add getObjectProperties function to codegen Parser

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

Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green

Reviewed By: cipolleschi

Differential Revision: D46584748

Pulled By: rshest

fbshipit-source-id: 7f509b6f8754472a9b3048214345dc94265604ba
2023-06-13 07:45:47 -07:00
Luna Wei e82bb7beb5 rn-ci-e2e-test CircleCI using wrong parameters (#37852)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37852

Changelog: [Internal] - rn-ci-e2e-test is running on CircleCI but has been passing in the wrong parameter with `--version` -- which didn't evaluate the script, it would early exit as `--version` is a reserved parameter in yargs.

You can see if you do `node scripts/set-rn-version.js --help`

When I fixed this [here](https://www.internalfb.com/diff/D46511840?dst_version_fbid=827076485041949&transaction_fbid=625055476222975), forgot to pass `build-type` parameter

This will fix the broken testjs e2e builds here: https://app.circleci.com/pipelines/github/facebook/react-native/25703/workflows/11a41ba1-c731-44e4-b515-a8b209ae0848/jobs/732035

Reviewed By: rshest

Differential Revision: D46672741

fbshipit-source-id: 4a189127e4d0545192a03c1e7abc995dff6f83ae
2023-06-13 07:32:13 -07:00
Gabriel Donadel 9c9945a5bf Revert "fix: border width top/bottom not matching the border radius" (#37840)
Summary:
In an effort to fix https://github.com/facebook/react-native/issues/37753, this PR reverts the changes introduced by https://github.com/facebook/react-native/commit/cd6a91343ee24af83c7437b3f2449b41e97760e9 and https://github.com/facebook/react-native/commit/1d5103227851ab92de889d5e7e910393b5d8743a so border-radius width calculations work as expected

## Changelog:

[ANDROID] [FIXED] - Fix border-radius width calculations

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

Test Plan:
Test border colors along with border-radius through RNTester
<img width="538" alt="image" src="https://github.com/facebook/react-native/assets/11707729/4b148d4b-35dc-4737-be00-c5ff156b0865">

Reviewed By: dmytrorykun

Differential Revision: D46684071

Pulled By: cipolleschi

fbshipit-source-id: cf7a80d0d63009b457f03d690b632e332a9b4a02
2023-06-13 07:29:02 -07:00
Pieter De Baets 3006a33baf Remove unused CookieHandler from ForwardingCookieHandler (#37775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37775

Most of this code was made irrelevant when we dropped support for API < 21 in D24548084.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D46557892

fbshipit-source-id: 6af85a24d476fe1010eb62126b4c5e9df14a0ea2
2023-06-13 05:30:20 -07:00
TatianaKapos efc5f73f27 Specify float value in ParagraphLayoutManager (#37660)
Summary:
React-Native-Windows had to override this file because we treat certain warning as errors. This fix adds in the "f suffix" to remove the unspecified float error.

## Changelog:
[GENERAL] [FIXED] - Specify float value in ParagraphLayoutManager

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

Test Plan: Tested with RNW tests

Reviewed By: NickGerleman

Differential Revision: D46560099

Pulled By: javache

fbshipit-source-id: de593cbe60677533f5194ab8fd7e650607b5829e
2023-06-13 05:30:16 -07:00
David Vacca 3f7507bae9 Move BridgelessReactPackage to com.facebook.react package (#37697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37697

Move BridgelessReactPackage to com.facebook.react package.
This is necessary because BridgelessReactPackage is a core package that needs to be part of RN (and should not be re-defined by all apps)

I will revisit naming in a later diff

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico, philIip

Differential Revision: D46408934

fbshipit-source-id: ac172d22a6d70c9d33d2e119da93b25736d85383
2023-06-12 20:19:06 -07:00
David Vacca 8351b08088 Fix lint warnings (#37699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37699

Fix lint warnings

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico, philIip

Differential Revision: D46407027

fbshipit-source-id: 80acd2a811f712be6a4b228ec3450dcbdf0d3ce3
2023-06-12 20:19:06 -07:00
David Vacca f821797e51 Reduce visibility of NativeModule methods in ReactHost (#37692)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37692

In this diff I'm reducing visibility of NativeModule methods in ReactHost (from public to package)

bypass-github-export-checks

changelog: [internal] ineternal

Reviewed By: cortinico, philIip, RSNara

Differential Revision: D46296987

fbshipit-source-id: d50ff9f855c71ee9565f0bc81ffe8be2fd0e2368
2023-06-12 20:19:06 -07:00
David Vacca 579d11ca9e Rename ReactHost.preload -> ReactHost.start (#37694)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37694

Rename ReactHost.preload -> ReactHost.start to adhere to stable api

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D46294685

fbshipit-source-id: 683683a557c28759db8925e0c0dd6629463511eb
2023-06-12 20:19:06 -07:00
Vincent Riemer 001e182f08 Add PointerEventCaptureMouse WPT test (#37603)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37603

Changelog: [Internal] - Add PointerEventCaptureMouse WPT test

This diff introduces a port of the wpt test "pointerevent_capture_mouse" (https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_capture_mouse.html) in preparation of validating our pointer capture implementation.

Reviewed By: adanoff

Differential Revision: D46230497

fbshipit-source-id: ebdfaad23935b96d35da98e30bd326ae1b50759a
2023-06-12 19:27:14 -07:00
Vincent Riemer 1ae1cc01ab Add plumbing/boilerplate for an iOS implementation of the gotpointercapture and lostpointercapture events (#37602)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37602

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

This diff simply adds the boilerplate necessary to hook up the `gotpointercapture` and `lostpointercapture` events to the fabric iOS touch handler. This diff does not contain any actual implementation of their behavior as that will occur in future diffs.

Reviewed By: yungsters

Differential Revision: D44977499

fbshipit-source-id: c9da5691d399f612f1980c7692c4ca62877901a9
2023-06-12 19:27:14 -07:00
Bernhard Owen Josephus 83d7a48a46 Resubmit D46501420 (#37790)
Summary:
Multiline text in Android shows some extra space. It's easily noticeable when you set the text `alignSelf` to `flex-start`. This is because we are using `layout.getLineWidth` which will include trailing whitespace.
<img width="300" alt="image" src="https://github.com/facebook/react-native/assets/50919443/8939092b-caef-4ad8-9b34-2ccef5d20968">

Based on Android doc, `getLineMax` exclude trailing whitespace.
<img width="625" alt="image" src="https://github.com/facebook/react-native/assets/50919443/0b32e842-5fab-4fc7-8fd9-299877b9c553">

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width

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

[ANDROID] [FIXED] - Exclude trailing whitespace from newline character on measuring text line width

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

Test Plan:
After applying the changes:
<img width="300" alt="image" src="https://github.com/facebook/react-native/assets/50919443/bfbf52b0-7e7d-4c89-8958-6af38d8bc1c7">

Code snippet:
```
<Text style={{backgroundColor: 'red', alignSelf: 'flex-start', color: 'white'}}>
    1{'\n'}
</Text>
```

Reviewed By: cortinico

Differential Revision: D46586516

Pulled By: NickGerleman

fbshipit-source-id: 3ea9c150ad92082f9b4d1da453ba0ef04b09ce51
2023-06-12 15:28:56 -07:00
Nick Gerleman 1f45459414 Localize Voiceover strings in Fabric (#37679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37679

This reuses the localizations from the last diff on the stack, on top of the new logic added with D45797554.

Changelog:
[iOS][Fixed] - Localize Voiceover strings in Fabric

Reviewed By: philIip

Differential Revision: D46426571

fbshipit-source-id: 7e6adc9eff5e6387299e95b6ea5eba8e2607386a
2023-06-12 15:22:05 -07:00
Nick Gerleman 0e99b19257 RCTLocalizedString: Replace usages of AccessibilityResources (#37680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37680

Changelog:
[iOS][Fixed] - Localize Voiceover strings in Paper

## Stack

React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized.

This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS.

Reviewed By: cipolleschi

Differential Revision: D46415273

fbshipit-source-id: 4174e38cef4eee251fa2d59e10763cde8e8681ad
2023-06-12 15:22:05 -07:00
Nick Gerleman f83ca12c40 RCTLocalizedString: Extract FBTs to bundle for CocoaPods (#37678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37678

## Stack

React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized.

This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS.

Reviewed By: cipolleschi

Differential Revision: D46414630

fbshipit-source-id: 1137182dbbd89d959b3d143ce534229968bdb8f7
2023-06-12 15:22:05 -07:00
Nick Gerleman 9b47148dd8 RCTLocalizedString: Add RCTLocalizedString (#37677)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37677

## Stack

React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized.

This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS.

Reviewed By: shwanton

Differential Revision: D46414631

fbshipit-source-id: 567a3500d39c1cb830e050edb1a644e3d8d502d3
2023-06-12 15:22:05 -07:00
Nick Gerleman 15bdaefe7b RCTLocalizedString: Dirsync FBXXHashUtils to OSS (#37676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37676

## Stack

React Native on iOS adds strings to Voiceover interactions to supply more information to users . Internally, and out-of-the-box externally, these are today always announced in English instead of being localized.

This stack adds a limited new internal API, `RCTLocalizedString(string, description)` to allow auto-translated strings which are consumed by both Meta and OSS.

Reviewed By: javache

Differential Revision: D46399962

fbshipit-source-id: 2188a1faba9339cff00f897990b727febc178361
2023-06-12 15:22:05 -07:00
Facebook Community BotandFacebook Community Bot 2eba6ab5ac Re-sync with internal repository (#37831)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2023-06-12 17:34:52 -04:00
Phillip Pan a300a35f28 introduce RCTTestUtils (#37810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37810

Changelog: [Internal]

in this change, i introduce a helper file for swizzling selectors that can be used for building custom shims and fakes. i tried putting this in the cxx target, but i struggled a lot with managing the dependencies and understanding the extra behavior that was happening from being in a `rn_xplat_cxx_library`. this file is also not obj-c++, so i feel like we should decouple if possible.

it does seem like this is a new practice i'm introducing, so let me know if there's something that i'm missing.

Reviewed By: cipolleschi

Differential Revision: D46507803

fbshipit-source-id: 9be63d992b9838e9a98ee0c1c6d684fc59c3fc80
2023-06-12 13:37:39 -07:00
Phillip Pan ee38c4a40c introduce build boilerplate for ios unit tests (#37811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37811

Changelog: [Internal]

i am looking to add ios unit tests to venice and this is the first unit test suite that will test native ios code in the new architecture afaik, so i wanted to open this up to discussion.

currently, all `XCTest` in `react-native-github` are coupled with the `RNTester` target. my main qualm with this is i am concerned that it won't scale well. currently we have only ~30ish tests but ultimately if we want a proper testing suite, surely this count will be in the hundreds and that won't be able to reasonably live in a single test target.

however, the trade is that this test will not show up in RNTester. i have added a unit test to RNTester before in D31949237, however the experience was extremely painful as i had to manually update the `project.pbxproj` to include my file, and i had to manually determine what hex value was the next one (for whatever reason, this doesn't increment at the endian...).

i am wondering if we can treat the current unit testing experience in RNTester as pretty much maintenance mode and start thinking of a improved version starting with something more modular like this.

Reviewed By: cipolleschi

Differential Revision: D46467229

fbshipit-source-id: 09de9cf8bc5f8b9c86abcaf7750a6f63686d8d1a
2023-06-12 13:37:39 -07:00
Phillip Pan 466742c9ce rename ReactInstanceTest directory from hermes to cxx (#37812)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37812

Changelog: [Internal]

I would like to add iOS unit tests, but this testing directory has a subdirectory based on features and not platform, which makes the organization challenging, so i'm moving it to a more aptly named directory.

Reviewed By: javache

Differential Revision: D46467041

fbshipit-source-id: f2ba714dc79ecb509b86b4708320c68235354240
2023-06-12 13:37:39 -07:00
Nicola Corti 3a246ed024 Remove CallInvoker parameter from toJs method in Codegen (#37832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37832

This parameter is currently unused and is causing Android builds to fail
as they compile with `-Wall`

This is a follow-up to https://github.com/facebook/react-native/pull/37454/ as that PR updated only the `fromJs` and not the `toJs` method as well.

Changelog:
[Internal] [Changed] - Remove CallInvoker parameter from toJs method in Codegen

Reviewed By: rshest

Differential Revision: D46647110

fbshipit-source-id: 1f3e22aca7a3df11ac02b5c4b89c9311b8b1798c
2023-06-12 12:46:00 -07:00
Genki Kondo 48cdc603f5 Back out "When animating using native driver, trigger rerender on animation completion" (#37820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37820

Original commit changeset: 185471b28f5f

Original Phabricator Diff: D46574511

Changelog: [internal]

Reviewed By: jehartzog

Differential Revision: D46629553

fbshipit-source-id: 7c8bc7970006643459a3b9c8613009614dcd3886
2023-06-12 12:09:45 -07:00
Rubén Norte c97dcc2de5 Cache properties in global.nativeFabricUIManager when accessed through FabricUIManager.getFabricUIManager (#37796)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37796

Changelog: [internal]

`global.nativeFabricUIManager` is defined as a host object in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp and every time a property of that object is accessed, the value is recreated by the host object (like in https://github.com/facebook/react-native/blob/5cc8ceeae210f2f23ef18ded7b7b614682f0d67b/packages/react-native/ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp#L179). This is problematic because we're continuously creating copies of those methods every time we access them.

As a quick solution (until we migrate the whole native implementation to a regular object with eagerly defined properties or to a TurboModule), this creates a proxy object in JavaScript to cache all properties.

Reviewed By: rshest

Differential Revision: D46592010

fbshipit-source-id: 38f233becd2ca130fa331d61f99ba54fbf706e13
2023-06-12 11:02:22 -07:00
Rubén Norte 5fa1d8287d Validate number of arguments passed to UIManagerBinding methods (#37783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37783

We're not checking the number of arguments received before accessing the `arguments` array in JSI methods in `UIManagerBinding`, which could cause access to garbage values. This fixes that by adding a check in all methods to ensure the number of arguments received is at least the arity of the function.

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D46564580

fbshipit-source-id: 7012e0d6fb12c5024e4d6a4c0fb7a8c00263ccac
2023-06-12 11:02:22 -07:00