Commit Graph

38536 Commits

Author SHA1 Message Date
Rubén Norte 67b9628af5 Modify native module codegen to throw JS errors when passing null values for non-nullable arguments
Summary:
Changelog: [General][Breaking] Native modules using the codegen now throw an error when called with `null` for optional but not nullable arguments.

## 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(null);
```

The app doesn't throw an error, but it should because this method shouldn't accept `null` according to its type definition.

## Changes

This modifies the codegen to only check for `undefined` in those cases, otherwise trying to cast the value to the expected type and failing if it's `null`.

NOTE: this is technically a breaking change, but if people are using Flow or TypeScript in their projects they're very unlikely to hit this case, because they would've complained if you tried to pass `null` in these cases.

Reviewed By: cipolleschi

Differential Revision: D54206289

fbshipit-source-id: 58f2f2f3009d203b96189d3c66d1ae98a9e4fb36
2024-02-29 13:12:49 -08:00
Rubén Norte 21171222eb More spec-compliant execution of microtasks
Summary:
Changelog: [internal]

This modifies the method to run microtasks in `RuntimeScheduler_Modern` to align a bit better with the spec. In this case, we'll check if we're already running microtasks when we call that method, and skip if that's the case.

We're not currently calling this method recursively so this shouldn't really be a change with the current logic.

Reviewed By: javache

Differential Revision: D54302537

fbshipit-source-id: ef5e12e68e0c7f8c9258929609c050ef78e4cde5
2024-02-29 11:38:30 -08:00
Nicola Corti 4d982dcdae Undo moving of TurboModule to internal and expose utility function for TurboModule.class.isAssignableFrom (#43219)
Summary:
After discussing with mdvacca, we prefer to undo the change of `TurboModule` package to `.internal` as this is a quite aggressive breaking change for the ecosystem.

Moreover: users should not invoke `TurboModule.class.isAssignableFrom` because `TurboModule` is `.internal`. Therefore I'm exposing another API to check if a class is a TurboModule as a static field of `ReactModuleInfo`.

## Changelog:

[INTERNAL] - Do not use TurboModule.class.isAssignableFrom

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

Test Plan: Tests are attached

Reviewed By: mdvacca, cipolleschi

Differential Revision: D54280882

Pulled By: cortinico

fbshipit-source-id: 9443c8aa23cf70dd5cfe574fe573d83313134358
2024-02-29 10:23:09 -08:00
Alex Hunt d889d77aed Add changelog for 0.72.11
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D54356952

fbshipit-source-id: dadfeaa1208c00055baad2b8cd704723a530742e
2024-02-29 09:29:19 -08:00
Rubén Norte 0555fdd93a Gate inspector target creation and destruction behind inspector feature flags
Summary:
Changelog: [internal]

This fixes a crashes during logout on Android and iOS caused by trying to unregister the inspector from instances that were not previously registered. This is because I removed a check in D51459050 that was necessary when the inspector was disabled via the flag (and we call the `unregisterFromInspector` method unconditionally).

This also gates the registration/unregistration on Android properly.

Reviewed By: huntie

Differential Revision: D54357554

fbshipit-source-id: 945288acdabdface324884bee1e832870ec8806f
2024-02-29 07:43:09 -08:00
Riccardo Cipolleschi 5d72e1115e Extract prepack tasks in a JS script and add codegen generation
Summary:
This change moves the prepack script of react-native in a separate script, so we can make sure we execute all the preprocessing we need before packing and publishing React Native to OSS.

## Changelog:
[General][Changed] - Moved the tasks of prepack in a separate node script

Reviewed By: huntie

Differential Revision: D54308411

fbshipit-source-id: 989c2b8c6cf88a1e9d87cf34e43351b5c0e7ea73
2024-02-29 07:17:02 -08:00
Riccardo Cipolleschi 03ba46f7e6 Avoid generation of RNCore component if they have been generated already
Summary:
Added a check to avoid the regeneration of RNCore components in case they have been generated already.
In order to maintain backward compatibility and to make sure not to break internal use cases, I think we should still keep the possibility to generate these components at `pod install` time.

Internal users of RNTester, for example, will not run `yarn prepack` before building react-native using OSS technology.
Notice that, in this specific case, the Codegen generates the file in a path that is not `node_modules`.

## Changelog:
[General][Added] - Skip generation of RNCore if the files have been already generated

Reviewed By: dmytrorykun

Differential Revision: D54308832

fbshipit-source-id: 0b5822a367eb0b191c42bc92f8bff20d541c5b29
2024-02-29 07:17:02 -08:00
Riccardo Cipolleschi 9a27c08fb9 Add script to generate RNCore components only
Summary:
This change extracts the function to create RNCore components in a separate reusable unit.
RNCore is now generate in the `node_modules` folder when the app runs pod install, which is a problem because there are use cases where it's not possible to modify the `node_modules` folder or the generated files might be lost.

The goal is to:
- extract this function
- execute this function before packing react-native during the release. (see D54308411)

In this way, we are going to generate the RNCore files in the react-native path that will be packaged and then released.

Users of react-native will have the generated code directly in the node_modules with no need to generate it.

## Changelog:
[General][Added] - Add function to only generate RNCore components

Reviewed By: huntie

Differential Revision: D54308713

fbshipit-source-id: 0fa9ab4ba7b66c577663f0c736742c4d5583f617
2024-02-29 07:17:02 -08:00
Riccardo Cipolleschi 23c541046c Extract libraryName in a seprate variable
Summary:
This change factor out in a variable the `libraryName` to avoid verbosity.

## Changelog:
[Internal] - factor out libraryName

Reviewed By: dmytrorykun

Differential Revision: D54308601

fbshipit-source-id: 1a64a6b960cc86a1cff059e3ba6a45c33bf3150e
2024-02-29 07:17:02 -08:00
Riccardo Cipolleschi 77cbe6d76d Extract RNCORE_CONFIG in a separate variable
Summary:
This change refactor the RNCORE_CONFIGS in a separate variable to simplify reuse.

## Changelog:
[Internal] - Refactor code

Reviewed By: dmytrorykun

Differential Revision: D54308346

fbshipit-source-id: b9d7c8e0a9b4042f2ab1adeb7aae875264d22499
2024-02-29 07:17:02 -08:00
Riccardo Cipolleschi 6a1509f318 Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE
Summary:
In OSS we have reports like [this one](https://github.com/facebook/react-native/issues/43241) where env variables from different settings might clash together, making react native apps fail to build hermes.

For example, a team might have defined a BUILD_FROM_SOURCE env variable to build their specific project from source and that will clash with how react native apps installs Hermes.

This change disambiguate the BUILD_FROM_SOURCE flag we have internally, moving to a less likely to clash RCT_BUILD_HERMES_FROM_SOURCE.

## Changelog:
[iOS][Breaking] - Rename BUILD_FROM_SOURCE to RCT_BUILD_HERMES_FROM_SOURCE

Reviewed By: huntie

Differential Revision: D54356337

fbshipit-source-id: 1115e3c22cbcf1d64b7edae30da614d52423123b
2024-02-29 03:06:52 -08:00
Biki-das 6204ea36d3 - fixes component unmounting behaviour in itemSeperatorComponent (#43223)
Summary:
Reopen in reference to https://github.com/facebook/react-native/issues/42435 , as it had a lot of commits and fixes making it messed up.
Weirdly when using a [Section List](https://reactnative.dev/docs/sectionlist) specifically when using the [SectionSeperatorComponent](https://reactnative.dev/docs/sectionlist#sectionseparatorcomponent), and adding additional Data on the renderItem List, there is a unmount occurring as the new Data is added, this only happens while using the `SectionSeparatorComponent` and limited to the same

**Here is the Current Behaviour**

https://github.com/facebook/react-native/assets/72331432/0622e789-ddbc-4038-8ccc-a421050eecbf

**Here is the Expected Behaviour After Fixes**

https://github.com/facebook/react-native/assets/72331432/2f0cc3a9-da97-43f5-8a4b-3faca74ae834

The issues is happening because the Parent View gets removed, as we add Data, the separator moves causing the unmount, the solution that i proposed here is to conditionally render to make sure that our separator renders correctly which required to add an empty view as the `itemSeparatorComponent`.

## Changelog:
[General] [Added] - Fixes SectionList Unmounting issue with separatorComponent on data addition and removal.

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

Test Plan:
i used the `rn-tester` App to test out the changes below is the code to test the same.
Update the snapshots to align with the changes.

```
import React, {useEffect, useState} from 'react';
import {
  StyleSheet,
  Text,
  View,
  SafeAreaView,
  StatusBar,
  SectionList,
  Image,
} from 'react-native';

