Commit Graph

12270 Commits

Author SHA1 Message Date
David Vacca 779e3be106 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54027177

fbshipit-source-id: 13b4352f0b61eec69bfdcb6a3e369faa4dfcc750
2024-02-28 08:47:35 -08:00
Oskar Kwaśniewski a1197695fc fix(iOS) [0.74]: properly warn about createRootViewWithBridge (#43146)
Summary:
This PR fixes an issue that `_logWarnIfCreateRootViewWithBridgeIsOverridden` was called in wrong place.

Assuming user overrides this method and call to `[super]`:

```objc
- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge moduleName:(NSString *)moduleName initProps:(NSDictionary *)initProps {
  UIView *view = [super createRootViewWithBridge:bridge moduleName:moduleName initProps:initProps];
  view.backgroundColor = [UIColor redColor];
  return view;
}
```

This method still wasn't called in bridgeless (and not showing the error).

Checking if user overrides this method in `appDidFinishWithLaunching` works every time

![simulator_screenshot_0E22557C-CE37-4617-A25A-F39A6ED4D3D0](https://github.com/facebook/react-native/assets/52801365/d7865f37-32f0-40ad-a252-74ab7c5b7757)

## Changelog:

[IOS] [FIXED] - Properly warn about `createRootViewWithBridge` being deprecated

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

Test Plan: Check if warning is shown when message is overridden

Reviewed By: huntie

Differential Revision: D54303506

Pulled By: cipolleschi

fbshipit-source-id: cf30555c791493f28b3015a189cf93b60cace8f8
2024-02-28 08:37:26 -08:00
Riccardo Cipolleschi c3b0a8f162 Deprecate getSurfacePresenter and getModuleRegistry in favor of their props
Summary:
This change align the `getSurfacePresenter` and `getModuleRegistry` to the iOS convention for which these should be computed properties with no `get` prefix in their name.

We want to land this change and to pick it in 0.74 so we can remove the `get` versions in 0.75.

## Changelog:
[iOS][Deprecated] - Deprecate `getSurfacePresenter` and `getModuleRegistry` for `surfacePresenter` and moduleRegistry` props.

Reviewed By: javache

Differential Revision: D54253805

fbshipit-source-id: e9ff7db744a73a3bd0f8ae1d87875e54ddd9a1a4
2024-02-28 06:09:38 -08:00
Ryan Linton 57ed0fb309 MapBuffer long support (#43030)
Summary:
This adds support for 64 bit integer (long) values to MapBuffer. Per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738) Android encodes wide gamut colors as long values so we need to update MapBuffer to support 64 bit integers as well.

## Changelog:

[ANDROID] [ADDED] - Add 64 bit integer (long) value support to MapBuffer

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

Test Plan: I've added a test to the MapBuffer test suite. This new API is otherwise currently unused but will be used in subsequent PRs as part of wide gamut color support changes.

Reviewed By: mdvacca

Differential Revision: D53881809

Pulled By: NickGerleman

fbshipit-source-id: 39c20b93493a2609db9f66426640ef5e97d6e1a8
2024-02-27 17:33:40 -08:00
Ruslan Shestopalyuk 50c9a47f55 Add missing #pragma once's in ReactCommon
Summary:
## Changelog:
[Internal] -

Was writing some unit tests, accidentally included `ImageProps.h` twice (once directly and once transitively) and realized that we have a handful of files without `#pragma once`.

This fixes it for header files inside `ReactCommon`.

Reviewed By: zeyap

Differential Revision: D54258058

fbshipit-source-id: 70f4e9935304803187d1affd72ed44157b1d8fb3
2024-02-27 09:41:24 -08:00
Rubén Norte 179b684e76 Modify native module codegen to throw JS errors instead of crashing when not passing required parameters
Summary:
Changelog: [General][Fixed] Fixed crash when passing fewer arguments than expected in native modules using codegen

## Context

Right now, if you have a native module using the codegen with a method like this:

```
someMethod(value: number): void;
```

And you call it like this:

```
NativeModule.someMethod();
```

The app crashes.

This happens because the codegen tries to cast the value to the expected type without checking if the argument is within the bounds of the arguments array.

## Changes

This fixes that issue with a change in the codegen to guard against this in the generated code (see changes in the snapshot tests).

Reviewed By: RSNara

Differential Revision: D54206287

fbshipit-source-id: 575af462725515928f8634fccc7a9cb51ca0ce4f
2024-02-27 09:29:53 -08:00
Rubén Norte abbc6eb022 Modify codegen to throw JS errors instead of crashing when passing non-number arguments where RootTags are expected
Summary:
Changelog: [General][Fixed] Fixed crash when passing non-numeric values where RootTag is expected to methods in native modules using codegen

## Context

Right now, if you have a native module using the codegen with a method like this:

```
someMethod(value: RootTag): void;
```

And you call it like this:

```
NativeModule.someMethod('');
```

The app crashes.

This happens because we cast the JS value to a C++ value using the method that asserts (`toNumber`) instead of the one that throws a JS error (`asNumber`).

## Changes

This fixes the crash by using `asNumber` instead of `toNumber`.

Reviewed By: RSNara

Differential Revision: D54206288

fbshipit-source-id: 9398112667e0f26edaf4f8f3b32e79fa8aafde62
2024-02-27 09:29:53 -08:00
Riccardo Cipolleschi 15f0895b85 Optimize RCTUIManager to avoid too many calls to viewForReactTag
Summary:
This change fixes a couple of issues within the RCTUIManager:
* it calls the right method in the `super` branches (although they should neve be executed)
* it invert the call order between the `_registry` and the `uiManager` to avoid extra calls into the `viewForReactTag`.

## Changelog:
[Internal] - Use the right method in super and invert the order of where we search for views.

## Facebook:
See S397861 and T180527210 for more information.

Reviewed By: javache

Differential Revision: D54246220

fbshipit-source-id: 1c7503ad3e80cf50ecc016a984ca180a19b73cc0
2024-02-27 05:52:51 -08:00
Dmitry Rykun f5d5d9d284 Fix findLibrariesFromReactNativeConfig
Summary:
This diff removes extra argument from the `extractLibrariesFromJSON` call inside `findLibrariesFromReactNativeConfig`.
This should fix the iOS failurte discribed in https://github.com/facebook/react-native/issues/43204
Changelog: [iOS][Fixed] - Codegen correctly handles react-native.config.js.

Reviewed By: cipolleschi

Differential Revision: D54248400

fbshipit-source-id: 2ae5d0d29f49725877559a5b0edd7d59f8bdefaa
2024-02-27 05:44:08 -08:00
Ryan Linton a40bd8e34a Add basic DisplayP3 color support (#42830)
Summary:
This adds initial support for wide gamut (DisplayP3) colors to React Native iOS per the [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738). It provides the ability to set the default color space to sRGB or DisplayP3 and provides the native code necessary to support `color()` function syntax per the [W3C CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#color-function) spec. It does _not_ yet support animations and requires additional JS code before fully supporting the `color()` function syntax.

bypass-github-export-checks

## Changelog:

[IOS] [ADDED] - Add basic DisplayP3 color support

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

Test Plan:
![Screenshot_20240131-100112](https://github.com/facebook/react-native/assets/1944151/bbd011b1-dab0-47d6-b341-74fa8fac6757)

Follow test steps from https://github.com/facebook/react-native/issues/42831 to test support for `color()` function syntax.

To globally change the default color space to DisplayP3 make the following changes to RNTester AppDelegate.mm:
```diff
+ #import <React/RCTConvert.h>

   - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
   {
     // ...
+    RCTSetDefaultColorSpace(RCTColorSpaceDisplayP3);
     return [super application:application didFinishLaunchingWithOptions:launchOptions];
   }
```

Reviewed By: javache

Differential Revision: D53380407

Pulled By: cipolleschi

fbshipit-source-id: 938523958f9021e8d98bdb1d4e254047e3ecdad7
2024-02-27 05:16:34 -08:00
Ruslan Shestopalyuk 3b93f0e3c1 Correctly initialize default transformOrigin prop value to "center"
Summary:
## Changelog:
[Internal] -

`view.transformOrigin` prop should be initialized to "center", since this is default [per documentaion](https://reactnative.dev/docs/next/transforms#transform-origin), and it should be treated this way even if the prop is not explicitly set from JS.

Reviewed By: christophpurrer

Differential Revision: D54229772

fbshipit-source-id: 5212792c8dc5db6f4c17d1b2980ac2564c986cd8
2024-02-27 02:09:11 -08:00
D N 2c1bcbac81 feature: Update Image.getSize/getSizeWithHeaders methods to return a promise (#42895)
Summary:
`Image.getSize/getSizeWithHeaders` are still working in old fashioned "callback" way

```tsx
Image.getSize(uri, function success(width,height) {  }, function failure(){   } ); // undefined
Image.getSizeWithHeaders(uri, headers, function success(width,height) {  }, function failure(){   } ); // undefined
```

But in 2024 more developers prefer use async/await syntax for asynchronous operations

So, in this PR I added support for Promise API with **backward compatibility**, modern way:

```tsx
Image.getSize(uri).then(({width,height}) => {    }); // Promise
Image.getSizeWithHeaders(uri, headers).then(({width,height}) => {    }); // Promise
```
bypass-github-export-checks
## Changelog:

[GENERAL] [ADDED] - `Image.getSize/getSizeWithHeaders` method returns a promise if you don't pass a `success` callback

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

Test Plan:
1. ts: New test cases added in typescript tests
2. runtime: you can create a new project and put code from this PR into the next files
  a. `node_modules/react-native/Libraries/Image/Image.android.js`
  b. `node_modules/react-native/Libraries/Image/Image.ios.js`

Reviewed By: javache

Differential Revision: D53919431

Pulled By: cipolleschi

fbshipit-source-id: 508b201e17e0ffda2e67aa5292bf9906b88d09c5
2024-02-27 01:54:30 -08:00
Thomas Nardone 489df722b3 Better error message for invalid response blob (#43069)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43069

Changelog:
[General][Changed] - Add info to invalid blob response error

Reviewed By: christophpurrer

Differential Revision: D53829400

fbshipit-source-id: 17b1dbb3cacf8368098b0b639e8d10aa9bd28d03
2024-02-26 14:23:21 -08:00
Kacper Rozniata cb2b265c20 fix(rn-tester): prevent alert example from crashing (#43084)
Summary:
This small PR fixes issue causing `AlertExample` to crash on `login-password` prompt example, as it was trying to render object in `<Text>`

## Changelog:

[INTERNAL] [FIXED] - Prevent alert example from crashing

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

Test Plan: `login-password` prompt example in `AlertExample` doesn't crash when pressing `OK`

Reviewed By: cipolleschi

Differential Revision: D53964494

Pulled By: lunaleaps

fbshipit-source-id: 16a0364d3d65a33956c21a68b121e6c26b41d123
2024-02-26 13:17:53 -08:00
Riccardo Cipolleschi fcabb2ad21 Rename PopupMenuAndroidNativeComponent.js to PopupMenuAndroidNativeComponent.android.js to fix CI
Summary:
This change renames `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`.

The reason is that, without the suffix, Codegen was reading the NativeComponent spec also for iOS, generating some invalid specs and making RNTester fail.

## Changelog:
[Android][Changed] - Rename `PopupMenuAndroidNativeComponent.js` to `PopupMenuAndroidNativeComponent.android.js`

Reviewed By: cortinico, dmytrorykun

Differential Revision: D54199736

fbshipit-source-id: 7fd67c4d38a69fe3a84c800c8ee5dcbd8c4f9a6c
2024-02-26 11:34:05 -08:00
Rob Hogan f0363f5cf0 Enable varying feature flags in ReactInstanceIntegrationTest, use modern CDP registry by default (#43101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43101

Extends `ReactInstanceIntegrationTest` to allow varying feature flags in tests, using gtest's parameterised tests.

Exercise this in `ConsoleLogTest` to test against the modern CDP registry, for which we also needed to modify some initialisation logic to account for the fact that under the modern registry, the page is added by the host, rather than by Hermes `DecoratedRuntime`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53919148

fbshipit-source-id: 4eb87abf548f30b5483b819a2dadd444d1d5c80d
2024-02-26 07:06:02 -08:00
Moti Zilberman 451fffbb59 Use host-relative WebSocket URLs when launching new debugger
Summary:
Changelog: [Internal]

Uses the capability introduced in https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/4 to avoid repeating the dev server's host:port in the `ws` / `wss` parameter we pass to the Chrome DevTools frontend. This gives us more flexibility to handle port forwarding and redirects outside of `dev-middleware`. This is mostly useful in Meta's internal VS Code remoting setup, but this particular change should work equally well in open source.

Reviewed By: huntie

Differential Revision: D54107316

fbshipit-source-id: 68d4dbf4849ca431274bfb0dc8a4e05981bdd5b5
2024-02-26 05:33:18 -08:00
Moti Zilberman 0f3018d6af Update debugger-frontend from 12a45e0...9ceb0ad
Summary:
Changelog: [Internal]

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/compare/12a45e0628384aa80075493354159ef5d91b2698...9ceb0ade8033ec165bbfbd41c08ac1fcd9f89a46
).

Reviewed By: huntie

Differential Revision: D54107317

fbshipit-source-id: 59e670d107e4c0f30900b11df2ad423004e05997
2024-02-26 05:33:18 -08:00
David Vacca 12f2c3cd2b Fix Build of RNLog in CI
Summary:
Fix Build of RNLog in CI

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D54167011

fbshipit-source-id: 7e1ea21860b479e9fe00df5951fe266f2e342eda
2024-02-25 03:40:11 -08:00
David Vacca 1947fef35c Fix InteropModuleRegistryTest
Summary:
Fix CI build for InteropModuleRegistryTest

changelog: [internal] internal

Reviewed By: bvanderhoof

Differential Revision: D54166759

fbshipit-source-id: 277c0a34dd4689eff8ef99afaf147efdfd36caa4
2024-02-25 03:40:11 -08:00
Cedric van Putten a6397afb7f feat(cli): warn underlying command when using npx react-native init (#43127)
Summary:
This adds a new warning for React Native 0.74, implementing the [RFC 0759](https://github.com/react-native-community/discussions-and-proposals/blob/nc/rnf/proposals/0759-react-native-frameworks.md#the-init-command) init command changes.

- It's added inside `react-native/cli.js` to avoid warning users when actually executing `npx react-native-community/cli` commands.
- The check is fairly simple: `process.argv[2] === 'init'`. The first two args are the Node bin and the actual script bin paths.
- The message is sent over `console.warn` to avoid potentially mixing JSON with non-JSON output.

## Changelog:

[GENERAL] [ADDED] - Warn with future command when using `npx react-native init`

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

Test Plan:
Any command other than `init` must not warn.

- `$ node ./path/to/react-native/cli.js init`
- `$ node ./path/to/react-native/cli.js init --help`
  - Should warn with `Running: npx react-native-community/cli init`
    ![image](https://github.com/facebook/react-native/assets/1203991/a3f5e3d2-7b59-41fe-9a53-bc9ce5a21fd1)
- `$ node ./path/to/react-native/cli.js --help`
  - Must not warn
    ![image](https://github.com/facebook/react-native/assets/1203991/97679429-db35-47f8-bdeb-33187bb167cf)

Reviewed By: cipolleschi

Differential Revision: D54063131

Pulled By: cortinico

fbshipit-source-id: c60b8b6034087b584e98b51f5bedf68a46caf44c
2024-02-24 02:16:55 -08:00
Nicola Corti 48a723366a Convert RNLog to Kotlin
Summary:
Convert RNLog to Kotlin

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

Reviewed By: mdvacca

Differential Revision: D54010172

fbshipit-source-id: eff124f094248563a2b80575d5ca9e8dae2563f7
2024-02-24 01:50:24 -08:00
Ramanpreet Nara 8bced4b29d Pull PopupMenuAndroid out of React Native core
Summary:
**History:** This component was originally introduced into React Native core in D52712758, to replace UIManagerModule.showPopupMenu().

**Problem:** But, React Native core should be lean. Adding this component to React Native bloats the core.

**Changes:** So, this diff pulls PopupMenuAndroid out into its own package in the react-native GitHub repository.

In the future, this will be migrated to a community package!

Changelog: [Android][Removed] Move PopupMenu out of React Native core

Reviewed By: NickGerleman

Differential Revision: D53328110

fbshipit-source-id: 469d8dc3e756c06040c72e08fa004aafa1bd6e18
2024-02-23 16:43:18 -08:00
David Vacca e6e5822d07 Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54027183

fbshipit-source-id: b87e3931642abaa22b84fd48f0504f36e9c3621f
2024-02-23 15:27:17 -08:00
David Vacca 51088c9b90 Mark classes of package uimanager as @Nullsafe (#43162)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43162

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027181

fbshipit-source-id: af9f022d36a2e60788d6790525736d1b6cfdf6fa
2024-02-23 15:27:17 -08:00
David Vacca e69faff265 Mark classes of package uimanager as @Nullsafe (#43161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43161

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027187

fbshipit-source-id: a25024ba7f7d4893a2b7d083e2ba10c5f2e3a035
2024-02-23 15:27:17 -08:00
David Vacca 9f58b1a0fc Mark classes of package uimanager as @Nullsafe
Summary:
All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D54027182

fbshipit-source-id: 946dbf484119890658c68767916fcbf7c66996bc
2024-02-23 15:27:17 -08:00
David Vacca a15e8f318d Mark interop classes and interfaces as Unstable
Summary:
Mark interop classes and interfaces as Unstable

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: fkgozali, arushikesarwani94

Differential Revision: D54128912

fbshipit-source-id: 56956fc38bac01f461bf686fda0f05a7a105008e
2024-02-23 15:22:45 -08:00
David Vacca 0274ad076d Mark UIManagerListener interface as UnstableReactNativeAPI
Summary:
UIManagerListener interface is unstable and not recommended to be consumed externally, this API is likely to change in the future

changelog: [internal] internal

Reviewed By: cortinico

Differential Revision: D54028407

fbshipit-source-id: c8601451f117226f9e5a4d291307f4a0ac04a10f
2024-02-23 15:22:45 -08:00
Nicola Corti c7bacf610d Remove accidental files included inside the template.
Summary:
Those files should not stay in the root `/app` folder but inside the `/app/gradle/wrapper` folder.
I've noticed this in the Upgrade Helper UI hence I'm removing them.

Changelog:
[Internal] [Changed] - Remove accidental files included inside the template

Reviewed By: mdvacca

Differential Revision: D54122995

fbshipit-source-id: 8873a91ffbea20f609c7aabd428a815c77a38db5
2024-02-23 11:46:14 -08:00
Nicola Corti 44e5bc9e2c Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode
Summary:
RN-Tester is currently instacrashing on fast-refresh (pressing r on Metro) as it ends up on `onJSBundleLoadedFromServer`
which throws an exception on Bridgeless mode. I'm fixing it by following the same logic as `onReloadWithJSDebugger`.

Changelog:
[Android] [Fixed] - Do not crash on onJSBundleLoadedFromServer when fast-refreshing on bridgeless mode

Reviewed By: huntie

Differential Revision: D54121838

fbshipit-source-id: 82d98ec0c5b2295f5751525368c956574dd7f3a0
2024-02-23 10:44:53 -08:00
Nicola Corti 2647dc8c39 Bump CLI to 13.6.1 (#43153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43153

This contains an hotfix for the CLI needed for 0.74

Changelog:
[Internal] [Changed] - Bump CLI to 13.6.1

Reviewed By: huntie

Differential Revision: D54073715

fbshipit-source-id: a5fdf02f47c5e144efc58e6b7fd355669a21e07b
2024-02-23 06:14:29 -08:00
David Vacca 52a70d7832 Mark IViewGroupManager interface as @Nullsafe (#43157)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43157

IViewGroupManager is NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D54034058

fbshipit-source-id: ad317c73d45fdd801aeee65d5308400e2e1c8552
2024-02-23 02:42:20 -08:00
David Vacca c77c13ab7c Mark classes of package uimanager as @Nullsafe (#43156)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43156

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54027185

fbshipit-source-id: f3c337def2d42cf1f6fed2e2eb4938a84a51f8d4
2024-02-23 02:42:20 -08:00
David Vacca ed3eacb8b9 Mark classes of package uimanager as @Nullsafe (#43155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43155

All these classes are NullSafe, let's mark them as NullSafe(Local) to ensure lint detect errors in the future

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54027178

fbshipit-source-id: 37940ecec4d42f9f5ae7784a865564b0ef80f4a7
2024-02-23 02:42:20 -08:00
David Vacca 93b4ec3472 Validate textAttributeProps is created with a non-null textAttributes map (#42932)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42932

Validate textAttributeProps is created with a non-null textAttributes map

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D53558784

fbshipit-source-id: 2f7521a7f0a1cfdf67c0ab8ea0048e7f5da365b8
2024-02-23 02:42:20 -08:00
Rubén Norte 0eac4181cc Enable the native module for feature flags by default for iOS apps in OSS (#43159)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43159

Changelog: [internal]

This modifies the default `RCTAppDelegate` for iOS apps in OSS to provide an implementation for the C++ native module for feature flags.

In a following diff I'll replace the `React-featureflagsnativemodule.podspec` file with one that includes all built-in C++ native modules.

Reviewed By: RSNara

Differential Revision: D54082349

fbshipit-source-id: 8c4ed7499c6fd35916ba105edcae0e2c85961e1c
2024-02-23 01:14:03 -08:00
Zeya Peng 073ca1aa03 extract constants type in BlobModule + add stub impl (#43160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43160

## Changelog:

[Internal] - extract constants type in BlobModule

Reviewed By: christophpurrer, rshest

Differential Revision: D54073162

fbshipit-source-id: ba783fd4592feb7ecd65c65ad646e681b2f26a17
2024-02-22 18:10:40 -08:00
Pieter De Baets 2584bcb6c8 Stop catching IllegalArgumentException in ReactPackageTurboModuleManagerDelegate (#43152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43152

Now that 0.74 has been cut, we can drop this warning and let the exception bubble up.

In https://github.com/facebook/react-native/pull/41509 we stopped masking this.

Changelog: [Android][Changed] Throwing IllegalArgumentException from ReactPackage is no longer suppressed

Reviewed By: cortinico, cipolleschi

Differential Revision: D54068429

fbshipit-source-id: c2f780ccfefabf2334c94b632bca93242af86008
2024-02-22 15:51:17 -08:00
Alex Hunt 2dc39c26ed Add fbjni wrapper for java.util.concurrent.Executor (#43154)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43154

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D54072449

fbshipit-source-id: 02a6fe6a95fd8e4b3bacab7a21f8480509d6c90c
2024-02-22 11:39:18 -08:00
Dmitry Rykun 6549216b76 Rename React-Codegen to ReactCodegen
Summary:
This diff renames React-Codegen to ReactCodegen. This way we'll no longer have to try both
```
#include <React-Codegen/MyModule.h>
```
and additionally
```
#include <React_Codegen/MyModule.h>
```
for cases with `use_frameworks`.

Changelog: [iOS][Breaking] - Rename React-Codegen to ReactCodegen

Reviewed By: cipolleschi

Differential Revision: D54068492

fbshipit-source-id: dab8ea2034d299266482929061caa14397421445
2024-02-22 09:52:48 -08:00
Diego Segura e33767a36d fix flatlist props being undefined in ios (#43141)
Summary:
When using Flatlist on iOS and Android its failing because props are undefined

The problem is described on https://github.com/facebook/react-native/issues/34783

![Captura de pantalla 2024-02-22 a las 4 13 11](https://github.com/facebook/react-native/assets/1161455/325738d9-2e49-44a0-bb6a-077b2e02e9cd)

![Captura de pantalla 2024-02-22 a las 4 14 58](https://github.com/facebook/react-native/assets/1161455/118f76e1-a818-428e-938e-123b55536b49)

Fixed by setting constructor before any statement and removing unnecessary props declaration at the top of the class.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [FIXED] - Fix undefined props crash in FlatList

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

Reviewed By: javache

Differential Revision: D54069559

Pulled By: robhogan

fbshipit-source-id: b39cd9a273eb0279ed353f9efcb66a3c4ccf93b4
2024-02-22 09:03:03 -08:00
Alex Taylor (alta) b857a6eb54 Update hermes-parser and related packages in fbsource to 0.19.2 (#43140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43140

Bump hermes-parser and related packages to [0.19.2](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D54044847

fbshipit-source-id: ce6830c6cdae8f9cb7225a86c0a1ff23a6929796
2024-02-22 08:56:32 -08:00
Rubén Norte 71ee246183 Include native module for ReactNativeFeatureFlags by default in all apps using TurboModules (#42431)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42431

Changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D52905704

fbshipit-source-id: df1a0ec71ba468d8352f2af92bf87b5175c0d72c
2024-02-22 08:39:12 -08:00
Rubén Norte d979452d24 Log an error when trying to access native feature flags from JS if the native module is not available (#43149)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43149

Changelog: [internal]

At the moment we're silently falling back to default values when trying to use common feature flags from JS when the native module isn't available. This could lead to unexpected behaviors and it's not immediately obvious, so this logs an error when it happens.

Reviewed By: javache

Differential Revision: D54063391

fbshipit-source-id: 5886754958930b88ef63c24d77a9e8486d92c731
2024-02-22 08:35:25 -08:00
Kesha Antonov 767330f218 Update Yoga.podspec: fixes archiving for Mac Catalyst (#42847)
Summary:
Hi

When I tried to archive macos catalyst app in Xcode I got errors:

<img width="977" alt="Screenshot 2024-02-05 at 00 03 32" src="https://github.com/kesha-antonov/react-native/assets/11584712/b83f75a5-b42f-42e4-9afa-1e2527501baa">

This PR fixes archiving by linking PrivateHeaders in yoga.framework

<img width="399" alt="Screenshot 2024-02-05 at 01 03 48" src="https://github.com/kesha-antonov/react-native/assets/11584712/089080ad-b1dc-4703-9273-d8aa3253205e">

<img width="1404" alt="Screenshot 2024-02-05 at 01 05 18" src="https://github.com/kesha-antonov/react-native/assets/11584712/5263cb80-8a53-4a51-bcfc-9d3a2ba739b4">

Prev PR here https://github.com/facebook/react-native/pull/42159

## Changelog:

[IOS] [FIXED] - fixed archiving for Mac Catalyst

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

Test Plan: Try archive react-native tester app for macos catalyst in Xcode

Reviewed By: NickGerleman

Differential Revision: D53920474

Pulled By: cipolleschi

fbshipit-source-id: 0534d9aa9d249e4e0c35ada0464c38c291be7f84
2024-02-22 06:00:12 -08:00
Riccardo Cipolleschi b9f3186ee6 Make the New Architecture the default (#43135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43135

This change makes the New Architecture the default on both iOS and Android.
This means that new application will be created using the New Architecture by default.

It is still possible to opt out from it.

## Changelog
[General][Changed] - Make the new architecture the default

Reviewed By: cortinico, sammy-SC, dmytrorykun

Differential Revision: D54006751

fbshipit-source-id: bd7de0814925b65ab180105e18c1f6f275ba2672
2024-02-22 05:10:57 -08:00
Rob Hogan 8cbf46a5f4 Move integration tests to OSS (#43094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43094

Merge the internal `cxxcdp-tester` project into `jsinspector-modern/tests`.

Note: These tests still use RN default feature flags and therefore test against the legacy CDP registry - that's addressed in the next diff.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D53766994

fbshipit-source-id: eec144124b20a4500e28398e98763febaed52748
2024-02-22 04:21:35 -08:00
Nikita Lutsenko 765e542c8d react-native | Allow invoking a sync callback under AsyncCallback via 'unsafeCallSync'. (#43143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43143

AsyncCallback allows storing SyncCallback and invoking it from any thread.
However, there are cases where if you have a mix of sync and async callbacks - you might want to invoke them together in one go, instead of spreading them out across thread invocations.

For those cases - allow invoking any AsyncCallback as a sync one, prefixing it with "unsafe", because it's inherently not a safe operation to perform.

Changelog:
[General][Changed] - Allow invoking the AsyncCallback synchronously to allow for tight performance optimization.

Reviewed By: s-rws

Differential Revision: D54028850

fbshipit-source-id: f6729819f791f1d58d2ca655d4082547f18bdd2d
2024-02-22 00:58:29 -08:00
Tommy Nguyen a1171f79f8 fix(android): fix ndkVersion is unset when building from source (#43131)
Summary:
`ndkVersion` is unset when building from source using this guide: https://reactnative.dev/contributing/how-to-build-from-source

## Changelog:

[ANDROID] [FIXED] - Fix `ndkVersion` is unset when building from source

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

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

# Manually apply the patch in node_modules/react-native/ReactAndroid/build.gradle.kts
# Enable building from source
sed -i '' 's/#react.buildFromSource/react.buildFromSource/' example/android/gradle.properties

# Build
cd example/android
./gradlew assembleDebug
```

Reviewed By: christophpurrer

Differential Revision: D54006425

Pulled By: cortinico

fbshipit-source-id: 9ede64bc14af4cf609b7a4c12c5a1082bbc31f09
2024-02-21 10:09:53 -08:00