Commit Graph

12270 Commits

Author SHA1 Message Date
Eli White 9e0a7e3263 Converge component's bespoke StringEnumTypeAnnotation into StringLiteralUnionTypeAnnotation (#48343)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48343

components store unions as 'StringEnumTypeAnnotation' even though it isn't actually a union, it's a literal.

Native Modules store these as 'StringLiteralTypeAnnotation' so this converges those and reuses the same types.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67427656

fbshipit-source-id: e39028114285588584596012d07db40c117b4b94
2025-01-02 13:20:02 -08:00
Eli White b691122afc Share ArrayTypeAnnotation between components and modules (#48318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48318

These structures were the same, but the component side didn't use generics and just had duplicates. Making a base one to be shared.

I need to follow up to this and constrain the types that components allow.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67371894

fbshipit-source-id: bb1a30fcd0efe6cc567b88bc6f11e7b385bd7c41
2025-01-02 13:20:02 -08:00
Alex Hunt 697e9462d5 Convert assets-registry to Flow comment syntax (#48458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48458

NOTE: This change is made once and is not guaranteed.

**Motivation**: Requiring Flow parsing for `react-native` and its dependencies in user space can involve friction. For the case of `react-native/assets-registry` → `react-native-web`, I believe we should do the pragmatic thing to relax this requirement.

- This is a convenience stopgap until https://github.com/facebook/react-native/pull/39542 can be stabilised.
- This package is tiny and infrequently modified — I believe it's pragmatic/safe to do a one-time conversion, with the above notice and no changelog (i.e. "experimental" for now).

Resolves https://github.com/facebook/react-native/issues/48349.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D67764460

fbshipit-source-id: 7687fd79c6dea73c234a46e475c1cc745225830b
2025-01-02 12:23:14 -08:00
Ruslan Shestopalyuk 5ef9e1fffe TouchEventCoalescingKeyHelper -> Kotlin (#48448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48448

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759862

fbshipit-source-id: 7a8e133962cdc43aed0bae38a89d37fb7e6031a6
2025-01-02 11:18:07 -08:00
Ruslan Shestopalyuk e8347b9854 Migrate EventCategoryDef to Kotlin (#48446)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48446

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67759756

fbshipit-source-id: bc922b3062d8790ada3f9d5ee71593a08046752b
2025-01-02 11:18:07 -08:00
Alex Hunt 430f7d8b72 Update debugger-frontend from 486803f...7727db8 (#48328)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48328

NOTE: This update is significant, as it includes the frontend repo sync with `chromium/6613` (https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/144).

Changelog: [Internal] - Update `react-native/debugger-frontend` from 486803f...7727db8

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/486803f6bf272e0629297265dee8048a2f1269dd...7727db85ac767cf41cce3e9ee54d27e97b2637f9).

Reviewed By: hoxyq

Differential Revision: D67402065

fbshipit-source-id: f32d328c5319ed25d8942e813db152921ca22ec8
2025-01-02 06:01:42 -08:00
zhongwuzw 09995fc874 Change Image load event size info from logical size to pixel (#45198)
Summary:
Fixes https://github.com/facebook/react-native/issues/45188. This fixes old arch. fabric fix may wait until https://github.com/facebook/react-native/issues/44918.

## Changelog:

[IOS] [BREAKING] - Change Image load event size info from logical size to pixel

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

Test Plan:
Android/iOS return the same size .
```
    <Image
      style={{width: '100%', height: '100%'}}
      source={{
        uri: 'https://image-placeholder.com/images/actual-size/75x75.png',
      }}
      resizeMode={'cover'}
      onLoad={e => {
        console.log(
          `RNImage:${Platform.OS} load JPEG image from url`,
          e.nativeEvent,
        );
      }}
    />
```

Reviewed By: cortinico

Differential Revision: D67735347

Pulled By: cipolleschi

fbshipit-source-id: 72422d8c15e4cc6313215bf6d9a2c1e6b5a235ad
2024-12-31 09:03:54 -08:00
Nicola Corti b10491a3c4 Fix RN-Tester JSC instacrashing (#48418)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48418

RNTester JSC Debug is currently insta-crashing on the 0.77 release branch due to:

```
12-31 10:59:36.388 15165 15204 E ReactNativeJS: React Native version mismatch.
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: JavaScript version: 0.77.0-rc.5
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Native version: 1000.0.0-bb9d7ad9a
12-31 10:59:36.388 15165 15204 E ReactNativeJS:
12-31 10:59:36.388 15165 15204 E ReactNativeJS: Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with `watchman watch-del-all && npx react-native start --reset-cache`.
```

This is causing a `console.error` that is resulting in the crash as one of the frame in the stack doesn't have the line/column number information. Calling `.putDouble(string,double)` is forcing a conversion from `null` -> `double` which is result in the crash.

This is happening only on CI because the `set-rn-version` step on GitHub Action is executed with `--dry-run` (as this is not a release run) so the version of React Native is set back to `1000.0.0-<SHA>`. Locally this doesn't happen because the React Native version is read from the local file which is never manipulated by the `set-rn-version`.

Changelog:

[ANDROID] [FIXED] - Fix JSC Debug instacrashing

Reviewed By: cipolleschi

Differential Revision: D67735962

fbshipit-source-id: 363218385277374d33b8313cacd14159b2f17106
2024-12-31 08:24:38 -08:00
TobiasH 920867d949 Fix useWindowDimensions not updating because of delayed applicationState update on iOS devices (#46353)
Summary:
### Issue
When a real device is oriented into landscape and the user locks the screen during said orientation incase the user rotates back to previous orientation and unlocks the screen `useWindowDimensions` will not get the correctly updated values. This is due to `applicationState` being equal to UIApplicationStateInactive still when `interfaceFrameDidChange` gets called.

### Fix
`didUpdateDimensions` on iOS. Now correctly emits the dimension values after the device has been oriented and device has been locked. By adding `UIDeviceOrientationDidChangeNotification` to `NSNotificationCenter`

## Changelog:
[IOS] [FIXED] - Emit didUpdateDimensions correctly

```
  // RCTDeviceInfo.mm

  // Adds the interfaceFrameDidChange to UIDeviceOrientationDidChangeNotification
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:selector(interfaceFrameDidChange)
                                               name:UIDeviceOrientationDidChangeNotification
                                             object:nil];
```

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

Test Plan:
### ***Note***: This doesn't seem to be replicable on simulators. It only happens on real iOS devices.

### Before change:

Rotate Device > Lock Screen > Rotate back to portrait > Unlock phone
![IMG_6089](https://github.com/user-attachments/assets/5d928613-2742-45fb-97fa-d87eaf64ea97)

### After change:

Same steps as above, now emits correct values
![IMG_6091](https://github.com/user-attachments/assets/eb46ed22-c3c5-4e77-8069-4a604a21947e)

Reviewed By: cortinico

Differential Revision: D67735523

Pulled By: cipolleschi

fbshipit-source-id: 146e5d62d55eeef0f6b17f962ca84ab418a7b7f0
2024-12-31 07:49:36 -08:00
Oskar Kwaśniewski 081be01a5d feat: implement ReactNativeFactory (#46298)
Summary:
This PR implements ReactNativeFactory to encapsulate further the logic of creating an instance of React Native for iOS.

This will remove the strong coupling on the RCTAppDelegate and allow us to support Scene Delegate in the future.

The goal is to have a following API:

```objc
self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];

UIView *rootView = [self.reactNativeFactory.rootViewFactory viewWithModuleName:self.moduleName
                                                               initialProperties:self.initialProps
                                                                   launchOptions:launchOptions];

// Standard iOS stuff here
```

## Changelog:

[IOS] [ADDED] - implement ReactNativeFactory

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

Test Plan: Test out all the methods of AppDelegate

Reviewed By: huntie

Differential Revision: D67451403

Pulled By: cipolleschi

fbshipit-source-id: 9e73cd996ffc27ca1e3e058b45fc899b1637bdba
2024-12-31 07:45:25 -08:00
timbocole 8b1f049879 fix: Prioritise local cpp (use default as fallback) (#48340)
Summary:
https://github.com/facebook/react-native/pull/47379 removed local cpp sources from the sources being built with the app. This resulted in a local `android/app/src/main/jni/OnLoad.cpp` file being ignored at build time. I have therefore added logic to the cmake file to prioritise local `cpp` files and fallback to `${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp` if none exist.

This resolves https://github.com/facebook/react-native/issues/48298

## Changelog:
[ANDROID] [FIXED] - Prioritise local OnLoad.cpp, falling back to default-app-setup

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

Test Plan:
- Followed the https://reactnative.dev/docs/the-new-architecture/pure-cxx-modules guide (which was broken > 0.76.1)
- Applied the patch to the reproduction repository linked to https://github.com/facebook/react-native/issues/47352 to ensure no regression

Reviewed By: cipolleschi

Differential Revision: D67736012

Pulled By: cortinico

fbshipit-source-id: 87f6b8edf1613682585a94e1d1b3e6b4b792e4f5
2024-12-31 05:30:26 -08:00
Peter Abbondanzo a3c8e21370 Enable vector drawable support by default (#48347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48347

Vector drawable support was added behind a feature flag in https://github.com/facebook/react-native/pull/45354 and is ready to release more widely. This change is effectively the same as removing the feature flag but allows our holdout to continue until mid-January.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67482531

fbshipit-source-id: 1733c4748f79fd4df72f531a24efcbd8a7822611
2024-12-30 14:32:55 -08:00
Ruslan Shestopalyuk 6dd4195d2d Avoid calling fmod twice in roundLayoutResultsToPixelGrid (#48404)
Summary:
X-link: https://github.com/facebook/litho/pull/1036

X-link: https://github.com/facebook/yoga/pull/1775

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

## Changelog:
[Internal] -

This popped up when profiling some heavy UI performance, calling `fmod` operation in Yoga's `roundLayoutResultsToPixelGrid` in `PixelGrid.cpp` can be expensive, furthermore it turns out that some of the calls were redundant.

This replaces the duplicate calls to fmod with an equivalent single round operation, which for e.g. clang compiler on Windows brings the code in question from ~50 instructions (including 4 call instructions to the fmod function) down to ~30 instructions (without any external calls), and the layout operation being **~1% more efficient** for the particular benchmark I was looking into.

Reviewed By: christophpurrer

Differential Revision: D67689065

fbshipit-source-id: 2a074a1cb81bd7f7a3c414050b9ddda2ba90180f
2024-12-30 12:38:48 -08:00
Ruslan Shestopalyuk dd1cfb70e9 Improve typing of BackHandler (#48411)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48411

## Changelog:
[Internal] -

Floow-up to https://github.com/facebook/react-native/pull/48388, based on the diff discussion (D67648077).

Adds a bit better typing to `BackHandler.js`.

Reviewed By: blakef

Differential Revision: D67713236

fbshipit-source-id: 95435898d8ea87f6ae32a6db859d6641e1264972
2024-12-30 06:17:39 -08:00
Maddie Lord 85bdd75828 Add "jsEngine: hermes" to JS runtime Error prototype (#48401)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48401

This change adds a flag to JS Error's prototype to specify the jsEngine.

Reviewed By: fkgozali

Differential Revision: D67665484

fbshipit-source-id: 64b7b4bd986bcbd45d58e70c1a16de6752b05ccd
2024-12-27 16:59:49 -08:00
Riccardo Cipolleschi 9ceabd341d Fix iOS E2E Tests (#48400)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48400

A couple of days ago, the iOS CI started failing for the E2E tests on main.
This is because We were not using the hermes artifacts we were preconfiguring.

In fact, this is the log of the `test_e2e_ios_rntester`, which is not using the prebuilt.
{F1974129000}

For comparison, this is the `test_ios_rntester`, which is using the prebuilt
{F1974129001}

While investigating why this was happening, I realized that we were not testing the old architecture anymore, because we forget to update the script after the release of the New Architecture.

This change should fix both.

## Changelog:
[Internal] - Fix E2E tests for iOS and test the Old Arch

Reviewed By: robhogan

Differential Revision: D67670976

fbshipit-source-id: 7d1383a89e06c138f437a9c5f876a2e900878fb0
2024-12-27 07:38:47 -08:00
BleemIs42 44705fe11b - Fix BackHandle callback undefined cause crash issue (#48388)
Summary:
### Error message:
we got an error
```
t[n] is not a function. (In 't[n]()', 't[n]' is undefined) \n <unknown> (index.bundle:317:168:317)
```
 it related the BackHandle execute handle function.

### Investigation result
our project has screen files`App.tsx`, `Dashboard.tsx`, and `Profile.tsx`.
When launching the app, the screen order is `App.tsx` -> `Dashboard.tsx`, then user can switch to `Profile.tsx`
For `App.tsx` and `Dashboard.tsx`, we just prevent the hardware button action use `usePreventHardwareBackPressEffect()` in the first line of screen code.
```js
export const useHardwareBackPressEffect = (goBack?: () => boolean): void => {
  useEffect(() => {
    if (goBack) {
      BackHandler.addEventListener("hardwareBackPress", goBack);
      return () => {
        BackHandler.removeEventListener("hardwareBackPress", goBack);
      };
    }
    return undefined;
  }, [ goBack ]);
};
export const usePreventHardwareBackPressEffect = (): void => useHardwareBackPressEffect(() => true);
```
currently, `_backPressSubscriptions ` has 2 callback functions.
then user switch to `Profile.tsx` screen, and has the below code for hardwareback button and the second doesn't `return true`:
```js
// first one
usePreventHardwareBackPressEffect();
...

// second one
useEffect(() => {
  const backButtonListener = BackHandler.addEventListener(
    "hardwareBackPress",
    () => navigate(Navigation.Login);
  );
  return () => backButtonListener.remove();
});
```
currently, `_backPressSubscriptions ` has 4 callback functions, include previous 2 and new 2 of `Profile.tsx`.
When the user press hardwareback button, it will navigate to the login screen, so the issue occurs:
the latest callback will be executed first, then the navigation will let the screen unmount, which will destroy the effect, so the code removing 2 hardwareBackPress callback of `Profile.tsx` by executed
```js
return () => {
        BackHandler.removeEventListener("hardwareBackPress", goBack);
      };
```
After the navigation ends and the loop is restored, the init `i` is 3, then `i--`, `i` is 2, then `_backPressSubscriptions[2]` is `undefined` now and executes as a function, so the app crashes.
```js
for (let i = _backPressSubscriptions.length - 1; i >= 0; i--) {
    if (_backPressSubscriptions[i]()) {
      return;
    }
  }
```
that's the issue I met.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix BackHandle callback undefined cause crash issue

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

Reviewed By: blakef

Differential Revision: D67648077

Pulled By: rshest

fbshipit-source-id: 5ca685b0c0c474ef11772fd803743968ec2d912e
2024-12-27 04:37:57 -08:00
zhongwuzw 8dfed7df4b RNTester: Fixes crash when app back to background (#48385)
Summary:
https://github.com/facebook/react-native/issues/48376 removed `applicationDidEnterBackground` from `RCTAppDelegate` but RNTester called it, leads to crash. cc cipolleschi can you please help to review?

## Changelog:

[INTERNAL] [FIXED] - RNTester: Fixes crash when app back to background

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

Test Plan: RNTester iOS back to background not crash.

Reviewed By: cipolleschi

Differential Revision: D67657449

Pulled By: philIip

fbshipit-source-id: e6d806b2677050fa2faa273a7468055d9d21c2a3
2024-12-27 04:16:25 -08:00
Ruslan Shestopalyuk fcf3c8cab7 Rename SystraceSection to TraceSection (#48383)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48383

## Changelog:
[Internal] -

This changes the name of `SystraceSection` class to `TraceSection`, the purpose being to make it Systrace/FBSystrace agnostic (and that it can be mapped to e.g. Perfetto instead).

It changes all the internal callsites to the RN code code, and also adds a shim include, `<cxxreact/SystraceSection.h`, for backward compatibility with the external callers for now (which will be addressed separately).

Reviewed By: javache

Differential Revision: D67621914

fbshipit-source-id: 337c63c45a7b075c6e00cfca67ecc06c298c94c0
2024-12-24 16:31:50 -08:00
Ruslan Shestopalyuk 17a644a230 Map SystraceSection to Perfetto instrumentation if the latter is enabled (#48379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48379

## Changelog:
[Internal] -

We have a good portion of RN core code already instrumented with `SystraceSection` blocks, and those do the timing via fbsystrace, which may or may not be enabled in the system and generally is obsolete.

This maps the blocks to the corresponding Perfetto instrumentation, in case the latter is enabled, which will allow to get this information in Perfetto sessions without need to have fbsystrace present.

Reviewed By: javache

Differential Revision: D67619443

fbshipit-source-id: 52e5666472ad118fbec176a0e82d72a5200a358a
2024-12-24 07:47:50 -08:00
Gaspard Viot 74bdab8bd8 Reduce memory allocations when computing accessibilityLabel (#44605)
Summary:
While investigating the root cause of app hanging on older devices in Instruments, I noticed that the heaviest stack trace was pointing to `RCTRecursiveAccessibilityLabel` in RCTView.m.

<details>
  <summary>Heaviest stack trace in Instruments</summary>
<img width="473" alt="Screenshot 2024-05-17 at 4 22 48 PM" src="https://github.com/facebook/react-native/assets/849905/fab8ed01-7a2f-4113-b2ca-04e76f25cd9d">
</details>

The profiling was done on an iPad (5th generation) running iOS 16.7.4. The app is text heavy which makes the issue more visible than in RNTester for instance.

### Before
<img width="854" alt="Screenshot 2024-05-17 at 4 19 46 PM" src="https://github.com/facebook/react-native/assets/849905/5e3cc7ad-299c-4814-ab4a-031c0e677b12">

It turns out that `[NSMutableString stringWithString:@""]` is initialized in every call of the recursion even though most of the time it's only used to check the length at the end and return `nil`.

My change only initialize the mutable string if it's going to be used. I applied the same logic to the equivalent Fabric component. It's a small change that improved the accessibility label generation by 60ms in my case.

## 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] [CHANGED] - Reduce memory allocations when computing accessibilityLabel

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

Test Plan:
Running the same measurements after the change, computing the accessibility label is not the heaviest stack trace anymore. And the line by line tracing shows that `[NSMutableString stringWithString:@""]` impact has been significantly reduced.

### After
<img width="769" alt="Screenshot 2024-05-17 at 4 53 04 PM" src="https://github.com/facebook/react-native/assets/849905/1ad638ac-ba7e-4dca-ac77-10df5d2dad49">

I have been using this change in production thanks to a patch-package and it effectively improved the performances when navigating between screens.

I also tested in RNTester with and without Fabric. For both architectures, I made sure the return value of `RCTRecursiveAccessibilityLabel`.

Interestingly, when there is no label, the Fabric implementation returns an empty string while the `RCTView.m` returns `nil`.

I'm open to align both implementations to return `nil` if you believe there is no underlying reason requiring the Fabric implementation to return an empty string.

Reviewed By: cipolleschi

Differential Revision: D67620818

Pulled By: javache

fbshipit-source-id: 1a6937075a5ff5a9ad03fbbf910d64b3884c0fe0
2024-12-24 07:42:33 -08:00
zhongwuzw 6d2b61691a Fabric: Fixes assert failure when surface stop before we start surface (#48213)
Summary:
Fixes https://github.com/facebook/react-native/issues/48149. Actually this issue is not caused by React 19. The underlying problem arises because we retain the surface in RCTHost at the time of its creation. Even though we call stop, there is a return check that prevents execution if the status is not running. For reference, you can view the relevant code here: [RCTFabricSurface.mm](https://github.com/facebook/react-native/blob/7d771de8a79b05e8dfed91e07de30d9f72d3c1c3/packages/react-native/React/Fabric/Surface/RCTFabricSurface.mm#L118).

To resolve this issue, we can implement a weak reference to the surface.

bt:
```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/13, queue = 'com.apple.root.user-interactive-qos', stop reason = signal SIGABRT
    frame #0: 0x0000000105699008 libsystem_kernel.dylib`__pthread_kill + 8
    frame https://github.com/facebook/react-native/issues/1: 0x00000001045df408 libsystem_pthread.dylib`pthread_kill + 256
    frame https://github.com/facebook/react-native/issues/2: 0x000000018016c4ec libsystem_c.dylib`abort + 104
    frame https://github.com/facebook/react-native/issues/3: 0x000000018016b934 libsystem_c.dylib`__assert_rtn + 268
    frame https://github.com/facebook/react-native/issues/4: 0x000000010651f4b4 React_Fabric`facebook::react::SurfaceHandler::setUIManager(this=0x0000000108108620, uiManager=0x0000000000000000) const at SurfaceHandler.cpp:317:3
    frame https://github.com/facebook/react-native/issues/5: 0x00000001064c98f4 React_Fabric`facebook::react::Scheduler::unregisterSurface(this=0x0000600003500370, surfaceHandler=0x0000000108108620) const at Scheduler.cpp:252:18
    frame https://github.com/facebook/react-native/issues/6: 0x0000000104c3e8a8 RCTFabric`-[RCTScheduler unregisterSurface:](self=0x000060000212a940, _cmd="unregisterSurface:", surfaceHandler=0x0000000108108620) at RCTScheduler.mm:163:15
    frame https://github.com/facebook/react-native/issues/7: 0x0000000104c61fc4 RCTFabric`-[RCTSurfacePresenter unregisterSurface:](self=0x00000001081080d0, _cmd="unregisterSurface:", surface=0x0000000108108610) at RCTSurfacePresenter.mm:126:5
  * frame https://github.com/facebook/react-native/issues/8: 0x0000000104bc30a0 RCTFabric`-[RCTFabricSurface dealloc](self=0x0000000108108610, _cmd="dealloc") at RCTFabricSurface.mm:87:3
    frame https://github.com/facebook/react-native/issues/9: 0x0000000104b9ae44 RCTFabric`__destroy_helper_block_ea8_32s((null)=0x0000600000cb5a70) at RCTBoxShadow.mm:0
    frame https://github.com/facebook/react-native/issues/10: 0x00000001800f6edc libsystem_blocks.dylib`_call_dispose_helpers_excp + 44
    frame https://github.com/facebook/react-native/issues/11: 0x00000001800f7d24 libsystem_blocks.dylib`_Block_release + 300
    frame https://github.com/facebook/react-native/issues/12: 0x000000010760a7b8 libdispatch.dylib`_dispatch_client_callout + 16
    frame https://github.com/facebook/react-native/issues/13: 0x000000010761e608 libdispatch.dylib`_dispatch_root_queue_drain + 936
    frame https://github.com/facebook/react-native/issues/14: 0x000000010761ef7c libdispatch.dylib`_dispatch_worker_thread2 + 256
    frame https://github.com/facebook/react-native/issues/15: 0x00000001045dbb38 libsystem_pthread.dylib`_pthread_wqthread + 224
```

## Changelog:

[IOS] [FIXED] - Fabric: Fixes assert failure when surface stop before we start surface

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

Test Plan:
Please see demo in https://github.com/facebook/react-native/issues/48149. Or open RNTester and apply the patch like below:
```
 diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm
index 64c5d4122e7..cf015458619 100644
 --- a/packages/rn-tester/RNTester/AppDelegate.mm
+++ b/packages/rn-tester/RNTester/AppDelegate.mm
@@ -50,7 +50,10 @@ static NSString *kBundlePath = @"js/RNTesterApp.ios";

   [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

-  return [super application:application didFinishLaunchingWithOptions:launchOptions];
+  [super application:application didFinishLaunchingWithOptions:launchOptions];
+  self.window.rootViewController = [UIViewController new];
+  [self.window makeKeyAndVisible];
+  return YES;
 }

 - (void)applicationDidEnterBackground:(UIApplication *)application

```

Reviewed By: javache

Differential Revision: D67335792

Pulled By: cipolleschi

fbshipit-source-id: e93aaaa60b3d204d7ed2cda6758b3b1d9dfcbc88
2024-12-24 07:41:51 -08:00
Alex Toudic adaceba546 Fix applicationDidEnterBackground not being called (#48376)
Summary:
I noticed that `AppDelegate` subscribers listening for `applicationDidEnterBackground` events in Expo projects (as documented [here](https://github.com/expo/expo/blob/238b6f57e459dd2c0b13ee158f0af709fe922460/docs/pages/modules/appdelegate-subscribers.mdx?plain=1#L56) aren't working as expected anymore.
While investigating, I discovered that the events aren't reaching the `ExpoAppDelegate` implementation ([source](https://github.com/expo/expo/blob/71f2c55ff3f11e43ab43761bb5cece2e48eae0bf/packages/expo-modules-core/ios/AppDelegates/ExpoAppDelegate.swift#L61)) because the `RCTAppDelegate` implementation of `applicationDidEnterBackground` interrupts the event chain. This appears to be affecting some legitimate use cases.
I believe we could improve this by removing the current implementation, but I'd love to hear your thoughts on this approach. I might be missing some context about why this implementation was originally needed, so any insights would be greatly appreciated!

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix applicationDidEnterBackground not being called

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - Fix applicationDidEnterBackground not being called

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

Test Plan: Ran a local test after change

Reviewed By: javache

Differential Revision: D67621557

Pulled By: cipolleschi

fbshipit-source-id: 2d73711372deba867bd616c79ef4d00c79aa86d5
2024-12-24 06:56:55 -08:00
Mateo Guzmán 974fdf9a37 Migrating FpsListener to Kotlin (#48360)
Summary:
Migrating `FpsListener` to Kotlin

## Changelog:

[INTERNAL] - Migrating `FpsListener` to Kotlin

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

Test Plan:
```bash
yarn test-android
```

Reviewed By: bnalls33

Differential Revision: D67599802

Pulled By: Abbondanzo

fbshipit-source-id: 769dbe26688309ffcf15565c5d51003e23c56412
2024-12-23 15:51:14 -08:00
Ramanpreet Nara a5a3d372be Rename ParsedError to ProcessedError
Summary:
I think parsed isn't a good enough name.

React native also does a lot of processing of the error.

This also opens the door for eventually forwarding the original error in the future.

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D67526700

fbshipit-source-id: 895d64fa1ee4061ecbf0c1a6033c25b6fca95fd6
2024-12-23 12:42:14 -08:00
Intl Scheduler 5b6e35afda translation auto-update for Apps/Wilde/scripts/intl-config.json on master
Summary:
Chronos Job Instance ID: 1125907954543643
Sandcastle Job Instance ID: 18014400108783919
allow-large-files
ignore-conflict-markers
opt-out-review
drop-conflicts

Differential Revision: D67558410

fbshipit-source-id: 98a48c02e85aa4f3481ac4800362728bfdb152db
2024-12-21 04:24:28 -08:00
Sam Zhou 4c1dd906b0 Replace React$Node with React.Node
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67529040

fbshipit-source-id: 09221c6f866628bbf9174293124e650b7fffa967
2024-12-20 13:00:12 -08:00
Riccardo Cipolleschi 5443359c88 Revert "Include autolinkin.h in OnLoad.cpp only if it exists (#47875)" (#48341)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48341

We reverted [this commit](https://github.com/facebook/react-native/commit/5b2bbb84b14208905fc0dd7eade9ee6ce6e079b7) in 0.76 and 0.77 as it was not the right fix.

## Changelog
[Internal] - Revert excluding `autolinking.h` only if it exists

Reviewed By: alanleedev

Differential Revision: D67456530

fbshipit-source-id: 0f7bfc11d23f7a8fef5100784754add5b4ecda58
2024-12-20 03:15:55 -08:00
David Vacca 7b8412d66d Migrate ReactDrawableHelper to Kotlin (#48346)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48346

Migrate ReactDrawableHelper to Kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420410

fbshipit-source-id: 524062d0c0a0d3440bf5ac4c61e8cae53b32a0d2
2024-12-20 00:18:50 -08:00
David Vacca e9faea2f3e Migrate ReactPackageLogger to kotlin (#48345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48345

Migrate ReactPackageLogger to kotlin

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D67420585

fbshipit-source-id: a82fc7f17828ef6ad36a666113673526eb723600
2024-12-20 00:15:54 -08:00
Krzysztof Piaskowy 23eb06f662 Static Hermes for React Native (#48327)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48327

This PR introduces necessary changes to let React Native uses latest version of static Hermes.

## Explanation

### Part 1
```cmake
append("/d2UndefIntOverflow-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
```
It seems like this flag doesn’t exist anymore in the MSVC 16 compiler.
CI logs - https://github.com/piaskowyk/react-native/actions/runs/11815096269/job/32915591004
```
fatal error C1007: unrecognized flag '-UndefIntOverflow-' in 'p2'
```

### Part 2
```cmake
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
  # MSVC needs C++20
  set(CMAKE_CXX_STANDARD 20)
else()
  set(CMAKE_CXX_STANDARD 17)
endif()
```

Some of the new syntax in static Hermes requires the newer C++ standard on MSVC.

### Part 3
```cmake
# Changes in lib/CMakeLists.txt
```

These updates are necessary to successfully build the Hermes Framework for iOS.

### Part 4
```diff
namespace hermes {
namespace hbc {
namespace {

class BytecodeSerializer {
-  friend void visitBytecodeSegmentsInOrder<BytecodeSerializer>(
+  friend void hermes::hbc::visitBytecodeSegmentsInOrder<BytecodeSerializer>(
```

Due to additional additional anonymous namespace, the MSVC wasn't able to recognise proper symbol without explicite definition.

X-link: https://github.com/facebook/hermes/pull/1566

Test Plan: Build RNTester app from here - https://github.com/piaskowyk/react-native/tree/%40piaskowyk/build-static-hermes

Reviewed By: tmikov, cipolleschi

Differential Revision: D67316013

Pulled By: neildhar

fbshipit-source-id: cf03850f94a75acd827b68794700a8f143a90e09
2024-12-19 16:23:41 -08:00
Thomas Nardone 0683206927 Restore subclipping view removal (#48329)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48329

With the call to `removeView()` removed from `ReactViewClippingManager` in https://github.com/facebook/react-native/pull/47634, we're seeing views erroneously sticking around in the layout.

While `removeViewWithSubviewClippingEnabled()` calls `removeViewsInLayout()`, it does not trigger the corresponding side effects of [removeView()](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5501):
```
public void removeView(View view) {
  if (removeViewInternal(view)) {
--> requestLayout();
--> invalidate(true);
  }
}
```
To compensate, flip `removeViewsInLayout()` to [`removeViews()`](https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-15.0.0_r9/core/java/android/view/ViewGroup.java#5562), which will ensure layout.

Changelog: [Android][Fixed] Restore layout/invalidate during ReactViewClippingManager.removeViewAt()

Reviewed By: javache

Differential Revision: D67398971

fbshipit-source-id: b100db468cc3be6ddc6edd6c6d078a8a0b59a2c1
2024-12-19 15:27:13 -08:00
Pieter De Baets a9f60bea72 Remove unused perftests JNI code (#48344)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48344

Matching Java code was removed in D60581611

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D67460124

fbshipit-source-id: 1c7e986fbb0c02af51e0c4035b2f131fcc2c64ec
2024-12-19 14:51:26 -08:00
Mateo Guzmán 52b6592559 Modal: Setting resource-id from testID prop (#48313)
Summary:
Follow up from https://github.com/facebook/react-native/issues/48271 and https://github.com/facebook/react-native/issues/48254, I noticed that the Modal component also doesn't map the `resource-id` from the `testID` on Android. This PR addresses that.

## Changelog:

[ANDROID] [FIXED] - Modal: Setting `resource-id` from `testID` prop

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

Test Plan:
Alternatively do:
```
$ adb shell uiautomator dump
UI hierchary dumped to: /sdcard/window_dump.xml
$ adb pull /sdcard/window_dump.xml
/sdcard/window_dump.xml: 1 file pulled, 0 skipped. 1.1 MB/s (3505 bytes in 0.003s)
```
and check in XML: ` resource-id="playground-modal"  class="android.view.ViewGroup" `
-------
Using Appium, check that the `testID` prop passed from JS is mapped as `resource-id` in the rendered view group of the Modal.

<details>
<summary>Example of the code implementation in the RNTester Playground:</summary>

```tsx
function Playground() {
  const [modalVisible, setModalVisible] = React.useState(false);

  return (
    <>
      <Modal
        visible={modalVisible}
        testID="playground-modal">
        <Text testID="inner-text-test-id">Hello World!</Text>
      </Modal>

      <Button
        title="Open Modal"
        onPress={() => {
          setModalVisible(true);
        }}
      />
    </>
  );
}
```
</details>

<details>
<summary>Output in Appium Inspector:</summary>

<img width="913" alt="image" src="https://github.com/user-attachments/assets/514ae2b3-35a8-4a1a-8efc-1ca6bd73f189" />

</details>

Reviewed By: javache

Differential Revision: D67369350

Pulled By: alanleedev

fbshipit-source-id: a799ad5b974895a39d9287e3d76d1139a6ef6a83
2024-12-19 11:49:45 -08:00
zhongwuzw dd303b2dde Fabric: Fixes AccessoryView not disappeared when pop up the page (#47311)
Summary:
Fixes AccessoryView not disappeared when page poped up. After page pop up, we can see a white view it the bottom of scrren.

Fixed:
https://github.com/user-attachments/assets/90305720-656b-4546-8730-53b89fee7a66

Before:
https://github.com/user-attachments/assets/8e4fbea3-1882-48f8-aa5f-0c4e9ddc4efd

## Changelog:

[IOS] [FIXED] - Fabric: Fixes AccessoryView not disappeared when pop up the page

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

Test Plan: RNTester InputAccessoryView example, repro steps please see the video above.

Reviewed By: christophpurrer

Differential Revision: D67455393

Pulled By: javache

fbshipit-source-id: b5d3a88bce41da77079eeb49fea8163f56d722dd
2024-12-19 10:55:21 -08:00
kirillzyusko 5fc582783d fix: do not overwrite external inputAccessoryView on Fabric (#48339)
Summary:
If 3rd party libs are using `inputAccessoryView` - the current code can easily break it. Whenever props gets changed we call `setDefaultInputAccessoryView` which will simply overwrite the current `inputAccessoryView` (which is highly undesirable).

The same fix on paper was made ~7 years ago: https://github.com/facebook/react-native/commit/bf3698323d81508fc77174df2b1ffe5fb03224e7

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [FIXED] - Fixed problem with accessory view & 3rd party libs

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

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

Test Plan: Make sure `inputAccessoryView` functionality works as before

Reviewed By: javache

Differential Revision: D67451188

Pulled By: cipolleschi

fbshipit-source-id: bc3fa82ae15f8acedfd0b4e17bdea69cbd8c8a8d
2024-12-19 10:12:36 -08:00
Matin Zadeh Dolatabad ea56c432b7 Disable react-in-jsx-scope rule in eslint config (#46587)
Summary:
All newly generated react native apps are still showing warnings to use react in the jsx scope. That is not needed anymore as of react 18 with built-in jsx transform plugin.

Reproduction: https://github.com/matinzd/react-in-jsx-warning-repro

Run `npm run lint` in this repo.

## Changelog:

[GENERAL] [FIXED] - Disable `react-in-jsx-scope` rule in eslint config

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

Test Plan: Initiate a new template with community CLI and you should not see this warning anymore.

Reviewed By: christophpurrer

Differential Revision: D67394923

Pulled By: cipolleschi

fbshipit-source-id: cfe8e44e33e1b3ae9fe17ca56dd3c7258b7bff69
2024-12-19 06:02:32 -08:00
Pieter De Baets 44ef2c484a Revert D66839601: Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3
Differential Revision:
D66839601

Original commit changeset: dfba4aab6d73

Original Phabricator Diff: D66839601

fbshipit-source-id: 4d59b3616193dc184f0de7df8556f2b9b192df67
2024-12-19 03:37:20 -08:00
Richard Barnes 72007a14af Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 (#48250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48250

LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D66839601

fbshipit-source-id: dfba4aab6d73a2fd805ad2761a49c23612c28ccd
2024-12-18 15:24:52 -08:00
Thomas Nardone 783cc5777a Remove GuardedAsyncTask wrapper for call.cancel() (#48251)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48251

The original comment mentioning https://github.com/square/okhttp/issues/869 predates the [upgrade to okhttp3](https://github.com/facebook/react-native/commit/6bbaff2944dafd6fa7e5b77ef46dece0ec2c9983), which resolved the issue via https://github.com/square/okhttp/issues/1592.

Cancel calls should now be async and don't need to be guarded.  Removing this also fixes a discrepancy in NetworkingModule unit test verification.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67157018

fbshipit-source-id: 72ce4deaaff306ef1dde6eda7be88707c37f0be7
2024-12-18 14:36:38 -08:00
Zeya Peng 2ea9a7b51f Allow debugID key in InterpolationNode config & Support debugID in NVE (#48323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48323

Allow `debugID` key in InterpolationNode config
Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D67185006

fbshipit-source-id: ec0081617103bd4b7bb78210702872a42db26361
2024-12-18 09:10:13 -08:00
Saad Najmi b04d17afca Fix Direct Debugging with JSC (#39549)
Summary:
Originally with https://github.com/facebook/react-native/commit/5cf8f43ab182781ea82e88077df425c3efbfc21f , we added a call to a new Apple API `JSGlobalContextSetInspectable` to ensure that our Javascript running with JSC is debuggable. That change was guarded with a `__builtin_available(macOS 13.3, iOS 16.4, tvOS 16.4, *)` check to make sure it only ran on OS'es where to function existed. Later, in https://github.com/facebook/react-native/commit/3eeee11d7ac4075d0917233d3be4a9469f802d35  we did an extra guard in the way of a macro to check we were compiling against a new enough version of Xcode (so that Xcode knows about the symbol).

Between the runtime check and the compile time check, we should be good right? Wrong! As it turns out, this bit of code still caused crashes on iOS 15 devices (See this [Apple Forum Thread](https://forums.developer.apple.com/forums/thread/749534)). To address this, https://github.com/facebook/react-native/pull/44185 was added which added a new compiler guard (`__OSX_AVAILABLE_STARTING(MAC_NA, IPHONE_16_4)` was added. Unfortunately, this guard is incorrect: It is basically checking if our minimum iOS deployment target is 16.4 (It's not, as of writing it is iOS 13.4), which effectively means this code is never compiled and one can never direct debug with JSC on iOS 16.4+ 😨!

So what went wrong, and why were the first two guards not good enough? Three main reasons..

Firstly, this is a device only crash, and not reproducible on simulator. This is probably why the crash was not caught earlier. Secondly, It's because system frameworks (like JavascriptCore) are _dynamically_ linked: the linker doesn't look for the symbol till runtime (and crashes when doing so). Thirdly, It's because we are _strongly_ linking the framework, so every symbol must be present and the macros / guard Apple provides with `AvailabilityMacros.h` don't work.

What we want to do is link JavascriptCore as a `weak_framework`, more info here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

From that link:
> One challenge faced by developers is that of taking advantage of new features introduced in new versions of OS X while still supporting older versions of the system. Normally, if an application uses a new feature in a framework, it is unable to run on earlier versions of the framework that do not support that feature. Such applications would either fail to launch or crash when an attempt to use the feature was made. Apple has solved this problem by adding support for weakly-linked symbols.

>When a symbol in a framework is defined as weakly linked, the symbol does not have to be present at runtime for a process to continue running. The static linker identifies a weakly linked symbol as such in any code module that references the symbol. The dynamic linker uses this same information at runtime to determine whether a process can continue running. If a weakly linked symbol is not present in the framework, the code module can continue to run as long as it does not reference the symbol. However, if the symbol is present, the code can use it normally.

This seems to be exactly what we want, and the Apple provided method for using new APIs in system frameworks!

Let's update our podspecs so we link JavascriptCore weakly. As a bonus (and admittedly, the original purpose of this PR) let's add macOS support to the `JSC_HAS_INSPECTABLE` macro (This file `JSCRuntime.cpp` used to have more explicit macOS support in it's macros, but I had removed it with https://github.com/facebook/react-native/commit/fb30fcaa2f526cc1f7c2d4189ec9c57f9cf9b3c5).

## Changelog:

[IOS] [FIXED] - Fix Direct Debugging with JSC

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

Test Plan:
Tested that RNTester doesn't crash on boot running on an iPad Air 2 running iOS 15.8., and that an iOS 17.2 simulator is debuggable.

Built RN-Tester and RN-Tester-macOS and verified both show up in Safari Web Inspectors' debug menu:

<img width="1316" alt="Screenshot 2023-09-19 at 10 48 43 PM" src="https://github.com/facebook/react-native/assets/6722175/c642e6e0-36af-4c9f-845a-7e491489f419">

macOS screenshot small bc I got some internal stuff I gotta crop 😅

<img width="347" alt="Screenshot 2023-09-19 at 10 53 46 PM" src="https://github.com/facebook/react-native/assets/6722175/1e802c88-02b8-49e1-8fd2-d91726ca1e93">

Reviewed By: huntie

Differential Revision: D67338150

Pulled By: cipolleschi

fbshipit-source-id: 620c3b3cc1e37e54de7fa4dc9956a02c8f3c09f8
2024-12-18 08:00:19 -08:00
Oskar Kwaśniewski 9f12fce53b fix(iOS): remove unused RCTTurboModuleManagerDelegate method (#48290)
Summary:
Hey, this PR removes unused method from RCTAppDelegate.

The only called method from RCTTurboModuleManagerDelegate is `getTurboModule:jsInvoker`, the `getTurboModule:initParams:` is never called.

https://github.com/facebook/react-native/blob/5a81ceed2a6c974211e6a238efee3eea68b9568a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm#L207

## Changelog:

[INTERNAL] [REMOVED] - remove unused RCTTurboModuleManagerDelegate method

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

Test Plan: CI Green, ensure everything works as before

Reviewed By: javache

Differential Revision: D67392056

Pulled By: cipolleschi

fbshipit-source-id: e7f35f81c48cdc163cfff45987e0b7eb022cbf7d
2024-12-18 07:14:04 -08:00
Eli White 4dac99cf6d Fix FlowFixMes in CodegenVersionDiffing (#48312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48312

I figured out how to fix these FlowFixMes

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D67313962

fbshipit-source-id: 21b109824411c1537f397aca45b7cdc2495f5e11
2024-12-17 20:23:24 -08:00
Sam Zhou f8119fc52b Pre-suppress errors in xplat ahead of 0.257.0 release
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D67368232

fbshipit-source-id: 23111f62c5731b5a58e15ac8ef2dcd9ea8006573
2024-12-17 18:28:25 -08:00
generatedunixname499836121 7948044179 Apply fixup patch to fbsource
Summary:
This is an automatically generated fixup patch to bring fbsource back into sync with
facebook/react on GitHub. Please land this patch as soon as possible, as the difference
reflected on here is already on GitHub and future changes may depend on these
changes!

<< DO NOT EDIT BELOW THIS LINE >>
diff-train-skip-merge
bypass-react-native-oss-changelog

Generated by: https://www.internalfb.com/intern/sandcastle/job/36028798618339642/

GitHub Repo: facebook/react

Reviewed By: kassens

Differential Revision: D67286468

fbshipit-source-id: 66632a2524e80bca065d0a0f94342c4ec2d2a7b9
2024-12-17 13:33:11 -08:00
Thomas Nardone e577e48ad7 Remove reflection in OkHttpCallUtil (#48308)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48308

Reflection is overkill here, we can simply suppress the deprecation "error".

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D67337980

fbshipit-source-id: 12076258ed4cb5c8737c84378621dda3072ec5a0
2024-12-17 11:22:46 -08:00
Alex Hunt dfdacb84ce Refactor PerformanceTracer buffer type to use output event format (#48310)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48310

Refactors the internal storage format of trace events buffered by `PerformanceTracer`.

Aligning with the emitted [Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview?pli=1&tab=t.0#heading=h.yr4qxyxotyw) enables us to simplify away the issue of defining and converting from any intermediate formats. This becomes desirable as we generalise to more event types and forthcoming browser-emulating `__metadata` events.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D67337442

fbshipit-source-id: 580928dfb4fcf4ac5efc82f93ab85a0d1d6dfb5c
2024-12-17 10:57:39 -08:00
Mitya Kononchuk 8696b79f73 Fix running fantom tests with high parallelism (#48307)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48307

Changelog:
[General][Fixed] - Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test.

Reviewed By: rubennorte, danalex97

Differential Revision: D67334828

fbshipit-source-id: 3db18f6a100925480dbf8385f9ea414187406f4a
2024-12-17 10:07:26 -08:00
Thomas Nardone 5a01291598 Categorize SoftAssertions (#48306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48306

Extract a constant for SoftAssertions so they can be logged appropriately

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D67296589

fbshipit-source-id: c8823fd5dfa09a771bb8fbf498edb8d9264f053f
2024-12-17 09:18:55 -08:00