Commit Graph

38536 Commits

Author SHA1 Message Date
Nick Gerleman c2c9b27ff2 Add extra logging for invalid Paragraph Attributes MapBuffer (#44709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44709

Add some extra logging to try to figure out heisenbug, where we cannot find MapBuffer key that we should expect to be present, only during view preallocation.

ReadableMapBuffer toString() will itself iterate through MapBuffer entries, so this might not return something sane if underlying MapBuffer is corrupt or wrongly oriented, but should give us more context.

We also need to be careful here, to avoid logging the actual state mapbuffer or its binary which may contain text content. Only the paragraph attributes.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D57925730

fbshipit-source-id: cecca1a1fe53b4b417d520e65c30d47243cb2fb2
2024-05-30 17:33:43 -07:00
Soe Lynn e880ed76fe DrawerLayoutAndroid fix for Layout inspector to select correct node (#44707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44707

Changelog: [Internal]

For DrawerLayoutAndroid in New Architecture, when we use ReactDev Tools layout inspection, incorrect node is being shown in the inspector tools.

This is because pointerEvents is not set to either `box-none` or `none` based on the drawer open/close state for the drawer child wrapper `View`.

Reviewed By: hoxyq

Differential Revision: D57873834

fbshipit-source-id: b2b82633969922189a0b96feea2115ddc0b2ebb5
2024-05-30 17:09:25 -07:00
Rubén Norte 0bea4cd0cc Mark root view as attached after executing all pending operations (#44726)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44726

Changelog: [internal]

## Context

We ran an experiment to test synchronous state updates in Fabric and we saw some crashes on Android. Those crashes were caused by mounting operations not being applied in the correct order.

There were 2 root causes for that problem:
1. State updates triggered during mount would be committed and mounted synchronously during that specific mount operation. That caused problems like trying to clip views that weren't created already (as we were processing the state update for the content offset before we actually created the child views).
2. Same problem as before, but with mount operations that were processed when the root view wasn't available yet (this is a separate queue).

We tried to fix the problem in https://github.com/facebook/react-native/pull/44015, but the solution for 2) was incorrect, as we didn't account for those operations being in a different queue (it was reverted in https://github.com/facebook/react-native/pull/44724).

## Changes

I think the right solution for point 2) is that, instead of marking the root view as available and then process all pending operations, we flip those operations.

That was, if there are any mount operations as a side-effect of processing that queue, those will also be added to the same queue, instead of being processed immediately in `MountItemDispatcher`.

Reviewed By: sammy-SC

Differential Revision: D57968937

fbshipit-source-id: 93d10cdeced0c837d4301768aee8575d2c940b10
2024-05-30 12:37:17 -07:00
Rubén Norte d1c72016c1 Allow recursive calls to schedulerShouldRenderTransactions without deadlocks (#44725)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44725

Changelog: [internal]

## Context

We're currently testing synchronous state updates in Fabric (committing shadow trees for state updates synchronously in the thread where they were dispatched, instead of always scheduling it in the JS thread).

In these experiments we saw a problem caused by a recent change in the Android mounting layer (done to fix a problem with the Event Loop) where we were doing the mount operations inside a mutex lock. The problem is that we didn't have recursive commit+mount operations (because we were dispatching state updates in the JS thread) but now that we do we get a deadlock here.

 {F1659804385}

These recursive commit+mount operations happen because it's possible to trigger state updates while we mount changes in the host platform (e.g.: we create the scroll view and we update the state to set the content offset). Those state updates trigger more mount operations, which deadlock in the mentioned place.

## Changes

This fixes the described issue by restricting the lock only to access the list of pending operations, but not to apply them. In the current implementation, `mountingManager->executeMount` is protected by the lock, whereas in the new version it isn't (so it can be safely called recursively). The synchronization of the mount operations is done directly at the mounting layer on Android.

Reviewed By: sammy-SC

Differential Revision: D57968936

fbshipit-source-id: 52f996d212cad691646610632b03b5223e7e90ca
2024-05-30 12:37:17 -07:00
Rubén Norte 958c2e840a Revert batching for mount operations accumulated before root view attached (#44724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44724

Changelog: [internal]

Batching operations at this layer was wrong because these are the operations that were already flushed by the mounting layer but were accumulated in `SurfaceMountingManager` because the root view wasn't created.

These operations should be executed before anything else that's scheduled in the `MountItemDispatcher`, so we should never batch them. The problem this was trying to solve is solved in a different way in D57968937.

This was gated so this shouldn't affect any current usages.

Reviewed By: sammy-SC

Differential Revision: D57968939

fbshipit-source-id: e9131614cdc76e9d553540757611bc8b0736c927
2024-05-30 12:37:17 -07:00
Dmitry Rykun c0692ab063 Re-land: Fix race condition in native module invalidation (#44727)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44727

This is a re-land of https://github.com/facebook/react-native/pull/44048

Reverting it caused even bigger regression, so my earlier assessment was wrong. The initial regression was caused by something else.

Changelog: [Internal] - Let's keep the changelog entry form the original diff.

Reviewed By: fkgozali

Differential Revision: D57970133

fbshipit-source-id: c683d661a805d44434f5491e89dd4b7218379bee
2024-05-30 11:42:22 -07:00
Blake Friedman 3b59b27087 fix rxjs flow types linting warnings (#44719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44719

Removed shadowing of generic values, which would cause warnings.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57915364

fbshipit-source-id: 6abf68a62fca88687343ac5677ac905e87220a91
2024-05-30 08:20:00 -07:00
Blake Friedman 32b5c9601f listr → listr2 (#44716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44716

Move to listr2 which handle non-TTY environment, outputting to CircleCI logs in a useful way.  This gives our CI users more useful debugging information, but limits the output when running locally.

If you want more explicit output locally, do something like:

```
yarn run build | cat
```

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D57915369

fbshipit-source-id: ae9f87b0b9608f16ee035b791c5f7b81544c498c
2024-05-30 07:40:36 -07:00
Saad Najmi c67dfbbe42 chore(ci): Set retryOnFailure for RNTester iOS Unit and Integration tests (#44642)
Summary:
On React Native macOS (I am not sure with the current state of React Native), the Xcode Unit and Integration tests are a bit flaky. Rather than set "retry on failure up to 3 times" through the pipeline config (in our case, Azure Pipelines), I realized my earlier PR to use Xcode test plans (https://github.com/facebook/react-native/pull/36443) means we can have Xcode retry the test. This should be faster than retrying it on the pipeline, because it retries just the failing test, not the entire "test" step. I did this on React Native macOS, so I'm doing it upstream so we can remove a diff.

## Changelog:

[INTERNAL] [CHANGED] - Set `retryOnFailure` for Xcode Unit and Integration tests

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

Test Plan: CI should pass (faster)

Reviewed By: cortinico

Differential Revision: D57662523

Pulled By: cipolleschi

fbshipit-source-id: 8de2ab0ea15ba4d38c3b5bf96108c0c7ff5e9f32
2024-05-30 07:24:35 -07:00
Rubén Norte e91a577262 Clean up old code for microtasks in Hermes (#44708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44708

Changelog: [internal]

We had a fallback to use a Hermes internal API if the native module exposing `queueMicrotask` wasn't available. This is no longer necessary as the module is available everywhere we enable the event loop, so we can remove it.

Reviewed By: christophpurrer

Differential Revision: D57922076

fbshipit-source-id: 0ca48abacd77a75ce8559db08f55c78a3e0ec815
2024-05-30 04:22:50 -07:00
Nick Gerleman cfbd15aff1 Add border clipping examples (#44711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44711

This adds just the border clipping examples and tests from D57668976

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D57941945

fbshipit-source-id: 2234927cb944710c9d929d1d77087d3d2ecdbca6
2024-05-29 23:32:34 -07:00
Neil Agarwal 06512aa565 fix: use consistent version of glob in react-native (#44713)
Summary:
https://github.com/isaacs/node-glob/issues/493

Fixes https://github.com/facebook/react-native/issues/44712

## Changelog:
[General][Fixed] - Use consistent version of glob in react-native

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

Reviewed By: yungsters

Differential Revision: D57949442

Pulled By: NickGerleman

fbshipit-source-id: 9ea246c6b5307370628f34a78373a8bddb42420d
2024-05-29 23:21:24 -07:00
Kudo Chien bed487e24b Add BindingsInstaller for TurboModules on iOS (#44486)
Summary:
Add synchronous JS bindings installation for TurboModules. That would help some 3rd party JSI based modules to install JS bindings easier.
Re-create from https://github.com/facebook/react-native/issues/43110 but for iOS

## Changelog:

[IOS] [ADDED] - Add BindingsInstaller for TurboModules

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

Test Plan: Added test in RN-Tester TurboModule test case

Reviewed By: javache

Differential Revision: D57224891

Pulled By: philIip

fbshipit-source-id: fabe5c4f8d2087ac9a465f2cb90d884b83265a68
2024-05-29 20:34:25 -07:00
Eric Rozell 775713cef7 Make consistent focusable behavior (#44705)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44705

`focusable` props behaviors are inconsistent across different flavors of Touchable components. Some use the disabled prop to check if the component should be focusable, others do not.

This ensures all Touchable* component flavors use the disabled prop.

## Changelog

[General][Fixed] Fixed inconsistency in TouchableX component disabled / focusable behavior

Reviewed By: yungsters

Differential Revision: D57910488

fbshipit-source-id: af17227403338fcd5bebd9ba7c3172b4c6776e1f
2024-05-29 19:06:34 -07:00
Sam Zhou f1265f7758 Deploy 0.237.1 to xplat
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D57939041

fbshipit-source-id: 738523fac25112ab3c75bde0c09b2df62c29aa9c
2024-05-29 16:44:34 -07:00
Nick Gerleman 5fbebb4852 Cleanup ReactFeatureFlags.enableTextSpannableCache (#44706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44706

We didn't ship this, and asking around, I don't think mdvacca was looking at this actively (though is on PTO right now).

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D57913491

fbshipit-source-id: 86afd5a6bb5e7ce6be540f2295aa407134a6d81c
2024-05-29 13:31:36 -07:00
Samuel Susla 3c31e9dd9f clip content offset when scroll view is restored from shadow tree (#44704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44704

changelog: [internal]

Checkout the code comments for explanation.

Reviewed By: javache

Differential Revision: D57903106

fbshipit-source-id: 202edfa0b93ce222997ed793313cdc3ca32f8818
2024-05-29 10:01:46 -07:00
zhongwuzw 690df7a556 Fixes animated frame timing (#44622)
Summary:
Fixes https://github.com/facebook/react-native/issues/44608 .

## Changelog:

[IOS] [FIXED] - Fixes animated frame timing

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

Test Plan: Example in https://github.com/facebook/react-native/issues/44608 .

Reviewed By: sammy-SC

Differential Revision: D57559884

Pulled By: cipolleschi

fbshipit-source-id: 33eaf71c24eb83715403a67b3471dd1ac2dd9d2f
2024-05-29 08:16:42 -07:00
zhongwuzw f500b47a95 Bridgeless: Expose host delegate methods (#44158)
Summary:
Expose host delegate methods that users can do some customize work.

## Changelog:

[IOS] [ADDED] - Bridgeless: Expose host delegate methods

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

Test Plan: Users can do some customized work by `RCTRootViewFactory`.

Reviewed By: sammy-SC

Differential Revision: D56521470

Pulled By: cipolleschi

fbshipit-source-id: dd22d0978b9fd4385380945a514eb6596b7d874f
2024-05-29 08:14:09 -07:00
Renaud Chaput fc4e099920 Fix Privacy Manifest generator when it does not contain a NSPrivacyAccessedAPITypes key (#44628)
Summary:
XCode privacy files might not contain a `NSPrivacyAccessedAPITypes` key, which causes the following error:

```
[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `each' for nil

node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:111:in `block (4 levels) in get_used_required_reason_apis'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `each'
node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:106:in `block (3 levels) in get_used_required_reason_apis'
```

## 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] [FIXED] - Privacy Manifest aggregation failing due to no `NSPrivacyAccessedAPITypes` key

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

Test Plan: I tested this patch on our own app and it solved the issue.

Reviewed By: christophpurrer

Differential Revision: D57618425

Pulled By: cipolleschi

fbshipit-source-id: 1a36ab5a1bb45b8507d3663b782c95258d97c8a4
2024-05-29 08:08:42 -07:00
Soe Lynn 805f1493c7 overflow props is not honored in ScrollView in new architecture (#44699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44699

Changelog: [Internal]

In Fabric, overflow props for ScrollView is not passed down. Hence, the overflow props is ignored and FlatList content is always clipped.

Reported from OSS https://github.com/facebook/react-native/issues/44683

Reviewed By: sammy-SC

Differential Revision: D57895399

fbshipit-source-id: 6ce65bea0803971060e8229b66563123dd6fc114
2024-05-29 07:49:13 -07:00
Gijs Weterings f4ec8cbdba Add rntester_android as a valid app in ReactNativeCoreE2ESetup
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D54662740

fbshipit-source-id: f845b127dc1cf5ef509eebea29c1c495a9ceb763
2024-05-29 07:06:19 -07:00
Edmond Chui 82a3bb8f75 add fusebox flag to error case of launch debugger event (#44696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44696

Changelog: [Internal]

Add `prefers_fusebox_frontend` annotation to the error case for the launch debugger event

Reviewed By: hoxyq

Differential Revision: D57866634

fbshipit-source-id: fcd3655539c936d9965b0c79a47b1b58bb9a4e48
2024-05-29 06:00:36 -07:00
Rubén Norte dc3a530191 Clean up androidEnablePendingFabricTransactions feature flag (#44695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44695

Changelog: [internal]

We tested this feature flag at Meta and it's neutral when used outside the event loop. We'll handle its effects on the event loop as part of the event loop experiment itself (when enabling paint blocking).

Reviewed By: tdn120

Differential Revision: D57861195

fbshipit-source-id: 11a208ef5433321a464cfc16f4ff026d52988b42
2024-05-29 05:00:12 -07:00
Vladyslav Krasnolutskyi a93a15aca3 Fix Animate.sequence restart issues (#44031)
Summary:
Currently, if the `Animated.sequence` animation is finished, and then the `start()` method is called without a `reset()` method being invoked beforehand, the failure happens: ```undefined is not an object (evaluating 'animations[current].start')```.
Use cases:
- sequence animation started, finished, and then started again
- sequence animation is used in `Animation.loop` with `resetBeforeIteration` set to `false`, which essentially does the same as the previous case

Related issues:
- https://github.com/facebook/react-native/issues/43120
- https://github.com/facebook/react-native/issues/37611

## Changelog:

[General] [Fixed] - Fix sequence restart failure

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

Test Plan: Test cases are included: 1 for regression and 2 for mentioned use cases in the summary

Reviewed By: cipolleschi

Differential Revision: D56015346

Pulled By: dmytrorykun

fbshipit-source-id: 8b0f46c8a33397fece807634463ce630c89d28af
2024-05-28 07:33:44 -07:00
Sachin Tewari 3c5a3e0a07 Cleanup ImageLoaderModule (#44693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44693

Changelog: [Internal]
Kotlin related simplifications

Reviewed By: oprisnik

Differential Revision: D57858309

fbshipit-source-id: 02ae17db13f5877ab83b05beadff3ff666aeff81
2024-05-28 07:30:20 -07:00
Christoph Purrer 24aed6ec49 Align with code-gen output Sample Turbo Modules (#44640)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44640

These modules are manually typed and don't use `react-native-codgen` (as a show case to demonstrates what code-gen produces).

There are some typos in the manually written code and they don't exactly match the JS Spec used at runtime:

https://github.com/facebook/react-native/blob/main/packages/react-native/src/private/specs/modules/NativeSampleTurboModule.js#L45-L48

Changelog: [Internal][Fixed] Align with code-gen output Sample Turbo Modules

Reviewed By: rshest

Differential Revision: D57624824

fbshipit-source-id: 023f2318630aa342758d5ea495e6298cb8884ae1
2024-05-28 07:15:28 -07:00
Håkon Knutzen d93788301c Add missing call to super.viewDidLoad in RCTRedBox.mm (#44686)
Summary:
When running the Analyzer in Xcode, I got a warning denoting that `viewDidLoad` was not called on `super` in the overridden `RCTRedBox.viewDidLoad`. While I have not observed any anomalies, it is best practice to call on super in the overridden view controller life cycle methods.

## Changelog:

[iOS] [FIXED] - Add missing call to `[super viewDidLoad]` in `RCTRedBox.mm`.

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

Test Plan:
Running the RNTester yielded the following screenshot:

<img width="549" alt="Screenshot 2024-05-27 at 11 26 40" src="https://github.com/facebook/react-native/assets/2263015/b91e126c-9dc1-4e52-8a6b-50ea8bea2c3f">

Reviewed By: fabriziocucci

Differential Revision: D57856354

Pulled By: javache

fbshipit-source-id: d76a4779e02f40af69eed156489e57299968d4be
2024-05-28 04:54:09 -07:00
Tomek Zawadzki c73e22142e Expose mapbufferjni via prefab (#44684)
Summary:
The `mapbufferjni` was not exposed via prefab. I'm adding it to make possible for react-native-live-markdown to integrate on top of React Native via prefab. Based on https://github.com/facebook/react-native/issues/36166.

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

[ANDROID] [CHANGED] - Expose `mapbufferjni` via prefab.

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

Reviewed By: fabriziocucci

Differential Revision: D57856389

Pulled By: javache

fbshipit-source-id: 9926b02724950f4025c7f867257e8229d44c43a3
2024-05-28 03:19:10 -07:00
Christoph Purrer ea3a7143b9 Align CodegenSchema.d.ts with CodegenSchema.js (#44629)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44629

Changelog: [General][Fixed] Align CodegenSchema.d.ts with CodegenSchema.js

Reviewed By: yungsters

Differential Revision: D57594059

fbshipit-source-id: 554afcb1520e291d5452f330137ea577000f2428
2024-05-27 19:15:42 -07:00
John Mavrantonakis c207708c4b Fix for Clang tidy, needed for fbcode include (#44655)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44655

Required to compile with clang

This is because previously it was comparing size_t with int which is not allowed under compilation with clang

Changelog: [Internal] [Fixed] - Replaced old style for loop with new style to avoid clang errors with size_t to int comparisons

Differential Revision: D57721635

fbshipit-source-id: 2738f7b415d668c37536f7f93b2e0985fa2cc5e6
2024-05-27 12:14:03 -07:00
Alex Hunt 29beea6b57 Split debugger flags into fuseboxEnabledDebug and fuseboxEnabledRelease (#44663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44663

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57733525

fbshipit-source-id: 70a7dacb641b75e73bd4f7e18bc5e3d04bc2c508
2024-05-27 09:27:47 -07:00
Alex Hunt 03b8b0997a Rename jsinspector-modern feature flag to fuseboxEnabled (#44661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44661

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57730920

fbshipit-source-id: 4761f7e8c2189ff5bfd5fa24891bba20c3750da8
2024-05-27 09:27:47 -07:00
Alex Hunt 352d4b1c83 Add default browser fallback to debugger launch flow (#44673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44673

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57726648

fbshipit-source-id: 66eaab1dd0d53fe2befb3dc96d5deb426b86e3e7
2024-05-27 02:53:36 -07:00
Alex Hunt 5d827d83c1 Simplify debugger launch flow to invoke Chrome directly, drop kill API (#44672)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44672

Swaps out and simplifies the internals of the debugger launch flow.

We observed that we could achieve better launch/windowing behaviour by passing the `--app` argument directly to the detected Chrome path.

This shares the user's default Chrome profile:
- Fixes unwanted behaviour such as a separate dock icon on macOS (which, when clicked, would launch an unwanted empty window).
- Enables settings persistence.

This change also removes the `LaunchedBrowser.kill` API.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57726649

fbshipit-source-id: fc3a715dc852a50559048d1d1c378f64aeb2013f
2024-05-27 02:53:36 -07:00
Alex Hunt 7e0f86f34b Revert debugger launch behaviour to default profile (#44638)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44638

Reverts the debugger launch flow to use the default `ChromeLauncher` profile. This is the approach used in the current `--experimental-debugger` experiment and by Expo.

This is motivated after a review of the tradeoffs of a guest profile — which allow us to programatically quit the browser process, however takes over system URL handling.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57619542

fbshipit-source-id: 3713e1cf8eed61e7a70ed1e4eb58f02da845155f
2024-05-27 02:53:36 -07:00
Alex Hunt a908387b73 Remove inspectorEnableCxxInspectorPackagerConnection flag (#44662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44662

- Remove `inspectorEnableCxxInspectorPackagerConnection` feature flag.
- Replace existing checks with `getEnableModernCDPRegistry()`.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57730921

fbshipit-source-id: fd13b84a826a4fa5973053a721d311c7d68dd2f5
2024-05-26 10:48:48 -07:00
Alex Hunt e363eeb53e Update debugger-frontend from b453d8bd...bf5ec69 (#44675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44675

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57782487

fbshipit-source-id: 449180c0fcbb8ef043716bc954f149aec6b2a263
2024-05-26 10:05:58 -07:00
Liron Yahdav 840c31c3a4 Make SystraceSection feed into Instruments signposts API (#44496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44496

When doing performance profiling on a React Native iOS app and trying to identify bottlenecks on the native side it can be helpful to correlate actions to what is happening inside React Native. We already have the SystraceSection class for this, but it does nothing in open source. This diff allows SystraceSection to feed into the Instruments signpost API on iOS/macOS.

Changelog:
[iOS][Added] - Add Instruments signposts API for SystraceSection

Reviewed By: sammy-SC

Differential Revision: D56280451

fbshipit-source-id: 4e962e932b6b6e09e5953abdc1aa621a2723c91e
2024-05-24 18:39:02 -07:00
Nick Gerleman 91d12d9b99 Revert D57668976: Simplify ReactViewGroup clip to border
Differential Revision:
D57668976

Original commit changeset: 8b8cf956dc86

Original Phabricator Diff: D57668976

fbshipit-source-id: 5147557c1f3561863b1ad9226ca6244ff94cb29c
2024-05-24 11:55:43 -07:00
Peter Abbondanzo ac51deeaf4 Add suppression for deprecated setters and getters (#44676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44676

Some of the setters and getters in these functions, like [`getStatusBarColor`](https://developer.android.com/reference/android/view/Window#getStatusBarColor), have been marked as deprecated in [`VANILLA_ICE_CREAM`](https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM). This change suppresses deprecation warnings until we can move to newer alternatives.

## Changelog

[Android] [Changed] - Added suppression for deprecated getter/setter usage in StatusBarModule

Reviewed By: sumkit

Differential Revision: D57780503

fbshipit-source-id: 6201f7a3e597fef420de0f80dd2243bee78bc583
2024-05-24 10:41:12 -07:00
Alex Hunt 06461c4ab5 Disable Fusebox in prod builds (temp) (#44664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44664

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57737342

fbshipit-source-id: 85bff2d2810e666a97b79b5d1fe598b6f8b68c68
2024-05-24 10:31:18 -07:00
Nishan c13790ff1d feat(android): percentage support in translate (#43193)
Summary:
This PR adds percentage support in translate properties for android. Isolating this PR for easier reviews.

## Changelog:
[Android] [ADDED] - Percentage support in translate
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

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

Test Plan:
- Checkout TransformExample.js -> Translate percentage example.
- Added a simple test in `processTransform-test.js`. The regex is not perfect (values like 20px%, 20%px will pass, can be improved, let me know!)

Related PRs - https://github.com/facebook/react-native/pull/43191, https://github.com/facebook/react-native/pull/43192

Reviewed By: joevilches

Differential Revision: D57723216

Pulled By: NickGerleman

fbshipit-source-id: c9da007678341b62745df858f043821bcc662a98
2024-05-24 04:50:41 -07:00
Nick Gerleman 4294b2446a Simplify ReactViewGroup clip to border (#44646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44646

We can remove most of the code for clipping children to border radius, and recalculating paths, in ReactViewGroup, and rely on the padding box path/rect already set.

I will move this to something more generic up the stack so other native components can reuse this logic.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57668976

fbshipit-source-id: 8b8cf956dc8689827bccba5e41751b465fd85eeb
2024-05-24 04:42:27 -07:00
Peter Abbondanzo 1cc1673c32 xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java (#44656)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44656

## Changelog

[Android] [Changed] - Converted StatusBarModule to Kotlin

Reviewed By: andrewdacenko

Differential Revision: D57614041

fbshipit-source-id: 054b13cd286e9e9b7f870e66ff0e07def075a3c3
2024-05-24 04:35:42 -07:00
Pieter De Baets b2ced62d33 Shortcut emitDeviceEvent in bridgeless (2nd attempt) (#44590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44590

emitDeviceEvent is frequently used for perf-critical operations such as sending network responses from native to JS. We don't need to go through JavaScriptModule Proxy (which is missing caching in bridgeless) and instead can immediately invoke the callable JS module.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D57435750

fbshipit-source-id: 1c120073ac80afd95deb8e3e6f1c00c2d3d80133
2024-05-23 14:57:00 -07:00
Pieter De Baets 1343313dc6 Invoke callableModule factory once (#44576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44576

Store callable modules as either a factory function or an object, so we can skip invoking the factory function for frequently accessed objects.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D57338528

fbshipit-source-id: cd39ccbe7168c6f093a0e62d5880cbbcd5209c8e
2024-05-23 12:33:41 -07:00
zhongwuzw 3f74f69cf0 Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls (#44653)
Summary:
Fixes https://github.com/facebook/react-native/issues/44649.

## Changelog:

[IOS] [FIXED] - Fixes race condition of m_batchHadNativeModuleOrTurboModuleCalls

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/44649.

Reviewed By: fabriziocucci

Differential Revision: D57727886

Pulled By: sammy-SC

fbshipit-source-id: 967e2d8452cc477f2225151a46e9aa27698f4506
2024-05-23 11:11:27 -07:00
Samuel Susla 33b064bb9c enable preventDoubleTextMeasure optimisation by default (#44659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44659

changelog: [internal]

Reviewed By: javache

Differential Revision: D57678341

fbshipit-source-id: cc6fbcfedccc0fd4610d52feee60b0fc35cc83b9
2024-05-23 10:58:01 -07:00
Christoph Purrer b7fc5867f2 Use hasteModuleName for C++ Turbo Module enums (#44631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44631

Changelog:
[General][Breaking] Use hasteModuleName for C++ Turbo Module enums

This is a follow up to https://github.com/facebook/react-native/pull/44630

This changes the names of C++ Turbo Modules enums to use the `hasteModuleName`.

Example: `NativeMyAbcModule.js` with this spec:
```
export enum EnumNone {
  NA,
  NB,
}

export interface Spec extends TurboModule {
  +getStrEnum: (arg: EnumNone) => EnumStr;t
}

export default (TurboModuleRegistry.get<Spec>('MyAbcModuleCxx'): ?Spec);
```

Before now we generated a base C++ struct with the name:
```
MyAbcModuleCxxEnumNone
           ^^^
```

Now the generate name is:
```
NativeMyAbcModuleEnumNone
^^^^^^
```

## Changes:
- No `Cxx` injected anymore
- Ensure base struct is `Native` prefixed (all RN JS TM specs start with it)

Reviewed By: cipolleschi

Differential Revision: D57602082

fbshipit-source-id: 9ebd68b8059dfbc6e2ec11065915cf049aa3cb0b
2024-05-23 10:23:36 -07:00