interface Item {
  id: string;
  title: string;
  imgSrc: string;
}

interface Section {
  title: string;
  data: Item[];
}

const keyExtractor = (item: Item, index: number) => `${item.title}-${index}`;

const renderItem = ({item, index}: {item: Item; index: number}) => {
  return <ItemComponent item={item} index={index} />;
};

const additionalFruits = [
  {
    id: '7',
    title: 'Sandwich',
    imgSrc:
      'https://img.freepik.com/premium-vector/sanwich-vector-isolated-fast-food_484148-2.jpg',
  },
  {
    id: '8',
    title: 'Burger',
    imgSrc:
      'https://static.vecteezy.com/system/resources/thumbnails/033/494/666/original/animated-illustration-of-burger-cartoon-for-foods-menu-animation-free-video.jpg',
  },
  {
    id: '9',
    title: 'Juice',
    imgSrc:
      'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQHg9yLXE7Jlq4OM9ey64TW4D9qUFaeGU76rg&usqp=CAU',
  },
  {
    id: '10',
    title: 'Milkshake',
    imgSrc:
      'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROpBez3eZKvEVdxBce9XyG6j6caDFMjV_xUQ&usqp=CAU',
  },
];
const DATA: Section[] = [
  {
    title: 'Items',
    data: [
      {
        id: '1',
        title: 'Cake',
        imgSrc:
          'https://static.vecteezy.com/system/resources/previews/012/132/227/original/cute-cake-cartoon-icon-illustration-food-recreation-icon-concept-isolated-premium-flat-cartoon-style-vector.jpg',
      },
      {
        id: '2',
        title: 'Pizza',
        imgSrc:
          'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR2kYjlsayzKZx4hFo6fbH7S8pde2JRo2a0hfaeoz3O7bjqdJjhI0tFiSROM8G4UbdbwXU&usqp=CAU',
      },
      {
        id: '3',
        title: 'Coke',
        imgSrc:
          'https://png.pngtree.com/png-clipart/20220116/original/pngtree-cartoon-hand-painted-coke-bottle-png-image_7106844.png',
      },
      {
        id: '4',
        title: 'Noodles',
        imgSrc:
          'https://thumbs.dreamstime.com/z/cute-cartoon-vector-bowl-noodle-isolated-white-background-115120959.jpg',
      },
      {
        id: '5',
        title: 'Pasta',
        imgSrc:
          'https://t4.ftcdn.net/jpg/02/65/00/69/360_F_265006936_2dlz2VtcqZZUbco1VnDpU2diyd8OagFS.jpg',
      },
      {
        id: '6',
        title: 'Fries',
        imgSrc:
          'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEBUQEBAVFRMTERkVFRISDw8PEBIVFRcWFhcSFRYYHSggGBolGxgVITEhJSkrLi4uFx8zODMtNygtLisBCgoKDg0OGxAQGismICYwLS4vLS0tLS0tLTUvLS0tLS0tLS0vLS0tLS0tLy0tLS0tLS0tLS0tLS0tLS0tLS0tLf/AABEIAOMA3gMBIgACEQEDEQH/xAAcAAEAAgMBAQEAAAAAAAAAAAAABQYCBAcDAQj/xABEEAACAQIBBwgEDAUEAwAAAAAAAQIDEQQFEiEx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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/Z',
      },
    ],
  },
];

