Summary:
After upgrading my project to the latest version of react native i.e, 0.74.2, i was getting an error when running `pod install` an the error was coming from the post install hook. Going deeper into the file tree, i found that some of the things are Nil and react native is trying to use some methods on them, so fixed those issues by using chaining operators to conditionally apply the path method on them.
## Changelog:
[Internal] - fixes the post install issue when running pod install with react native version, 0.74.2
Pull Request resolved: https://github.com/facebook/react-native/pull/45095
Test Plan: Manually tested the fix. Works perfectly fine in both debug and production mode.
Reviewed By: cortinico
Differential Revision: D58863666
Pulled By: cipolleschi
fbshipit-source-id: 64459711dcf926b7544b99b542e9861c1c0f05ca
Summary:
https://github.com/facebook/react-native/pull/45409 broke CI because it didn't set up dependencies correctly. This should fix it.
Changelog: [internal]
Reviewed By: cipolleschi
Differential Revision: D59751194
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45409
Changelog: [internal]
This removes `BridgelessJSCallInvoker` in favor of `RuntimeSchedulerCallInvoker`. This change should be transparent when not invoking JS callbacks using priorities, as both of them would just go directly to the scheduler using `scheduleWork`, but when priorities are specified, they'd now be honored in `RuntimeSchedulerCallInvoker`.
I realized this wasn't being used when I saw that `PerformanceObserver` callbacks were always scheduled with the highest priority, instead of with idle priority as specified in code.
Reviewed By: sammy-SC
Differential Revision: D59679512
fbshipit-source-id: 51d36d56ef1ff0b34e5157ed7b5e08de0a3884d2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45408
Changelog: [General][Fixed] Fixed prioritization of idle priority tasks
We recently found out that idle priority tasks were never scheduled with the lowest priority possible. We didn't realize before because idle priority tasks weren't used, but now they are via `requestIdleCallback` and other mechanisms.
The problem was that the timeout for idle priority tasks was `std::chrono:milliseconds::max()`, and we compute the expiration time adding that to the current time. Doing that operation is always guaranteed to overflow, and the resulting expiration time was always in the past, resulting in the task having higher priority than any other tasks with any other priorities.
Instead of using `max()` we can just use a sensible value for idle priorities. In this case, 5 minutes should be more than enough.
Reviewed By: sammy-SC
Differential Revision: D59679513
fbshipit-source-id: 6c0f9e275818737ce804f05615c01f7ea6c126ab
Summary:
In order to fix the data races described in https://github.com/facebook/react-native/issues/44715, I propose a simple solution by leveraging shared counter functions wherein `std::atomic` is the backing for the integer values.
## Changelog:
[iOS] [Fixed] - Implement shared atomic counters and replace static integers in `RCTImageLoader` and `RCTNetworkTask` that were accessed concurrently, which in some cases lead to data races.
Pull Request resolved: https://github.com/facebook/react-native/pull/45114
Test Plan: Added unit tests for the counters in `RCTSharedCounterTests`.
Reviewed By: cipolleschi
Differential Revision: D59155076
Pulled By: javache
fbshipit-source-id: f73afce6a816ad3226ed8c123cb2ccf4183549a0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45389
This undos a breaking change with ResourceDrawableIdHelper for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.
Changelog:
[Android] [Fixed] - Undo a breaking change with ResourceDrawableIdHelper.instance
Reviewed By: robhogan
Differential Revision: D59638043
fbshipit-source-id: ae2aab962e9a7676f0bfbae21f699e274502dc6a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45390
This undos a breaking change with I18nUtil for Kotlin consumer.
I've re-added a `getInstance` method so that Kotlin libraries won't break.
The method is added as Deprecated as those libraries need to migrate to `.instance`
accessors as more idiomatic.
Changelog:
[Android] [Fixed] - Undo a breaking change with I18nUtil.instance
Reviewed By: alanleedev
Differential Revision: D59638044
fbshipit-source-id: 1c93a98676b5b01e89be3b974961c5f3ae919511
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45388
This undos a breaking change we're about to ship in 0.75, where Kotlin users
where forced to update this callsite to be `.getEntryIterator`.
This re-introduces a `entryIterator` val so both Kotlin and Java compatibility are retained.
Changelog:
[Android] [Fixed] - Undo breaking change for ReadableMap.entryIterator for Kotlin consumers
Reviewed By: alanleedev
Differential Revision: D59637925
fbshipit-source-id: b674df86e056f17791d9cabe28557529886f1c93
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45378
Kotlin consumers of those APIs are forced with this breaking change:
```
# Before thanks to Java property conversion
Dynamic.type
# After
Dynamic.getType()
```
This restores the old more idiomatic API by moving those 2 funcitons to be vals.
Changelog:
[Android] [Fixed] - Undo breaking change on Dynamic.type and Dynamic.isNull
Reviewed By: javache
Differential Revision: D59631783
fbshipit-source-id: 8d720af34e104ee0e4f3120302a4a84fc17a7b1c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45376
This reduces one breaking change users are seeing on `CatalystInstance.getJsCallInvokerHolder`.
I had to specify:
```
Suppress("INAPPLICABLE_JVM_NAME")
get:JvmName("getJSCallInvokerHolder")
```
as the Kotlin compiler is unhappy with me setting a JvmName on a interface property.
More on this here: https://youtrack.jetbrains.com/issue/KT-31420
Changelog:
[Android] [Fixed] - Undo breaking change on `CatalystInstance.getJsCallInvokerHolder`
Reviewed By: javache
Differential Revision: D59631640
fbshipit-source-id: 4d5b3499e4e0e0bec1d380c4b7942ea28ae35465
Summary:
This PR restores the virtual destructor for `ShadowNodeWrapper` which was added in https://github.com/facebook/react-native/pull/33500 and unfortunately removed in https://github.com/facebook/react-native/pull/40864.
The virtual destructor here serves as a key function. Without a key function, `obj.hasNativeState<ShadowNodeWrapper>(rt)` **does not** work correctly between shared library boundaries on Android and always returns false.
We need this pretty badly in third-party libraries like react-native-reanimated or react-native-gesture-handler.
## 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
-->
[ANDROID] [FIXED] - Fix dynamic_cast (RTTI) for ShadowNodeWrapper when accessed by third-party libraries again
Pull Request resolved: https://github.com/facebook/react-native/pull/45290
Test Plan: This patch fixes an issue in Reanimated's fabric-example app.
Reviewed By: fabriziocucci
Differential Revision: D59375554
Pulled By: javache
fbshipit-source-id: 09f3eda89a67c26d6dacca3428e08d1b7138d350
Summary:
Changes `.npmignore` file to only exclude the `ReactAndroid/build` directory instead of all `build` directories under `ReactAndroid` (which included the `ReactAndroid/src/main/java/com/facebook/react/common/build` package). This problem was caused by the newer version of NPM being used.
Closes https://github.com/facebook/react-native/issues/45204
## Changelog:
[ANDROID] [FIXED] - Fixed build from source failing due to a missing file
Pull Request resolved: https://github.com/facebook/react-native/pull/45279
Test Plan:
Run `npm pack` or `npm publish -dry-run`.
Before this change it includes 3774 files in the package and `ReactBuildConfig` isn't included. After this change it includes 3775 files in the package and `ReactBuildConfig` is included.
Reviewed By: javache
Differential Revision: D59371555
Pulled By: cortinico
fbshipit-source-id: f54f1e88e30429d538b9e160e6ce20d994c5d1b8
Summary:
This PR adds missing `WithRuntimeDecorator` methods related to `NativeState`. This pattern is used by reanimated to ensure no concurrent access to the runtime. Without this `override` the `RuntimeDecorator` implementation was used, bypassing our mutex.
Changelog:
[GENERAL] [FIXED] - Add missing `NativeState` methods to the `WithRuntimeDecorator` class.
Pull Request resolved: https://github.com/facebook/react-native/pull/45042
Reviewed By: fbmal7
Differential Revision: D58744051
Pulled By: neildhar
fbshipit-source-id: 3f5c85d0bf7cd6445d0c434ac4ae7ed54df203ba
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44884
Removing JavaScript error handler supplied to ReactHostImpl.java which is just a stub and creating a default handler in ReactInstance.java which uses NativeExceptionHandler TurboModule to handle error.
Changelog: [Android][BREAKING] Removing `ReactJsExceptionHandler` param from ReactHostImpl() constructor and providing a default private implementation
Reviewed By: javache, cortinico
Differential Revision: D58385767
fbshipit-source-id: 46548677df936b7c2f584084a2c9769c27e6a963
Summary:
Fixes https://github.com/facebook/react-native/issues/45222
## Changelog:
[ANDROID] [FIXED] - Fix autolink plugin for libraries that are platform-specific
Pull Request resolved: https://github.com/facebook/react-native/pull/45223
Test Plan: And a library that does not have Android native code such as react-native-segmented-control/segmented-control and sync gradle
Reviewed By: rshest
Differential Revision: D59221562
Pulled By: cortinico
fbshipit-source-id: 55739d63ded63e46897d0d770281f937668c1f50
Summary:
Users are reporting that RN 0.75 is crashing due to us attempting to accessing a static method
on `AndroidUnicodeUtils.convertToCase` which is not static anymore due to Kotlin conversion.
Static access is inside Hermes codebase here:
https://github.com/facebook/hermes/blob/f5c867514c71b25212eb3039230e0c095518b532/lib/Platform/Unicode/PlatformUnicodeJava.cpp#L107-L109
Changelog:
[Android] [Fixed] - Fix crash due to missing JvmStatic to `convertToCase`
Reviewed By: javache
Differential Revision: D59218291
fbshipit-source-id: ac121a8bcd5fd917ee134d257f967c8e3e338ca5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45165
This is a fix for https://github.com/facebook/react-native/issues/45112
This diff changes the codegen so that the output path is computed relative to project root (or `path` if provided) instead of current working directory.
Changelog: [General][Fixed] - Codegen computes output path relative to project root instead of current working directory.
Reviewed By: fkgozali
Differential Revision: D59009821
fbshipit-source-id: 3a138a3508fc239c8600b8c9f242f1c665f8e3c0
* [LOCAL][CI] Require cocoapods to hermes-engine podspec
* Refactor Hermes workspace (#45071)
Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.
That this change do:
* moves `prepare_hermes_workspace` to a composite action
* saves the `prepare_hermes_workspace` caches only on main
* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`
[Internal] - Factor out the prepare_hermes_workspace action
Pull Request resolved: https://github.com/facebook/react-native/pull/45071
Test Plan: GHA in CI
Reviewed By: cortinico
Differential Revision: D58808087
Pulled By: cipolleschi
fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d
* [LOCAL][RN][CI] Improve stability of the Hermes pipeline
* chore: align nighlties and releases to the test-all jobs which is green in GHA
* [LOCAL][CI] Require cocoapods to hermes-engine podspec
* Refactor Hermes workspace (#45071)
Summary:
This change is the first step in refactoring GHA so that they can be reused more easily across jobs.
Its goal is also to be more reliable w.r.t. caches.
That this change do:
* moves `prepare_hermes_workspace` to a composite action
* saves the `prepare_hermes_workspace` caches only on main
* uploads the destination folder as an artifact so that we can use it later in the run
* makes the `test-all`, `nightly` and `publish-release` workflow use the new composite action
* updates the `setup-hermes-workspace` to download and use the artifact uploaded by `prepare_hermes_workspace`
[Internal] - Factor out the prepare_hermes_workspace action
Pull Request resolved: https://github.com/facebook/react-native/pull/45071
Test Plan: GHA in CI
Reviewed By: cortinico
Differential Revision: D58808087
Pulled By: cipolleschi
fbshipit-source-id: 42c46bcf75fc73b2edfda9be62b5d0fe8a919a5d