Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53475
This is cleanup of IHermesExtra. Move the last method in IHermesExtra,
dumpOpcodeStats(), to jsi::Instrumentation, since other profile stats
dumping methods live in that interface as well.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D81087047
fbshipit-source-id: e145aafea7459a161fca04ffc30f0838ee6c03c6
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53473
This is a cleanup of IHermesExtra:
1. Move dumpSampledTraceToProfile() and debugJavasScript() to IHermes.
I'm still keeping the empty DebugFlags, since changing that requires
more changes. It's also possible that we may need it in the future.
2. Remove `dumpBasicBlockProfileTrace`. Use
writeBasicBlockProfileTraceToFile` if users need to dump the profile.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D81075460
fbshipit-source-id: b81005e531809cfd870fd9bdb5c0e17864ed92fb
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53419
By default, this function returns nullptr. User can pass a preprocessor
definition "-DHERMES_SH_UNIT_FN=sh_export_<unit_name>" (where
<unit_name> is the name passed to shermesc when compiling the JS
input), so that this function returns the function pointer, which can
be passed to `evaluateSHUnit` for evaluation.
Changelog: [Internal]
Reviewed By: avp
Differential Revision: D80747463
fbshipit-source-id: a798a7a572679444fca111c34674fd7ced9311f3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53418
Expose these methods so that we can access from RN code. To minimize
the change, a few methods that depend on other headers or preprocessor
flags are wrapped into IHermesExtra in hermes/API/hermes.h.
Changelog: [Internal]
Reviewed By: tsaichien
Differential Revision: D80740969
fbshipit-source-id: 79565d851bc1b0833931f4fe7fb62d89d3d669ef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53577
Simplify the API to keep all formatting inside of ReactHostStateTracker and remove the `bridgeless` part of the name. Bit more efficient binary-size wise.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D81445833
fbshipit-source-id: 5bc8bc9e3de326f23e95e01e889b4e2806438c06
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53588
# Changelog: [Internal]
Since the `name` was already moved for the begin event, there is nothing to be moved for `end` event. Instead, we will be creating a copy for the `begin` event.
This was actually affecting some entries on a timeline, like component triggers (yellow ones).
Reviewed By: vzaidman
Differential Revision: D81589847
fbshipit-source-id: 3b7d801d3429217ce279ed7de41c40c3838a5f37
Summary:
This PR fixes swipe dismissal to work each time the modal is shown. Previously modalInPresentation was set on the view controller which gets destroyed every time user dismisses the modal. This makes sure that modal in presentation is correctly preserved when showing multiple modals.
https://github.com/user-attachments/assets/c7f140e5-1c4f-4809-8453-148d4becc9eb
## Changelog:
[IOS] [FIXED] - modal swipe dismissal works only for the first time
Pull Request resolved: https://github.com/facebook/react-native/pull/53499
Test Plan:
1. Open RN Tester
2. Check allow swipe dismissal
3. Check closing it multiple times
Reviewed By: javache
Differential Revision: D81312918
Pulled By: cipolleschi
fbshipit-source-id: 4f7cc60762660e5d5310f4973fe8df340c1ba52b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53367
We are missing a dependency in the React-jsinspector podspec that prevents React Native from building with dynamic frameworks.
## Changelog:
[Internal] -
Reviewed By: cortinico
Differential Revision: D80619664
fbshipit-source-id: 1c87ef4d3614ceea3a23196831479ecae0a5acc8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53570
Idle callbacks are implemented as a C++ module in the new architecture, this code should not be used.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D81485912
fbshipit-source-id: 18103bb96441880ff3de423aa6c03a176f6ff5de
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53569
Simplify construction to save a JNI call, slightly more efficient on binary size too (1KiB hah)
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D81445834
fbshipit-source-id: b0ec84d5e04d364e34eef4c3b712c62f878325cf
Summary:
Resolves https://github.com/facebook/react-native/issues/53501
This is a pretty major oversight of (presumably) the old autolinking refactor. The iOS autolinking's second stage, invoked in `use_react_native!` does not accept the `react-native-config` sub-command's `react-native-config` output. This is only invoked and used in the prior step, `use_native_modules`.
The second step instead invokes old code that does something _similar_ to the new autolinking in `scripts/generate-artifacts-executor`, and happens to align in most cases. (But it does "autolinking" from scratch). tl;dr: When the results don't match up, things go wrong.
Instead, we now write the autolinking (react native config) results to a file, then read the output back in the second step.
This doesn't affect Android/Gradle, which are implemented correctly.
## Changelog:
[IOS] [FIXED] - Use autolinking-generated react-native-config output in second step of cocoapods linking that generates artifacts and generated source
Pull Request resolved: https://github.com/facebook/react-native/pull/53503
Test Plan:
- See https://github.com/facebook/react-native/issues/53501 for failing repro
- Clone for working repro: https://github.com/byCedric/react-native-codegen-ios-autolinking/tree/fix-54503
- Note: Contains this PR's changes as a patch
- `bun install`
- `bun expo run:ios`
Reviewed By: cortinico
Differential Revision: D81490755
Pulled By: cipolleschi
fbshipit-source-id: eefe786a116404f4ed24bd7125dfb108a811f71e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53560
Since Gradle 9.0, all the projects in the path must have an existing folder.
As we build :packages:react-native:ReactAndroid, we need to declare the folders
for :packages and :packages:react-native as well as otherwise the build from
source will fail with a missing folder exception.
Changelog:
[Android] [Fixed] - Fix build from source due to missing folder error on Gradle 9.0
Reviewed By: fabriziocucci
Differential Revision: D81482789
fbshipit-source-id: 609b503755486e10060a0f321bd0a38bd71864a1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53566
TLDR; we never advertised this and it's not in use. We have an updated incoming plan for exposing internal private code to Expo / other frameworks.
Changelog: [Internal]
Reviewed By: christophpurrer
Differential Revision: D81490655
fbshipit-source-id: f3d64582f5e6092e4928865d868ea26867ee7e47
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53571
Changes `VirtualView` so that its layout when hidden can be configured by call sites.
Previously, it was hardcoded to only retain the last known height. However, this logic only works for `VirtualView` children oriented in a column layout.
This change enables the use of `VirtualView` in more flexible abstractions that require different hidden styles (e.g. row or grid orientations).
Also, this changes the default behavior to set `minWidth` and `minHeight`, so that the default behavior is more general and more likely to work in a reasonable manner in more use cases.
NOTE: Ideally, we would be able to default to using `flexBasis` instead. However, the `hiddenStyle` function receives a `Rect` and does not know whether the parent's flex direction is row or column to influence whether to use `targetRect.width` or `targetRect.height`. This is an opportunity for future improvement.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81344126
fbshipit-source-id: 33d9e81601b671059f97b4590816243cbd24734a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53533
Creates a new `enableVirtualViewExperimental` feature flag that determines whether `VirtualView` uses the old or new implementation.
Changelog:
[Internal]
Reviewed By: lunaleaps
Differential Revision: D81340963
fbshipit-source-id: f550fe4e4573e080eb8668077d0ad3ca53cd4d33
Summary:
This PR falls back to UIScreen when windowScene is not available.
<img width="500" alt="CleanShot 2025-08-28 at 14 30 59@2x" src="https://github.com/user-attachments/assets/9dda3153-dfe7-48a5-9d0e-5416c2e34c64" />
## Changelog:
[IOS] [FIXED] - Simplify RCTAlertController, don't create additional UIWindow
Pull Request resolved: https://github.com/facebook/react-native/pull/53500
Test Plan:
Open the alert multiple times to check if everything works as expected.
Rollback Plan:
Reviewed By: javache
Differential Revision: D81410450
Pulled By: cipolleschi
fbshipit-source-id: c27ea98d9e811c2f259f0ff3c6689482d116c418
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53534
BackgroundDrawable and BorderDrawable have already substituted CSSBackgroundDrawable en every Android surface.
- Deleting CSSBackgroundDrawable.java and its callsites
- Deleting enableNewBackgroundAndDrawable featureflag
Just cleaning up what at this point is just dead code.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D81330969
fbshipit-source-id: bcf66ec8d3225802432ae1d93a2b26ea65cfcda0
Summary:
Follow-up to https://github.com/facebook/react-native/issues/53194
This wasn't previously visible in testing without prebuilds and without a release build. This doesn't show up in debug builds.
When testing more against paths that contain spaces, I noticed that release builds can still run into trouble due to the use of `execSync` without escaping paths. While, in other scripts that aren't used in user-projects (afaict), we often escape with quotes and rely on `execSync` calling the shell (due to its `shell: true` default), in some scripts we don't have quote escapes.
That said, since paths could in theory contain quotes, adding quotes wouldn't be sufficient. Instead, since the affected `tar` calls are really trivial, we can instead use `spawnSync` with the `shell: false` default, which escapes arguments automatically.
## Changelog:
[IOS] [FIXED] - fix Node scripts related to prebuilt tarball extraction for paths containing whitespaces
Pull Request resolved: https://github.com/facebook/react-native/pull/53540
Test Plan: - Create a project in a folder `with spaces` and build a release build
Reviewed By: cipolleschi, cortinico
Differential Revision: D81406841
Pulled By: robhogan
fbshipit-source-id: 08bb06b2cd2b15dc17c2f95fab9024129deca6f3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53431
Changelog: [internal]
This renames `setUpPerformanceObserver` as `setUpPerformanceModern` and removes the need to call it manually. If the native module is defined, we define the whole new API.
Reviewed By: javache
Differential Revision: D80803626
fbshipit-source-id: ef41cb9aa959ee898d32724c102d7597e6bee84e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53430
Changelog: [internal]
This fixes the spec-compliance of several classes in the Performance API by not allowing userland code to instantiate them directly.
This also exposes some missing interfaces from the Performance API in the global scope.
Reviewed By: rshest
Differential Revision: D80800076
fbshipit-source-id: f6439b9c7914817ef552e78fd61646ccab1e1de2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53429
Changelog: [internal]
This is a refactor of the types in `PerformanceEntry` and subclasses to accept interfaces instead of objects. This allows us to pass down the init object from subclasses to the superclass without having to create intermediate objects.
Additionally, this is also more semantically correct, as existing APIs don't need those options to be own properties of the init object.
Existing benchmark for Performance doesn't show any significant impact.
Reviewed By: rshest
Differential Revision: D80800075
fbshipit-source-id: ab439d70f4db9ce60e3089d89ccb105a91e7ef48
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53428
Changelog: [internal]
This is the last method in `PerformanceObserver` to implement. For some reason we never added it, even though it was trivial.
Reviewed By: rshest
Differential Revision: D80717237
fbshipit-source-id: ae3bd243d0f3f0fe4f0705437d78d14c532515f7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53427
Changelog: [internal]
Migrate the imported types to the globally defined ones, so we follow the good practice of only accessing the public API in Fantom tests.
Reviewed By: rshest
Differential Revision: D80807160
fbshipit-source-id: 77d792b56b53c8da8409dd9133cd111afb8084f1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53433
Changelog: [internal]
This adds the definitions for the Web Performance APIs in the global scope.
Reviewed By: zeyap
Differential Revision: D80811659
fbshipit-source-id: a81117a27a480ba03f8feb2e813a3a66a10307f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53536
# Changelog: [Internal]
For every chunk, we already have a threshold for the number of samples captured in this chunk.
There could be really tall call stacks, where we could record hundreds of unique nodes, which makes the chunk already big enough for a CDP traffic on android.
We are adding a threshold for a number of unique nodes in a single chunk. If the chunk has a greater number of nodes recorded, it will be dispatched over CDP.
Reviewed By: huntie
Differential Revision: D81339677
fbshipit-source-id: 388d14c64c4c3f60918a8526025f79d19d397cb4
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53535
# Changelog: [Internal]
This primarily addressed the case when we have captured a Runtime Profile during the app startup. The Hermes Runtime is created on the main thread, so the first few samples will be recorded there, but then it will be moved to JavaScript thread.
Reviewed By: huntie
Differential Revision: D81339676
fbshipit-source-id: 8202ca03df54134330aa921a9a0a97816c51cea5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53548
Add tests to View similar to D81043503, and clarify why `accessibilityElementsHidden` does not show up in the rendered component tree (because Fantom uses the Android platform for bundling, and Android does not have accessibilityElementsHidden in its BaseViewConfig.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D81437063
fbshipit-source-id: aa10573aee686d1d650b152365607877f34f8508