Commit Graph

31192 Commits

Author SHA1 Message Date
Fabrizio Cucci 49ea2a43c2 Kotlinify NativeArrayInterface (#43892)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43892

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55789985

fbshipit-source-id: 5523012a66179b2a35cc046c948bfd4f7cccf200
2024-04-05 11:21:33 -07:00
Nicola Corti ed4106736a Convert ReactModalHostManager to Kotlin (#43844)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43844

This converts the last class inside `com.facebook.react.views.modal` to Kotlin

Changelog:
[Internal] [Changed] - Convert ReactModalHostManager to Kotlin

Reviewed By: javache

Differential Revision: D55739386

fbshipit-source-id: 6bf85449c2bfd6d81a2d899bd044835b9b72c185
2024-04-05 11:12:02 -07:00
Nicola Corti ab44550f6e Convert ReactModalHostView to Kotlin (#43845)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43845

This class is quite legacy and requires a couple of eyes before merging it.
I've tested that modals are working fine on RN-Tester both Old & New Arch.

Changelog:
[Internal] [Changed] - ReactModalHostView to Kotlin

Reviewed By: javache

Differential Revision: D55739128

fbshipit-source-id: 740d24df39ceb7b6a8120ae5315cf0684d1e6e27
2024-04-05 11:12:02 -07:00
Nicola Corti 20c1cc5e65 Bump AGP from 8.2.1 to 8.3.1 (#43925)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43925

Another diff to keep our dependencies updated.

Changelog:
[Internal] [Changed] - Bump AGP from 8.2.1 to 8.3.1

Reviewed By: cipolleschi

Differential Revision: D55803537

fbshipit-source-id: f94512799f5d32c667520cd11b8db38c93485ab7
2024-04-05 10:14:42 -07:00
Nicola Corti acd6d154e5 Bump Kotlin to 1.9.23 (#43928)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43928

This is a patch version for Kotlin, no practical changes expected.

Changelog:
[Internal] [Changed] - Bump Kotlin to 1.9.23

Reviewed By: cipolleschi

Differential Revision: D55803534

fbshipit-source-id: 99fcf444885cbc7b95baec2983303cfee88874a6
2024-04-05 10:14:42 -07:00
Nicola Corti ca7cc32288 Bump Gradle to 8.7 (#43926)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43926

Just keeping our dependencies up-to-date.

Changelog:
[Internal] [Changed] - Bump Gradle to 8.7

Reviewed By: cipolleschi

Differential Revision: D55803535

fbshipit-source-id: 90bc2902d8692f1fa621a088189f6bae74c3c61f
2024-04-05 10:14:42 -07:00
Nicola Corti 854c57c3e8 Bump SoLoader to 0.11.0 in OSS (#43924)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43924

Just keeping our dependecies up to date.

Changelog:
[Internal] [Changed] - Bump SoLoader to 0.11.0 in OSS

Reviewed By: cipolleschi

Differential Revision: D55803536

fbshipit-source-id: a1bea4d53c325db3f56986b08e3f3963c75f2269
2024-04-05 10:14:42 -07:00
Fabrizio Cucci 33a1794755 Kotlinify RuntimeConfig (#43891)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43891

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55788661

fbshipit-source-id: 1da14b556c013d679a671ae78671df690ebd9326
2024-04-05 08:42:22 -07:00
Nicola Corti 03c75c22fa Rename reactnative.a -> react_cxxreact.a (#43859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43859

This frees up the `reactnative` CMake target so we could use it as single .so
for the CMake build.

Changelog:
[Internal] [Changed] - Rename reactnative.a -> react_cxxreact.a

Reviewed By: javache

Differential Revision: D55745640

fbshipit-source-id: 3cad512cc07a277af2a0cea696863c85a17dabc1
2024-04-05 08:02:35 -07:00
Riccardo Cipolleschi 041bca4227 do not force CMake version for windows (#43916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43916

build_hermesc_windows is starting to fail because version 3.14.7 is [not available anymore](https://app.circleci.com/pipelines/github/facebook/react-native/44621/workflows/0c7d3474-ddf4-4138-bdbc-3fec59486f6c/jobs/1452518?invite=true#step-108-735_84) on chocolatey. By removing the version, the system should try to download the latest available.

## Changelog:
[Internal] - use the latest cmake on chocolatey for windows

Reviewed By: cortinico

Differential Revision: D55799078

fbshipit-source-id: d33a3a5f2c45c05e86a0cdf775ed820df5f8b9d4
2024-04-05 07:49:56 -07:00
Thomas Nardone 8c0b5df05a Convert systrace module (#43877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43877

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D55765258

fbshipit-source-id: 1582500d73239064272f567f183f6f6f406d815d
2024-04-05 07:37:15 -07:00
Nicola Corti bc832ca3aa Fix Android instacrashing on JSC with NoSuchMethodException (#43907)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43907

JSC is currently instacrashing because we missed a JvmStatic.
Android will attempt to load JSCInstance.initHybrid which is missing unless we specify JvmStatic.

Changelog:
[Internal] [Changed] - Fix Android instacrashing on JSC with NoSuchMethodException

Reviewed By: GijsWeterings

Differential Revision: D55795290

fbshipit-source-id: 5d10344e3f481dc5832706d77ccf2bf163dfb30f
2024-04-05 05:25:31 -07:00
Dmitry Rykun d6c21495f7 Print Hermes build script shell commands only in CI (#43767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43767

Print Hermes build script shell commands only in CI.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D55635527

fbshipit-source-id: f0a901e11c523987e97a28b5238dcc08586516dd
2024-04-05 05:08:25 -07:00
Riccardo Cipolleschi 627bff2c38 Remove duplicated include when preparing prefabs (#43865)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43865

Some of the includes in the task that prepares prefabs are duplicated. Removing the duplication

## Changelog:
[Internal] - Cleanup android prefabs

Reviewed By: cortinico

Differential Revision: D55751660

fbshipit-source-id: 2ea610937f122f82bc91e09fac1a2c78efa83410
2024-04-05 01:18:05 -07:00
Soe Lynn d2a8222bc6 Back out "Update useNativeViewConfigsInBridgelessMode" (#43883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43883

Changelog: [Internal]

Backing out original diff `D55705805` to fix CircleCI Dynamic library test failure

Reviewed By: philIip

Differential Revision: D55773581

fbshipit-source-id: 2ec1b82241389166c1c31c979106c4ee6ead83fe
2024-04-04 23:03:47 -07:00
Soe Lynn b5db214d2a Deprecate RedBox from RCTBridge to RCTModuleRegistry (#43717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43717

As we are going to bridgeless in new architecture, we want to clean up the usage of RCTBridge to use RCTModuleRegistry to access NativeModule.

Changelog:
[iOS][Breaking] Remove `RCTRedBox` access through `RCTBridge`

Reviewed By: philIip

Differential Revision: D55532209

fbshipit-source-id: 62aa2a24b60ab54d7f3cf25c34beda4449aaeaed
2024-04-04 20:27:32 -07:00
Alan Lee bf1a5d4934 convert ViewUtil to Kotlin (#43799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43799

convert Java to Kotlin: `/react/uimanager/common/ViewUtil.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55651762

fbshipit-source-id: 26896a41df8efec9fa032f0e16e3e50342dd54f8
2024-04-04 18:30:57 -07:00
Thomas Nardone fd3ef7b692 Avoid !! in ResourceDrawableHelper.kt (#43820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43820

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55701291

fbshipit-source-id: afdce3ffa59bc488d6c36d78a8cf3176089599ba
2024-04-04 15:00:41 -07:00
Samuel Susla 70c3158b64 delete unused trait: AndroidMapBufferPropsSupported (#43787)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43787

changelog: [internal]

This is not used. Let's delete it.

Reviewed By: fabriziocucci

Differential Revision: D55485422

fbshipit-source-id: 13c2e75aa384810ad07c055cedb3bb18f30b8378
2024-04-04 13:08:11 -07:00
Alan Lee 445c9ce806 convert LayoutMetricsConversions to Kotlin (#43863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43863

convert Java to Kotlin: `react/fabric/mounding/LayoutMetricsConversions.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55714004

fbshipit-source-id: fbf167cb6030916789f6676c1bd0690f144cf330
2024-04-04 13:07:26 -07:00
Fabrizio Cucci c84faadd50 Kotlinify DoubleTapReloadRecognizer (#43862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43862

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: andrewdacenko

Differential Revision: D55747942

fbshipit-source-id: 07376f5ca2790d1656903cd03705f32c2050a589
2024-04-04 12:36:06 -07:00
Fabrizio Cucci 0132142446 Kotlinify ReactUnimplementedView (#43828)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43828

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55709336

fbshipit-source-id: 714e6d806cfe7ff4a2979e896201b640de4f5182
2024-04-04 12:33:18 -07:00
Fabrizio Cucci e36baddff7 Kotlinify NoRetryPolicy (#43831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43831

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708871

fbshipit-source-id: c557743bf35cd27559fe8365025ca071bef57701
2024-04-04 12:33:18 -07:00
Fabrizio Cucci 06a3028694 Kotlinify SimpleViewManager (#43834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43834

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55708429

fbshipit-source-id: ff76e5dc2e8c6d99b7792ed58e8bcd5e1441b2dd
2024-04-04 12:30:49 -07:00
Fabrizio Cucci af35442d88 Kotlinify GuardedFrameCallback (fabric) (#43842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43842

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55738719

fbshipit-source-id: 13bf28bf17f15f2e7d4dfbe2b49473a945a139ef
2024-04-04 12:30:49 -07:00
Andrew Datsenko 4c4a6e4b7c Update useNativeViewConfigsInBridgelessMode (#43824)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43824

Changelog: [Internal]

# Feature flag cleanup/migration
This migration is part of the new Feature Flag system built by rubennorte. The goal of this migration is to clean up our Feature Flags and consolidate them into a single place, accessible by all platforms.

# In this diff
Replaced `RCTSetUseNativeViewConfigsInBridgelessMode` and `RCTGetUseNativeViewConfigsInBridgelessMode` with `ReactNativeFeatureFlags.useNativeViewConfigsInBridgelessMode()` and ReactNativeFeatureFlags::override

Reviewed By: javache

Differential Revision: D55705805

fbshipit-source-id: 861675a1a94da0fcef8d8a02ccbd8ecdd97ec700
2024-04-04 12:27:07 -07:00
Alan Lee b09f378320 covert MainPackageCongfig to Kotlin (#43784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43784

convert Java to Kotlin: `react/shell/MainPackageConfig.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55627449

fbshipit-source-id: 1d0c0a034eb12e88fbadab88fa5e4c08bdbc1ad3
2024-04-04 12:10:56 -07:00
Vojtech Novak 98b1331609 fix: add missing fields to native errors in new arch (#43649)
Summary:
With 0.74.rc-5 one bug which related to errors was fixed (https://github.com/facebook/react-native/issues/41950). However, the fix introduced another one: the shape of Error objects that come from native modules has changed. This PR attempts to fix that, though it's not (yet) doing it in a way that would be 100% compatible with the old arch.

The problem was observed on iOS, not sure what the situation is on Android but believe it's okay there.

edit: on Android, there are no issues but the `message` field is enumerable, so that part is different from ios (see logs below).

Consider this code, where `error` is produced from a promise rejection inside of a native module.

```ts
  console.log(
    'own properties: ',
    JSON.stringify(Object.getOwnPropertyNames(error), null, 2),
  );
  console.log(
    'own enumerable properties: ',
    JSON.stringify(Object.entries(error), null, 2),
  );
```

These are the results for

<details>
  <summary>Old architecture</summary>

```
 LOG  Running "google-one-tap-example" with {"rootTag":1,"initialProps":{}}
 LOG  own properties:  [
  "stack",
  "code",
  "message",
  "domain",
  "userInfo",
  "nativeStackIOS"
]
 LOG  own enumerable properties:  [
  [
    "code",
    "-5"
  ],
  [
    "message",
    "RNGoogleSignIn: The user canceled the sign in request., Error Domain=com.google.GIDSignIn Code=-5 \"The user canceled the sign-in flow.\" UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}"
  ],
  [
    "domain",
    "com.google.GIDSignIn"
  ],
  [
    "userInfo",
    {
      "NSLocalizedDescription": "The user canceled the sign-in flow."
    }
  ],
  [
    "nativeStackIOS",
    [
      "0   ReactTestApp                        0x0000000102f4a6d8 RCTJSErrorFromCodeMessageAndNSError + 112",
      "1   ReactTestApp                        0x0000000102eeedd0 __41-[RCTModuleMethod processMethodSignature]_block_invoke_2.73 + 152",
      "2   ReactTestApp                        0x0000000102e2ae24 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
      "3   ReactTestApp                        0x0000000102e2aa8c -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
      "4   ReactTestApp                        0x0000000102e2a8e0 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
      "5   ReactTestApp                        0x0000000102e28628 __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
      "6   ReactTestApp                        0x0000000102dc9d80 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
    ]
  ]
]
```
</details>

<details>
  <summary>RN 74 rc-5 (with bridgeless on)</summary>

```
  (NOBRIDGE) LOG  Bridgeless mode is enabled
 (NOBRIDGE) LOG  Running "google-one-tap-example" with {"rootTag":1,"initialProps":{"concurrentRoot":true},"fabric":true}
 (NOBRIDGE) LOG  own properties:  [
  "stack",
  "message",
  "cause"
]
 (NOBRIDGE) LOG  own enumerable properties:  [
  [
    "cause",
    {
      "code": "-5",
      "message": "RNGoogleSignIn: The user canceled the sign in request., Error Domain=com.google.GIDSignIn Code=-5 \"The user canceled the sign-in flow.\" UserInfo={NSLocalizedDescription=The user canceled the sign-in flow.}",
      "nativeStackIOS": [
        "0   ReactTestApp                        0x00000001023a7b38 RCTJSErrorFromCodeMessageAndNSError + 112",
        "1   ReactTestApp                        0x00000001026cf774 ___ZZN8facebook5react15ObjCTurboModule13createPromiseERNS_3jsi7RuntimeENSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEU13block_pointerFvU13block_pointerFvP11objc_objectEU13block_pointerFvP8NSStringSH_P7NSErrorEEENK3$_0clES4_RKNS2_5ValueEPSQ_m_block_invoke.57 + 332",
        "2   ReactTestApp                        0x0000000102270958 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
        "3   ReactTestApp                        0x00000001022705c0 -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
        "4   ReactTestApp                        0x0000000102270414 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
        "5   ReactTestApp                        0x000000010226e15c __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
        "6   ReactTestApp                        0x000000010220f328 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
      ],
      "domain": "com.google.GIDSignIn",
      "userInfo": {
        "NSLocalizedDescription": "The user canceled the sign-in flow."
      }
    }
  ]
]
```
</details>

<details>
  <summary>with the diff from this PR</summary>

```
 (NOBRIDGE) LOG  own properties:  [
  "stack",
  "message",
  "code",
  "nativeStackIOS",
  "domain",
  "userInfo"
]
 (NOBRIDGE) LOG  own enumerable properties:  [
  [
    "code",
    "-5"
  ],
  [
    "nativeStackIOS",
    [
      "0   ReactTestApp                        0x000000010083b8f8 RCTJSErrorFromCodeMessageAndNSError + 112",
      "1   ReactTestApp                        0x0000000100b63534 ___ZZN8facebook5react15ObjCTurboModule13createPromiseERNS_3jsi7RuntimeENSt3__112basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEU13block_pointerFvU13block_pointerFvP11objc_objectEU13block_pointerFvP8NSStringSH_P7NSErrorEEENK3$_0clES4_RKNS2_5ValueEPSQ_m_block_invoke.57 + 332",
      "2   ReactTestApp                        0x0000000100704718 +[RNGoogleSignin rejectWithSigninError:withRejector:] + 548",
      "3   ReactTestApp                        0x0000000100704380 -[RNGoogleSignin handleCompletion:serverAuthCode:withError:withResolver:withRejector:fromCallsite:] + 184",
      "4   ReactTestApp                        0x00000001007041d4 -[RNGoogleSignin handleCompletion:withError:withResolver:withRejector:fromCallsite:] + 236",
      "5   ReactTestApp                        0x0000000100701f1c __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke_2 + 100",
      "6   ReactTestApp                        0x00000001006a30e8 __35-[GIDSignIn addCompletionCallback:]_block_invoke_2 + 132",
...
    ]
  ],
  [
    "domain",
    "com.google.GIDSignIn"
  ],
  [
    "userInfo",
    {
      "NSLocalizedDescription": "The user canceled the sign-in flow."
    }
  ]
]

```
</details>

You see there is a change compared to old arch because `message` is no longer own enumerable property. If that needs to change (I guess it should), it'd be nice if someone more familiar with JSI pointed me in the right direction. Even with this inconsistency, the PR is an improvement and would be nice to have this fix included in the next RC.

This is output from Chrome's console for completeness, just to have something to compare to:

```
let err = new Error('hello')
undefined
Object.getOwnPropertyNames(err)
> ['stack', 'message']
Object.entries(err)
> []
```

bypass-github-export-checks

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[IOS] [FIXED] - add missing fields to native errors in new arch

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: Tested locally with an example app running RN 74-rc 5

Reviewed By: cortinico

Differential Revision: D55690184

Pulled By: cipolleschi

fbshipit-source-id: 60a857b9871af888dcd526782b5e6b73c07c051a
2024-04-04 12:09:41 -07:00
Moti Zilberman b309af79e8 Introduce DevSupportManager.openDebugger() method (#43685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43685

Changelog: [Changed][Android] Expose `openDebugger()` method on `DevSupportManager`

Exposes the `openDebugger()` method on `DevSupportManager` for ease of integration by RN Android frameworks.

Reviewed By: cortinico, arushikesarwani94

Differential Revision: D55408820

fbshipit-source-id: f06684de47cee23642bf893afaedb2755453f253
2024-04-04 11:19:54 -07:00
Alan Lee c84f5cb5cd convert StandardCharsets to Kotlin (#43790)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43790

convert Java to Kotlin: `react/common/StandardCharsets.java`

Changelog:
[Internal] internal

Reviewed By: cortinico

Differential Revision: D55611308

fbshipit-source-id: 11af39f9bcff555c7d5b30e1836d73c09d278f72
2024-04-04 11:12:45 -07:00
Alex Hunt 9c00d6d332 Add VS Code workspace config (#43851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43851

## Summary

Adds a `react-native.code-workspace` workspace file when using VS Code. This disables the built-in TypeScript Language Service for `.js` files, recommends extensions, enables `formatOnSave`, and configures Flow language support.

We will recommend this workspace config in our contributing guide: https://github.com/facebook/react-native-website/pull/4075.

**Motivation**

This is a DevX benefit for **React Native contributors** using open source VS Code — in particular to help with recent/trivial papercuts in PRs such as inserting a final newline in files (configured by EditorConfig).

**Recommended extensions**

NOTE: The recommended extensions list is currently minimal — happy to extend this now or in future, but let's aim to keep these conservative.

- Flow — language support
- EditorConfig — formatting based on `.editorconfig`, all file types
- Prettier — formatting for JS* files
- ESLint — linter for JS* files

**Why `react-native.code-workspace`?**

`.code-workspace` files have slight extra behaviours over a `.vscode/` directory:
- Allows user to opt-in or skip.
- Allows double-click launching from file managers.
- Allows base folder (and any subfolders in future) to be opened with local file tree scope (useful in fbsource!)
- (Minor point) Single config file over multiple files.

https://code.visualstudio.com/docs/editor/workspaces

Changelog: [Internal]

## Test plan

Aganst a new unconfigured copy of Visual Studio Code Insiders.

**Without workspace config**

 `.js` files raise errors by default (built-in TypeScript language service)

 {F1478195672}

 When using the Flow VS Code extension, the wrong version (global) of Flow is used.

**With workspace config**

 Workspace config is suggested when folder is opened in VS Code

 {F1478194795}

 Dialog is shown on workspace launch with recommended VS Code extensions

{F1478196003}

 Built-in TypeScript Language Service is disabled for `.js` files
 Flow language support is configured correctly against `flow` version in `package.json`

{F1478291085}
{F1478200649}

Reviewed By: motiz88

Differential Revision: D55698495

fbshipit-source-id: b0b2f459cf05afc3e7862c9845066a66aaa1985b
2024-04-04 09:04:20 -07:00
Riccardo Cipolleschi 82b58d0367 Fix RCTRCTComposedViewRegistry for Old Arch by adding count and keyEnumerator (#43850)
Summary:
In the Old Architecture and for Swift Libraries, these two methods are used to initialize a new disctionary but their implementation was missing so some libraries like lottie were failig to build.

## Changelog:
[Internal] - Implement missing `count` and `keyEnumerator` methods for RCTComposedViewRegistry

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

Test Plan: Tested locally with the repro provided by SWM

Reviewed By: javache

Differential Revision: D55743648

Pulled By: cipolleschi

fbshipit-source-id: 7bdb92625341cd704b8b09920ab3223a2ca61a54
2024-04-04 08:36:58 -07:00
Fabrizio Cucci 6bac579a12 Back out "Kotlinify OkHttpCallUtil" (#43857)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43857

Changelog: [Internal]

There seems to be a weird problem with OkHttpCallUtil:
* D55707704 works in fbsource but breaks the CircleCI build with

> using 'dispatcher(): Dispatcher' is an error. moved to val

* D55744165 fixes the CircleCI build but breaks in fbsource with

> cannot access 'dispatcher': it is package-private in 'OkHttpClient'

Not sure what's the real fix to migrate `OkHttpCallUtil` to Koltin but at this point is probably safer to backout the original migration! 😥

Reviewed By: cortinico

Differential Revision: D55745345

fbshipit-source-id: 3ec6e4d99c950098fae974aa5f0e5be0b6663249
2024-04-04 08:25:14 -07:00
Riccardo Cipolleschi 0b6b8e2fe6 Fix static linking for Bridgeless mode (#43846)
Summary:
Working with gabrieldonadel, we realized that static frameworks of the React-RendererRuntime are not following the proper folder structure.
When a user tries to import `ReactCommon/RCTHost` in the app delegate, for example, the user ends up with an error and they can't find the files.

These changes fixes this by establishing the right folder structure in the static frameworks

## Changelog:
[Internal] - Make sure that React-RuntimeCore and JSErrorHandler are created with the proper structure for static frameworks

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

Test Plan:
Tested locally on an app with 0.74.
Before: it failed to build.
After: it build successfully.

Reviewed By: cortinico

Differential Revision: D55741581

Pulled By: cipolleschi

fbshipit-source-id: 11ac0882d3feea05ef8904d55856ba5704b7a3b8
2024-04-04 08:06:53 -07:00
zhongwuzw 91279a822b Remove invalidate observer instead of re-adding observer in DeviceInfo module (#43737)
Summary:
Previous fix brings in https://github.com/facebook/react-native/pull/42396. Seems it's a mistake to re-add observer?
So let's remove it and also not `invalidate` method not be called twice.

## Changelog:

[IOS] [FIXED] - Remove invalidate observer instead of re-adding observer in DeviceInfo module

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

Test Plan: Fix for https://github.com/facebook/react-native/issues/42120 also works.

Reviewed By: javache

Differential Revision: D55692219

Pulled By: cipolleschi

fbshipit-source-id: dba1ddc39a9f2611fc2b84fadf8c23827891379a
2024-04-04 07:33:10 -07:00
Alex Hunt 629159a1e3 Improve comment describing inspectorExecutor lifetime (#43856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43856

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D55744630

fbshipit-source-id: 4dc930342948253d4cc3b2d04fc4c474e53fc14d
2024-04-04 07:17:56 -07:00
Nicola Corti 71cc8a506b Annotate as @Nullsafe everything in package com.facebook.react.views.text.internal.span (#43843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43843

This just annotates more classes as nullsafe.

Changelog:
[Internal] [Changed] - Annotate as Nullsafe everything in package com.facebook.react.views.text.internal.span

Reviewed By: fabriziocucci

Differential Revision: D55739092

fbshipit-source-id: f4f4267b344d103b87376aad88291941dce896cd
2024-04-04 06:07:46 -07:00
Samuel Susla c7d9571d6a only trigger RCTContentDidAppearNotification when content appears (#43823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43823

changelog: [internal]

Notification RCTContentDidAppearNotification was posted too early in RCTSurfaceHostingProxyRootView, which does not know when views are mounted.
It was also posted if no views were mounted, leading to inconsistent behaviour between Paper and Fabric.

The implementation is aligned with Paper: https://github.com/facebook/react-native/blob/main/packages/react-native/React/Base/RCTRootContentView.m#L45-L55

Reviewed By: cipolleschi

Differential Revision: D55640654

fbshipit-source-id: 2d7bc5afb6ba1c1e8db529ee11eac2bae2d936d6
2024-04-04 05:52:53 -07:00
Arushi Kesarwani dc83cb7a26 Migrate FabricSoLoader to Kotlin (#43837)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43837

FabricSoLoader.java -> FabricSoLoader.kt

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D55724712

fbshipit-source-id: bef37f74df50006d842dd4913386841a2eddf2b5
2024-04-04 04:19:17 -07:00
Fabrizio Cucci e7b352daf0 Kotlinify ViewUtils (#43826)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43826

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55707886

fbshipit-source-id: ffe291cbb9ac18b1092b5d466019a8230c1772c1
2024-04-04 04:02:55 -07:00
Fabrizio Cucci 0646d50306 Kotlinify OkHttpCallUtil (#43825)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43825

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55707704

fbshipit-source-id: 658f2aed252abfd75f8d7670ca35a396ed06390a
2024-04-04 04:02:55 -07:00
Fabrizio Cucci c1081cc1ac Kotlinify GuardedFrameCallback (#43841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43841

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55732555

fbshipit-source-id: baab9a33be7d963dfe0fe765211de3d5abaebaca
2024-04-04 03:43:38 -07:00
Fabrizio Cucci 13cdd480ea Kotlinify ChoreographerProvider (#43840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43840

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55731748

fbshipit-source-id: f43c687f44b351ade907be4dcd55518b5bef913d
2024-04-04 03:43:38 -07:00
Fabrizio Cucci 9d51bfdc14 Kotlinify AndroidChoreographerProvider (#43839)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43839

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: cortinico

Differential Revision: D55731620

fbshipit-source-id: c75eca4d324fb6761b681f28a9fe65fb2659aa3e
2024-04-04 03:43:38 -07:00
Alan Lee bc3e3360d1 add PopupMenuDismissEvent (#43785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43785

Deprecated `UIManager.showPopupMenu()` had success callback that would be triggered on 1) item selection or 2) dismiss.
New `PopupMenuAndroid` only has item selection callback so adding in missing dismiss callback.

Changelog:
[Android][Added] - Add (optional) onPopupDismiss() callback for PopupMenuAndroid

Reviewed By: cortinico

Differential Revision: D55531870

fbshipit-source-id: 26f3992ef6c85fbc6d8dfff00cb723ac4aae3762
2024-04-04 02:29:29 -07:00
Fabrizio Cucci f937f55ec4 Kotlinify DrawerStateChangedEvent (#43835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43835

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709997

fbshipit-source-id: 43c89680ca373c6f68119f63107c616568df0cbc
2024-04-04 02:00:36 -07:00
Fabrizio Cucci 4b580c0060 Kotlinify DrawerSlideEvent (#43836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43836

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709887

fbshipit-source-id: ce15c18dcfdcf68eba0973ac2277a377435149fb
2024-04-04 02:00:36 -07:00
Fabrizio Cucci c34dfb036b Kotlinify DrawerClosedEvent (#43833)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43833

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709690

fbshipit-source-id: fdfe8fbc8f8faffc3dcde27e03a5f6667f621e46
2024-04-04 02:00:36 -07:00
Fabrizio Cucci bd385f831f Kotlinify DrawerOpenedEvent (#43830)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43830

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55709628

fbshipit-source-id: f87483381e948333fc6a437e3c2b42ec927cffda
2024-04-04 02:00:36 -07:00
Fabrizio Cucci 49589fe92e Kotlinify RefreshEvent (#43829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43829

Changelog: [Internal]

As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)).

Reviewed By: alanleedev

Differential Revision: D55708970

fbshipit-source-id: 7a19f509ce97a9159b85c4e0a7540c0ae7cff3f1
2024-04-04 02:00:36 -07:00