Commit Graph

38536 Commits

Author SHA1 Message Date
Ruslan Lesiutin 4b7906bc15 Switch from single Complete event to a pair of Async Nestable events (#48906)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48906

# Changelog: [Internal]

It looks like on `Chrome` side, Complete events (`ph="X"`) are only used for Renderer-related events.

For user-land events with duration (non-instant events), there is a [set of supported types](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L62-L65), which don't include `"X"`.

Later, pair of such events will form a [performance measure event](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/types/TraceEvents.ts#L2256-L2258).

Reviewed By: huntie

Differential Revision: D68564754

fbshipit-source-id: dac87ab06c47925a70e03f43f0628364217a06a2
2025-01-24 08:41:48 -08:00
Vitali Zaidman d85294b953 fix ignoring of temp local project settings for RNTester
Summary: Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D68625659

fbshipit-source-id: b5ce8ff04b5bb678b5fd19bc6fa5d1c5451df3a9
2025-01-24 07:53:32 -08:00
Andrew Datsenko 1b050b571e Upgrade undici to 5.28.5 (#48898)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48898

Changelog: [Internal]

GitHub has identified a security vulnerability in a package dependency defined in the repository, facebook/react-native.

Package name: undici
Affected versions: >= 4.5.0, < 5.28.5
Fixed in version: 5.28.5
Severity: MODERATE

Identifiers
GHSA-c76h-2ccp-4975
CVE-2025-22150

References
https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975
https://nvd.nist.gov/vuln/detail/CVE-2025-22150
https://github.com/nodejs/undici/commit/711e20772764c29f6622ddc937c63b6eefdf07d0
https://github.com/nodejs/undici/commit/c2d78cd19fe4f4c621424491e26ce299e65e934a
https://github.com/nodejs/undici/commit/c3acc6050b781b827d80c86cbbab34f14458d385
https://hackerone.com/reports/2913312
https://blog.securityevaluators.com/hacking-the-javascript-lottery-80cc437e3b7f
https://github.com/nodejs/undici/blob/8b06b8250907d92fead664b3368f1d2aa27c1f35/lib/web/fetch/body.js#L113
https://github.com/advisories/GHSA-c76h-2ccp-4975

Reviewed By: NickGerleman

Differential Revision: D68561080

fbshipit-source-id: 7aa71e959ac38f3e0f49d8503a471f60d2f44c5d
2025-01-24 07:06:10 -08:00
Samuel Susla 70fa456ddc remove explicit calls to root.destroy (#48927)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48927

changelog: [internal]

Remove explicit calls to root.destroy() in favour of automated system that will call it and check for memory leaks.

Reviewed By: rubennorte

Differential Revision: D68624917

fbshipit-source-id: 44be1dee9a56ec31bea5a9eefdda086a4cb4248f
2025-01-24 07:03:27 -08:00
Iwo Plaza e5818d92a8 Migrate files in Libraries/Core to export syntax (#48889)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48889

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/Core` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections
- Appends `.default` to requires of the changed files.
- Changed `* as ExceptionsManager` to `ExceptionsManager` in import statements throughout product code.
- Updates test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Core` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.
[General][Breaking] - `Libraries/Core/ExceptionsManager` now exports a default `ExceptionsManager` object, and `SyntheticError` as a secondary export.

Reviewed By: huntie

Differential Revision: D68553694

fbshipit-source-id: 51c9a404b2762cb1cdb5f56cae3a683ccdfffc7f
2025-01-24 05:43:28 -08:00
Dawid Małecki d2adb976ab Replace $FlowFixMe in WebSocketInterceptor callbacks (#48702)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48702

Changelog:
[General][Changed] - Improved types in WebSockertInterceptor callbacks

Reviewed By: cortinico

Differential Revision: D68210857

fbshipit-source-id: 4f2a47be6f96e26db25edbaffcbe97b76ffbdc33
2025-01-24 04:51:43 -08:00
Rubén Norte 348b917c58 Move methods to access internals of DOM nodes to a separate module (#48854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48854

Changelog: [internal]

Moves the internals to access instance handle and shadow node from public instances from `ReadOnlyNode` to `NodeInternals` so it's more obvious when people are reaching into internal APIs/state.

Reviewed By: javache

Differential Revision: D67654404

fbshipit-source-id: 1063bc9451eeacb79af34614df3be02466f93fa3
2025-01-24 04:42:45 -08:00
Ruslan Lesiutin ad67f8099b add optional id field (#48897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48897

# Changelog: [Internal]

Adds optional `id` field to Trace Event spec. This field will be required once we are going to emit trace with real custom tracks.

For custom tracks, we would need to emit pair of trace events:
1. Begin Event with type `b`.
2. End Event with type `e`.

They are [matched](https://github.com/ChromeDevTools/devtools-frontend/blob/99a9104ae974f8caa63927e356800f6762cdbf25/front_end/models/trace/helpers/Trace.ts#L261-L294) by Chrome DevTools frontend by `id` and `name` fields.

Reviewed By: huntie

Differential Revision: D68559862

fbshipit-source-id: 732ae52691e31213f9c63474905eb7c1b12adb8c
2025-01-24 04:38:18 -08:00
Ruslan Lesiutin df4d9d1cce Split stopTracingAndCollectEvents (#48795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48795

# Changelog: [Internal]

Splitting `PerformanceTracer::stopTracingAndCollectEvents()` into 2 separate methods.

Once we add logic for starting and stopping tracing on `InstanceAgent`:
- We would need to stop tracing everywhere synchronously
- Populate data sources in `PerformanceTracer`, like JavaScript samples
- Collect all events from different data sources in one payload via `PerformanceTracer::collectEvents()`

Reviewed By: huntie

Differential Revision: D68331485

fbshipit-source-id: 0d6b21a522d841f7f734e2fad2e0fc533097fdee
2025-01-24 04:27:55 -08:00
Jorge Cabiedes Acosta 6c6e0a9085 Fix anti-aliasing on older Android devices
Summary:
On older Android versions clipping doesn't have anti-aliasing by default which means that clipping with no border will always make the background not have anti-aliasing.

This is fixed by default on new Background and Border drawables since rendering logic is separated

Moving the clipping logic so it only runs when we have a border.

https://github.com/facebook/react-native/issues/41226

Changelog: [Android] [Fixed] - Fixed anti-aliasing not showing on older Android versions

Reviewed By: javache

Differential Revision: D68279400

fbshipit-source-id: e2383c71bd1ca89f66f42630b3712bb4cc5cd7ac
2025-01-23 20:52:48 -08:00
Joe Vilches 1b710a0cb2 Back out "Allow text links to be navigatable via keyboard by default"
Summary:
This was causing links to not ellipsize and be scrollable. Gonna revert while I see if I can workaround

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D68596950

fbshipit-source-id: 432a059d0b10acbb45d34e0c98763680d280937b
2025-01-23 19:19:13 -08:00
David Vacca 5ea7594b5c Fully rollout enableDeletionOfUnmountedViews feature flag (#48872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48872

enableDeletionOfUnmountedViews feature flag has been enabled for 4 months with no errors on production, also it's been enabled in OSS since 0.76.
This diff removes the feature flag and fully rollout this fix

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D68511227

fbshipit-source-id: a42481c57aaab2e8c45b952af5e044bf60740df3
2025-01-23 17:38:38 -08:00
Nick Gerleman fae6edb65c Support parsing hsl() and hsla() functions (#48843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48843

Adds support for hsl() and hsla() funtions. This supports more modern syntax options than normalize-color, like number components, optional alpha, and fills in missing support for angle units. The underlying math was lifted pretty much directly from normalize-color though.

An aside, std::remainder for these is not guaranteed to be constexpr, but Clang is still okay with rgb function parsing to be contexpr because we never try to evaluate non-constexpr function?

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68473990

fbshipit-source-id: 2a71d8367b22f9d1ba6a66598d40ef2683847704
2025-01-23 16:19:48 -08:00
Nick Gerleman 91add1e4e0 Remove redundant check in CSSRatio (#48842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48842

This is a result of inlining isinf previously but we can never be negative infinity because we can never be less than zero.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68474836

fbshipit-source-id: bfce78c4bd269ff2afac99c03250ede676ee1029
2025-01-23 16:19:48 -08:00
Nick Gerleman a4b112cb0b Do not consume delimeter when not consuming component value (#48841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48841

Right now during parsing we can ask for a next component value, with a delimeter, and even if we don't have a component value to consume, we will consume the delimeter.

This is kind of awkward since e.g. trailing comma can be consumed, then we think syntax is valid. Let's try changing this.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68474739

fbshipit-source-id: 47a942681bc8472ca28470eba821d4d95306ae5d
2025-01-23 16:19:48 -08:00
Nick Gerleman 5b3d8d3410 More spec compliant rgb function parsing (#48839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48839

In the last diff I mixed and matched `<legacy-rgb-syntax>` and `<modern-rgb-syntax>` a bit to keep compatiblity with `normalze-color`.

Spec noncompliant values have only been allowed since https://github.com/facebook/react-native/pull/34600 with the main issue being that legacy syntax rgb functions are allowed to use the `/` based alpha syntax, and commas can be mixed with whitespace. This seems like an exceedingly rare real-world scenario (there are currently zero usages of slash syntax in RKJSModules validated by `rgb\([^\)]*/`), so I'm going to instead just follow the spec for more sanity.

Another bit that I missed was that modern RGB functions allow individual components to be `<percentage>` or `<number>` compared to legacy functions which only allow the full function to accept one or the other (`normalize-color` doesn't support `<percentage>` at all), so I fixed that as well.

I started sharing a little bit more of the logic here, to make things more readable when adding more functions.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68468275

fbshipit-source-id: f1dfab51b91a3f64436c2559daa3d1e8891db889
2025-01-23 16:19:48 -08:00
Nick Gerleman 24393c7dde Add CSSDelimeter::OptionalWhitespace and CSSDelimeter::CommaOrWhitespaceOrSolidus (#48828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48828

1. Rename `CSSComponentValueDelimeter` to `CSSDelimeter` bc the names are getting way too long.
2. Make the distinction between `Whitespace` and `OptionalWhitespace`. Note that for property values, and function blocks, the value parser will already remove trailing/leading whitespace, but it's weird that whitespace unlike others was not required to be present
3. Add `CSSDelimeter::CommaOrWhitespaceOrSolidus` for simpler parsing in the common pattern of alpha values, and move CSSColor function parsing to use that

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68461968

fbshipit-source-id: 388056e47dfe6ca6003b44e82e00fe416706330b
2025-01-23 16:19:48 -08:00
David Vacca d40f90b5e7 Migrate PackagerStatusCheck to Kotlin (#48838)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48838

Migrate PackagerStatusCheck to Kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68467780

fbshipit-source-id: ace98692ebcf96bf0ca36640183c432121d95519
2025-01-23 14:57:33 -08:00
Chi Tsai d9d824055e Add createFromUtf16 JSI method (#48211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48211

Adding the default implementation for `createFromUtf16` method for JSI
String and PropNameId.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D67070206

fbshipit-source-id: 47297e6ae3028ee0e101628aab5bc076fcbbdebc
2025-01-23 14:54:17 -08:00
Jorge Cabiedes Acosta f89f191c26 Go back to object approach instead of manual drawable layer handling for CompositeBackgroundDrawable (#48835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48835

D65907786 ended up regressing a bit of the performance gains from new Background and Border Drawables. changing back to the previous approach.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68354292

fbshipit-source-id: f2db6d7ad5c1590d5d4d8261d76281f3592f488a
2025-01-23 12:39:25 -08:00
Samuel Susla 0353648f46 add tests for ScrollView.onScroll (#48891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48891

changelog: [internal]

add two tests covering onScroll: one for the case where onScroll is triggered multiple times during one UI tick and one where it is triggered once per UI tick.

Reviewed By: rubennorte

Differential Revision: D68499566

fbshipit-source-id: ee25227b620569e3a43038575f04b0a325e5e38b
2025-01-23 11:47:31 -08:00
Samuel Susla f695411bf3 add isUnique option to Fantom.dispatchNativeEvent (#48801)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48801

changelog: [internal]

Adds isUnique option to Fantom.dispatchNativeEvent.

isUnique controls whether only the last event of the same type and target is dispatched to JavaScript or all events are queued and dispatched.

Reviewed By: rubennorte

Differential Revision: D68416157

fbshipit-source-id: 415e7db7d258d60a6bc510d929091153bfdccb3f
2025-01-23 11:47:31 -08:00
Riccardo Cipolleschi b9f418e9bc Fix images not displayed when extension is implicit (#48888)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48888

We have a report from OSS where Images are not displayed properly in case they are saved on disk with no extension.

We previously had a fix attempt iwith [this pr](https://github.com/facebook/react-native/pull/46971), but this was breaking some internal apps.

This second attempt should work for both cases.

## Changelog:
[iOS][Fixed] - Load images even when the extension is implicit

Reviewed By: cortinico

Differential Revision: D68555813

fbshipit-source-id: bc25970aafe3e6e5284163b663d36e00b3df3d82
2025-01-23 11:37:16 -08:00
Nicola Corti 3702c986ed RNGP - Update comment on INCLUDE_JITPACK_REPOSITORY_DEFAULT (#48896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48896

This comment is not exact and should be updated.

Changelog:
[Internal] [Changed] -

Reviewed By: yungsters

Differential Revision: D68556425

fbshipit-source-id: 67427ff325809907fdeba1c6a90b84b97713bf5e
2025-01-23 10:52:34 -08:00
Edmond Chui 9b977def6c Fix app lagging while attempting a connection to Metro (#48895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48895

Changelog:
[General][Breaking][Fixed] - removed a long-running loop causing the app to lag while attempting a connection to Metro

Round 2: Sorry I broke VR/Java apps in D68023397. Helpful teammates have reverted and Jedi landed it via D68522537.

This diff adds the missing method call that caused the crash:

```
makeNativeMethod(
  "didOpen",
  JCxxInspectorPackagerConnectionWebSocketDelegate::didOpen
)
```

Test plan has been updated to include testing VR Store.

This error wasn't caught by existing automated tests, because it only impacts development builds while using Metro. vzaidman is leading the effort to bring Jest E2E tests on React Native DevTools, which could catch crashes like this.

Original summary in D68023397:

D65952134 fixed the auto-reconnection between Metro and the device.

There's an existing "constructed = connected" contract as [discussed](https://www.internalfb.com/diff/D65952134?dst_version_fbid=3741052436109227&transaction_fbid=581445277659906):

https://www.internalfb.com/code/fbsource/[1592525fbcbb]/xplat/js/react-native-github/packages/react-native/ReactCommon/jsinspector-modern/WebSocketInterfaces.h?lines=16-20

In compliance, busy-waiting was [introduced](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=427393513742494) in V4 to wait for the connection result in the constructor.

xArthasx [discovered](https://www.internalfb.com/diff/D65952134?dst_version_fbid=896147259315683&transaction_fbid=1406890420289706) a performance issue from this impl via a profiling result.

In favour of async connection results, we're going back to V3 design with the imperative `isConnected()` check to the interface. xArthasx has confirmed this fixes the perf issue.

While I haven't found a compelling reason against removing this contract from the initial design in D52134592, please let me know if I've missed one.

This also means there was a scenario where messages were sent before the websocket is open. Those were dropped silently previously (before the busy-waiting while loop was introduced):

https://www.internalfb.com/code/fbsource/[f7113e167ee1]/fbobjc/VendorLib/SocketRocket/src/SocketRocket/SRWebSocket.m?lines=630-637

This means message senders must now consider the connection state, e.g. by maintaining a pre-connection message queue, if they need to guarantee the messages to be sent.

Reviewed By: robhogan

Differential Revision: D68559198

fbshipit-source-id: afb3d8bfbf949c3324cbf126e9f3e3fc25e50541
2025-01-23 10:43:59 -08:00
Iwo Plaza ecae8a2908 Remove seemingly unused AnimatedWeb file. (#48894)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48894

## Motivation
In our efforts to migrate the RN codebase to modern Flow (to enable ingestion by modern Flow tooling) I stumbled upon the `AnimatedWeb.js` file, which does not seems to be imported anywhere throughout the monorepo.

Searching on GitHub for imports to this file in OSS projects returned no results.

In case this file has actual uses outside of Meta (e.g. in OSS), I'll abandon the diff 🙌

## This diff
- Removes `Libraries/Animated/AnimatedWeb.js` file

Changelog:
[General][Breaking] Removed `Libraries/Animated/AnimatedWeb.js` file.

Reviewed By: cortinico

Differential Revision: D68558237

fbshipit-source-id: 319b5e59eb83e518cd123b9f74642e90f0003a4a
2025-01-23 10:32:59 -08:00
Ruslan Lesiutin a995ecc9c6 Encapsulate Trace Event format (#48648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48648

# Changelog: [Internal]

This is the pre-requisite before adding a formatter for conversion from Hermes format-agnostic API for JavaScript samples to Trace Events.

This struct will probably be used a lot around this module and big enough for a separate header.

Reviewed By: huntie

Differential Revision: D68104202

fbshipit-source-id: 93f2816de5a87471c5f7761468ccc52a34a895d6
2025-01-23 10:29:48 -08:00
Rubén Norte 0736234e90 Use test name as a hint for benchmarks (#48882)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48882

Changelog: [internal]

The current hint for benchmarks is that the test body contains `unstable_benchmark` calls, but some benchmarks that need to use feature flags define their test bodies in a separate file, so the file containing the call to `unstable_benchmark` isn't the `-itest.js` one.

This adds a new hint to opt into optimized builds that uses the name of the test instead of its contents. If it contains `-benchmark` then we consider it a benchmark and do the opt in.

Reviewed By: andrewdacenko

Differential Revision: D68102300

fbshipit-source-id: 4c0909969f76b8a7d563959cccf686aefaef700d
2025-01-23 10:26:47 -08:00
Rubén Norte 8702ed5f37 Improve format of benchmark results (#48881)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48881

Changelog: [internal]

Small improvement in the printed benchmark results.

Reviewed By: andrewdacenko

Differential Revision: D68552379

fbshipit-source-id: 39312a757a9de57e462c17a9f1455dfe8cab53f1
2025-01-23 10:26:47 -08:00
Andrew Datsenko c5bab82a60 migrate console-itest to beforeEach/afterEach (#48821)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48821

Changelog: [Internal]
Add setup and teardown to console-itest

Reviewed By: rubennorte

Differential Revision: D68454178

fbshipit-source-id: 277e1125248b860a6fe085a5e47dddf4c5cd12da
2025-01-23 09:45:21 -08:00
Andrew Datsenko cf6b807745 Add support for (before|after)(Each|All) methods (#48820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48820

Changelog: [Internal]
Add capability to setup / teardown tests

Reviewed By: rubennorte

Differential Revision: D68454176

fbshipit-source-id: 93c19c91dfe2b8b98385547da24955fd31adbf0b
2025-01-23 09:45:21 -08:00
Iwo Plaza da695f3a20 Migrated components to export syntax (part 4) (#48808)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48808

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates a handful of components in `Libraries/Components` to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates test files.
- Updates the public API snapshot *(intented breaking change)*
- Synchronizes `GoodwillVideoEditorCandidateImage.js` with www, as it was using `require`s that would result in invalid code after this Diff's changes. Added `ReactNativeImage` shim.

Changelog:
[General][Breaking] - Files inside `Libraries/Components` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: yungsters

Differential Revision: D68436611

fbshipit-source-id: 14f33e375e60429ea2340fb49ddf9dc6eb79594f
2025-01-23 09:03:46 -08:00
Samuel Susla 56a60601da add tests for TextInput.onChange and TextInput.onChangeText (#48899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48899

changelog: [internal]

Add tests for `TextInput.onChange` and `TextInput.onChangeText`.

Reviewed By: rubennorte

Differential Revision: D68498998

fbshipit-source-id: 212bc251700b343f7290fb7e2a5f2ddfdb68dfd1
2025-01-23 08:59:13 -08:00
Iwo Plaza 7df73eebdc Migrated Libraries/WebSocket/* to export syntax. (#48884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48884

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in `Libraries/WebSocket` to use `export` syntax
- Appends `.default` to requires of the changed files.
- Updates mocks.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/WebSocket` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: cortinico

Differential Revision: D68554260

fbshipit-source-id: 90a660fe9e76b255171189101819253521354fda
2025-01-23 08:55:25 -08:00
Alex Hunt b8ee2b3503 Add source transformation pipeline to build-types (#48893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48893

Updates `build-types` to support source file AST transforms, and templates out an initial `stripPrivateProperties` transform.

- Also, parallelise file translation via `Promise.all`.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D68558012

fbshipit-source-id: 6eb3881fcf30bf8f4ba045522f6569fbbad14f62
2025-01-23 08:29:09 -08:00
Rubén Norte 8a2b44568d Partially restore feature flag to disable event loop on bridgeless (#48892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48892

Changelog: [internal]

Reviewed By: javache, Abbondanzo

Differential Revision: D68557746

fbshipit-source-id: d94877d03dc6ea2bf6bca45da77a0a769fa0efeb
2025-01-23 08:12:35 -08:00
Ritesh Kumar Shukla 317f130267 Update info.ts (#48876)
Summary:
Found this while I was trying to make my own react native info for CI. For android Podfile.lock is being read instead of gradle.properties

## Changelog:

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

Pick one each for the category and type tags:
[INTERNAL][FIXED] - Fixed React native info where Podfile.lock was being read for android

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

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

Reviewed By: blakef

Differential Revision: D68553964

Pulled By: cortinico

fbshipit-source-id: 7d6391195dab0c2230fe86fb465de6d3f94ccbef
2025-01-23 07:19:55 -08:00
Riccardo Cipolleschi dab9b3b440 Stop generating the ReactCodegen.podspec in Cocoapods (#48815)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48815

In an effort to reduce the responsibility of Cocoapods in React Native, we are moving the generation of the Reactcodegen podspec from Cocoapods itself to the codegen infrastructure.

This reduce the responsibility of Cocoapods and allow us to migrate away from it with more ease.

## Changelog:
[iOS][Changed] - Generate the ReactCodegen.podspec as part of codegen instead of as part of pod install.

Reviewed By: cortinico

Differential Revision: D68418268

fbshipit-source-id: 004ac5b6b3563bf96cc38942f2b48b6f269541c3
2025-01-23 05:38:20 -08:00
Samuel Susla 3e29cbe1d0 add test for TextInput blut and focus (#48862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48862

changelog: [internal]

Add simple tests that use new `Fantom.dispatchNativeEvent` and `Fantom.runOnUIThread`.

Reviewed By: rubennorte

Differential Revision: D68492472

fbshipit-source-id: 33537ed7a728c2cc01abdcc5aa178b3afa3779fa
2025-01-23 05:30:24 -08:00
Samuel Susla 864c34e9f6 add event category to Fantom.dispatchNativeEvent (#48855)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48855

changelog: [internal]

add event category argument to Fantom.dispatchNativeEvent.

This gives tests option to control whether an event is continuous, discrete etc.

Reviewed By: rubennorte

Differential Revision: D68413879

fbshipit-source-id: f0c365df505a325440693ca7c3408dd612614946
2025-01-23 04:02:06 -08:00
Alex Hunt d4c1c7bfe3 Move experimental type generation into dedicated script (#48867)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48867

Also:
- Rename output dir to `types_generated/`.
- Support source patterns outside of the `react-native` package.

Changelog: [Internal]

Reviewed By: j-piasecki

Differential Revision: D68498211

fbshipit-source-id: 7f9f540efd6d3d2c70b8b1721738f3fea569641d
2025-01-23 02:39:32 -08:00
Ruslan Lesiutin 8a586f2fa1 Move setUpReactDevTools to InitializeCore (#48871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48871

# Changelog: [Internal]

Forward-fixing D68380665.

Requirements:
- `setUpReactDevTools` should be called before `setUpErrorHandling` to avoid React DevTools mutating `console.error` call arguments.
- `setUpReactDevTools` should be called after `setUpTimers`, because it is using `queueMicrotask`, see https://fb.workplace.com/groups/rn.panelapps/permalink/1120810879540337/.
- `setUpTimers` should be called after `polyfillPromise`, because it uses on `global.Promise`.

I went over bundles, which are not using `InitializeCore` and using either `setUpErrorHandling` or `setUpDeveloperTools` and updated their order of initialization accordingly.

Reviewed By: javache

Differential Revision: D68510100

fbshipit-source-id: 4331dcc7a7cb1dc438ca2ed5ccae49e736c41b2a
2025-01-22 22:06:43 -08:00
David Vacca c5af75294a Migrate SurfaceHandlerBinding to kotlin (#48870)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48870

Migrate SurfaceHandlerBinding to kotlin

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D68480893

fbshipit-source-id: a326d2646212598ded962d25cb8d1caf7a2ed6aa
2025-01-22 22:06:37 -08:00
Tim Yung d1028885ee Back out "Fix app lagging while attempting a connection to Metro"
Summary: Reverts {D68023397}

Reviewed By: Abbondanzo

Differential Revision: D68522537

fbshipit-source-id: 1c331969fea898fdee06dd988f86c5e1f034684f
2025-01-22 15:12:57 -08:00
David Vacca 159fc9922c Migrate FabricUIManagerProviderImpl to kotlin (#48869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48869

Migrate FabricUIManagerProviderImpl to kotlin

changelog: [internal] internal

Reviewed By: tdn120, cortinico

Differential Revision: D68480341

fbshipit-source-id: bf0f548230f9c8bcba07fe32a1fde5d9a1d72550
2025-01-22 13:20:37 -08:00
Joe Vilches 98b0991128 Allow text links to be navigatable via keyboard by default (#48773)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48773

This diff contains 2 fixes with regards to clickable text accessibility on Android.

1. It allows nested `Text` links to be accessible via keyboard. The accessibility here is a bit unique. The clickable text is not focused in the classical since that Android provides on `View`s (after all, the part being focused is not even a `TextView`. Its a `Span` in a `TextView`). However, it is [selected](https://developer.android.com/reference/android/widget/TextView#setSelected(boolean)), and pressing enter while it is selected will press the text, so for all intents and purposes it is focused. Some quirks here, though, are that you cannot press tab to cycle through the links in text, you have to use arrow keys. And the arrow keys no longer let you move around to the next item (as they are stuck being used to navigate the links). I *could* override this behavior but I do not see much of a point as long as one can actually get to everything on screen in a semi-logical way. Anyway, the fix here is using [`LinkMovementMethod`](https://developer.android.com/reference/android/text/method/LinkMovementMethod) to navigate between clickable spans, which is exactly what that class exists for. Note that I override this class so that touching the links does not actually highlight them like you see in the videos.
2. In the case we state update and remove the "click-ability" of the text, this diff makes it so that Explore By Touch no longer can focus on the link. The code was in the same area so I decided to just lump that together :P

Changelog: [Android] [Fixed] - Allow text links to be navigable via keyboard by default

Reviewed By: javache

Differential Revision: D68306316

fbshipit-source-id: a72145f6b60caf2a8077e1bd2ca987bdde0b82ab
2025-01-22 12:16:14 -08:00
Samuel Susla 4d96467954 add payload to Fantom.dispatchNativeEvent (#48794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48794

changelog: [internal]

Add payload argument to Fantom.dispatchNativeEvent. For example, in `TextInput.onChange` event, new value of input field must be present in the event payload.

Reviewed By: rubennorte

Differential Revision: D68410469

fbshipit-source-id: eb915f9f961efdfe9902f060173072c6259b7eea
2025-01-22 12:16:11 -08:00
Chi Tsai 7b0f83165e Fix unicode character usage in windows tests (#48840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48840

MSVC unicode handling is causing our windows test to fail. To fix,
simply replace the special characters with the their explicit UTF-16
encoding.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D68466808

fbshipit-source-id: 1bfc689972e1e5862fe6525bc48d5ebc508a95da
2025-01-22 12:07:20 -08:00
David Vacca 2c50e7043b Implement prop diffing for nativeForegroundAndroid prop (#48834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48834

Implement prop diffing for nativeForegroundAndroid prop

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D60001410

fbshipit-source-id: c6b5b71ddb66136f9cf61e2cca5aeb6e1274841e
2025-01-22 12:07:06 -08:00
David Vacca 48fad21759 Implement prop diffing for accessibility props in <View> (#48833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48833

This diff implements the diffing for accessibility props of <View>

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D59972041

fbshipit-source-id: 171381744e0e695cbc144507fa86b2d2ef536c30
2025-01-22 12:07:06 -08:00