Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49788
Release of 0.78 was successful but it failed to verify the package of NPM because of some error in the JS files.
Preparing for 0.79, I discovered some other issues in the NPM checking scripts.
This change should fix them.
## Changelog:
[Internal] - Fix publishing scripts
Reviewed By: fabriziocucci
Differential Revision: D70489717
fbshipit-source-id: 02a37d9a86fe108c7f7d2d634b8c0727dabb153d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49746
This flag is no longer necessary since RN 0.73 so I'm cleaning it up.
Changelog:
[Internal] [Changed] -
Reviewed By: rshest
Differential Revision: D70386741
fbshipit-source-id: c2c8f998fa7b97985396b26345cfcf3474effc7b
Summary:
When setting `USE_THIRD_PARTY_JSC=1`, we don't return anything from createJSRuntimeFactory function:

It's meant to be overwritten, but we must satisfy the compiler.
## Changelog:
[IOS] [FIXED] - return nullptr when USE_THIRD_PARTY_JSC is set to true
Pull Request resolved: https://github.com/facebook/react-native/pull/49781
Test Plan: CI Green
Reviewed By: cortinico
Differential Revision: D70486837
Pulled By: cipolleschi
fbshipit-source-id: c09622f75608dc203d41167fc375a000a2f12e37
Summary:
Upstreaming a fix by ntre that fixes a crash we saw internally related to `[_queue cancelAllOperations]`.
>Calling [_queue cancelAllOperations] will release all references to any active operations.
>If the blocks of those operations have a reference to itself, it will result in dangling pointers, which could conceptually trigger a later crash if there's a race between the operation completing and it being pulled out of the queue.
>
>Add explicit strong reference while block is running.
>For good measure, fix same pattern also in RCTFileRequestHandler.
>
>Note: separately, that this code is passing the op itself as a requestToken to [delegate URLRequest:] methods is suspect. That delegate can retain said token.
## Changelog:
[IOS] [FIXED] - avoid race condition crash in [RCTDataRequestHandler invalidate]
Pull Request resolved: https://github.com/facebook/react-native/pull/49705
Test Plan: Tested internally, we no longer saw the crash after this fix.
Reviewed By: javache
Differential Revision: D70314889
Pulled By: cipolleschi
fbshipit-source-id: ebcecb4675bd1dda3d9ee60d69967feb4e05e11b
Summary:
This PR makes React Native not relying on the `window` property in AppDelegate. When running in SwiftUI lifecycle mode / SceneDelegate mode there is window property on AppDelegate. This PR fixes crashes that happen because RN asserts window property is there.
## Changelog:
[IOS] [FIXED] - make React Native work without AppDelegate window property
Pull Request resolved: https://github.com/facebook/react-native/pull/49748
Test Plan: CI Green
Reviewed By: javache
Differential Revision: D70389691
Pulled By: cipolleschi
fbshipit-source-id: fe39f123b47014ba91a080239ccd298192c92a6a
Summary:
When downloading artifacts using a pattern, GHA, by default, creates a folder for each artifacts and copies the artifacts in that folder.
This breaks the maven publishing which expects the artifacts in the `artifact` folder and not i a subfolder.
The `merge-multiple` option allow for the artifacts to be downloaded in the specified folder, without the extra folder in the path
## Changelog:
[Internal] - Avoid the creation of intermediate folder when downloading the artifacts
Pull Request resolved: https://github.com/facebook/react-native/pull/49760
Test Plan:
GHA
<img width="791" alt="Screenshot 2025-03-02 at 11 08 33" src="https://github.com/user-attachments/assets/cfc85b27-117f-4d21-97ef-67493615a5a1" />
Reviewed By: fabriziocucci
Differential Revision: D70462254
Pulled By: cipolleschi
fbshipit-source-id: ed310a90bcdea55e466d4d71942a25abc6e6986a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49726
The `InspectorProxy` debug logging became incredibly spammy making it almost unuseful unless the output is manipulated so this commit batches all these cdp messages and only desplays how many were received in the span of 5s. If no messages are received, the throttle is not triggered.
To get the actual CDP messages logged, we still log these to `Metro:InspectorProxyCDPMessages`.
Changelog:
[General][Internal] batch debug logging for cdp messages
Reviewed By: robhogan
Differential Revision: D70324724
fbshipit-source-id: a269302f52e18af6c4be651758c042596abdbad8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49755
The artifacts are uploaded without the .tar.gz extension and the gradle script fails to upload them to sonatype.
This change adds the extensions.
## Changelog:
[Internal] -
Reviewed By: sammy-SC
Differential Revision: D70443149
fbshipit-source-id: c16d1842688b82ac216ffb90ecf2b75f562cca64
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49753
Sonatype cannot sign folders. It needs a file to be signed.
To make it happen, we are compressing the xcframeworks and the dSYM with tar, and we are uploading those files instead of the folders
I also observed that the cache keys were not computed correctly, so I'm fixing them.
## Changelog:
[Internal] - use tar.gz instad of folders for dSYM and xcframeworks
Reviewed By: bvanderhoof, mofeiZ
Differential Revision: D70409314
fbshipit-source-id: 20a5ee4f24b644f4f087974ad6b0831d5769b1d9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49749
This change configures gradle and CI to properly publish the RNDependencies artifacts to Maven Central
## Changelog
[Internal] - Configure gradle to publish on Maven Central
Reviewed By: cortinico
Differential Revision: D70390191
fbshipit-source-id: fc1e1070325240584cb07fb17e58118c4c583fa9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49731
This change runs the prebuilds in all the workflows we need:
- test-all
- nightlies
- create-release
## Changelog:
[Internal] - connect the rebuild-ios workflow with the other workflows
Reviewed By: cortinico
Differential Revision: D70331579
fbshipit-source-id: 6505a32672d43d06e29e68d37bd0ceff21bd7386
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49530
This change introduces the workflow to prebuild iOS artifacts.
This will be a reusable workflow, so we can then call it as it is from test-all, nightlies and publish-release
## Changelog:
[Internal] - Create prepare artifacts workflows
Reviewed By: cortinico
Differential Revision: D69854568
fbshipit-source-id: 5dc532fa564fe7e0987ba5d133da42e04237c3cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49711
Changelog: [IOS][CHANGED] - Moved workaround for multiline text measurement with `maximumNumberOfLines` earlier in the pipeline
Reviewed By: huntie
Differential Revision: D70314397
fbshipit-source-id: ef7dbf0c4bb3d5053328d81b7d5b8208e92ee7f5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49680
changelog: [internal]
add an end to end test for AppState module.
Reviewed By: rshest
Differential Revision: D70184850
fbshipit-source-id: ead1388ceb1018e7615e50f846f3c95224be97d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49643
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
Aligns `useAnimatedValue.js` with its manual .d.ts types.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D70096210
fbshipit-source-id: c3cd517eccf1cb68400772ddde6e5891861c927d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49741
While the test delay `PAGES_POLLING_DELAY` is usually enough to be equal to `PAGES_POLLING_INTERVAL`, in some cases we need extra time to sync that with the polling in `Devices.js`.
Changelog:
[General][Internal] - fix test
Reviewed By: huntie
Differential Revision: D70384823
fbshipit-source-id: ccb18884d32dc27636dbbb3a9786412056f90830
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49730
Changelog: [internal]
This removes all the types from "bom" that are actually not implemented in RN. For now, we're just stripping whole interfaces and not looking into specific methods/properties in interfaces that we do implement but not 100%.
`Performance`, `PerformanceObserver`, `MutationObserver` and `IntersectionObserver` are implemented but not stable yet, so they aren't exposed as globals in the types.
Reviewed By: huntie
Differential Revision: D70329185
fbshipit-source-id: 63bac619e100ca66b41df071df80dfa73d0f9651
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49737
Changelog: [internal]
Just a minor change to align with similar other option bags and TypeScript definitions.
Reviewed By: huntie
Differential Revision: D70355669
fbshipit-source-id: 37c44338c7b358eb2d25e8a14c75a78545b34bf1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49727
Changelog: [internal]
React Native doesn't define or use Service Workers, so this entire section for types is unnecessary.
Reviewed By: cortinico
Differential Revision: D70327703
fbshipit-source-id: b998eade21d19ed124824cb255a37cb9e805d151
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49724
Changelog: [internal]
This moves the type definitions for the globals defined by React Native from the repository root to the `react-native` package, in the same directory as the existing TypeScript definitions. This will make it easier for end users to configure the globals from RN using the right source of truth.
Reviewed By: huntie
Differential Revision: D70322032
fbshipit-source-id: 932df75ded0c254f2acb32e865cbbb9474c94159
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49685
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.
Changelog: [Internal]
Reviewed By: huntie
Differential Revision: D70237239
fbshipit-source-id: f552490cb6bb721c6163272689ec9b6c68386574
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49742
Seems like publishing jobs are not happy with Gradle Config Caching.
I'm disabling it for now till we find out what's the root cause.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D70385662
fbshipit-source-id: 532c46ea1e578bab5f3e5d6814a7f7193e67a7ad
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49738
**Context**
- D70012142 added TM module provider support
- This was causing RN MacOS to silently fail to load any platform modules since it didn't implement the delegate method
Changelog:
[iOS][Fixed] - Add guard for custom module provider lookup in TMManager
Reviewed By: sbuggay
Differential Revision: D70357542
fbshipit-source-id: 5b338616655ecb84cdb3c60e243fdb99444af657
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49735
I always get confused when I open this file. One of the main reasons is the order of contents is quite random, so I decided to reorder things. I tried to find a style guide on this but the [google ones](https://google.github.io/styleguide/javaguide.html#s3.4.2-ordering-class-contents) really just say do something that is logical so...
In general what I did was
* All instance variables, class variables, class constants, etc. are at the top of the class
* The constructor, `setDelegate`, `resetDelegate` methods are at the top of the class since these all deal with creating or destroying instances of this class
* Nested enums towards the bottom of the class so they are not in the way of people trying to reason about the methods and other contents (they are quite long)
* Delete random extra spaces / unneeded comments
* Move some private methods to be closer to the public methods that call them
Changelog: [Internal]
Reviewed By: mlord93
Differential Revision: D70345882
fbshipit-source-id: a8425c7b90c5d4fbea5ee5daa3c4ff9f7f189ce5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49649
- Added a new template to React Native's Feature Flag's script for Canary and Experimental prerelease stages
- Added a parameter to `DefaultNewArchitectureEntryPoint.kt` to select prerelease stage
Changelog: [Android] [Added] - On `DefaultNewArchitectureEntryPoint` class add property to specify the desired release level for an application
Reviewed By: rubennorte, mdvacca
Differential Revision: D69412971
fbshipit-source-id: 1a76ac723e1e06b40aad5910604e0384b208d3a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49729
# Changelog: [Internal]
The only data source for non-bridgeless setup is JavaScript samples.
Chrome DevTools frontend is built around an assumption that thread should have at least single timeline or user timing event to be represented on a timeline view. They do it for filtering out unnecessary workers threads and other.
We will emit 2 synthetic Trace Events that should cover these requirements and recorded traces that contain only JavaScript samples should now be displayed correctly.
This is where trace bounds are calculated - https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/3adf51aa915c2deb26f5d373751a15b4d0c8f259/front_end/models/trace/handlers/MetaHandler.ts#L169-L173
Reviewed By: huntie
Differential Revision: D70328681
fbshipit-source-id: 8eca0017d85de9ecbfb49074b439d5c4fee4aa56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49624
This change improves the iOS infra so that there is no need to modify the Swift AppDelegate or to create a Bridging Header.
## Problem
As of today, it is not possible to create a pure C++ TM and to register it through a Swift AppDelegate
## Solution
We can create a pod that can be imported in a Swift AppDelegate and that offer some pure Objective-C classes.
These classes contains a provider that can be instantiated in Swift.
The TurboModule manager delegate will ask the AppDelegate about the presence of some provider that can instantiate a pure C++ turbomodule with a given name.
The provider has an empty interface, but the implementation contains a function that can actually instantiate the TM. The function is implemented in an Objective-C++ class that imports the pure C++ turbomodule and creates it.
The TMManager extends the provider through a category to attaach the signature of the function that is implemented by the provider.
The last diff in this stack contains an exaple on how to implement this.
## Changelog:
[iOS][Added] - Wire codegen to the new TM provider to automatically register CXX modules.
Reviewed By: javache
Differential Revision: D70082999
fbshipit-source-id: 11d829450e1d17984d6f22ee5b8907073c59d008
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49611
This Change connects the pod created previously to the `RCTTuboModuleManager` so that it can ask the delegate about the CxxTurboModuleProviders.
We had to introduce a `RCTFullTurboModuleManagerDelegate` that implements both the old `TurboModuleManagerDelegate` and the new Swift compatible one.
## Problem
As of today, it is not possible to create a pure C++ TM and to register it through a Swift AppDelegate
## Solution
We can create a pod that can be imported in a Swift AppDelegate and that offer some pure Objective-C classes.
These classes contains a provider that can be instantiated in Swift.
The TurboModule manager delegate will ask the AppDelegate about the presence of some provider that can instantiate a pure C++ turbomodule with a given name.
The provider has an empty interface, but the implementation contains a function that can actually instantiate the TM. The function is implemented in an Objective-C++ class that imports the pure C++ turbomodule and creates it.
The TMManager extends the provider through a category to attaach the signature of the function that is implemented by the provider.
The last diff in this stack contains an exaple on how to implement this.
## Changelog:
[iOS][Added] - Added the React-SwiftCompatibleNativeModules pod
Reviewed By: javache
Differential Revision: D70012142
fbshipit-source-id: db96c4cd3cdd1062b12f11131b7c6c51ecd74bc7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49712
Just keeping AGP up to date to the latest patch version
Changelog:
[Android] [Changed] - Bump AGP to 8.8.2
Reviewed By: cipolleschi
Differential Revision: D70316244
fbshipit-source-id: 6e447bd04841d09717a1c6153b7e5c977a10787c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48315
# Changelog: [Internal]
> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.
Use newly added serializer and record Trace Events for profiles.
Reviewed By: huntie
Differential Revision: D67353586
fbshipit-source-id: f3738418ec1d47ef4435f00120823845ea5e2fe5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49191
# Changelog: [Internal]
In this diff we are adding another serializer, that will receive local sampling profile (in tracing domain), and will record corresponding Trace Events with `PerformanceTracer`.
It encapsulates the logic of transforming list of samples to `"Profile"` and `"ProfileChunk"` trace events, which will be parsed by Chrome DevTools later.
Reviewed By: huntie
Differential Revision: D68439735
fbshipit-source-id: 0b3f2b3aff5b79a921e0350759e93f5b05e34d8e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49084
# Changelog: [Internal]
> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.
Added public methods to `PerformanceTracer` instance for registering `Profile` and `ProfileChunk` Trace Events.
Also created data structs in `TraceEvent.h` to simplify serialization process for objects like call frames / samples / etc.
Reviewed By: huntie
Differential Revision: D68558805
fbshipit-source-id: f5eca0435c56828909f99ec0b47841d24ee907b6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49082
# Changelog: [Internal]
> NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes.
In this diff we will:
- Call newly added API in Hermes from `HermesRuntimeTargetDelegate.cpp`
- Define format for local Sampling Profile that will be used in Tracing domain
- Implement formatter for Hermes Profile -> Tracign Profile
Reviewed By: bgirard
Differential Revision: D68414421
fbshipit-source-id: 05d76e9bcff46f88a2338490a9d858cb121f72cc
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49436
# Changelog: [Internal]
We will record event loop ticks and register corresponding `"RunTask"` Trace Event with our Trace Event engine.
Since this is hot path, I've added some gating under macros that are being used for Fusebox initialization.
There are also plans to add a public method to `PerformanceTracer` to get tracing status, so we could avoid cost of serialization / saving timestamps if trace is not being recorded. I believe rubennorte had plans on this, we will add it on top of that.
> Q: Why not add this to TraceSection?
Long-term, we will have a solution that will be one layer above TraceSection and this `EventLoopTaskReporterRAII`, it is risky now to modify existing `TraceSection` and rely on event names and attempt to map them to Trace Events.
Reviewed By: rubennorte
Differential Revision: D69399955
fbshipit-source-id: b26ac0c376e7dcb5755f36a27bf00dcca6cbff60
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49395
# Changelog: [Internal]
Adding a new method to `RuntimeTarget` that will register it for Tracing.
In our case, it will schedule a callback on JS executor that will register JavaScript thread with `PerformanceTracer`.
Reviewed By: huntie
Differential Revision: D69530984
fbshipit-source-id: 58cffe9e9c4482b494cfcfd3405f7bffa40cdc56
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48836
# Changelog: [Internal]
When `Tracing.start` CDP method is received, here is what happens next:
- `TracingAgent`, which intercepts the event will propagate this status to `Instance` by calling `startTracing()` on `InstanceAgent`.
- `InstanceAgent` will propagate it to `Runtime` entities. The only difference, there is no concept of tracing for Runtime, it will only have an API for starting sampling profiler.
When `Tracing.end` CDP method is received, it is propagated in the same order.
There is also `collect*()` methods for collecting profiles.
This has multiple benefits:
- We can control when `Runtime` or `Instance` are recreated and can ask them to start recording trace profiles right away. This may be required when we would add support for Reload and Profile from Performance panel.
- We might leverage this setup in the future, once we add instrumentation for Network panel. `InstanceAgent` will get notified when tracing started and will correspondingly notify other part of the infrastructure that will be responsible for recording network calls.
- We remain being fully agnostic to the actual `Runtime`, see corresponding `RuntimeTargetDelegate` for `V8`. We don't have the capacity for implementing and maintaining sampling profiler capabilities for it, but this approach unblocks it from technical perspective, if someone would want to invest into this.
`InstanceProfile` is a superset of `RuntimeSamplingProfile`. In the future, `InstanceProfile` may also include things like `NetworkProfile`, or similar stuff.
The definition for `RuntimeSamplingProfile` will be added in D68414421 and relies on the availability of new API for sampling profiler in Hermes.
Reviewed By: huntie
Differential Revision: D68327630
fbshipit-source-id: f8446057f88d87b4394fb692c28b89f1b8ce4eea