Commit Graph
133 Commits
Author SHA1 Message Date
Carmi Grushko b1590a2f98 Update ktfmt component on FBS:master
Differential Revision: D52529945

fbshipit-source-id: b43fc3e4cf207a63232b41b3e7b790ab9ef66880
2024-01-04 04:14:44 -08:00
Zeya Peng 5d1eac047a add RNTester example for native command Array param (#41897)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41897

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51875073

fbshipit-source-id: 403274b3063d7c49fe4642347d2f724d58a46c1f
2023-12-14 21:06:09 -08:00
Nicola Corti bae52388d2 Fix broken RN Tester custom ViewManager (#41708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41708

RN-Tester is currently instacrashing due to a method accepting a `Float?` rather than a `Float`.
`Float` from Kotlin gets converted to Java's `float`, while `Float?` gets converted to the boxed type, which is not recognized by the framework and is making the app crash.

On top of this, the implementation of `setColor` was wrong as we don't properly handle the null case. Fixing it here as well.

Changelog:
[Internal] [Changed] - Fix broken RN Tester custom ViewManager

Reviewed By: NickGerleman

Differential Revision: D51667346

fbshipit-source-id: b7498a520936f81a0524ba53dc7230ad7ef57bf8
2023-11-29 09:40:05 -08:00
Nicola Corti 25196ba24f Fix several build warnings on RN Tester Android (#41660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41660

While working on other things, I noticed those warnings firing on console which I'm fixing here.

Changelog:
[Internal] [Changed] - Fix several build warnings on RN Tester Android

Reviewed By: cipolleschi

Differential Revision: D51589072

fbshipit-source-id: 1ddb29afd0d150f1ccbc7a8def9f27ecedb69724
2023-11-28 07:08:54 -08:00
David Vacca 45dce98533 Fix rendering of RN Tester New Architecture examples in Android
Summary:
When bridgeless is enabled, RN Tester New Architecture examples crashed with a StackOverflow Exception
The root cause of this issue is that MyLegacyViewManager is sending an event to JS during the execution of MyLegacyViewManager.createViewInstance() method.

This is a problem because the delivery of events depend on the "id" of the view, but the "id" of the view is set after MyLegacyViewManager.createViewInstance() finishes executing.

The documentations "implicitly" mentions to not set props during the execution of the ViewManager.createViewInstance() method:

https://reactnative.dev/docs/native-components-android#2-implement-method-createviewinstance

To fix this issue I'm removing the execution of the method that triggers the event.

bypass-github-export-checks

changelog: [Android][Fix] Fix rendering of 'RN Tester New Architecture examples' when bridgeless is enabled

Reviewed By: fkgozali

Differential Revision: D51047007

fbshipit-source-id: 17be493f79114fa402029063e79fabc1d90efc17
2023-11-07 09:41:23 -08:00
Nicola Corti 21e8327e0e Revert accidental bridgelessEnabled=true for RN Tester (#41056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41056

As the title says,
I accidentally included this as the diff on top of it that would have made this flag toggleable was abandoned.

Changelog:
[Internal] [Changed] - Revert accidental bridgelessEnabled=true for RN Tester

Reviewed By: luluwu2032

Differential Revision: D50409804

fbshipit-source-id: 0e17883094f90e397544b2be0daee5f6cacd8756
2023-10-18 11:37:52 -07:00
Nicola Corti 805f74f2a8 Make IntArray events work on Bridgeless for RN-Tester (#41047)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41047

Array events are currently broken in the sample for RN Tester. This is because the event name is not registered correctly.

I'm updating the event registration to be correct.

Changelog:
[Internal] [Changed] - Make IntArray events work on Bridgeless for RN-Tester

Reviewed By: cipolleschi

Differential Revision: D50266485

fbshipit-source-id: 13bbce91a41281383d4857048e573b6d9cc5387b
2023-10-18 03:24:08 -07:00
Nicola Corti a7f9080475 Simplify new app template for bridgeless (#40929)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40929

This diff reduces the footprint that bridgeless is imposing on the new app template. Specifically:
- I've created a `.toReactHost` method that converts a DefaultReactNativeHost to a DefaultReactHost
- I've updated RN Tester to use the same setup as the New App template which reduces code duplication.

I also had to remove a couple of `UnstableReactNativeAPI` as those were bleeding in the new app template.
I don't think we should ask users to opt-in in `UnstableReactNativeAPI` in the New App template itself as
this means that all the apps will get this opt-in.
Instead we should keep it only for specific APIs that we want the users to opt into.

Changelog:
[Internal] [Changed] - Simplify new app template for bridgeless

Reviewed By: cipolleschi, luluwu2032

Differential Revision: D50227693

fbshipit-source-id: e86c54d5156cc27f1f898b43ca89c57d5cf148b8
2023-10-16 10:52:22 -07:00
Nicola Corti f034808dad Fix broken Fabric Interop example (#40942)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40942

The Fabric Interop example for Android is broken. This is due to the Kotlin conversion which moved the `Color.colorToHSV(color, hsv)` statement *after* the HSV array is read so the array is always [0,0,0].

I'm fixing it here.

Changelog:
[Internal] [Changed] - Fix broken Fabric Interop example

Reviewed By: cipolleschi

Differential Revision: D50264766

fbshipit-source-id: 27ae5289408c7c23c667d6d7112437fa7ebe36d5
2023-10-16 10:17:46 -07:00
Nicola Corti 171a479150 Remove ReactNative/Flipper Integration (#40935)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40935

This is scheduled to land in 0.74, so I'm removed the native integration as this is not needed anymore.
The only thing I left is a stub class to ease the migration out of `ReactNativeFlipper`.

Changelog:
[Android] [Removed] - Remove ReactNative/Flipper Integration

Reviewed By: mdvacca, huntie, cipolleschi

Differential Revision: D50259817

fbshipit-source-id: 28427425340896635607202cd78936f6030e78e0
2023-10-16 05:32:55 -07:00
Lulu Wu 4d70337fb5 Add ExceptionsManagerModule for RNTester (#40767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40767

Fix the following issue:
```Invariant Violation: TurboModuleRegistry.getEnforcing(...):
'ExceptionsManager' could not be found. Verify that a module by this name is registered in the native
binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules":
["PlatformConstants","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","LogBox","Networking","Appearance","DevLoadingView","DeviceInfo","DeviceEventManager",
"SoundManager","ImageLoader","DialogManagerAndroid","NativeAnimatedModule","I18nManager","AccessibilityInfo","StatusBarManager","StatusBarManager","IntentAndroid","ToastAndroid","ShareModule","Vibration"],
"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","FrameRateLogger","KeyboardObserver",
"AccessibilityManager","ModalManager","LinkingManager","ActionSheetManager","ExceptionsManager"]}
```

Changelog:
[Android][Changed] - Add Add ExceptionsManagerModule to CoreReactPackage

Reviewed By: cortinico

Differential Revision: D50017783

fbshipit-source-id: 8642bb23bdae50a1e702f5e0586b0ede80007bb1
2023-10-11 09:56:27 -07:00
Christoph Purrer 4e92f609af rntester Android > Don't call rncore_ModuleProvider(name, params) twice (#40758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40758

This is a follow up to https://github.com/facebook/react-native/pull/39987?fbclid=IwAR3qXLYUtfGSg81CpfDZFAwlnOb2J0zcJb1Wpc9ikLtd_9w2FUDovD6Xwx8

As we already call
```
  return rncore_ModuleProvider(name, params);
```
in:
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultTurboModuleManagerDelegate.cpp#L55

we don't have to do it again in:
https://github.com/facebook/react-native/blob/main/packages/rn-tester/android/app/src/main/jni/OnLoad.cpp#L53

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D50109991

fbshipit-source-id: eeb5af739f4dbf4bf45a21a13eec44ae772db7c4
2023-10-10 17:43:37 -07:00
Christoph Purrer 9e3d466c48 Add rn-tester Android BUCK configuration (#39987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39987

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49983211

fbshipit-source-id: c362d5b93e159bfb5ca17bea0ec0484adcdb4dca
2023-10-10 17:03:55 -07:00
David Vacca 63557034fe Remove TurboModuleManager from ReactHostDelegate (#39613)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39613

In this diff I'm removing TurboModuleManager from ReactHostDelegate. The goal is to stop exposing TurboModuleManager and TurboModuleRegistry
Developers should use ReactContext.getNativeModule to retrieve native modules instead of TurboModuleManager or TurboModuleRegistry

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D49483636

fbshipit-source-id: 6c2e29d83700bebf05475875edad6d5c0877d9df
2023-10-05 22:02:34 -07:00
David Vacca 7a44bd5578 Move ReactHost to com.facebook.react (#39769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39769

Move ReactHost to com.facebook.react

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D49834870

fbshipit-source-id: 2cfdd34297399115457424f0ba1279fd477da4a1
2023-10-05 17:11:39 -07:00
Lulu Wu 48dcfa1718 Fix new arch example not render in RNTester (#39810)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39810

Two issues will be fixed:
- Bridgeless has lazy view manager loading by default so the React Package that provides view managers must implement ViewManagerOnDemandReactPackage, we might could refactor the design of package classes later
- ThemedReactContext should **NOT** be used directly to call function ```getJSModule```, since it doesn't overrides ```getJSModule``` for Bridgeless, we can use it's internal variable ```meactApplicationContext``` which should be an instance of BridgelessReactContext

Reviewed By: cortinico

Differential Revision: D49912656

fbshipit-source-id: a0bdd717612398e8d7a6f36d36dba241a3b06bd7
2023-10-05 07:04:57 -07:00
Nicola Corti b93bd79779 Do not guard initializeFlipper for bridgeless for RN Tester
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
2023-10-04 14:24:17 -07:00
Oleksii c4110d0475 rewrite RNTesterApplication to kotlin (#39557)
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
2023-10-03 17:12:56 -07:00
David Vacca 27b631e5b0 reactHostInterface -> reactHost (#39636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39636

rename ReactApplication.reactHostInterface -> ReactApplication.reactHost

changelog: [internal] internal

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D49610674

fbshipit-source-id: 24ddf410cf6aae176f673dc574216a3a12f25767
2023-09-25 18:09:13 -07:00
Lulu Wu 188eceec98 Fix crash "lateinit property initialProps has not been initialized" (#39632)
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
2023-09-25 10:36:04 -07:00
Bogusz Kaszowski 0f2ecd3254 migrate RNTesterActivity to Kotlin (#39584)
Summary:
PR converts RNTesterActivity to Kotlin as requested in https://github.com/facebook/react-native/issues/38825 .

## Changelog:

[INTERNAL] [CHANGED] - Migrate RNTesterActivity to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/39584

Test Plan:
1. run `yarn android`
2. Check whether RN Tester runs as expected

Reviewed By: cortinico

Differential Revision: D49506304

Pulled By: ryancat

fbshipit-source-id: 7675b43e6ef1d09f9a6e09e5a70526fc59f07bbf
2023-09-22 15:45:30 -07:00
Riccardo Cipolleschi c6d14f6e16 Make New Architecture Examples in RNTester work properly (#39500)
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
2023-09-18 06:12:19 -07:00
Phillip Pan 9f52378cc1 deprecate hasConstants from ReactModuleInfo (#39459)
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
2023-09-16 01:35:01 -07:00
Nick Gerleman d2e91599c8 PointerAlignment: Left
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
2023-09-04 10:55:18 -07:00
Nick Gerleman a966291611 Consistent QualifierAlignment (for real this time I swear) (#39217)
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
2023-08-30 19:56:13 -07:00
Arushi Kesarwani 1547b81ec1 Bridgeless -> Runtime (#39062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39062

Renaming `bridgeless` -> `runtime`

Package `com.facebook.react.bridgeless` -> `com.facebook.react.runtime`

changelog: [General][Changed] - Renaming bridgeless to runtime

Reviewed By: rshest

Differential Revision: D48440542

fbshipit-source-id: 5e310cfee13c7d34c7fac36d3eda94280880b1eb
2023-08-28 17:46:27 -07:00
FabianSolheim 0b6e9bf0d8 Converted RNTesterReactHostDelegate.java to RNTesterReactHostDelegate.kt (#38978)
Summary:
This PR converts RNTesterReactHostDelegate into Kotlin as requested in https://github.com/facebook/react-native/issues/38825 .

## Changelog:

[INTERNAL] [CHANGED] - Convert to RNTesterReactHostDelegate.java => Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/38978

Test Plan:
Run yarn && yarn android
All tests should pass

Reviewed By: huntie, rshest

Differential Revision: D48598018

Pulled By: cortinico

fbshipit-source-id: f29eaa32c63835e090baf60bbde6c0c72b9041c2
2023-08-23 08:33:41 -07:00
imalgrab 172e2d0c7e refactor: migrate MyLegacyViewManager to kotlin (#39014)
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
2023-08-22 08:11:49 -07:00
Ramanpreet Nara 145659241a Introduce SampleLegacyModule example in RNTester (#38539)
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
2023-08-21 17:58:46 -07:00
Bogusz Kaszowski 3ef5e7a9a6 migrate MyNativeView to Kotlin (#38951)
Summary:
This PR converts MyNativeView into Kotlin as requested in https://github.com/facebook/react-native/issues/38825 .

## Changelog:

[INTERNAL] [CHANGED] - Migrate MyNativeView to Kotlin

Pull Request resolved: https://github.com/facebook/react-native/pull/38951

Test Plan:
1. run `yarn android`
2. Check whether RN Tester runs as expected

Reviewed By: philIip, bvanderhoof

Differential Revision: D48281685

Pulled By: mdvacca

fbshipit-source-id: e57d6ab9418b3b1df630de13591af4011bd126b0
2023-08-11 15:34:55 -07:00
tarunrajput acaf667433 migrate MyNativeViewManager to kotlin (#38916)
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
2023-08-11 05:58:23 -07:00
Arushi Kesarwani 01b9b509cf ReactHostInterface & ReactHost refactoring (#38826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38826

`ReactHostInterface` -> `ReactHost`
`ReactHost` -> `ReactHostImpl`

changelog: [internal] internal

allow-large-files

Reviewed By: cortinico

Differential Revision: D48054716

fbshipit-source-id: b926877a0119f906ff794a496df4e30351b71423
2023-08-10 17:24:46 -07:00
David Vacca 354bfc3587 Rename jSBundleLoader -> jsBundleLoader (#38910)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38910

Rename jSBundleLoader -> jsBundleLoader

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051752

fbshipit-source-id: 4443e9fc1801e3a0794b9dfad677318e897d5400
2023-08-10 15:14:13 -07:00
David Vacca e2ef6b98a0 Rename jSEngineInstance -> jsEngineInstance (#38909)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38909

Rename jSEngineInstance -> jsEngineInstance

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D48051751

fbshipit-source-id: ae96270f9dfa56b39bcc42ea8ac108235695311c
2023-08-09 23:30:01 -07:00
David Vacca 2e5b122f23 Rename jSMainModulePath -> jsMainModulePath (#38908)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38908

Rename jSMainModulePath -> jsMainModulePath

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D48051753

fbshipit-source-id: af20a18ec6a01de7db6484b7a7a2e3b2b3353396
2023-08-09 23:30:01 -07:00
Nicola Corti ccc50ddd2d Fabric Interop - Properly dispatch integer commands (#38527)
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
2023-07-21 10:17:31 -07:00
Kevin Gozali 7341f9abdc Android: expose ReactFontManager as a standalone target (#38506)
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
2023-07-18 23:17:48 -07:00
Christoph Purrer 856931b11b rn-tester > Use code-generated Turbo Module name constants (#38297)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38297

Continuation of https://github.com/facebook/react-native/pull/38295

Changelog:
[Internal] [Changed] - Use code-generated Turbo Module name constants

Reviewed By: shwanton

Differential Revision: D47376344

fbshipit-source-id: 62bd63b83d2aa47ef05ee7073e8c20bfdf192e44
2023-07-11 15:33:48 -07:00
David Vacca e58add29a0 Mark ReactJsExceptionHandler to require UnstableReactNativeAPI (#38250)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38250

This diff marks ReactJsExceptionHandler to require UnstableReactNativeAPI annotation

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D47304094

fbshipit-source-id: 93f39422b21925770b99fcf41e004b47d6649c14
2023-07-08 16:10:15 -07:00
David Vacca 683e279dfe Move ReactJsExceptionHandler -> interfaces package (#38241)
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
2023-07-08 16:10:15 -07:00
Nicola Corti 16201f8be3 Move Flipper integration to a separate Gradle module inside ReactAndroid (#37688)
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
2023-07-04 06:01:09 -07:00
Nicola Corti e6502d85bf Remove unnecessary @JvmDefault (#38063)
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
2023-06-26 04:39:02 -07:00
Lulu Wu 016e77a033 Enable JSC (#38007)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38007

Enable JSC for Bridgeless and wire it up with RNTester Android

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D46527692

fbshipit-source-id: 68f36a6db5573a70156864904bb428a4f789d4f5
2023-06-26 03:45:56 -07:00
David Vacca 890565000e Fix RNTester build in CI (#38057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38057

Fix RNTester build in CI

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D47006806

fbshipit-source-id: 762d2ef82af368acbfb4012879c3851f844c84ec
2023-06-25 11:05:09 -07:00
Lulu Wu 0876170681 Enable Bridgeless (#38002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38002

Enable Bridgeless in RNTester Android by adding the initialization logic

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D46375362

fbshipit-source-id: 4c62cba5920d4c90d83a43afed4c4f91e52ec469
2023-06-24 08:06:55 -07:00
Nicola Corti f3c86364da Create a Debug manifest inside React Native Android (#37771)
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
2023-06-08 13:14:47 -07:00
jcdhlzq 98789e9da6 fix: TextInput npe in #29452 on react native side (#37302)
Summary:
Fix the TextInput npe in https://github.com/facebook/react-native/issues/29452 on react native side because if it is just avoided on App side by  changing themes may cause side effects.

## Changelog:

- [ANDROID] [FIXED] - Fix TextInput NPE.

<!-- 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/37302

Test Plan:
Thanks to Fabriziobertoglio1987's wok, the problem in https://github.com/facebook/react-native/issues/29452 can be tested easily. This fixing works fine and causes no side effects.

The following video shows the test result. And the number 101 has been changed to 1001  in RNTester/TextInputKeyProp.js when testing.

https://user-images.githubusercontent.com/23273745/236796702-e61a6fa9-9935-4179-9c5f-e9370d543657.mp4

Reviewed By: javache

Differential Revision: D45688987

Pulled By: cipolleschi

fbshipit-source-id: 4e13c19c10ed53cfcead79e66ab2e232369317e0
2023-05-23 04:45:59 -07:00
Nicola Corti 9e893a9a69 Add Adaptive Icons for RN-Tester (#37255)
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
2023-05-04 09:33:23 -07:00
Nicola Corti 88e3130218 Fix unreadable dev menu header on dark theme apps (#37253)
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
2023-05-04 09:33:23 -07:00
Riccardo Cipolleschi 8c8f7a510f Add example in RNTester to use events with arrays (#37143)
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
2023-05-04 04:11:49 -07:00