Commit Graph

27555 Commits

Author SHA1 Message Date
Ramanpreet Nara f06632c83d Introduce ObjCInteropTurboModule (#37367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37367

## Changes
This diff introduces ObjCInteropTurboModule.

ObjCInteropTurboModule implements method dispatch for legacy native modules (i.e: modules that aren't schematized).

**Note:** This method dispatch relies on the RCT_EXPORT_METHOD macros, not the TurboModule system's C++ codegen.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D44807334

fbshipit-source-id: 8b6162181504ca9fbf8bf13a6951061936e0ff26
2023-05-10 15:58:13 -07:00
Ramanpreet Nara f8929f8d54 Allow the TurboModule system to create legacy modules (#37364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37364

When the TurboModule interop layer is enabled, it should create modules that conform to RCTBridgeModule (i.e: legacy and turbo modules).

When the TurboModule interop layer is disabled, it should only create modules that conform to RCTTurboModule (i.e: turbo modules).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D45706884

fbshipit-source-id: be6f054556d1506e2934884ab5014394f0c08e8f
2023-05-10 15:58:13 -07:00
Ramanpreet Nara 16a250eb13 Integrate TurboModuleManager with legacy module registration (#37366)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37366

## Rationale
In Bridgeless mode, the TurboModule system needs to integrate with the legacy native module registration mechanisms.

That way, it knows what legacy native modules it's responsible for creating.

## Context
There are three ways to register native modules with the Bridge.

### A) Class loads (i.e: +load)
1. Write an [RCT_EXPORT_MODULE()](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/rn-tester/NativeComponentExample/ios/RNTMyLegacyNativeViewManager.mm?lines=25) macro in the module's implementation.
2. This macro [generates a +load](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeModule.h?lines=70%2C76-79) method on the native module class. When the ObjC runtime loads the native module class (during app start), it executes the class's +load method, which [inserts the native module class into a global array (i.e: RCTModuleClasses)](https://www.internalfb.com/code/fbsource/[daf070f990c6a701677f4db3de8bf6fd3d00c6a4]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridge.m?lines=43-44%2C58-61)
4. Then, when the application starts the bridge, the bridge [registers all these native module classes (in RCTModuleClasses) with itself](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=412).

### B) App provides modules eagerly (i.e: extraModulesForBridge)

1. The application provides an RCTBridgeDelegate to the Bridge. This delegate implements [extraModulesForBridge:](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeDelegate.h?lines=13%2C23%2C25-39)
2. The Bridge [registers these extra modules with itself](https://www.internalfb.com/code/fbsource/[574e410dcffbc900152cea60a50e750d833a2534]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=389%2C410%2C412%2C799%2C804-805), when it starts up.

### C) App provides modules lazily (i.e: bridge:didNotLoadModule)
1. The application provides an RCTBridgeDelegate to the Bridge. This delegate implements [bridge:didNotFindModule:](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridgeDelegate.h?lines=13%2C23%2C57)
2. When module lookup fails on the bridge, the bridge [calls the delegate's bridge:didNotFindModule](https://www.internalfb.com/code/fbsource/[ee3eaa48f826202c6c0e2ee663916ef62fb135d0]/xplat/js/react-native-github/packages/react-native/React/CxxBridge/RCTCxxBridge.mm?lines=585%2C618-619)
3. In this method, the delegate [loads the native module class from *somewhere*](https://www.internalfb.com/code/fbsource/[0f0f48a4723c830310c6e2c194822b6a5ba3000e]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1072%2C1074-1075), and [registers it with the bridge](https://www.internalfb.com/code/fbsource/[0f0f48a4723c830310c6e2c194822b6a5ba3000e]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/Exported/FBReactModule.mm?lines=1072%2C1083-1085)

## Changes
This diff integrates the TurboModule system with +loads and extraModulesForBridge.

It does not integrate with the lazy module registration mechanism, because I believe that mechanism isn't used in open source.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D44647858

fbshipit-source-id: 785240c51eb90f0f3e15304c25b5998b2069c2d2
2023-05-10 15:58:13 -07:00
Nick Gerleman 26983aed25 Rename directory "eslint-config-react-native-community" (#37347)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37347

This fixes the file-structure of `eslint-config-react-native-communtiy`, and `eslint-plugin-react-native-communtiy` to match the name they were renamed to as part of 0.72.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D45721173

fbshipit-source-id: 7ad784dbf56fb4cd05d7dba608e6d5064392e43d
2023-05-10 15:46:34 -07:00
Nick Gerleman cae52f6cf8 Add @react-native/typescript-config (#37345)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37345

This moves from `tsconfig/react-native`, a centralized repository of tsconfigs, to `react-native/typescript-config`, a package maintained as part of the RN monorepo.

We end up wanting to make changes where the versions are coupled, so this publishes them as part of the same repo, etc. It also means Meta engineers can more freely make changes to it with normal approval processes.

Changelog:
[General][Added] - Add react-native/typescript-config

Reviewed By: cortinico

Differential Revision: D45721088

fbshipit-source-id: b949bffb14014695abf3b9b359d3f5e30bfc8919
2023-05-10 15:46:34 -07:00
Intl Scheduler 61fc1a5796 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746209

fbshipit-source-id: e18eafcbe3af8d4da604a1791cb8b9a1ce3bbde1
2023-05-10 12:51:36 -07:00
Intl Scheduler 1831b96d6a translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746196

fbshipit-source-id: d740bcf2947a71b23efe12037db08690786d8317
2023-05-10 12:51:36 -07:00
Intl Scheduler 9e27a422ec translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746197

fbshipit-source-id: 3d977191a703acb48869cab6594c403c0e5430a8
2023-05-10 12:51:36 -07:00
Intl Scheduler 9ea1a38335 translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746207

fbshipit-source-id: b1c55462827bd7f1fe73929f95188b9e19387ebf
2023-05-10 12:51:36 -07:00
Intl Scheduler cdc7fbf656 translation auto-update for i18n/oculus-mirage.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746202

fbshipit-source-id: 380a4b06b6cd6e3c0328de272907b26aea755f59
2023-05-10 12:51:36 -07:00
Intl Scheduler 3fe23b6589 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746198

fbshipit-source-id: 803734749fa1b4d49eae551c1b7b091ac0f0264a
2023-05-10 12:51:36 -07:00
Intl Scheduler 0d8b684f7f translation auto-update for i18n/creatorstudio.config.json on master
Summary:
Chronos Job Instance ID: 1125907876207142
Sandcastle Job Instance ID: 948104804
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45746200

fbshipit-source-id: 88d361a964e645edafe7796ca76062083c88003a
2023-05-10 12:51:36 -07:00
Samuel Susla 757851607c Update scheduler package (#37295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37295

changelog: [internal]

Update scheduler package. It will use the native scheduler if available.

Reviewed By: cortinico, cipolleschi

Differential Revision: D45634886

fbshipit-source-id: f169a1e9ab12399a0e0d7bc5e9a19c27944db1d0
2023-05-10 11:20:03 -07:00
Lorenzo Sciandra 9aa25e6162 add 0.71.8 changelog (#37354)
Summary:
Adds changelog for new patch.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - add changelog entry for 0.71.8

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

Test Plan: N/A

Reviewed By: lunaleaps

Differential Revision: D45733332

Pulled By: cipolleschi

fbshipit-source-id: 0505378aef165f66361f6fc21128fa85f0ef5e32
2023-05-10 11:01:16 -07:00
kassens (Meta Employee) cbc28da666 Flow upgrade to 0.205.1 (#26796)
Summary:
Just a small upgrade to keep us current and remove unused suppressions
(probably fixed by some upgrade since).

- `*` is no longer allowed and has been an alias for `any` for a while
now.

DiffTrain build for commit https://github.com/facebook/react/commit/fda1f0b902b527089fe5ae7b3aa573c633166ec9.

Changelog: [Internal]

Reviewed By: tyao1

Differential Revision: D45695294

Pulled By: kassens

fbshipit-source-id: 1090328c30faf5ca8c22744f0b25ddf7fa60cd93
2023-05-10 09:02:50 -07:00
Mathieu Acthernoene 33e0521788 Add view getter on RCTRootView / RCTFabricSurfaceHostingProxyRootView (#37310)
Summary:
Hi 👋

During the [react-native-bootsplash](https://github.com/zoontek/react-native-bootsplash) implementation of the new architecture, I noticed a few thing regarding `RCTRootView` / `RCTFabricSurfaceHostingProxyRootView` compat.

Currently `RCTRootView` inherits from `UIView`, but `RCTFabricSurfaceHostingProxyRootView` does not, which this works:

```obj-c
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
  RCTRootView *rootView = (RCTRootView *)
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = rootView.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(rootView.bounds), CGRectGetMidY(rootView.bounds)};
  loadingView.hidden = NO;

  [rootView addSubview:loadingView];

  return rootView;
}
```

But this doesn't:

```obj-c
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
  RCTFabricSurfaceHostingProxyRootView *rootView = (RCTFabricSurfaceHostingProxyRootView *)
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = rootView.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(rootView.bounds), CGRectGetMidY(rootView.bounds)};
  loadingView.hidden = NO;

  [rootView addSubview:loadingView];

  return rootView;
}
```

Because `RCTFabricSurfaceHostingProxyRootView` is an imperfect proxy as it doesn't give access to the underlaying `UIView *`. As a solution, I added a prop on both: `UIView *view`

PS: I'm well aware that `setLoadingView` also exists in both files, but it's currently not usable as the current `isActivityIndicatorViewVisible` / `isSurfaceViewVisible` / `_activityIndicatorViewFactory` logic in `RCTSurfaceHostingView.mm` doesn't work: a situation where `isActivityIndicatorViewVisible == true && isSurfaceViewVisible == false && _activityIndicatorViewFactory != nil` never happen:

<img width="1162" alt="Screenshot_2023-05-06_at_18 10 18" src="https://user-images.githubusercontent.com/1902323/236883439-2256ddfb-7846-482a-b957-002a7d51a148.png">

## 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

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

Test Plan:
Add this block of code in `AppDelegate.mm`:

```obj-c
#import <React/RCTRootView.h>

#if __has_include(<React/RCTFabricSurfaceHostingProxyRootView.h>)
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#endif

// …

- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge
                          moduleName:(NSString *)moduleName
                           initProps:(NSDictionary *)initProps {
#ifdef RCT_NEW_ARCH_ENABLED
  RCTFabricSurfaceHostingProxyRootView *rootView = (RCTFabricSurfaceHostingProxyRootView *)
#else
  RCTRootView *rootView = (RCTRootView *)
#endif
      [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];

  // accessing the "real" root view on both arch
  UIView *view = rootView.view;

  UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"LaunchScreen" bundle:nil];
  UIView *loadingView = [[storyboard instantiateInitialViewController] view];

  loadingView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
  loadingView.frame = view.bounds;
  loadingView.center = (CGPoint){CGRectGetMidX(view.bounds), CGRectGetMidY(view.bounds)};
  loadingView.hidden = NO;

  [view addSubview:loadingView];

  return rootView;
}
```

It should persist the splash screen on both old and new architecture.

Reviewed By: sammy-SC

Differential Revision: D45688644

Pulled By: cipolleschi

fbshipit-source-id: b6f2fc8091a15189ea2eceb8ea426593f62674cb
2023-05-10 05:48:17 -07:00
LeoTM d2e446d98f Bump TypeScript in template from 4.8.4 to 5.0.4 (#36862)
Summary:
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0

## Changelog:

[GENERAL] [CHANGED] - Bump TypeScript in template from 4.8.4 to 5.0.4 and ESLint pkgs from 8.19.0 to 8.38.0

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

Test Plan: Everything builds and runs as expected

Reviewed By: cortinico

Differential Revision: D45720238

Pulled By: NickGerleman

fbshipit-source-id: d38b60110434760fdedc84ad941e0918bb986a40
2023-05-10 02:55:42 -07:00
Intl Scheduler 7ea3950a56 translation auto-update for i18n/analyticsapp.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724898

fbshipit-source-id: ad096ebb60c1cb1c27fdcdba7d8f3d824c560c14
2023-05-10 01:12:59 -07:00
Intl Scheduler 12616e87e1 translation auto-update for i18n/twilight.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724900

fbshipit-source-id: a27cef7d3e2fe4d470129181498948981097b223
2023-05-10 01:12:59 -07:00
Intl Scheduler 1c41506539 translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724907

fbshipit-source-id: a77a9bd0dd35aa9e8ff83b39e1dfc4ef48a79086
2023-05-10 01:12:59 -07:00
Intl Scheduler d102388ea3 translation auto-update for i18n/messenger.config.json on master
Summary:
Chronos Job Instance ID: 1125907876026300
Sandcastle Job Instance ID: 31525198336491767
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45724909

fbshipit-source-id: 18edefe4940ca8f0eeedcbd201aef693a8cb7c10
2023-05-10 01:12:59 -07:00
Tim Yung 77be932bc0 RN: Upgrade to flow-enums-runtime@0.0.6 (#37342)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37342

Upgrades to `flow-enums-runtime@0.0.6`, which is just a `README.md` update.

Changelog:
[Internal]

Differential Revision: D45713984

fbshipit-source-id: a458ccb099df53401fa41826f3571bca7e292dbf
2023-05-09 19:31:47 -07:00
Phillip Pan 9e0bab28d6 introduce RCTHostJSEngineProvider (#37326)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37326

Changelog: [Internal]

in this change, i introduced a block type that returns a `JSEngineInstance`. a block gives a bit more flexibility in terms of lazily loading the engine + its dependencies, but i might get rid of it later and just pass down the engine itself.

Reviewed By: javache

Differential Revision: D45678969

fbshipit-source-id: 52d3ec0de77a3ab74d3cf304ea22fb5fc1315a2e
2023-05-09 17:49:13 -07:00
Intl Scheduler 268d95eca5 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907875729350
Sandcastle Job Instance ID: 9007200197403049
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45714584

fbshipit-source-id: 1356eacda35319e8b6838fe129d450aa4f750888
2023-05-09 16:11:13 -07:00
Intl Scheduler e696ee5a17 translation auto-update for i18n/anna.config.json on master
Summary:
Chronos Job Instance ID: 1125907875729350
Sandcastle Job Instance ID: 9007200197403049
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45714592

fbshipit-source-id: dff9b30d66a4a0fbe593c37cade3a050f8583faf
2023-05-09 16:11:13 -07:00
Intl Scheduler b796dd9500 translation auto-update for i18n/messenger.config.json on master
Summary:
Chronos Job Instance ID: 1125907875729350
Sandcastle Job Instance ID: 9007200197403049
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45714583

fbshipit-source-id: e5fa316a72016908ca2a96014a578d9d215ffc85
2023-05-09 16:11:13 -07:00
Samuel Susla 93ce46113c Combine iOS and Android optimisations (#37317)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37317

changelog: [internal]

This diff does three things:
1. Combines Android's mobile config `react_fabric:enable_text_measure_cache` with iOS mobile config `react_fabric:enable_nstextstorage_caching`. We will get into why later.
2. Fixes cache `ParagraphLayoutManager::cachedTextMeasurement_` invalidation logic for iOS and Android.
3. Fixes cache invalidation logic for `ParagraphLayoutManager::hostTextStorage_`.

Initially, Android's text measure cache (D44221170) and iOS's NSTextStorage (D43692171) were design as two separate optimisations. But they overlap and NSTextStorage actually needs some parts of text measure cache to work correctly. That's why I decided to merge them together.

Previously, `ParagraphLayoutManager::cachedTextMeasurement_` was only invalidated if maximum width for the node changed. But node can change in different ways, for example input string changes or attributes change. This diff accounts for that by computing a hash for AttributedString+ParagraphAttributes to check if anything has changed.

Previously, `ParagraphLayoutManager::hostTextStorage_` was not correctly invalidated if maximum width changed. To my surprise, this happens less frequently than one expects.

bypass-github-export-checks

Reviewed By: mdvacca

Differential Revision: D45637797

fbshipit-source-id: 1840b51cdb1423de0560a35fd17c24a71ad115e1
2023-05-09 15:25:38 -07:00
Nick Gerleman a941d067f5 Use ContextContainer::find() for MC access instead of ContextContainer::at() (#37303)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37303

Intent of a change to the last diff was to make `PropsParserContext` act gracefully if it tried to parse "auto" without a `ReactNativeConfig` being set (e.g. if our tests wanted to do that).

We would actually assert if we tried to do that with what I added, since `ContextContainer::at()` acts like `at()` does in the STL containers and will expect the parameter to be in bounds/present. (`RawProps::at()` is the odd one out that will return `nullptr` instead).

This changes the usage to ContextContainer::find() which will return ` std::optional<std::shared_ptr>>`.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45651032

fbshipit-source-id: b1f16f9329ceb4ef7a6c469f968eae57a2fe3da5
2023-05-09 14:29:40 -07:00
Ruslan Shestopalyuk c71fa46eb8 Use global Performance instance in createPerformanceLogger (#37337)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37337

Changelog: [Internal]

Removes usage of a local `Performance` instance, since this the global one is now safe to use.

Reviewed By: christophpurrer

Differential Revision: D45697243

fbshipit-source-id: 4f3f9798e79c15295094d5a4650af04db2856f60
2023-05-09 13:56:10 -07:00
David Vacca 19927867bb Rename ReactInstanceDelegate -> ReactHostDelegate (#37323)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37323

ReactInstance is an internal concept and name, we should not leak ReactInstance name for client code.

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: RSNara

Differential Revision: D45578268

fbshipit-source-id: c0306b89d854d7beb5fcd38ba3623099846ec932
2023-05-09 13:41:53 -07:00
David Vacca 1200cdc810 Migrate BindingsInstaller to kotlin (#37322)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37322

migration of BindingsInstaller to kotlin to ez integration with ReactInstanceDelegate

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: philIip

Differential Revision: D45577886

fbshipit-source-id: 67991b09bf7c719136a615d846d3f7ee3bf359b2
2023-05-09 13:41:53 -07:00
Ruslan Shestopalyuk 9cceb43c52 Add a compile-time safeguard against ShadowNode lacking a virtual destructor (#37333)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37333

## Changelog:
[Internal] -

Add a safeguard against accidentally removing a virtual destructor from `ShadowNode`.

Since this is something that happened before, and `ShadowNode` has a non-trivial class inheritance tree, this could be a good idea to prevent potential memory leaks.

Differential Revision: D45691614

fbshipit-source-id: 3aa7a3eecba98478d7fb9aaef62adb547b653b82
2023-05-09 10:32:16 -07:00
Olga Zinoveva b6f269e8a3 Enhance labeling workflow (#37324)
Summary:
This PR does two things:
1. Improves the labeling workflow in cases where the user is on a supported version but a higher patch number is available. Now, the label name will be friendlier ('Newer Patch Available') and we will report the version they should consider upgrading to in the message body. Once this change is merged, I can also rename all existing versions of this label for consistency.
2. Moves the addDescriptiveLabels.js script to the workflow-scripts folder for consistency with the other workflow scripts.

## Changelog:

[INTERNAL] [CHANGED] - Enhancing issue triage workflow for patch versioning

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

Test Plan: See some examples of the workflow run in my fork: https://github.com/SlyCaptainFlint/react-native/issues

Reviewed By: cipolleschi

Differential Revision: D45680812

Pulled By: NickGerleman

fbshipit-source-id: 7ab07fcf52fe372d2e449bb43d6618b1c98e9245
2023-05-09 10:19:47 -07:00
Intl Scheduler e0f43fdf89 translation auto-update for i18n/adsmanager.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695391

fbshipit-source-id: f0484ff27ecf9aefa2cf16c81504cf740d76d39a
2023-05-09 08:06:48 -07:00
Intl Scheduler 94c844c1fb translation auto-update for i18n/barcelona.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695382

fbshipit-source-id: bf81a653d52aef86509ec356c384444a6afd98b1
2023-05-09 08:06:48 -07:00
Intl Scheduler 5ab7dcd5ac translation auto-update for i18n/creatorstudio.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695390

fbshipit-source-id: f2b8781d6d1530099592213320fddfb56e56a830
2023-05-09 08:06:48 -07:00
Intl Scheduler ebed2c1039 translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695394

fbshipit-source-id: 34c9eb9e21c3adc46f3f04baed2f831f9ee278a3
2023-05-09 08:06:48 -07:00
Intl Scheduler 0c31f8084b translation auto-update for i18n/pages-manager.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695383

fbshipit-source-id: 60fbbf7abf22d3e8b3018a51005d0b73507ecf77
2023-05-09 08:06:48 -07:00
Intl Scheduler f9aa55ff01 translation auto-update for i18n/analyticsapp.config.json on master
Summary:
Chronos Job Instance ID: 1125907875406092
Sandcastle Job Instance ID: 4503600571892814
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45695387

fbshipit-source-id: 7ccec058f4832b819928a85c8c5b0b44965c07c6
2023-05-09 08:06:48 -07:00
Ruslan Lesiutin d3e8b646a7 upgrade react-devtools to v4.27.7 in fbsource (#37146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37146

X-link: https://github.com/facebook/flipper/pull/4706

Changelog: [Internal]

Updating react-devtools-* packages to v4.27.7

Reviewed By: jacdebug

Differential Revision: D45317588

fbshipit-source-id: 5625f654feffced92ca933796e90ac10fc4801ff
2023-05-09 07:13:39 -07:00
Tommy Nguyen cceef57be1 fix(gradle-plugin): fix nightly build regression (#37332)
Summary:
Nightly builds of Android no longer build due to a recent version format change.

## Changelog:

[ANDROID] [FIXED] - Fixed nightly builds of Android no longer building due to a recent version format change

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

Test Plan:
```
git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
cd example
yarn android
```

Reviewed By: jacdebug

Differential Revision: D45690926

Pulled By: cortinico

fbshipit-source-id: dc935733607c2b33ba296b507a98f43ba483e348
2023-05-09 06:05:46 -07:00
shubham0142 ec66f2eeb9 Codegen 113: add isOptionalProperty in parser (#37134)
Summary:
part of codegen issue https://github.com/facebook/react-native/issues/34872
Add a function isOptionalProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the [parsers/flow/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/flow/components/events.js#L172-L173) and [parsers/typescript/components/events.js](https://github.com/facebook/react-native/blob/e133100721939108b0f28dfa9f60ac627c804018/packages/react-native-codegen/src/parsers/typescript/components/events.js#L196). Use the parsers in the buildPropertiesForEvent.

bypass-github-export-checks

## Changelog:
[Internal][Changed]: add isOptionalProperty in parser and use it in parser events.
<!-- 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/37134

Test Plan: `yarn test react-native-codegen`

Reviewed By: christophpurrer

Differential Revision: D45390880

Pulled By: cipolleschi

fbshipit-source-id: bb2575b8602c6a15be0a87817ca1961ae834324e
2023-05-09 05:35:45 -07:00
Riccardo Cipolleschi c027f0a41f Fix podspec setup for 3rd parties when using dynamic linking (#37275)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37275

When enabling `USE_FRAMEWORKS=dynamic`, we need to explicitly defines all the dependencies used by the pods.

This change add those missing dependencies.

## Changelog:
[iOS][Added] - Add explicit dependencies for 3rd parties libraries

Reviewed By: NickGerleman

Differential Revision: D45523646

fbshipit-source-id: 228a7e0ae98ea262af4d58b7dc855f944ebed463
2023-05-09 04:42:17 -07:00
Riccardo Cipolleschi 44af6ca03c Add React-FabricImage pod to solve Circulare dependency between Fabric image component and ImageManager (#37276)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37276

When enabling dynamic linking, we had a circulr dependency between Fabric and the Image Manager.

Specifically, Image Manager depends on Fabric, but the Image component, in Fabric, is using some implementation specific files from the Image Manager that surface only when enabling the dynamic linking.

Xcode fails to find those symbols unless the dependencies are explicitly added to the podspec.

This change is technically breaking, but we tried to minimize the breakage by adding the new pod in all the required search paths.

## Changelog
[iOS][Breaking] - Add React-FabricImage pod.

Reviewed By: NickGerleman

Differential Revision: D45517278

fbshipit-source-id: 994aa8c40301c68bf9fecdf46de7833028f0d3c2
2023-05-09 04:42:17 -07:00
Blake Friedman 6d83889ba9 Fix for investigating high number of ReactViewManager exceptions (#37312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37312

## Why?
Internally one of our apps is using a custom view manager that isn't respecting the `NotNull` constraint,
causing a runtime error. We have no visibility over what this manager is. The custom exception will give
us more clues to track this down.

If you look at the below stack trace, it's pretty clear the earlier approach would fail:
{F979121677}

Like a bit of a noddy, I've been waiting for days for the new exception to be hit, when it's very clear from [3 May](https://fburl.com/scuba/errorreporting_facebook_android_crashes/a63t7ilm) that this wasn't going to happen:
{F979130611}
The lesson here is to monitor 3 things:
1. the [original NullPointerExceptions](https://fburl.com/scuba/errorreporting_facebook_android_crashes/m2o0t45h),
2. the new [ReactViewReturnTypeException](https://fburl.com/scuba/errorreporting_facebook_android_crashes/2j0vtuwb), and
3. the [number of users exposed](https://fburl.com/scuba/mobile_active_users/9mbevwed) to whatever release this change goes out on.

Changelog: [Internal]
The NullPointerExceptions are hit when call the the java createView method. Previous (D45185598)
didn't capture this exception and wasn't very useful.

Reviewed By: cortinico

Differential Revision: D45660487

fbshipit-source-id: f1a7a114778a0c2eae963d64558541266ed57bda
2023-05-09 04:30:57 -07:00
Pieter De Baets e43607c5a7 Fix missing override in ConcreteState (#37279)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37279

Changelog: [Internal]

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D45610260

fbshipit-source-id: 7610ec3898e8cc75fa7ed20d6f87f76f97cdfd12
2023-05-09 04:22:34 -07:00
Jerry 5dfa38a20e fix: fix FlatList viewabilityConfig prop type (#37299)
Summary:
FlatList `viewabilityConfig` prop seems  no need to be any type. So I replaced it with `ViewabilityConfig` from `VirtualizedList.d.ts`

## Changelog:

[GENERAL] [FIXED] - change FlatList `viewabilityConfig` prop type `any` to `ViewabilityConfig`

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

Test Plan: Ran yarn test-typescript and yarn test-typescript-offline with no errors.

Reviewed By: jacdebug

Differential Revision: D45689033

Pulled By: cipolleschi

fbshipit-source-id: e7fd31c534c5f47321b36d0d764f466392ad897e
2023-05-09 04:13:09 -07:00
Ruslan Lesiutin e540d05846 RN: Make hermes-inspector-msggen tests visible for jest matcher (#37131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37131

Changelog: [Internal]

Looks like all this time jest was not running these tests, because their file names are not matching the
https://www.internalfb.com/code/fbsource/[1e8a1b307ffd]/xplat/js/react-native-github/jest.config.js?lines=30

- Renamed tests to kebab-case
- Some of them were failing, now updated

Reviewed By: motiz88

Differential Revision: D45368748

fbshipit-source-id: a00e6ebb8f37363516b1af79d6251fbceb0afb68
2023-05-09 03:14:45 -07:00
Intl Scheduler 8132500d93 translation auto-update for i18n/instagram.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686942

fbshipit-source-id: e3dc213144d91b6c98b84d1c477bdeb317132a55
2023-05-09 01:40:57 -07:00
Intl Scheduler eb1393de2d translation auto-update for i18n/fb4a.config.json on master
Summary:
Chronos Job Instance ID: 1125907875312406
Sandcastle Job Instance ID: 13510799826655976
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D45686955

fbshipit-source-id: 340e75e6809802ca9425ce43abfaa494b2f9e1b4
2023-05-09 01:40:57 -07:00