Commit Graph

12270 Commits

Author SHA1 Message Date
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
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
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
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
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
Rob Walker 216865cdb7 feat: Support iOS 17 text content types (#38354)
Summary:
While setting up a credit card form in RN, I discovered that iOS 17 supports a number of new content types ([`UITextContentType` docs](https://developer.apple.com/documentation/uikit/uitextcontenttype?language=objc)). In the docs these are marked with the `Beta` flag.

Setting up the new content types is relatively straightforward, but a change is required in https://github.com/facebook/react-native-deprecated-modules to update the `TextInput` prop types. ~~I will open a PR in that repo shortly.~~ I have [opened a PR](https://github.com/facebook/react-native-deprecated-modules/pull/23) to update the prop types. ~~Once that PR is merged, a version bump for that dependency will need to be added to this PR.~~ The PR is merged and the dependency in this PR has been updated.

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [ADDED] - Added support for iOS 17+ text content types

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

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

Test Plan: The `rn-tester` app builds and runs successfully. I have added a few new examples of inputs using the new text content types.

Reviewed By: javache

Differential Revision: D47554161

Pulled By: philIip

fbshipit-source-id: 8d4414dc6229063f81164f2d8727921c8294c92e
2023-07-20 20:31:04 -07:00
Vincent Riemer 0527aea3d9 Add basics of pointer event interception (#38474)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38474

Changelog: [Internal] - Add basics of pointer event interception

This diff adds the scaffolding for intercepting Pointer Events (without actually doing anything with them yet). Most notably introduces the logic of determining which events are of the PointerEvent type and downcasting to the type so the interceptor can properly work with the typed properties.

Originally my plan was to leverage `dynamic_cast` but sandcastle's signals let me know that there exists internal apps (particularly VR ones) which don't have RTTI enabled — so to avoid that usage I introduced an additional abstract method on EventPayload which lets subclasses identify themselves cheaply and then subsequently leverage `static_cast`.

Reviewed By: NickGerleman

Differential Revision: D47443773

fbshipit-source-id: 3671285c0413a60475d51318e209376f8a2790ed
2023-07-20 16:23:36 -07:00
Everaldo Junior caa8dbf0e9 fix: unified Share Action types (#38351)
Summary:
This pull request simplifies the type and fixes a TypeScript object destructuring problem by combining the ShareSharedAction and ShareDismissedAction types into a single ShareAction type. Enabling proper access to the activityType property without TypeScript errors.

## Changelog:
[INTERNAL] [FIXED] -  Unified ShareSharedAction and ShareDismissedAction into ShareAction. Resolved TypeScript issue with object destructuring.

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

Test Plan:
With the current typing:
![image](https://github.com/facebook/react-native/assets/7197169/40b43c40-ed6c-4b1a-8f43-0bb853920e20)

With the proposed solution:
![image](https://github.com/facebook/react-native/assets/7197169/af9e601b-780c-4c69-9a8c-11771a125a0c)

Reviewed By: NickGerleman

Differential Revision: D47527426

Pulled By: philIip

fbshipit-source-id: 9830cd993596bbac2dc07d9f37ca20b35f582156
2023-07-20 16:04:58 -07:00
Neil Dhar 2669f8c384 Fix setting array elements through JSI (#38521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38521

`HermesRuntimeImpl::setValueAtIndexImpl` directly called
`setElementAt`, which meant that it would not handle index-like
properties properly. Use `putComputed_RJS` instead, which will check
for such properties.

Reviewed By: avp

Differential Revision: D47617445

fbshipit-source-id: c3505670960bd6223bd014f138cee191267a5315
2023-07-20 13:01:46 -07:00
hublot b675667a47 Replace RCTLocalAssetImageLoader to RCTBundleAssetImageLoader (#37232)
Summary:
From the video below, we can see that the UI thread has dropped many frames, and it would become worse if there are multiple images.

If an image is located in the sandbox of the disk, we cannot load it using `RCTLocalAssetImageLoader` because `RCTLocalAssetImageLoader.requiresScheduling` is set to true, which loads the data on the UI thread and causes main thread stuttering. This will affect libraries such as `react-native-code-push` and others that save images to the sandbox of the disk.

Therefore, we should replace `RCTLocalAssetImageLoader.canLoadImageURL` from `RCTIsLocalAssetURL(url)` to `RCTIsBundleAssetURL(url)`. Similarly, we should rename the entire `RCTLocalAssetImageLoader` file with `RCTBundleAssetImageLoader`, which ignores images in the disk sandbox. And finally these images will be loaded from `NSURLRequest`, and our UI thread will run smoothly again.

https://user-images.githubusercontent.com/20135674/236368418-8933a2c6-549c-40d3-a551-81b492fe41d5.mp4

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

[IOS] [Breaking] - Replace `RCTLocalAssetImageLoader` to `RCTBundleAssetImageLoader`

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

Test Plan:
Test Code:
```javascript
constructor(props) {
  super(props)
  this.state = {
    bundle_image: require('./large_image.png'),
    sandbox_image: '',
    source: null,
    isLoading: false,
  }
}

render() {
  console.log('render', this.state)
  return (
    <View style={{ flex: 1, padding: 50, backgroundColor: 'white'}}>
      <View style={{ flexDirection: 'row', alignItems: 'center', height: 70}}>
      {
        [{ title: 'Save Image To SandBox', onPress: () => {
          let image = Image.resolveAssetSource(this.state.bundle_image)
          console.log(image.uri)
          this.setState({ isLoading: true })
          RNFetchBlob.config({ fileCache: true, appendExt: "png" }).fetch("GET", image.uri).then(response => {
            let path = response.path()
            path = /^file:\/\//.test(path) ? path : 'file://' + path
            console.log(path)
            this.state.sandbox_image = path
          }).finally(() => this.setState({ isLoading: false }))
        }}, { title: 'Load From SandBox', onPress: () => {
          this.setState({ source: { uri: this.state.sandbox_image } })
        }}, { title: 'Clear', onPress: () => {
          this.setState({
              source: null,
              isLoading: false
          })
        }}, { title: 'Load From Bundle', onPress: () => {
          this.setState({ source: this.state.bundle_image })
        }}].map((item, index) => {
          return (
              <Pressable
                  key={index}
                  style={{ height: '100%', justifyContent: 'center', flex: 1, borderWidth: 1, borderColor: 'black', marginLeft: index > 0 ? 15 : 0 }}
                  onPress={item.onPress}
              >
                  <Text style={{ textAlign: 'center' }}>{item.title}</Text>
              </Pressable>
          )
        })
      }
      </View>
      <ActivityIndicator style={{ marginTop: 10 }} animating={this.state.isLoading} />
      <Image
        key={`${this.state.source}`}
        style={{ marginTop: 20, width: 200, height: 200 }}
        source={this.state.source}
        onProgress={({ nativeEvent }) => console.log(nativeEvent)}
        onLoadStart={() => this.setState({ isLoading: true })}
        onLoadEnd={() => this.setState({ isLoading: false })}
      />
    </View>
  )
}

```
It needs to be tested in three environments: [Simulator_Debug, RealDevice_Debug, RealDevice_Release]

1. Open `Perf Monitor` (RealDevice_Release can be skipped)
2. Click `Save Image to SandBox`
3. Wait for the loading to end and click `Load From SandBox`
4. Verify that the image can be loaded successfully
5. Verify that the `UI thread` keeps `60 FPS` (RealDevice_Release can be skipped)
6. Click `Clear`
7. Repeat steps [3, 4, 5, 6] several times
8. Click `Load From Bundle` to verify that the bundle image can be loaded successfully

Simulator_Debug

https://user-images.githubusercontent.com/20135674/236369344-ee1b8ff1-2d49-49f3-a322-d973f4adf3e7.mp4

RealDevice_Debug

https://user-images.githubusercontent.com/20135674/236369356-fe440b2b-f72a-49be-b63c-b4bf709dac8c.mp4

RealDevice_Release

https://user-images.githubusercontent.com/20135674/236369365-8a6a5c2f-09ad-4c90-b6bd-41e8a5e3aa7f.mp4

Reviewed By: rshest

Differential Revision: D46441513

Pulled By: dmytrorykun

fbshipit-source-id: 652febd4147dbff6c1ceef03d84ce125b8c66770
2023-07-20 10:55:54 -07:00
Intl Scheduler f6c417c7ae translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907925522686
Sandcastle Job Instance ID: 27021598760821970
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47633539

fbshipit-source-id: b4e0f207270d831108ade6078d693a0ab0c4930a
2023-07-20 07:52:45 -07:00
Dmitry Rykun a6b49a15a0 Use RN$LegacyInterop_UIManager_getConstants in BridgelessUIManager (#37730)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37730

This diff makes unschematized native components available in bridgeless mode. In case there is no static view config, `BridgelessUIManager` calls `RN$LegacyInterop_UIManager_getConstants`, and gets native view config form the constants.

Changelog: [Internal] - Use RN$LegacyInterop_UIManager_getConstants in BridgelessUIManager

Reviewed By: sammy-SC

Differential Revision: D45154396

fbshipit-source-id: 32b3718841b59a8b6fb22022c9d9edc17dad877f
2023-07-20 05:49:46 -07:00
Shoaib Meenai 2d3348e642 Fix builds with C++20 (#38501)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38501

char8_t is a distinct type in C++20, which would need to be propagated
everywhere else (e.g. using `std::u8string` instead of `std::string`).
The code was already assuming that char is UTF-8, so we can just cast
accordingly (which works on all compilers: https://godbolt.org/z/9cv4c48o4).

Reviewed By: javache

Differential Revision: D47537998

fbshipit-source-id: ba045483361463f1754e02791114b78f51932a56
2023-07-19 16:34:41 -07:00
Arushi Kesarwani 6d1de636a6 Move SurfaceHandler to fabric/interfaces (#38508)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38508

Moving SurfaceHandler to `fabric/interfaces` since it was already a interface.

changelog: [internal] internal

Reviewed By: luluwu2032

Differential Revision: D47280778

fbshipit-source-id: e759cb6e1b570b782ff208f7cf26b9b9f62762b4
2023-07-19 15:38:23 -07:00
Arushi Kesarwani 442ccee313 Kotlinfy SurfaceHandler interface (#38507)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38507

Converting SurfaceHandler.java to Kotlin

Reviewed By: rshest

Differential Revision: D47568614

fbshipit-source-id: 5dda9d970e232fe2ff9e61a87d348961d212d6ea
2023-07-19 15:38:23 -07:00
Intl Scheduler c0b04d6647 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907925133086
Sandcastle Job Instance ID: 1000126147
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47606614

fbshipit-source-id: 0595aa23a4d6ce2f60c1fdebbe9ac3221261e8c8
2023-07-19 13:16:31 -07:00
Intl Scheduler 595465bf34 translation auto-update for i18n/messenger.config.json on master
Summary:
Chronos Job Instance ID: 1125907925133086
Sandcastle Job Instance ID: 1000126147
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47606628

fbshipit-source-id: ca795c6890b82740e91d202a8373cdb81ff3c88d
2023-07-19 13:16:31 -07:00
Lulu Wu fa9ea8326e Throw ReactNoCrashSoftException when handle memeory pressure to avoid crash
Summary:
As title

Changelog:
[Android][Changed] - Throw ReactNoCrashSoftException when handle memeory pressure to avoid crash

Reviewed By: jacdebug

Differential Revision: D47596577

fbshipit-source-id: 311492eaa4ed15b17807f5aa6c351a528fcfcdfa
2023-07-19 11:04:12 -07:00
Dmitry Rykun f7f5b4913a Android: Introduce RN$LegacyInterop_UIManager_getConstants (#38153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38153

This diff adds Android specific implementation of `RN$LegacyInterop_UIManager_getConstants` and binds it to JS runtime. It is supposed to be used as a substitute to UIManager.getConstants in bridgeless mode.

Changelog:
[Internal] - Introduce RN$LegacyInterop_UIManager_getConstants in Android.

Reviewed By: RSNara

Differential Revision: D45773342

fbshipit-source-id: 194aa5e940743b4d2c242798764a4207e8b1334f
2023-07-19 10:09:03 -07:00
Deepak Jacob 6eeb81a86e Clear bundler banner messages after a certain delay during development. (#38355)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38355

Changelog: [General] [iOS] Clear bundler banner messages after a certain delay during development.

Reviewed By: cipolleschi

Differential Revision: D47478373

fbshipit-source-id: e171ec714fc13096adfd4811f2007ff3e37cbf38
2023-07-19 09:24:49 -07:00
Ruslan Shestopalyuk 256aaa15bf Populate Platform.isDisableAnimations for the Android mobile platform (#38511)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38511

## Changelog
[Internal] -

This allows to override `Platform.isDisableAnimations` for the Android platform, in the same way as it's done with `IS_TESTING` (but similarly optionally doing `IS_DISABLE_ANIMATIONS` in addition to/instead).

See for more context: https://github.com/facebook/react-native/pull/38490

Reviewed By: cortinico

Differential Revision: D47530731

fbshipit-source-id: b90300124b2a8bac97fae78a94e8a2cc9d7fd5bc
2023-07-19 07:04:18 -07:00
Kevin Gozali 6d317cf1f8 Sort iOS plugin maps
Summary:
A simple sorting of the plugins list in each map. This is to sync with Meta internal tools update.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D47581872

fbshipit-source-id: 522f845eaee63c2812315eb4b8c25237d114ccd4
2023-07-19 01:10:23 -07:00
Kevin Gozali 7341f9abdc Android: expose ReactFontManager as a standalone target (#38506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38506

There are use cases where an app needs to install a custom font in a separate infra/tool. Instead of bloating those infra/tool with deep React Native dependencies, this allows it to depend on only the pieces that matter.

To ensure backward compatibility, the existing ReactFontManager will proxy method calls to the new impl going forward.

Changelog: [Changed][Android] Moved ReactFontManager to a common package

Reviewed By: mdvacca

Differential Revision: D47569319

fbshipit-source-id: 18ba6617d6c3f68823bdccaacfd8cc961cd6ce34
2023-07-18 23:17:48 -07:00
Xin Chen cb173e6a6f Change how app startup time is collected from platform side (#38325)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38325

This diff changed how we log app startup time by leveraging ReactMarker `logMarker` API, instead of the custom `setAppStartTime` API.

Changelog:
[Android][Internal] - Refactor how app should notify C++ about the app startup time.

Reviewed By: mdvacca

Differential Revision: D43863975

fbshipit-source-id: f80bcdb55fae82abce08eb2eff689985f90f1213
2023-07-18 19:20:44 -07:00
Xin Chen c12670263a Create flag to enable background executor and add to VR panel apps (#38343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38343

We'd like to run experiments on removing background executor in RN Fabric. This will move layout computing from the background thread (fabric_bg) to the JS thread. It will simplify the RN threading model and unblock new performance tracking features like Visual Completion Tracker and MutationObserver.

Changelog:
[Android][Internal] - Experiment with disabling background executor in VR panel apps

Reviewed By: javache

Differential Revision: D47452561

fbshipit-source-id: 554fef4ace2a967cdf0748d9148257d5d6bce987
2023-07-18 17:28:36 -07:00
Xin Chen d9260a81d1 Cache android react marker before the JNI load C++ libraries (#38327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38327

This diff caches the react marker sent from the android host platform before JNI library is loaded and sent out once it's ready. This way the C++ side will receive those markers as expecetd.

Changelog:
[Android][Internal] - Cache react marker timings before JNI library is loaded.

Reviewed By: mdvacca

Differential Revision: D43863973

fbshipit-source-id: 6d0d41d803d39e66a793f86a21ee11133a631bf7
2023-07-18 15:52:34 -07:00
Intl Scheduler 230d7e3a79 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907924647465
Sandcastle Job Instance ID: 9007200249714837
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D47569928

fbshipit-source-id: 65ac0d4bd4cb07c187334c292566c0fbaa0e7422
2023-07-18 15:49:56 -07:00