Summary:
The [React Native TV repo](https://github.com/react-native-tvos/react-native-tvos) shares most of the same Android code as the core repo. Beginning in 0.71, it needs to also publish Android Maven artifacts for the `react-android` and `hermes-android` libraries.
In order to avoid conflicts, it needs to publish the artifacts to a different group name. However, `react-native-gradle-plugin` uses a hardcoded group name (`com.facebook.react`).
Solution: read the group name from the existing `GROUP` property in `ReactAndroid/gradle.properties`.
## Changelog:
[Android] [Fixed] - read GROUP name in gradle-plugin dependency code
Pull Request resolved: https://github.com/facebook/react-native/pull/37204
Test Plan:
- Android unit tests have been added for the new code and new method in `DependencyUtils.kt`.
- Existing tests should pass
- The new code defaults to the correct group (`com.facebook.react`) so no functional change is expected in the core repo.
Reviewed By: luluwu2032
Differential Revision: D45576700
Pulled By: cortinico
fbshipit-source-id: 6297ab515b4bdbb17024989c7d3035b0a2ded0ae
# Conflicts:
# packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt
Summary:
An out-of-the-box react-native init project no longer enables Flipper properly as of 0.72.0-rc1.
## Changelog:
[IOS] [FIXED] Fix Flipper by moving podfile modification of preprocessor def `FB_SONARKIT_ENABLED` from React-Core to React-RCTAppDelegate where it is now used.
Pull Request resolved: https://github.com/facebook/react-native/pull/37240
Test Plan: Generated an app and verified Flipper cannot see the app. Made the modification and generated another app and verified Flipper now sees it and can enable plugins. Verified that runtime (non-test) use of FB_SONARKIT_ENABLED is limited to Libraries/AppDelegate in this project.
Reviewed By: dmytrorykun
Differential Revision: D45563282
Pulled By: cipolleschi
fbshipit-source-id: d760c5ae123cc7c967b19c6c626801d6db28d052
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37228
As discussed offline, the current approach for the Hermes profiler is not the right one.
I'm partially reverting [the commit](https://github.com/facebook/react-native/commit/dce9d8d5de381fe53760ddda0d6cbbdfb5be00e4) which introduced it.
The commit did also a bit of refactoring to improve the quality of the cocoapods scripts we would like to keep.
## Changelog:
[iOS][Removed] - Remove support of Hermes profiler as that's not the right approach.
Reviewed By: cortinico
Differential Revision: D45527507
fbshipit-source-id: acea5f8b610d8b67ee7a6a91993bb8e4592d093f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37222
changelog: [internal]
User defined destructor does not make sense here. ImageRequest is owned by ImageState, which is owned by ImageShadowNode. ImageShadowNode requires garbage collection from the runtime to be destroyed. Calling cancel in dtor is not deterministic and that is undesired.
bypass-github-export-checks
Reviewed By: javache
Differential Revision: D45524705
fbshipit-source-id: 410def2100f479b68682620b2c43071fdfb86715
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37195
Updates the Dev Menu header on Android.
- Small alignment related to D44872456.
- Add subheading label showing current JS executor description (matching iOS) (note: on Android this is unformatted (but informative), e.g. `JSIExecutor+HermesRuntime`).
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D45142924
fbshipit-source-id: 5c95fc85e6d3b6879287440f76165b02957283e5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37148
This should fix https://github.com/facebook/react-native/issue/36945, which is also causing annoyance when doing the releases
## Changelog:
[iOS][Changed] - Use contents of sdks/.hermesversion to let cocoapods recognize Hermes updates.
Reviewed By: cipolleschi
Differential Revision: D45394241
fbshipit-source-id: 972fbee8f954b90f7087bb232f922761c1639e06
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37152
Those files are unncessary and can be removed from RNTester.
* Proguard file is empty
* Signing config is unnecessary and we can use the debug one also for release.
Changelog:
[Internal] [Changed] - Remove unnecessary files in RN-Tester
Reviewed By: hoxyq
Differential Revision: D45399388
fbshipit-source-id: fd1c6cccaef668e688a699e31045bdc8103ea98e
Summary:
I accidentally turned off New Architecture on RN-Tester while shipping the Fabric Interop. This reverts it.
Changelog:
[Internal] [Changed] - Re-enable newArch on RN-Tester
Reviewed By: cipolleschi
Differential Revision: D45398914
fbshipit-source-id: 2c36f3d0440f147189de644821e1704c00353bac
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37139
This dependency is unnecessary. React Native already exposes a `api` dependency on
`androidx.swiperefreshlayout:swiperefreshlayout` so every consumer will also get it.
This is just another line in the template we can effectively remove.
Changelog:
[Android] [Changed] - Do not explicitely depend on androidx.swiperefreshlayout:swiperefreshlayout
Reviewed By: cipolleschi
Differential Revision: D45390819
fbshipit-source-id: cce34c6a09100d36ee5eb003bb30323f64f0bb9c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37059
This diff introduces InteropEventEmitter, a re-implementation of RCTEventEmitter that works with Fabric and allows to support events on the Fabric Interop for Android.
Thanks to this, users can keep on calling `getJSModule(RCTEventEmitter.class).receiveEvent(...)` in their legacy ViewManagers and they will be using the EventDispatcher
under the hood to dispatch events.
The logic is enabled only if the `unstable_useFabricInterop` flag is turned on. I've turned this on for the template setup and for RN Tester.
On top of this, this diff takes care also of event name "normalization".
On Fabric, all the events needs to be registered with a "top" prefix. With this diff, we'll be adding the "top" prefix at registration time, if the user hasn't added them.
This allows to use legacy ViewManagers on Fabric without having to ask users to change their event name.
Changelog:
[Android] [Added] - Add support for Events on the Fabric Interop Layer
Reviewed By: mdvacca
Differential Revision: D45144246
fbshipit-source-id: 63d4060153907c05977c976379b90574d1f69866
Summary:
Upgrades React Native to `deprecated-react-native-prop-types@4.1.0`, which includes many of the new prop types in React Native v0.72.
See: https://github.com/facebook/react-native-deprecated-modules/blob/main/deprecated-react-native-prop-types/CHANGELOG.md
Changelog:
[General][Changed] - Upgrade to deprecated-react-native-prop-types@4.1.0
Reviewed By: rickhanlonii
Differential Revision: D45155955
fbshipit-source-id: 36e715c2338b667755bd1e522b7d5a2611103779
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36981
We are (following a quick internal RFC) looking to standardise the term "[in-app] [Developer|Debug] menu" to "Dev Menu" in the React Native Debugging docs (and all docs references). (Indeed, the prevalent existing use in docs was already "Developer menu".) This PR aligns naming in the `RCTDevMenu` component on iOS.
See also https://github.com/facebook/react-native-website/pull/3692.
Changelog:
[iOS][Changed] - Rename "Debug Menu" title to "Dev Menu"
Reviewed By: christophpurrer
Differential Revision: D44872456
fbshipit-source-id: c222bb2c551a4f434a1dc0efbb8d4f75c785aa11
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36957
Fixes https://github.com/facebook/react-native/issues/36830
This bumps the version of tsconfig/react-native to inform TypeScript of more libraries provided by Hermes/React Native. See https://github.com/tsconfig/bases/commit/eee5f19ce8c6a9a8d8baed5ce42588b95262b1a8.
I did the search off of current Hermes/RN main branch, but I think the new config should be valid as far back as 0.71. It doesn't make sense to change the new app template for an old version though, so instead I think we should include this new version in 0.72.
Changelog:
[General][Changed] - Bump tsconfig/react-native to 3.0.0
Reviewed By: cortinico
Differential Revision: D45085932
fbshipit-source-id: 448f1103ef13f76fa95884f790a3cccd9ff75b2f
# Conflicts:
# packages/react-native/template/package.json
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36632
Discovered when bumping the RN documentation to typecheck against 0.72, https://github.com/facebook/react-native/pull/36109 removed the `EmitterSubscription` type which should be kept public.
Changelog:
[General][Fixed] - Export EmitterSubscription TypeScript Type
Reviewed By: cortinico
Differential Revision: D44375081
fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
Summary:
Implement a few missing bits for `maintainVisibleContentPosition` to work with fabric. The main thing needed is to add 2 fabric renderer listener methods to allow to hook into specific parts of the rendering process. We need some code to execute before view updates are executed and after view updates are executed. The current methods that are exposed do not work for this case. `willDispatchViewUpdates` is called from JS thread, and there doesn't seem to be a way to add UI blocks that will be executed at the right time like we do in paper. `didDispatchMountItems` is called for every frame which we don't want and will cause lots of overhead.
After that we simply need to call the right methods in the new renderer listener methods.
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID] [ADDED] - Add fabric support for maintainVisibleContentPosition on Android
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/35994
Test Plan: Tested in RN tester maintainVisibleContentPosition example on Android with fabric enabled.
Reviewed By: cipolleschi
Differential Revision: D44131763
Pulled By: cortinico
fbshipit-source-id: 32c0b5867d460537b18a70d472fd58052da6cf80
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36796
As the title says, this fixes a instacrash on template when `createRootView` is invoked with
a bundle being null. The crash was happening as the parameter, despite being not used, is
specified as `Bundle` and is not nullable. When the Java caller passes `null`, the app crashes.
Changelog:
[Android] [Fixed] - Fix a crash new app template when `createRootView` is invoked with null bundle
Reviewed By: cipolleschi
Differential Revision: D44668305
fbshipit-source-id: 1150ddac26f19765e7340878c8850d8462c6f3fd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36771
Changelog: [internal]
Previously, when `NSTextStorage` was cached, we were not accounting for case where text which was aligned to centre or left, was used to size its container.
The result was that it was painted outside of its container, therefore invisible. To fix this, we adjust the offset to make sure text is painted correctly.
This bug only happens if:
- Text is not aligned to left in right to left writing system.
- The canvas where text is drawn is not stretched to full width of its parent.
- The offset needs to be large enough for this to matter, otherwise the text is just slightly off.
- Because of the caching mechanism, it had to be a piece of text that was rendered before. Otherwise it would work.
This complexity is worth the trouble to avoid invalidation of layout inside NSTextContainer, which is expensive.
Reviewed By: cipolleschi
Differential Revision: D44624085
fbshipit-source-id: 1bb8ef88933a49b478a2606dba6bf16b4e728b2b
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36773
Changelog: [internal]
Do not construct `NSAttributedString` if `NSTextStorage` exists. Creating `NSAttributedString` is expensive and it isn't needed to measure text if `NSTextStorage` `exists`
Reviewed By: cipolleschi
Differential Revision: D44620292
fbshipit-source-id: 0827c514e40fcbd9626d2b7d7b6d28a3332d9aa1
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36759
On Thursday the 30th, Apple Released Xcode 14.3.0.
This Version of Xcode enforce some version checks for which React-Codegen, which supported iOS 11 as minimum supported version, could not be build anymore.
This change ensue that React-Codegen is always aligned to the min version supported by React Native.
Plus, it moves CircleCI's Xcode to 14.3.0, to keep this problem in Check.
While working on this, I figured that, with the monorepo, Ruby tests stopped working because they were in the wrong folder: I moved them in the right one.
## Changelog:
[iOS][Fixed] - Make React Native build with Xcode 14.3.0 and fix tests
Reviewed By: blakef
Differential Revision: D44605617
fbshipit-source-id: 3ec1f5b36858ef07d9f713d74eb411a1edcccd45
Summary:
Changelog: [Internal]
Okay, so before the monorepo migration we had to use two scripts separately:
1. Bumping every package with `npm run bump-all-updated-packages`
2. Aligning other packages versions with `npm run align-package-versions`
The reason for it is that *before the monorepo* in a release branch cutoff process we had a step, which was removing `workspaces` keyword from `react-native` package. Without this keyword all new versions of packages will be resolved from npm (where they will be not available yet, because we have to publish them prior to it)
This is not the case for our current setup, and we can actually bump packages versions and they will be resolved as a workspaces successfully
Differential Revision: D44261057
fbshipit-source-id: 6095209c8183f6d84e2697fda2e9a21f8a57f73e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36724
Similarly to iOS, this adds some examples of direct manipulation on Android using
all the various methods.
Changelog:
[Internal] [Changed] - Add examples of Direct Manipulation in Fabric Intrerop
Reviewed By: cipolleschi
Differential Revision: D44541437
fbshipit-source-id: b6e10ac0a815f41ff3c980236b7d8c6937e92065