const ItemComponent = ({item, index}: {item: Item; index: number}) => {
  useEffect(() => {
    console.log('Mount of', index, item.title);
    return () => {
      console.log('Unmount of', index, item.title);
    };
  }, []);

  return (
    <View style={styles.card}>
      <Text style={styles.cardText}>{item.title}</Text>
      <Image source={{uri: item.imgSrc}} style={styles.imageStyles} />
    </View>
  );
};

const App = () => {
  const [data, setData] = useState(DATA);
  const fetchNextPage = () => {
    const newInnerData = [...data[0].data, ...additionalFruits];
    setData([{...data[0], data: newInnerData}]);
  };

  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.scrollView}>
        <SectionList
          keyExtractor={keyExtractor}
          onEndReachedThreshold={0.5}
          onEndReached={fetchNextPage}
          sections={data}
          renderItem={renderItem}
          ItemSeparatorComponent={() => <View style={{height: 16}} />}
          renderSectionHeader={({section}) => (
            <Text style={styles.sectionHeaderText}>{section.title}</Text>
          )}
        />
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#F5F5F5',
    paddingTop: StatusBar.currentHeight,
  },
  scrollView: {
    paddingHorizontal: 16,
  },
  card: {
    backgroundColor: '#FFFFFF',
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center',
    gap: 8,
    height: 200,
    padding: 16,
    borderRadius: 8,
    marginBottom: 16,
    borderWidth: 1,
  },
  cardText: {
    fontSize: 30,
  },
  headerText: {
    fontSize: 24,
    textAlign: 'center',
    marginBottom: 12,
  },
  footerText: {
    fontSize: 24,
    textAlign: 'center',
    marginTop: 12,
  },
  sectionHeaderText: {
    backgroundColor: '#FFFFFF',
    fontSize: 24,
    fontWeight: 'bold',
  },
  imageStyles: {
    height: '100%',
    width: 100,
  },
});

