Summary:
We don't need this if-than-else because the initializeFlipper already checks if we're on bridgeless or not
Changelog:
[Internal] [Changed] - Do not guard initializeFlipper for bridgeless for RN Tester
Reviewed By: NickGerleman
Differential Revision: D49881903
fbshipit-source-id: e6bfc941b43382580bd418a5f27ad9426d300c69
Summary:
Rewrite `RNTesterApplication` to Kotlin as per [Help us Kotlin-ify React Native tests - Round 2](https://github.com/facebook/react-native/issues/38825)
## Changelog:
[ANDROID] [CHANGED] - Rewrite RNTesterApplication to Kotlin, add AnnotationTarget property.
Pull Request resolved: https://github.com/facebook/react-native/pull/39557
Test Plan:
`yarn && yarn android` ✅
The only thing I'm kinda unsure of is whether `AnnotationTarget.PROPERTY` should be added, but it didn't let me annotate `reactHostInterface` without that and didn't compile.
<img width="637" alt="image" src="https://github.com/facebook/react-native/assets/33528752/8bc84870-f3f2-4a46-b076-6ee7e38bd735">
cortinico mdvacca
Reviewed By: cortinico
Differential Revision: D49598401
Pulled By: mdvacca
fbshipit-source-id: 105ae0c13c93dae0eeb2b6fa9040f03f42d2736a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39632
Found a new [crash](P837035842) caused by converting RNTesterActivity to kotlin in D49506304
Changelog:
[Android][Changed] - fix crash "lateinit property initialProps has not been initialized"
Reviewed By: cortinico
Differential Revision: D49594073
fbshipit-source-id: e6d086f6e9bc64b449e6a3da4bc1903729970e7d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39502
This diff adds the parsing of the package.json to retrieve the version of react native and it matches it against a regex to decide whether to enable or not the New Architecture.
This change depends on [this CLI's PR](https://github.com/react-native-community/cli/pull/2076).
## Changelog:
[Android][Added] - Parse RN Version to decide whether to enable the New Arch or not.
Reviewed By: cortinico
Differential Revision: D49270012
fbshipit-source-id: 5164a1ddd26f1822c0d717a7a9e2416ec38d78a2
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39500
When working on RNTeaster, we discovered that the Kotlin migration. broke something.
This diff make sure we can test RNTester
## Changelog:
[Internal] - Make RNTester's New Architecture Example execute again
Reviewed By: cortinico
Differential Revision: D49154282
fbshipit-source-id: cb1f6b076b129dc088cf2cbb5799b373b6afdcda
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39459
## Changelog
[Android][Deprecated] - ReactModuleInfo constructor with getConstants arg is deprecated
introducing a new constructor that doesn't use getConstants and updating the internal codebase to use it. deprecated the old one since it's been copypasta'd a lot in oss.
Reviewed By: cortinico
Differential Revision: D49262824
fbshipit-source-id: 1a4d36b3153d8ce0ee869b8635c94005fe7c9594
Summary:
This changes Clang format config to enforce left pointer alignment instead of right, in accordance with https://www.internalfb.com/intern/wiki/Cpp/CppStyle/
Changelog: [Internal]
bypass-github-export-checks
Reviewed By: sammy-SC
Differential Revision: D48952040
fbshipit-source-id: 108329b2f11d2041a31dee3334c7801d69a3f1ad
Summary:
(reland of D48761722)
Pull Request resolved: https://github.com/facebook/react-native/pull/39217
React Native uses an inconsistent mix of "west const" and "east const". E.g. `const auto &` in 74 files, but `auto const &` in 60. Sometimes they are mixed from one line to the next: {F1079102436}
Clang format 14 adds a QualifierAlignment option, but fbsource is still on 12, so we cannot use it in our config until the [world is updated]()https://fb.workplace.com/groups/toolchain.fndn/posts/24006558685624673/?comment_id=24009214565359085&reply_comment_id=24009455088668366. This diff just runs a local version of Clang format locally first to fix QualifierAlignment, then reformats with the fbsource version, to fix any other output differences unrelated to that. This will not continually enforce a style, but will make the world more consistent, and hopefully encourage a consistent style until we can set it.
West const seems more popular in `//xplat` so I just picked left alignment somewhat arbitrarily, but we could also maybe take a poll on this.
Changelog: [Internal]
bypass-github-export-checks
Reviewed By: shwanton
Differential Revision: D48852450
fbshipit-source-id: 1789aa0db43948169f482188cb8b5e8f0f0246b8
Summary:
Migrate MyLegacyViewManager to Kotlin (https://github.com/facebook/react-native/issues/38825)
## Changelog:
[INTERNAL] [CHANGED] - Moved MyLegacyViewManager to Kotlin
<!-- 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
Pull Request resolved: https://github.com/facebook/react-native/pull/39014
Test Plan: Run `yarn && yarn android`
Reviewed By: rshest
Differential Revision: D48519780
Pulled By: cortinico
fbshipit-source-id: b43a2cfacad977c52b8552c464246b812de30855
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38539
We will use this example to:
- Showcase legacy module support in the TurboModule system in RNTester
- E2E test legacy module support in the TurboModule system
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D47529295
fbshipit-source-id: b98e315741bed7740c36997d706f48e375b0c815
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38886
This change introduces a property called `react.internal.useHermesNightly`
This allows users building RN-Tester or just ReactAndroid to fetch Hermes from the latest
nightly, without having to build it from source.
The change could be useful to speedup local development, but it should not be enabled on CI or when doing releases.
Changelog:
[Internal] [Changed] - Introduce react.internal.useHermesNightly
Reviewed By: mdvacca, cipolleschi
Differential Revision: D48188769
fbshipit-source-id: cb4330cb9082e9db0c7ba82e48b2d10030637353
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38949
I've done another pass and moved all the compileSdk/minSdk/targetSdk and buildToolVersion in a single place so that we can easily bump one for all the projects.
Changelog:
[Internal] [Changed] - Consoliate Android SDK version inside the Version Catalog
Reviewed By: cipolleschi
Differential Revision: D48263891
fbshipit-source-id: bb9565cded37bae986865f37f4891575396128d0
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38946
I'm doing another pass of moving all the various version numbers of the Gradle Plugin inside the `[plugins]` section of the version catalog.
Changelog:
[Internal] [Changed] - Consolidate Gradle Plugin versions inside the version catalog
Reviewed By: mdvacca
Differential Revision: D48233147
fbshipit-source-id: afd12e5377d2d88c53cef4e6913b5c49b3da5bbb
Summary:
Migrate MyNativeViewManager to kotlin as part of ☂️https://github.com/facebook/react-native/issues/38825
## 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
-->
[Internal][Changed]: Migrate MyNativeViewManager to kotlin
Pull Request resolved: https://github.com/facebook/react-native/pull/38916
Test Plan: Verify RN Tester runs with `yarn android`
Reviewed By: cortinico, NickGerleman
Differential Revision: D48221141
Pulled By: mdvacca
fbshipit-source-id: 1cc5dc4346f265883e79893b69f0da5e8c632f2a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38903
Currently Android is not rebuilding the CLI if its content changes. This is a bug.
It's resolution is a bit more complicated as we do have various `buildCodegenCLI` tasks, also in user projects.
I've removed the tasks from the user projects, as they're practically not needed (users always consume a prebuilt codegen).
And I've also updated the setup to have only one `buildCodegenCLI` in the ReactAndroid project.
This allows us to ensure the job executes only once and has correct input/outputs.
Changelog:
[Internal] [Changed] - Fix compilation avoidance bug with buildCodegenCLI
Reviewed By: mdvacca
Differential Revision: D48199157
fbshipit-source-id: ba3be6a0ca959ac4e1240e8feb99b8274e4e2b46
Summary:
As we had version numbers scattered all over the places, I'm consolidating them to use a version catalog: https://docs.gradle.org/current/userguide/platforms.html
## Changelog:
[INTERNAL] - Use version catalog to consolidate versions for JVM dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/38836
Test Plan: CI
Reviewed By: cipolleschi
Differential Revision: D48150285
Pulled By: cortinico
fbshipit-source-id: 83a1867aace5395d9a10fadd6c6ab11c31fa14b5
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38638
A new stable version of Android Gradle Plugin has just been released which I'm bumping over here, and applying all the required changes.
Changelog:
[Internal] [Changed] - Bump AGP to 8.1.0
Reviewed By: cipolleschi
Differential Revision: D47798273
fbshipit-source-id: 57672b10444ffb6079aa5881ff09d033d2a5e895
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38527
This fixes a bug that got reported for the Fabric Interop for Android with Command dispatching.
(See https://github.com/terrylinla/react-native-sketch-canvas/issues/236)
The problem is that libraries that were receiving commands as ints with:
```
public void receiveCommand(
int surfaceId, int reactTag, int commandId, Nullable ReadableArray commandArgs) {
```
would not receive command with the Fabric Interop for Android.
The problem is that with Fabric, events are dispatched as string always.
cipolleschi took care of this for iOS, but we realized that the Android part was missing. I'm adding it here.
The logic is, if the event is dispatched as a string that represents a number (say `"42"`) and the user has Fabric Interop enabled, then we dispatch the event as `int` (so libraries will keep on working).
Changelog:
[Android] [Fixed] - Fabric Interop - Properly dispatch integer commands
Reviewed By: cipolleschi
Differential Revision: D47600094
fbshipit-source-id: c35f0509e6c6c0cddc7090a069882f92dd95532e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38506
There are use cases where an app needs to install a custom font in a separate infra/tool. Instead of bloating those infra/tool with deep React Native dependencies, this allows it to depend on only the pieces that matter.
To ensure backward compatibility, the existing ReactFontManager will proxy method calls to the new impl going forward.
Changelog: [Changed][Android] Moved ReactFontManager to a common package
Reviewed By: mdvacca
Differential Revision: D47569319
fbshipit-source-id: 18ba6617d6c3f68823bdccaacfd8cc961cd6ce34
Summary:
Use Apple Silicon instead of M1 because we have M2 and other variations too.
I did not change the name of `__apply_Xcode_12_5_M1_post_install_workaround` as it's in use.
## 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
-->
[GENERAL] [FIXED] - Use Apple Silicon instead of M1
Pull Request resolved: https://github.com/facebook/react-native/pull/38344
Test Plan: None as no behavioral changes
Reviewed By: christophpurrer
Differential Revision: D47466540
Pulled By: javache
fbshipit-source-id: d770189e065899181a8b4ea17465beef09607d2f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38241
In this diff I'm moving the ReactJsExceptionHandler interface into the react.interfaces package.
This bring consistence with the rest of bridgeless APIs
changelog: [internal] internal
Reviewed By: cortinico
Differential Revision: D47277572
fbshipit-source-id: ad17b19de3571df4ea1545f45d5998912deac072
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37688
This moves the `ReactNativeFlipper` classes used to configure Flipper on Android from the template to
a separate Gradle artifact that will be published under the coordinates:
```
com.facebook.react:flipper-integration:0.73.x
```
This reduces the footprint of Flipper on the app template and makes easier for user on 0.73 to migrate
to Kotlin (as they will now have to migrate only 2 files rather than 4).
Changelog:
[Android] [Changed] - Move Flipper integration to a separate Gradle module inside `ReactAndroid`
Reviewed By: huntie
Differential Revision: D46441588
fbshipit-source-id: e197f29b7386b52091b8d38ed09bbd8f74a997df
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38063
I'm cleaning up the ReactApplication code a bit to use a property with custom setter
Moreover I'm also removing the JvmDefault annotation as that is unnecessary as we use
the `-Xjvm-default=all`, plus is deprecated and will be removed soon by Kotlin.
Changelog:
[Internal] [Changed] - Remove unnecessary JvmDefault
Reviewed By: javache
Differential Revision: D47016727
fbshipit-source-id: 8ab1325c6a9d1db2f8290fb89b766e3d93674b0d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37771
While working on debugging tools, I noticed that we ask in every template app to
- Add a "com.facebook.react.devsupport.DevSettingsActivity" activity
- Add the <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
This is error prone and can be cleanup as we now distribute React Native that is variant aware (debug/release).
So I'm creating a manifest inside `src/debug` that contains those directive so we don't need to ask users
to add them (I'm removing them from the template).
Changelog:
[Internal] [Changed] - Create a Debug manifest inside React Native Android
Reviewed By: cipolleschi
Differential Revision: D46556884
fbshipit-source-id: 10034a6b245bf419dfa663bc998c4d1ad5d24a90
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37255
I've just realized that RN-Tester still ships with a legacy Android icon. Those have been superseeded in API 26 by adaptive icon. On API 33 Android also added support for monochrome icons which we haven't followed up with.
This brings the icon setup of RN Tester similar to one from the template + makes it easier to recognize.
Changelog:
[Internal] [Changed] - Add Adaptive Icons for RN-Tester
Reviewed By: yungsters, NickGerleman, mdvacca
Differential Revision: D45567471
fbshipit-source-id: 51bfe9bb9f99376353ab76e7d54c34b66382b007
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37253
Currently the Dev Menu has unreadable header/subtitle on apps with Dark theme. Here I'm fixing it:
* First I'm adding support for Dark Theme to RN Tester (we were forcign ligth theme).
* Then I'm removing any color reference and defaulting to the theme provided colors.
Changelog:
[Android] [Fixed] - Fix unreadable dev menu header on dark theme apps
Reviewed By: mdvacca
Differential Revision: D45566321
fbshipit-source-id: 947693aefdea846fec927a2cfa4d8236e02e0bfd
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37143
This change add an example on how to use events with arrays in the New Architecture in RNTester.
## Changelog:
[Internal] - Add Examples on RNTester on how to send events with arrays from Native to JS
Reviewed By: cortinico
Differential Revision: D45357873
fbshipit-source-id: 812521aad070181759c0a1c76b5e8c628166229c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37226
Those functions are deprecated and should be replaced with the properties minSdk and targetSdk.
I'm replacing all of those (apart from the template).
Changelog:
[Internal] [Changed] - Do not use deprecated [minSdk|targetSdk]version functions
Reviewed By: cipolleschi
Differential Revision: D45525922
fbshipit-source-id: dd6c795a669d9760eca3e083e220917916032c2c
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