Summary:
Currently we observed many iOS app crashes caused by the `[RCTFileRequestHanlder invalidate]` method, just as the below screenshot.
<img width="1008" alt="image" src="https://github.com/user-attachments/assets/d2d6714f-63d9-40ae-8de5-742cfe718a36" />
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[IOS] [FIXED] - app crash caused by the `[RCTFileRequestHanlder invalidate]` method
Pull Request resolved: https://github.com/facebook/react-native/pull/48350
Test Plan: I am not able to reproduce this issue locally either, so the changes in this PR are totally from my inference, I am not sure if it really makes sense, so please help take a deeper look, thanks.
Reviewed By: javache
Differential Revision: D69751695
Pulled By: cipolleschi
fbshipit-source-id: aa4654a30f5dfac99b72ed1bda0dae1e0dc881c9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49479
changelog: [internal]
Notification UIApplicationDidBecomeActiveNotification is always delivered on the main thread, no need for dispatch.
Reviewed By: javache
Differential Revision: D69750103
fbshipit-source-id: 070fa7f95d8ecddff5d56ba317c8ed4f0ad880f8
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49470
Adds a `packages/react-native/index.js.flow` file.
**Motivation**
This is on the critical path to generating TypeScript types, and a full API snapshot, from `index.js.flow`.
As we iterate, this new file will move to closely matching `types/index.d.ts` by adding type exports (missing today) — giving us an equivalent public API in both languages.
**Motivation for this pattern**
Having a type index file:
- Will become the entry point for `yarn build-types`.
- Enables us to bypass the `module.exports` pattern in `index.js` without a runtime breaking change.
- This pattern is preferable because:
- 1/ Aligns with existing manual TypeScript definitions (i.e. these are **already restricted** to `import` syntax in user code)
- 2/ Allows doc comments on original types to propagate to IDEs/users.
**Implementation notes**
NOTE: This diff has **no effect** on compiled code at runtime, and **no effect** on the current manual TypeScript API of `react-native`. It only has an effect on Flow usage in fbsource — most of which are deep type imports today.
- Exports are grouped and sorted identically to each pre-existing getter in `index.js`.
Changelog: [Internal] - Redefine root `react-native` type exports, affecting Flow usages only
Reviewed By: rubennorte
Differential Revision: D69659837
fbshipit-source-id: c65e30d1ac5c4f322cfde9335dbee80a8c9efda8
Summary:
ref: https://github.com/facebook/react-native/pull/28266
Currently, SVG is not recognized as an image in the CLI bundle command, as defined in [assetPathUtils.js](https://github.com/facebook/react-native/blob/main/packages/community-cli-plugin/src/commands/bundle/assetPathUtils.js#L43-L50) . This is the correct behavior, as it ensures that SVG files are copied to the raw folder for Android resources.
However, there is an inconsistency with Image.resolveAssetSource, which does not follow the same classification. Instead, it resolves SVG assets to the drawable folder, leading to blank svg rendering errors in some scenario (codepush).
## Changelog
[Android][Fixed] - getAndroidResourceFolderName() should return raw folder for svg file
Pull Request resolved: https://github.com/facebook/react-native/pull/49452
Test Plan:
1. Use svg file this way `<LocalSvg asset={require('./react-logo.svg')} />`
2. Use `react-native bundle` command to make a bundle and sideload that bundle from sdcard. The svg file should render correctly.
Reviewed By: cortinico
Differential Revision: D69750779
Pulled By: Abbondanzo
fbshipit-source-id: 3af8d4a5da07213cdbb968b070d2507ed897d194
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49370
# Changelog: [Internal]
When we start tracing, we will record metadata event for current process.
We will base it off the assumption that the thread where we handle `Tracing.start` event is the main one.
We can't register the main thread yet:
1. We can't assume that CDP messages are handled on it - this is not the case for Windows and in a long term Inspector will be moved to its own thread
2. We don't have any similar mechanism as Runtime Executor, but for Main thread. This will require Host providing an executor for it.
I've validated at the top of the stack that not registering the main thread should not affect how trace is displayed in CDT.
Reviewed By: rozele
Differential Revision: D69465926
fbshipit-source-id: 103de1da9d00564bf201456ad04a465387c1d542
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49083
# 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 2 new public methods to `PerformanceTracer` instance for registering metadata Trace Events for processes and threads.
Reviewed By: huntie
Differential Revision: D68439733
fbshipit-source-id: dd9f0e72e2414b8c665c57a542cbbfe7df34a516
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49309
# Changelog: [Internal]
Use newly added module to get real OS-level process and thread ids.
We will keep process id on an instance, because I don't think it could change over time? For thread id, we will get it at the time of event registration.
Reviewed By: rozele
Differential Revision: D69316094
fbshipit-source-id: e12f2ea147ee8bf5a0a13ef293b8d85a0b64fc02
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49302
# Changelog: [Internal]
Added OS-agnostic module that will implement 2 basic capabilities:
- Getting current process id
- Getting current thread id
Reviewed By: javache
Differential Revision: D69316093
fbshipit-source-id: 114d235f1137eaf9c41d95df76f15532766d1bc8
Summary:
Recently, I've introduced `RCTReactNativeFactory` in this PR: https://github.com/facebook/react-native/issues/46298, which is a good successor for `RCTAppDelegate`.
### Why?
`RCTAppDelegate` introduced strong coupling between React Native and AppDelegate pattern. From iOS 13+ there is a newer equivalent (Scene Delegate) which is not possible to achieve with current architecture. The proposed solution involves migration to a `RCTReactNativeFactory` a class that encapsulates initialization logic of React Native.
This migration will make brownfield initialization easier by making it more flexible and simpler to integrate into already established apps.
### Deprecation plan
The plan I've discussed with cipolleschi involves:
- Deprecation of `RCTAppDelegate` in 0.79 (current main)
- Migration off `RCTAppDelegate` to SceneDelegate + `RCTReactNativeFactory` in 0.80
## Changelog:
[IOS] [DEPRECATED] - deprecate RCTAppDelegate
Pull Request resolved: https://github.com/facebook/react-native/pull/49078
Test Plan: Not needed
Reviewed By: cortinico
Differential Revision: D69061022
Pulled By: cipolleschi
fbshipit-source-id: b02a0ff3f26be9320da749f38c9cf083804f9f30
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49426
This is a nit, but I'm following up on a review comment that was left behind.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69656370
fbshipit-source-id: 76de4d77d9993bd9a35d7df019a6cebcce13d632
Summary:
an effort of lean core for jsc: https://github.com/Kudo/discussions-and-proposals/blob/%40kudo/lean-core-jsc/proposals/0836-lean-core-jsc.md. this pr tries to decouple all jsc code when `USE_THIRD_PARTY_JSC=1` on ios
this pr includes these changes:
- exclude `React-jsc` pod and pod dependency when `USE_THIRD_PARTY_JSC=1`
- in objcpp code, remove `JSCExecutorFactory` / `RCTJscInstance` references when `USE_THIRD_PARTY_JSC=1`. it throws c++ errors like `No JSRuntimeFactory specified.` when no engine is specified (USE_HERMES=0 && USE_THIRD_PARTY_JSC=1). people need to override delegate methods to specify a JSRuntimeFactory.
## Changelog:
[IOS] [CHANGED] - Decouple JSC when `USE_THIRD_PARTY_JSC=1`
Pull Request resolved: https://github.com/facebook/react-native/pull/49371
Test Plan:
- ci passed
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=1 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 USE_FRAMEWORKS=dynamic bundle exec pod install`
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=0 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 USE_FRAMEWORKS=dynamic bundle exec pod install`
- rn-tester build success for `RCT_NEW_ARCH_ENABLED=0 USE_THIRD_PARTY_JSC=1 USE_HERMES=0 bundle exec pod install`
Reviewed By: cortinico
Differential Revision: D69662457
Pulled By: cipolleschi
fbshipit-source-id: b272f46dde896d0981cfca75c9bfcf6775507307
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49461
Flow now supports Package Exports 🎉. This means we can delete the compatiblity pattern in each of our build-enabled Node.js packages.
This simplifies the internal package structure needed to support Flow while developing from source in the monorepo — no prod impact.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D69741143
fbshipit-source-id: 070715cb6beb00eb393186dbf95856ceb87fabef
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49441
Changelog:
[General][Internal] - keep heartbeat between inspector proxy and debugger going even if not idle
When heartbeat was only used to keep the connection alive and to detect debugger timeouts, it was enough to send a ping every time the connection was idle for 10 seconds.
Now, when we use the heartbeat as a way to track how good is the round trip time between the inspector proxy and the debugger, we would like to make this tracking more reliable by sending a ping 10 seconds after each pong, even if the connection is not idle.
It also simplifies the code and makes it more clear by removing the confusing `shouldSetTerminateTimeout` variable.
Reviewed By: hoxyq
Differential Revision: D69665738
fbshipit-source-id: c8175b54d2b3df32ee60b316ec7bcf7bc0f0a1ee
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49439
This is the next part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm removing the `onlyIf` lambdas to make some tasks CC friendly.
The problem is that some `onlyIf` lambdas can't easily be serialized. Here I'm cleaning up
the problematic one to move the condition checks at execution time
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69664732
fbshipit-source-id: a457b2fae8114568ec4e04d772c9944022b1e1a5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49438
This is the second part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm making the exec tasks CC friendly.
The problem is that previously we were using explicit streams which are not CC friendly
for stderr/stdout. The solution is to create a custom task and handle files as input
properties.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69662246
fbshipit-source-id: ad7e82e52b12d508ee15b68408882fdc3516d287
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49421
This is a first part of a series of diff needed to enable G. Configuration Cache:
https://docs.gradle.org/current/userguide/configuration_cache.html
as it will make our CI faster (and will be the default in the future Gradle version).
Here I'm making all those tasks `prepare*` CC friendly.
Those tasks were not CC friendly as they were referencing an external variable inside their body.
We don't need to know the library version, we can just substring after the first folder
and the tasks will behave as before.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi
Differential Revision: D69655168
fbshipit-source-id: 801d7817c7e2d7380342f175565cc9b1ff30c5d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49458
Changelog: [Internal]
Sorts the entry points in the TS generator script and adds `Clipboard` and `AccessibilityInfo` which, as far as I can see, require no changes for their types to align with OSS.
Reviewed By: huntie
Differential Revision: D69663092
fbshipit-source-id: cfdb9ab5c07105497a1cdf4ebdc8de1e34b510bd
Summary:
Problem: Duplicate issues were notified on discord channel in issue triaging section.
## Changelog:
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[GENERAL] [FIXED] - Changed cron timings to run at fix schedule and upgraded action for better debugging
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Changed cron timings to run at fix schedule and upgraded action for better debugging
Root cause:
- The cron job (cron: "0 /6 * *") is expected to run every 6 hours.
- Expected runs: 5:54 AM → 11:54 AM → 5:54 PM.
- However, the second run happened earlier at 11:37 AM instead of 11:54 AM.
- This caused duplicate pings for issues created around 5:42:24 AM.
Pull Request resolved: https://github.com/facebook/react-native/pull/49407
Test Plan: Tested action locally
Reviewed By: cortinico, NickGerleman
Differential Revision: D69667174
Pulled By: cipolleschi
fbshipit-source-id: 3dcadc25783335c32cba8acdda26e1c755294629
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48585
[Changelog] [Internal] - Align logic in BaseTextInputShadowNode to determine updateStateIfNeeded with AndroidTextInputShadowNode
As a preparation for https://github.com/facebook/react-native/pull/48165 this aligns the implementation of those 2 methods
Reviewed By: javache
Differential Revision: D68004755
fbshipit-source-id: 519247de0d081f37b5ef8ad6093b43d2c735a50e
Summary:
An internal crash report notified us that we were getting an `IllegalArgumentException` in Android's `BlurMaskFilter` used in Box Shadows. The only requirement for the arguments there are that the blur radius is positive. We ensure that, but pass to `sigmaToRadius` afterwards, which does NOT ensure that. This updates that conversion so that
* We will never return negative numbers, regardless of what `PixelUtil.toDIPFromPixel` is doing
* Small enough numbers ( < 0.5) will just go through as 0.0, which is what Android does in https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/utils/Blur.cpp;l=34
* Ensure shadows check that we have a POSITIVE blur radius AFTER conversion. sigmaToRadius can still return 0 which with also throw, so gotta make sure we change our checks. Filter blurs and dropShadow should be ok, renderEffect does not mention anything about being > 0 in the docs.
Changelog: [Android] [Fixed] - Fix issue where boxShadow crashes with small blur radius
Facebook
Post alerting us of this: https://fb.workplace.com/groups/rn.panelapps/permalink/1136446121310146/
Reviewed By: NickGerleman
Differential Revision: D69683031
fbshipit-source-id: 92f0938fea65e1af280bdb12b6c3d2b9014e89c0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49445
This diff marks a subset of LayoutAnimations classes with LegacyArchitecture, since these classes should not be called, loaded nor included in apk that are running in new archtictecture by default
changelog: [internal] internal
Reviewed By: shwanton
Differential Revision: D69674674
fbshipit-source-id: 84c71c7491064abf8d70f52b14ddb81bd0515227
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49443
This diff introduces an internal annotation called LegacyArchitecture that will be used to document what classes are part of Legacy or new architecture
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D69538444
fbshipit-source-id: 5037ba03cd3b1675544f432c3981503c28606f19
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49435
This change adds a Package.swift file that allows to consume the binary from a local path.
As soon as we publish this on Maven, we will update the path to the url.
## Changelog:
[Internal] - Add the Package.swift file to consume the binary
Reviewed By: cortinico
Differential Revision: D69660943
fbshipit-source-id: c76ff3272d106236b6cf713b7e054070a3d45176
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49434
This change adds a function to create the xcframework sarting from the various .framework's slice built before.
## Changelog:
[Internal] - Add function to create the xcframework
Reviewed By: cortinico
Differential Revision: D69660662
fbshipit-source-id: f58034c75cce3d242910d0ec1512be28059771ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49433
This change adds the logic to copy the Headers files from the dependency folder to the generated frameworks folder.
There is a slight possibility that this function will be implemented by the Swift PM build system, as I open [this question](https://forums.swift.org/t/xcodebuild-does-not-generate-headers-if-the-source-is-swift-pm/77856) on the Swift forums.
In that case, we would be able to drop this.
## Changelog:
[Internal] - Add function to copy headers over to the .frameworks
Reviewed By: cortinico
Differential Revision: D69656046
fbshipit-source-id: e9d4f0f53ea57bc0df86fc9194cdf9fc1f372730
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48724
changelog: [internal]
A change in D68154908 caused issues where AnimatedValue would oversubscribe to native module, bring apps to halt.
This is unit test to prevent that.
Reviewed By: yungsters
Differential Revision: D68265033
fbshipit-source-id: 60cc93a619a5c654dc1bf77b00b2d9be2c482894
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49402
## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.
## This diff
- Migrates `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` and `Utilities/SceneTracker.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates jest mocks
- Updates the current iteration of API snapshots (intended).
Changelog:
[General][Breaking] - Deep imports to `Utilities/dismissKeyboard.js`, `Utilities/GlobalPerformanceLogger.js` or `Utilities/SceneTracker.js` with `require` syntax need to be appended with '.default'.
Reviewed By: huntie
Differential Revision: D69599636
fbshipit-source-id: 0c450996f908d8139dd0c48677f58e07243d6150
Summary:
Fix `react-native-community/cli` not being found in pnpm setups
## Changelog:
[GENERAL] [FIXED] - Fix `react-native-community/cli` not being found in pnpm setups
Pull Request resolved: https://github.com/facebook/react-native/pull/47304
Test Plan:
1. Clone/check out this branch: https://github.com/microsoft/rnx-kit/pull/3409
2. Run `yarn react-native config`
Reviewed By: cortinico
Differential Revision: D65209065
Pulled By: robhogan
fbshipit-source-id: 2ceb73ad140b4afe193e879779c2d8a4b9adf3fc