export default App;
```

Reviewed By: yungsters

Differential Revision: D54301991

Pulled By: javache

fbshipit-source-id: d2cfafb1b4eb868761d849111b5abb7e9d584a46
2024-02-29 02:38:46 -08:00
David Vacca e1b0914e09 Mark UIManagerModuleConstantsHelper.normalizeEventTypes as Nullable
Summary:
Mark UIManagerModuleConstantsHelper.normalizeEventTypes as Nullable

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D54327799

fbshipit-source-id: 66dd42c8ed220e76c62e3d215c59d6547c374265
2024-02-28 17:45:27 -08:00
David Rickard 252ef19c8d Allow partially visible items to be picked as scroll anchors for maintainVisibleContentPosition
Summary:
The current behavior for `maintainVisibleContentPosition` on ScrollView is to pick the first fully visible item as the scroll anchor. This has a number of disadvantages:

* It causes problems for lists with loading indicators and large items. The loading glimmer can be picked as the anchor and pull the scroll down too quickly. This is the case for Marketplace.
* It's inconsistent with the [CSS Scroll Anchoring](https://www.w3.org/TR/css-scroll-anchoring-1/) behavior, which is to pick the first partially visible view.

This change will switch to picking the first partially visible view as the anchor, to align with the CSS implementation.

Discussed the change with yungsters, NickGerleman, and cipolleschi and agreed about the change in behavior.

This also enables `maintainVisibleContentPosition` for Android. After adding it to `validAttributes` for Android it appears to be working well. Previously it was not functional at all on Android, as the property change from React was not passed to ReactScrollViewManager.java.

## Changelog:
[General] [Changed] - maintainVisibleContentPosition property on ScrollView now selects the first partially visible view as the anchor, rather than the first fully visible view.

Reviewed By: NickGerleman

Differential Revision: D54223244

fbshipit-source-id: 05ddfc0bbf16d61f9599b9d8066c0bd21b086301
2024-02-28 12:26:14 -08:00
Moti Zilberman 32c74fbc59 Explicitly init InspectorFlags::inconsistentFlagsStateLogged_ to avoid UB
Summary:
Changelog: [Internal]

TSIA (bug found by UBSAN)

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54305549

fbshipit-source-id: e9c69d7922337c77d4503c5862637040a885eb0e
2024-02-28 11:55:14 -08:00
Moti Zilberman 659712b475 Destroy SessionState only after destroying HostAgent
Summary:
Changelog: [Internal]

Fixes a bug detected by LeakSanitizer: `HostAgent`'s destructor writes to session state, but when the containing `HostTargetSession` is being torn down, the `SessionState` object currently gets destroyed first, resulting in a dangling reference. Reordering the members of `HostTargetSession` results in the correct destruction order.

bypass-github-export-checks

Reviewed By: robhogan

Differential Revision: D54305545

fbshipit-source-id: e91a6f3de5eed327b811524548d01565e26234fa
2024-02-28 11:33:54 -08:00
Moti Zilberman 7cfd686214 Use standard (lowercase) assert in ReactInstanceIntegrationTest
Summary:
Changelog: [Internal]

TSIA; `ASSERT` isn't universally defined so let's switch to `assert`.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D54305583

fbshipit-source-id: ee80b462f1372e53301f1bb66eb589e4f7da89c6
2024-02-28 10:03:15 -08:00
David Vacca 798903a3a2 Mark ViewGroupManager.getChildAt() as Nullable
Summary:
ViewGroup.getChildAt() is nullable, we should make ViewGroupManager.getChildAt() as well.

see https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/ViewGroup.java#6939

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D54271529

fbshipit-source-id: 10170031ec560d3f2956474e3a82ffe41bc5dc36
2024-02-28 09:53:21 -08:00
Rubén Norte 11394e7c88 Register ReactInstance with modern CDP backend
Summary:
Changelog: [Internal]

This implements the integration of `ReactInstance` with the modern CDP backend.

This is the last missing piece to complete the integration of bridgeless with the modern CDP backend, and now we can test it end to end.

Reviewed By: huntie

Differential Revision: D51459050

fbshipit-source-id: 54e8972ee199cbcc8e5e73d7215a34f008feeaa3
2024-02-28 09:53:18 -08:00
Rubén Norte 65c394f33a Register ReactHostImpl with modern CDP backend
Summary:
Changelog: [Internal]

This implements the integration of `ReactHost` with the modern CDP backend. It handles the registration of pages in CDP when we create new instances of `ReactHost` (which is the equivalent concept in React Native).

The next PR will handle the registration of `ReactInstance` to complete the integration on bridgeless.

Reviewed By: huntie

Differential Revision: D51459049

fbshipit-source-id: 9576c8d8e38ca925035d90f2871bcd7aa534f725
2024-02-28 09:53:18 -08:00
Rubén Norte a861a66d71 Add uiThreadConditionalSync executor to AndroidExecutors
Summary:
Changelog: [internal]

This adds a new type of executor in AndroidExecutors to execute runnables on the UI thread.

If the caller is already on the UI thread it'd call the runnable immediately. Otherwise it'd be scheduled in the UI thread to execute asynchronously.

Reviewed By: huntie

Differential Revision: D53941120

fbshipit-source-id: b68c7a4540be2a12df930e4e52eeb7b7a1aa91d8
2024-02-28 09:53:18 -08:00
David Vacca eff28ae113 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: javache

Differential Revision: D54027184

fbshipit-source-id: 722a7e398849f5d935894f321aa0177167eebaef
2024-02-28 08:47:35 -08:00
David Vacca 2e708c9c2c 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: javache

Differential Revision: D54027180

fbshipit-source-id: bf8875c06c8990172e6b449e12902691131b9cef
2024-02-28 08:47:35 -08:00
David Vacca becb9a3df6 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: javache

Differential Revision: D54027186

fbshipit-source-id: 2cee2b598c3ef15641222018703a7d6a467ba30c
2024-02-28 08:47:35 -08:00
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
Luna Wei 8317325fb2 Changelog for 0.73.5 and 0.71.17 (#43216)
Summary:
Changelog: [Internal] - Changelog for 0.73.5 and 0.71.17

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

Reviewed By: hezi

Differential Revision: D54270560

Pulled By: lunaleaps

fbshipit-source-id: 34167f5ba44c230c86896e61bff733e2be11367f
2024-02-27 12:28:49 -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
Luna Wei fadcf7bf83 set to public access by default
Summary: Changelog: [Internal] - Specify `access` flag in publishing nightlies

Reviewed By: cipolleschi

Differential Revision: D54230208

fbshipit-source-id: 7711eee62e8e01a12d6604831754d36a5cd5dc13
2024-02-27 09:09:50 -08:00
Alex Hunt 3eaf9658a4 Add changelog for 0.74.0-rc.1
Summary: Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D54261247

fbshipit-source-id: 5f34372c8ccd2132f59c8369a820a5e877b2ec08
2024-02-27 09:01:12 -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
Sam Zhou 8003189bd9 Deploy 0.229.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D54166486

fbshipit-source-id: 204102267edb9d975b166ecd27b17650f554d24a
2024-02-26 08:05:06 -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