Commit Graph

12270 Commits

Author SHA1 Message Date
Dan Melnic 2052a1dfa3 Fix warning C4100: 'rt': unreferenced formal parameter (#45633)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45633

Changelog: [Internal]
Fix warning C4100: 'rt': unreferenced formal parameter

Differential Revision: D60152935

fbshipit-source-id: 9fe4b934721d38e7edf5c3329c40f5c0595a2897
2024-07-24 09:28:18 -07:00
Ramanpreet Nara 842c382773 Refactor: RuntimeScheduler: Make error handlers configurable (#45616)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45616

We want to eventually route all js error handling through JsErrorHandler in bridgeless.

This will help with that.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D60138415

fbshipit-source-id: de62edfe75066ba135225e24543628306aa5f4a0
2024-07-24 08:57:31 -07:00
Jakub Piasecki dc8c8ebc5b Disable JS batching when animation batch is finished on Android (#45563)
Summary:
When an animation using the native driver [is started](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/animations/Animation.js#L89), all animated operations are [queued](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js#L115). The queue is then flushed as part of [a single batch](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js#L173-L181). The problem here is that when a batch is executed, on the native side a [flag is flipped](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java#L543) and it assumes that JS will take control of the batching operation from that point onward, which is not the case. Operations are queued with the current batch number but are never executed, since the new "batch" is never finished. The case which let to figuring it out is the creation of `AnimatedInterpolation` in the [sticky header component](https://github.com/facebook/react-native/blob/c82edec62e2149a746627c6b474d4d413f545128/packages/react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js#L215).

This PR changes this by returning to the default behavior when the batch is completed.

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

## Changelog:

[ANDROID] [FIXED] - Fix scheduled animated operations not being executed in some cases

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

Test Plan: Tested on Animated examples in RNTester and on the reproducer app from the issue

Reviewed By: cipolleschi

Differential Revision: D60108049

Pulled By: dmytrorykun

fbshipit-source-id: 9c14d116b0df2c78fbbb00cf7224bddd09ae5796
2024-07-24 06:09:45 -07:00
Janic Duplessis 19cffab383 Fix legacy view interop apis not available in view method (#45609)
Summary:
When trying to use the legacy view interop with `stripe/stripe-react-native` there is an issue with the `CardField` component because it tries to access module registry inside the `view` method (https://github.com/stripe/stripe-react-native/blob/master/ios/CardFieldManager.swift#L7).

The problem is that we attach the legacy view apis after creating view, so they are not available in that method.

To fix this we can change the order of the methods and attach the apis first. Note that we also need to use the `manager` method instead of `bridgelessViewManager` since `bridgelessViewManager` is not initialized otherwise, it is initialized lazily in the `manager` method.

## Changelog:

[IOS] [FIXED] - Fix legacy view interop apis not available in view method

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

Test Plan: Tested in an app that legacy interop apis (`moduleRegistry`) is available in the `view` method in an app using RN 0.74 with bridgeless mode enabled.

Reviewed By: cipolleschi

Differential Revision: D60165191

Pulled By: dmytrorykun

fbshipit-source-id: 60187556fb36d342bb1ef084a093132bdb0496bd
2024-07-24 06:08:45 -07:00
Dong-Hwan Kim 1dcbf41725 fix: add missing submitBehavior prop type and mark blurOnSubmit prop as deprecated in typescript declaration file of TextInput (#45588)
Summary:
Hi, I just found out that https://github.com/facebook/react-native/pull/33653 adds a new prop in `TextInput` that enables multiline `TextInput` be able to submit without blurring.

It does that by adding a new prop called `submitBehavior` which accepts `'submit' | 'blurAndSubmit' | 'newline'`:
https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L195

https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L910-L928

It also marks `blurOnSubmit` prop as deprecated since it can now be handled from `submitBehavior`:
https://github.com/facebook/react-native/blob/700b403e06fdcbcde2a4ade9570eb572431487ea/packages/react-native/Libraries/Components/TextInput/TextInput.js#L896-L908

However, that PR doesn't update `TextInput.d.ts` file which results Typescript to complain that the type doesn't exist:
<img width="760" alt="text_input_error" src="https://github.com/user-attachments/assets/2235cb36-1e4e-4ec9-a8b0-c09728a3336f">

So this PR adds and updates the types in declaration file to support them in Typescript
<img width="520" alt="fixed" src="https://github.com/user-attachments/assets/a7a3a0c4-9f3e-4644-bfac-ae60ac21d0f7">

## Changelog:

[GENERAL] [FIXED] - add missing `submitBehavior` prop and mark `blurOnSubmit` prop as deprecated in Typescript declaration file of `TextInput`

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

Test Plan:
Before:
<img width="295" alt="before" src="https://github.com/user-attachments/assets/90ed0cd1-c127-4667-bf72-6b5317ea4dd6">

After:
<img width="589" alt="after1" src="https://github.com/user-attachments/assets/826002a4-45dc-4f97-882d-7622238ac766">

<img width="833" alt="after2" src="https://github.com/user-attachments/assets/467eeecd-4b0b-4740-ac78-253e3c7aa901">

Reviewed By: christophpurrer

Differential Revision: D60107516

Pulled By: dmytrorykun

fbshipit-source-id: ce79e41aefc1ef39dc1d44179405cf6a8d5e12de
2024-07-24 02:25:08 -07:00
bufgix d25249442d chore: ☂️ Migrate BlobModuleTest.kt to AssertJ (#45610)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[INTERNAL] [CHANGED] - Migrated to AssertJ within file `BlobModuleTest.kt`

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

Test Plan: `Run ./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca

Differential Revision: D60138457

Pulled By: cortinico

fbshipit-source-id: 8dcbede98130c24da2d81525d6596a8e4b4aa402
2024-07-24 00:14:28 -07:00
gustavoabel 7829de6221 chore: ☂️ migrate BackwardCompatUtilsTest to AssertJ (#45607)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

Migrated to AssertJ within file:
- ```BackwardCompatUtilsTest.kt```

Changelog:
[Internal] [Changed] -  chore: ☂️ migrate BackwardCompatUtilsTest to AssertJ

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

Test Plan: Run ```./gradlew -p packages/gradle-plugin test```

Reviewed By: mdvacca

Differential Revision: D60137770

Pulled By: cortinico

fbshipit-source-id: 883b2abee430ce45018808fa934a7949ae23fcaf
2024-07-24 00:08:49 -07:00
Miguel Daipré e7881c2f45 feat: migrate JsonUtilsTest, OsTest and TaskUtilsTest to AssertJ (#45608)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

Note:

The formatting changes have been altered by Android Studio. `Code -> Format Code`

## Changelog:

[INTERNAL] [CHANGED] - Migrated `JsonUtilsTest`, `OsTest`, `TaskUtilsTest` from junit.Assert to assertj.core.api.Assertions.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: mdvacca

Differential Revision: D60137234

Pulled By: cortinico

fbshipit-source-id: 236dc46dd04ad1f62a5e11fd77cf2c63bec99cff
2024-07-23 16:56:59 -07:00
Rubén Norte 010c004d75 Rename track for performance.mark / measures without custom tracks as Web Performance: Timings to align with Chrome (#45597)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45597

Changelog: [internal]

Minor change to align with the Chrome DevTools performance panel.

Reviewed By: sammy-SC

Differential Revision: D60115147

fbshipit-source-id: bfd7b071fc76e226783ef41bd3f13d941acccec5
2024-07-23 14:23:03 -07:00
Rubén Norte 4caf9ec7a0 Migrate CoreFeatures::enableReportEventPaintTime to new feature flags system (#45585)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45585

Changelog: [internal]

Just migrates the flag to the new system.

Reviewed By: sammy-SC

Differential Revision: D60050005

fbshipit-source-id: 4da39446ecdb6cd86ccf7ee75a0d489764c37be6
2024-07-23 14:23:03 -07:00
D N bb23026daf chore: ☂️ Migrate a ClipboardModuleTest test to AssertJ (#45600)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## Changelog:

[Internal] [Changed] - Migrate ClipboardModuleTest to Assertj

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

Reviewed By: zeyap

Differential Revision: D60120117

Pulled By: cortinico

fbshipit-source-id: 39720d81e0abad978515b8429f559df817303cd9
2024-07-23 09:47:43 -07:00
Nicola Corti 9e64d09cfb Migrate com.facebook.react.views.progressbar to Kotlin (#45594)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45594

This moves all the remaining Java classes inside com.facebook.react.views.progressbar to Kotlin

Changelog:
[Internal] [Changed] - Migrate com.facebook.react.views.progressbar to Kotlin

Reviewed By: tdn120

Differential Revision: D60108654

fbshipit-source-id: 69b3597020520eb444cd1fb9020b6572b7e1d804
2024-07-23 09:14:31 -07:00
Nicola Corti bd4aec869b RNGP - Do not attempt to load JSC from other repositories (#45598)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45598

I've noticed we attempt to load JSC from the Sonatype Snapshot repository.
That is inefficient as we already know that JSC is available only inside node modules.
This change makes the repository resolution stricter by better specifying which
repo can download which dependency.

Changelog:
[Internal] [Changed] - Do not attempt to load JSC from other repositories

Reviewed By: cipolleschi

Differential Revision: D60116002

fbshipit-source-id: 21a2213708f5b0103860a59f3342f1bc0f59cdb9
2024-07-23 08:12:42 -07:00
Blake Friedman 014370d825 Move init deprecation notice 30 Sept → 31 Dec (#45590)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45590

This gives us more wiggle room with the release of 0.76.

Changelog: [General][Changed] Move init deprecation notice 30 Sept → 31 Dec

Reviewed By: cortinico

Differential Revision: D60105868

fbshipit-source-id: d03fcf5d4a97db9b21792eff6f993e2671b276ef
2024-07-23 05:56:39 -07:00
Alex Hunt 7571e9a46a Update device APIs for macOS compatibility (#45515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45515

After some provisional hacking on macOS support for React Native DevTools last week, this revealed some incompatibilities with traditional OS X APIs, which are minimally addressed here.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D59807146

fbshipit-source-id: 39c4eab723046926b0b469232152e2f994af2366
2024-07-23 05:55:47 -07:00
Nicola Corti 91ecd7eb53 RNGP - Migrate settings-plugin to AssertJ (#45575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45575

We should move over to use AssertJ as per our linter.
I'm adding it here to a first test and will use it as a reference for some OSS contributions from outside.

Changelog:
[Internal] [Changed] - Migrate settings-plugin to Assertj

Reviewed By: cipolleschi

Differential Revision: D60037797

fbshipit-source-id: 579ed7bf5fb219e25577af3ab87934503ee7898e
2024-07-23 04:41:54 -07:00
Nicola Corti fedbe2d486 Fix core autolinking not working on Windows (#45572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45572

0.75-rc.5 is currently broken on Windows.

This is due to us invoking `npx react-native-community/cli config` without
a `cmd /c` prefix.

This fixes it by using our function `windowsAwareCommandLine`.
The problem is that this required a lot of refactoring since that util was not available for the settings plugin.

Fixes #45403

Changelog:
[Internal] [Changed] - Fix core autolinking not working on Windows

Reviewed By: cipolleschi

Differential Revision: D60037587

fbshipit-source-id: eefeda7aafc43b9ce08f0f9225b0847fad2f46b7
2024-07-23 04:41:54 -07:00
Samuel Susla 7d17ae4d3b add optimised path for view preallocation on android behind feature flag (#45587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45587

changelog: [internal]

There is a way to avoid doing large number of JNI calls from JS thread for view preallocation on Android. We can move the JNI call to the main thread by creating a queue of views to be created on the JS thread and pulling it from the main thread. This way, the expensive part of JNI call (the actual call + creating JNI values) is moved to the main thread and doesn't block the JS thread from executing rendering.

Reviewed By: javache

Differential Revision: D59966062

fbshipit-source-id: af85138cfdb9b2a7a7710d79e09e165b2be55067
2024-07-23 04:10:42 -07:00
Ruslan Lesiutin 7bd5b84e32 Update debugger-frontend from a4fff8a...a56e5b7 (#45579)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45579

Changelog: [Internal] - Update `react-native/debugger-frontend` from a4fff8a...a56e5b7

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

Reviewed By: robhogan

Differential Revision: D60041876

fbshipit-source-id: 48c1a314797638b140052e6f30b2597e9b8ee48a
2024-07-23 04:05:57 -07:00
wh201906 6390cf67d0 Add upper case keys to the debug key handler (#45559)
Summary:
The CLI of Metro bundler only accepts key presses when the Caps Lock is off. This is somehow inconvenient because the developers might think the Metro bundler doesn't response when the Caps Lock is on.

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

[GENERAL] [ADDED] - Add upper case keys to the debug key handler

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D60107316

Pulled By: dmytrorykun

fbshipit-source-id: 045dcd382d84c4781dff75a1ff913cd3ccc8d288
2024-07-23 03:57:39 -07:00
CHEN Xian-an c24929c5f4 Not all the targets have a defined symbol_type (#45591)
Summary:
Errors occurred on running `pod install`:

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

undefined method `symbol_type' for #<Xcodeproj::Project::Object::PBXAggregateTarget:0x000000010f6ea568>

[redact]/node_modules/react-native/scripts/cocoapods/privacy_manifest_utils.rb:53:in `block in get_application_targets'
```

## Changelog:

[iOS] [Fixed] - Fix error on handling privacy manifest

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

Reviewed By: cipolleschi

Differential Revision: D60107607

Pulled By: dmytrorykun

fbshipit-source-id: 316220fe54174b18c9b61775f807d5d05d9f0240
2024-07-23 03:21:28 -07:00
David Vacca 700b403e06 Migrate excludeYogaFromRawProps to ReactNativeFeatureFlags (#45586)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45586

Migrate excludeYogaFromRawProps to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022939

fbshipit-source-id: 150ecc98aa3323d5adea3a41a3d91d404c99e5a7
2024-07-22 14:20:40 -07:00
David Vacca 4d77c35584 Delete ReactFeatureFlags.rejectTurboModulePromiseOnNativeError (#45583)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45583

ReactFeatureFlags.rejectTurboModulePromiseOnNativeError is not used, I'm deleteing it

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022938

fbshipit-source-id: 80f2d551b4416fae81c9081d3ddbb896e5f5a560
2024-07-22 14:20:40 -07:00
David Vacca d4a74d8b83 Migrate enableFabricRendererExclusively to ReactNativeFeatureFlags (#45584)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45584

Migrate enableFabricRendererExclusively to ReactNativeFeatureFlags

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60022933

fbshipit-source-id: 35b09673744bb5fb29b7d3b5ee4c7bb7d51a01b7
2024-07-22 14:20:40 -07:00
Nicola Corti 90e4397d99 Converted com.facebook.react.views.drawer to Kotlin (#45573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45573

This makes this module now be fully in Kotlin instead of having mixed Java/Kotlin sources.

Changelog:
[Internal] [Changed] - Converted com.facebook.react.modules.dialog to Kotlin

Reviewed By: tdn120

Differential Revision: D60035771

fbshipit-source-id: b45fd099c0b353768ab6580eb6a4a3dccf68f07d
2024-07-22 13:40:07 -07:00
Nicola Corti 0529818d36 Fix several build warnings on RN-Tester (#45569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45569

Same as title

Changelog:
[Internal] [Changed] - Fix several build warnings on RN-Tester

Reviewed By: realsoelynn

Differential Revision: D60036158

fbshipit-source-id: 549b84f52594e1a442058222a3a45118739a1eb3
2024-07-22 12:16:12 -07:00
Nicola Corti c1a8ae412b Properly annotate with @Deprecated methods that are just deprecated in JavaDoc (#45570)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45570

We do have several methods/classes that are `deprecated` in the JavaDoc but not
with an annotation. That's not correct as users will never get those deprecation otherwise
and we'll be forced to keep both implementation around for a longer time.

Changelog:
[Internal] [Changed] - Properly annotate with Deprecated methods that are just deprecated in JavaDoc

Reviewed By: javache

Differential Revision: D60036159

fbshipit-source-id: 466072d6a3fb4f1220e1dc3deaa51a46c714a388
2024-07-22 06:39:04 -07:00
Rubén Norte 43c32e1e25 Fix broken overlapping measures in Perfetto integration (#45567)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45567

Changelog: [internal]

(internal because our integration for Perfetto hasn't been released in OSS yet)

In our current React integration for Perfetto we're logging arbitrary time spans via `performance.measure` in specific tracks (that can be custom based on a naming scheme).

For a given track, Perfetto doesn't allow partially overlapping segments (as it's considered to always be a stack of time spans). When logging arbitrary time spans that partially overlap, Perfetto cuts the nested ones to make sure they fit into their suspected parent. This makes the logged data incorrect and makes it hard to understand the performance of an application using this data.

There's a fix for this problem: logging these arbitrary segments/time spans in separate tracks that only share the name. In this case, Perfetto groups the data in the UI but allows overlapping (as they're not really on the same track).

Reviewed By: sammy-SC

Differential Revision: D60010696

fbshipit-source-id: 378ea492c4fafbe55ef97fa91e4fa50bbc1893ae
2024-07-22 05:00:31 -07:00
Rubén Norte df9b2cef7e Prefix custom tracks for markers coming from JS with Web Performance (#45564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45564

Changelog: [internal]

(this is internal because the integration hasn't been enabled in OSS yet)

In our current React integration for Perfetto we're currently creating multiple custom tracks that are spread throughout the process section and it can be hard to identify the source of the information.

This adds a "Web Performance: " prefix to all custom tracks coming from JS to achieve 2 purposes:
* Group them together (in terms of order in the process)
* Clarify the source of the data

Reviewed By: sammy-SC

Differential Revision: D60010695

fbshipit-source-id: 081f5b6417d676c61005114337530a089142e7c6
2024-07-22 05:00:31 -07:00
Rubén Norte 2551aee4b0 Expose PerformanceObserver related classes in the global scope (#45539)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45539

Changelog: [internal]

This exposes several classes (interfaces in the spec lingo) related to the Performance API to the global scope, so users can access them directly to do things like refinements using `instanceof`. This also prevents the need from importing the modules from `react-native` directly, which would prevent code sharing with Web.

Reviewed By: rshest

Differential Revision: D59859654

fbshipit-source-id: e1f7afb0c98b394b1f97c3790db2e570e6ba0cd9
2024-07-22 04:45:02 -07:00
Rubén Norte a5bd64ece8 Move classes for Event Timing API to the same module to align with existing convention (#45535)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45535

Changelog: [internal]

Small refactor to group things based on the spec where they're defined.

Reviewed By: rshest

Differential Revision: D59911334

fbshipit-source-id: 1c40d6bf82b6cc7be78bd81b652d6855c39a53eb
2024-07-22 04:45:02 -07:00
Rubén Norte 2680198b09 Use the right interfaces for PerformanceLongTaskTiming (#45526)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45526

Changelog: [internal]

Just using the right interfaces so we can expose them in the global scope and do refinements as necessary using `instanceof`.

Reviewed By: rshest

Differential Revision: D59911144

fbshipit-source-id: 9779e3220f2c6f81955f54506f97142f0f4ffdd4
2024-07-22 04:45:02 -07:00
Rubén Norte 2a91a703cc Improve spec-compliance of Performance interfaces (#45525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45525

Changelog: [internal]

This makes several changes to the Performance API to align it closer with the spec:
* Makes fields of `PerformanceEntry` and subclasses read-only.
* Returns instances of the correct subclass of `PerformanceEntry` to observers.
* Renames `HighResTimeStamp` as `DOMHighResTimeStamp` for alignment with the spec and native

Additionally, I realized that the way we handle `performance.measure` is a bit problematic at the moment. When we call the function, we create a `PerformanceMeasure` instance with the data we receive, and return that value. In parallel, we notify the entry to native, which will in turn notify the observers. But the observers will not get those instances we just created, but new instances of `PerformanceEntry` (not even `PerformanceMeasure`) with the resolved values. At the same time, the `PerformanceMeasure` instance we return doesn't resolve its `startTime` and `duration` based on the indicated marks (when specified as strings). We need to fix this in the future by resolving the timing data synchronously when calling `performance.measure`.

Reviewed By: rshest

Differential Revision: D59911145

fbshipit-source-id: e0be0441f307cc9bdea8795ae88b6f390780fc7b
2024-07-22 04:45:02 -07:00
Rubén Norte 9b06ac8379 Restrict durationThreshold to event entry types only (#45524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45524

Changelog: [internal]

The `durationThreshold` option is only meant to be used with `event` entry types. `mark`, `measure`, `longtask`, etc. shouldn't take that option into account, as per the spec.

Reviewed By: mdvacca

Differential Revision: D59918519

fbshipit-source-id: 0553d46944cbe80a32712ff57140763f2514f734
2024-07-22 04:45:02 -07:00
Samuel Susla 9a380363ae use constexpr string_view to avoid allocation (#45565)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45565

changelog: [internal]

Simple change to avoid string allocation.

Reviewed By: christophpurrer

Differential Revision: D59964183

fbshipit-source-id: fc0f341f10ef2fb5afdc9f5593d268d4444717da
2024-07-22 04:40:42 -07:00
Pieter De Baets 235e84ccae Remove delay between instance start and surface creation (#45545)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45545

ReactInstance creation in bridgeless returns a callback that requires dispatching on the UI thread to complete the init. If that thread is busy (eg with other startup tasks), we delay starting the initial surface unnecessarily.

This diff adds an experiment to return early from that startup task to allow follow-up tasks to be scheduled on the JS thread without waiting for lifecycle changes to have been applied.

Changelog: [Internal]

Reviewed By: markv

Differential Revision: D59961779

fbshipit-source-id: dd6a6fe093a32144ef6823bde5ac94a61d268fd2
2024-07-22 04:04:40 -07:00
Gabriel Donadel aa4f802fde Restore CLI_PATH variable in react-native-xcode script (#45560)
Summary:
When changing the `react-native-xcode.sh` logic to use the helloworld cli on https://github.com/facebook/react-native/pull/44721, the `CLI_PATH` env var was removed along with `BUNDLE_COMMAND`. Both of these values were used by Expo to override the default CLI and use our custom bundling command.

https://github.com/expo/expo/blob/10e302ee13add0e24a08c7ee792c2da50ace95a6/templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj#L215C4-L215C15

This restores the `CLI_PATH` variable and set the default value as `"$REACT_NATIVE_DIR/scripts/bundle.js"`, along with the `BUNDLE_COMMAND` variable. With this Expo and other frameworks can keep the ability to easily replace the internal CLI

## Changelog:

[INTERNAL] [CHANGED] - Restore CLI_PATH variable in react-native-xcode script

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

Test Plan: Project compiles correctly on iOS

Reviewed By: robhogan

Differential Revision: D60035338

Pulled By: blakef

fbshipit-source-id: 26583d11d9f573f7cfa405b68e0cc3304c3601df
2024-07-22 03:19:39 -07:00
David Vacca 9af63956d2 Enable prop diffing for <View> (#45551)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45551

This diffs toggles the new Android prop diffing mechanism for <View> components

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D59613243

fbshipit-source-id: 79c1e4bf4f5a67fc516e5db7b9f4ffba0cb9b69b
2024-07-20 10:23:12 -07:00
David Vacca a052e1eefd Refactor BaseProps.resolveborderMetrics method (#45554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45554

In this diff I'm extracting the creation of borderWidth into its own method, this is necessary for next diffs of the stack.

Nh behavior change is introduced here

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59942306

fbshipit-source-id: 85d39b64deaa4e8a8632d6f4aab72f626e594b5d
2024-07-20 10:23:12 -07:00
David Vacca 6d08d3af93 Introduce Props.getDiffProps method (#45553)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45553

This diff introduces a "temporary" method called getDiffProps to calculate the difference between 2 props and serialize its result into a folly::dynamic map.

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59613245

fbshipit-source-id: 3e23cde0113ac2a3904c8daa48a1ca048cd0262d
2024-07-20 10:23:12 -07:00
Nick Gerleman b18635e5ab Fix drop-shadow filter (#45556)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45556

I missed updating this, and the e2e test we had isn't running, so switching JS objects to camel case broke this.

Changelog: [internal]

Reviewed By: jorge-cab

Differential Revision: D60003747

fbshipit-source-id: 6b7b1138e3ebbfdb982f5a089804351cc4b198ba
2024-07-20 07:57:03 -07:00
Alan Lee 3a5eb19731 fix ConcurrentModificationException in ReactScrollViewHelper (#45550)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45550

`ConcurrentModificationException` is happening from `emitScrollEvent()`.
This usually happens if we modify the collection (add/remove) while accessing collection in a foreach loop.
Seems likely add/remove is called from a different thread while in the foreach loop.
Converting to list before we do the foreach as a quick fix.

Changelog: [Internal] - quick fix for exception

Issure reported here: https://fb.workplace.com/groups/rn.support/permalink/26557068097248454/

Reviewed By: mdvacca

Differential Revision: D59991739

fbshipit-source-id: a2fcc798430acaadd07561a5be871967cc8f2c3b
2024-07-19 18:44:48 -07:00
Peter Abbondanzo aeb020dfa3 Add null check for instance manager (#45549)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45549

## Summary
Calling `getCurrentReactContext` on an unmounted `ReactRootView` could lead to a NPE. The method currently returns a nullable value so return type is the exact same. This change checks if the react instance manager is present and returns null early if not.

## Changelog:
[Android] [Fixed] - Adds a null check in react context getter

Reviewed By: zeyap

Differential Revision: D59982179

fbshipit-source-id: bac5c12e7dc4ee3296991063eb3746141b8446bc
2024-07-19 15:45:20 -07:00
Nick Gerleman d9263fbdbb Enable ViewConfig validation in RNTester (#45530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45530

Enable viewconfig validation for RNTester to catch where static and native viewconfigs are mismatched, during development or contribution time. This relies on `useNativeViewConfigsInBridgelessMode()` which is already enabled in `DefaultNewArchitectureEntryPoint` on Android, and seems to be in iOS AppDelegate `RCTRootViewFactory` as well.

We put it in an early place in the bundle before first render, since we don't have RNTester preludes right now, but I think it is still early enough?

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D59946366

fbshipit-source-id: ae0c23b13a566489a88a7b4e408f61dce314b003
2024-07-19 09:37:03 -07:00
Nicola Corti e50e554039 Move helloworld to build from artifacts on Android (#45517)
Summary:
This moves the `helloworld` app to build from the artifacts produced by build_npm_package so that we don't rebuild ReactNative Android from source 8 times.
It reduces build time of such jobs from 14mins to 4mins, resulting in 80mins of build time for every test_all run.

## Changelog:

[INTERNAL] - Move helloworld to build from artifacts on Android

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

Test Plan: CI

Reviewed By: blakef

Differential Revision: D59957613

Pulled By: cortinico

fbshipit-source-id: b6c4adcf804af6c8d2661cf56549d037e09aa2c1
2024-07-19 08:55:19 -07:00
szymonrybczak 353d88d54e feat: update CLI to 14.0.0 (#45540)
Summary:
Update to stable version of `react-native-community/cli`.

## Changelog:

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to `13.6.9`

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

Test Plan: n/a

Reviewed By: blakef

Differential Revision: D59960021

Pulled By: cortinico

fbshipit-source-id: 9d470699cdd2d20e08e844c92c7982056aec082c
2024-07-19 08:36:24 -07:00
Ruslan Shestopalyuk f3eaf63683 Remove inconsistency warning in viewconfig validation (#45543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45543

# Changelog:

[Internal]-

Introduced recently, this confuses viewconfig validation vs the vanilla Android view managers.

So this change effectively reverts the exposure of `ScrollView.scrollIndicatorInsets` to Android, achieving the goal in a different way (via the SVC injection workaround for the specific Android platform flavour).

Reviewed By: NickGerleman

Differential Revision: D59960782

fbshipit-source-id: 3b9a49f1466426d909e94bf4d33f1d09fbf822c2
2024-07-19 08:24:54 -07:00
nik910 be93092c1b Adding space to $(inherited) string to avoid merging of inherited and… (#45520)
Summary:
Added space to $(inherited) string to avoid creation of wrong cpp flags in RCTAppDelegate podspec

<img width="1157" alt="Screenshot 2024-07-18 at 8 51 19 PM" src="https://github.com/user-attachments/assets/29d32d08-e81f-4c25-b8ee-5dccc0f620ea">

## Changelog:

[IOS] [FIXED] - Building of iOS project when RCTAppDelegate is used in the project

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

Test Plan: To test this you can simply change in your node modules and run pod install, the build will now work successfully

Reviewed By: cipolleschi

Differential Revision: D59950906

Pulled By: arushikesarwani94

fbshipit-source-id: 0d58620aa0be7ac4fcbcd309f06df0eef7844016
2024-07-19 02:05:24 -07:00
Nick Gerleman 245e5d9d95 Remove experimental_boxShadow from Android base view config (#45529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45529

`experimental_boxShadow` is not yet part of Android view managers, and when we enable it, we are likely to do a view manager at a time before moving to BaseViewManager.

This causes user-visible errors when viewconfig validation is turned on, since we have a static view config, but not yet a native view config.

This removes the static viewconfig for Android until we start adding setters to view manager.

It is kept in `ReactNativeStyleAttributes` (which I think can have members not in the native view-config, since it has component specific props like tintColor), and iOS base viewconfig. On Fabric iOS, this is part of BaseViewProps, and handled by RCTView, but it looks like the prop (and also `experimental_filter`, `experimental_mixBlendMode`) do not have entries in iOS RCTViewManager, which is fixed in next diff in the stack.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D59939866

fbshipit-source-id: 2781029a0c29ba111ed04edfe9940c6c72f4e5ac
2024-07-18 18:19:41 -07:00
Nick Gerleman 1315d65bf5 Handle nullish values in processBoxShadow and processFilter
Summary:
Viewconfig processors may still get called for nullish values I think. Most other processors explicitly handle these (but some don't??).

This returns an empty list, like on parse error, when we have a value, but the value is nullish.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D59933611

fbshipit-source-id: 3f1d89d21977bbe01a05e708aadf1a9451d88083
2024-07-18 17:17:16 -07:00