Commit Graph

38536 Commits

Author SHA1 Message Date
Nick Gerleman 62ea6e891c react/utils/toLower (#49187)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49187

`tolower` is not `constexpr`. Share some quick utilities for char to lowercase, and case insensitive comparision that does not create new string.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69134770

fbshipit-source-id: 57a84f2d1a441e5a4c07c0db96cb6c133770fb51
2025-02-04 21:51:21 -08:00
Nick Gerleman 75097b2599 CSSCompoundDataType (#49186)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49186

Next up for transforms, and for some future cases, it is convenient to be able to export a single marker type like `CSSTransform`, that can expand to a variant of multiple possible types of different shape (e.g. `CSSMatrix3D` vs `CSSScale`).

It is also best (for code size) to only have a single representation of compound types (e.g. `<CSSLength, CSSPercentage>` generates a separate copy of code compared to `<CSSPercentage, CSSLength>`).

This diff introduces `CSSCompoundDataTypes` which allows composing types, which are then flattened out to discrete types during parsing. For simplicity, `CSSCompoundDataType` cannot currently be nested inside of other `CSSCompoundDataType`, though this could be added in the future.

```
/**
 * Marker for the <length-percentage> data type
 * https://drafts.csswg.org/css-values/#mixed-percentages
 */
using CSSLengthPercentage = CSSCompoundDataType<CSSLength, CSSPercentage>;
```

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69089416

fbshipit-source-id: 8645009f06eb14b1ac4437a4fc4dd6b9ad3f88a2
2025-02-04 21:51:21 -08:00
Nicola Corti b345cecaaa Centralize yarn install to use actions/yarn-install (#49174)
Summary:
This centralizes the invocation of yarn install to be via the `actions/yarn-install`.
It will make it easier to add a retry if we want for all the `yarn install` steps in all the workflows.

## Changelog:

[INTERNAL] -

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D69121525

Pulled By: cortinico

fbshipit-source-id: 135da2e172cdf95b2a0ef8fd3d25996ab9317167
2025-02-04 21:12:19 -08:00
Andrew Datsenko b0501a5be2 Add .toStrictEqual (#49176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49176

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69123117

fbshipit-source-id: 11c326f7ac4df80852409a1c9d72c911ceff21f7
2025-02-04 13:52:57 -08:00
Nick Gerleman 6a683cb268 Cleanup CSSKeyword (#49155)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49155

This does some code cleanup for CSS keywords to reduce boilerplate, duplication, better isolate namespace, fix a typo, and ensure we get a warning (unused variable) if we miss handling a defined keyword.

We technically don't need `CSSKeyword` at all anymore, and don't need to overlay each keywords values to be the same, though having a pattern where each keyword set uses ordinal values from CSSKeyword forces folks to look and add the enum to the list, and include the header defining the data types for keyword sets, instead of each set looking a little magic.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69083181

fbshipit-source-id: b2764e87c2a127d73f816327c4edd45151ea8d82
2025-02-04 12:16:40 -08:00
Nick Gerleman 0cea462113 Font Variant Parsing (#49151)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49151

This diff is... maybe an argument against a global list of interned keywords (it works better in some other contexts though), and this structure is likely to change later when we reintroduce what was previously `CSSPropertyDescriptor` (a list of allowed keywords per property).

But... we're going to roll with this for now to replace the ViewConfig processor (which string splits) in the most over-engineered way possible.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68851566

fbshipit-source-id: 71022f051b112adc03bd182d433e3d890e6023f2
2025-02-04 12:16:40 -08:00
Nick Gerleman b985831702 CSSWhitespaceSeparatedList (#49152)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49152

For parsing a variable number of whitespace separated data types.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68849561

fbshipit-source-id: be3314990d9e7c202c02deba463d79e50985c0b7
2025-02-04 12:16:40 -08:00
Nick Gerleman 68946780d0 Support parsing <shadow> (#48991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48991

This adds support for parsing the `<shadow>` data type. In combination with `CSSCommaSeparatedList`, we can now parse box shadow expressions.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68744811

fbshipit-source-id: bac7be0faf8cd8eee04f21651180151edeef7294
2025-02-04 12:16:40 -08:00
Nick Gerleman 1624cdb29e Fix missing handling of "inset" CSS Keyword (#48990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48990

tsia

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68743950

fbshipit-source-id: 4c4814e3e83be92aea56992cc7d2c830edca99dd
2025-02-04 12:16:40 -08:00
Nick Gerleman f77fced5e2 CSSCommaSeparatedList (#48987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48987

Adds a data type parser for a variable number of values of a given single data type (at least 1).

E.g. `CSSCommaSeparatedList<CSSShadow>` will represent the syntax of `<shadow>#` (ie the value produced by box-shadow).

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D68738165

fbshipit-source-id: 6dd17b3da24b1c24808e49834a29a237c0115fab
2025-02-04 12:16:40 -08:00
Nick Gerleman 6482204523 CSSDataTypeParser consume() function (#48986)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48986

This adds a new `consume()` function to data type parsers which passes a raw parser. This can be used for types which are compounds of other data types, where we may want to accept more than the first token.

This will be used for shadow parsing, but also fixes a hypothetical future bug with ratios. E.g. `calc(foo) / calc(bar)` may be a valid ratio, not starting with a token. We instead just want to try to parse a number data type from the stream.

The form of parsing a preserved token + rest is removed, with the assumption that anything parsing more than a single token should use compound parsing.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D68735370

fbshipit-source-id: 660e0b4a496136c8a559f4ba47bc1bd8d17aa116
2025-02-04 12:16:40 -08:00
Nick Gerleman 966f2a2983 Do not consume component value on visitor failure (#48985)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48985

This reverts some of the behavior I added in D68357624, since peeking a component value is non-obviously more expensive than manually copying the parser, and needing to peek will be a pain for flat lists of values (like for box-shadow).

Changelog: [internal]

Reviewed By: lenaic

Differential Revision: D68733518

fbshipit-source-id: 7b4a061d1649019274441ae0e82609f771dd2916
2025-02-04 12:16:40 -08:00
Andrew Datsenko a702238bed Add .toBeFalsy and .toBeTruthy (#49169)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49169

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119852

fbshipit-source-id: dfda47dcc61f17ecbd205863d83b268005c74a83
2025-02-04 10:54:19 -08:00
Edmond Chui 92fede1a1d report Network inspection capability to CDT frontend (#49142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49142

Changelog: [Internal] ground work for Network panel

Report Network inspection capability from the target.

If `true`, CDT frontend will read it and enable the Network panel. See https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/146

Reviewed By: hoxyq

Differential Revision: D69059543

fbshipit-source-id: 887aef82a2b942965922323bbcdfd5cae7fad3b7
2025-02-04 09:27:50 -08:00
Ruslan Lesiutin fbfb251177 Enable profiling builds identification for iOS (#49137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49137

# Changelog: [Internal]

Similarly as D66501768, adding new `profiling` query parameter to inspector url for registering profiling fields.

Reviewed By: huntie

Differential Revision: D69057572

fbshipit-source-id: d11d88c7e5260d4ca405564d180d8a0edcb39596
2025-02-04 09:26:11 -08:00
Ruslan Lesiutin 90f6e1010d Enable RCT_REMOTE_PROFILE for iOS builds with Fusebox enabled in production (#49136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49136

# Changelog: [Internal]

Same as D64110061, but for iOS.

Reviewed By: javache

Differential Revision: D69051435

fbshipit-source-id: 1294e4f19315376c7a202f493f07994b09bbe932
2025-02-04 09:26:11 -08:00
Nicola Corti e4babdd224 Make ReactYogaConfigProvider internal (#49170)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49170

This makes the `ReactYogaConfigProvider` class internal. I've verified that there are no meaningful usages in OSS:
https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.ReactYogaConfigProvider

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D69120491

fbshipit-source-id: 3de342364897c09747ca724d26db437c81e235a1
2025-02-04 09:17:14 -08:00
Andrew Datsenko e0f514d860 Add .toBeDefined and .toBeUndefined (#49168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49168

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69119330

fbshipit-source-id: 2da7643cd969587b3aabe17d8c9eb405bc814b7b
2025-02-04 09:11:00 -08:00
Andrew Datsenko 13b57781ba Add .toBeCalled and .toBeCalledTimes (#49165)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49165

Changelog: [Internal]
Add missing jest expect apis

Reviewed By: rubennorte

Differential Revision: D69118825

fbshipit-source-id: bed276d8ba544b2351157052c3b37ebcc7398129
2025-02-04 08:26:06 -08:00
evanbacon 9350d6f2f5 React: Update conditional compilation for RCTKeyCommands to include only simulator and Mac Catalyst (#49154)
Summary:
Support distributing Expo Dev Clients to TestFlight. Expo Dev Clients are like custom versions of Expo Go that you can use to connect to a dev server or test remote updates with. Currently they can only be distributed through AdHoc provisioning because Apple rejects the use of private symbols. The symbols in question are used for simulator builds to support reloading when the "R" key is pressed (amongst other features). This is not imperative since there are a number of systems for reloading the app such as pressing R in the CLI window, but it's also not relevant to a physical phone where there is no keyboard.

## Changelog:

[IOS] [FIXED] - Remove private symbols for non-simulator and non-catalyst builds.

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

Test Plan:
- I built an deployed an app with this patch enabled to TestFlight to ensure the submission wouldn't fail. This can be reproduced locally with:
- `npx create-expo`
- Add the patch (ensure it's set with a `prepare` script).
- Following `eas.json`:
```json
{
  "cli": {
    "version": ">= 14.7.0",
    "appVersionSource": "remote"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "resourceClass": "large",
      "autoIncrement": true
    },
    "production": {
      "autoIncrement": true
    }
  },
  "submit": {
    "production": {},
    "development": {}
  }
}
```
-  Then building and deploying to TestFlight: `npx eas-cli@latest build -p ios -s --profile development`

Reviewed By: huntie

Differential Revision: D69106388

Pulled By: cipolleschi

fbshipit-source-id: 773a897ff5061929367b72188f06a08213c7dd46
2025-02-04 07:47:33 -08:00
Nicola Corti 55b3839183 Convert com.facebook.react.devsupport.RedBoxDialogSurfaceDelegate to Kotlin (#49091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49091

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: Abbondanzo

Differential Revision: D68954219

fbshipit-source-id: 4d82a8965207916acec4fa3779627b9e93bb8b10
2025-02-04 07:02:40 -08:00
Nicola Corti 95f9ca5b5b Convert com.facebook.react.devsupport.RedBoxContentView to Kotlin (#49090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49090

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: alanleedev

Differential Revision: D68954222

fbshipit-source-id: d24ceefb1419d24546ae362a6f37625e724c658b
2025-02-04 07:02:40 -08:00
Mateo Guzmán b76895d6f4 Make BorderRadiusStyle internal (#49150)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.uimanager.style.BorderRadiusStyle).

## Changelog:

[INTERNAL] - Make com.facebook.react.uimanager.style.BorderRadiusStyle internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: rshest

Differential Revision: D69111932

Pulled By: cortinico

fbshipit-source-id: 2c6fbec27140e6fef78ee3077d8a64369f56b143
2025-02-04 06:57:17 -08:00
Pieter De Baets 64fa41a573 Default XMLHttpRequest's trackingName to null (#49161)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49161

Avoid special strings, and default to null to mean undefined or unknown. This save us from bridging an unnecessary string but also makes the fallback name for logging network requests clearer.

Changelog: [Internal]

Reviewed By: bgirard

Differential Revision: D69058211

fbshipit-source-id: d83f424e0c2c23842554a8e4e616cad39719f311
2025-02-04 06:11:52 -08:00
Rubén Norte d2a6ff0c37 Add method to take a save a JS memory heap snapshot (#49125)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49125

Changelog: [internal]

This adds support for taking JS memory heap snapshots from Fantom tests via `Fantom.saveJSMemoryHeapSnapshot`. This can be used in one-off tests to do memory analysis and determine the existence of leaks:

```
// Warm up

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/1.heapsnapshot');

// Do work

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/2.heapsnapshot');

// Clean up

Fantom.saveJSMemoryHeapSnapshot('/path/to/my/3.heapsnapshot');
```

Load these snapshots in Chrome and select "Objects allocated between 1 and 2" in the dropdown to see the potentially leaked objects.

In the future we could introduce additional utilities to analyze the snapshots and do the detection automatically, e.g.:

```
// Warm up

const baseline = Fantom.takeJSMemoryHeapSnapshot();

// Do work

const before = Fantom.takeJSMemoryHeapSnapshot();

// Clean up

const after = Fantom.takeJSMemoryHeapSnapshot();

const leaks = findMemoryLeaks(baseline, before, after);
expect(leaks.sizeKB()).toBeLessThan(THRESHOLD);
```

Reviewed By: rshest

Differential Revision: D68953788

fbshipit-source-id: 6b3899297837c582a7b7235909d59b3e1631913d
2025-02-04 04:51:00 -08:00
Mateo Guzmán 360cbf7433 Make ResponseUtil internal (#49153)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.network.ResponseUtil).

## Changelog:

[Android][Breaking] - Make com.facebook.react.modules.network.ResponseUtil internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: fabriziocucci

Differential Revision: D69111691

Pulled By: javache

fbshipit-source-id: 985677316be7546d06119826bb53b78e1ae11d75
2025-02-04 04:21:27 -08:00
Mateo Guzmán 1c51b77868 Fix Android Image defaultSource runtime error (#49097)
Summary:
Fixes https://github.com/facebook/react-native/issues/49075

The Image `defaultSource` prop is causing a runtime error from 0.77 just by using it in the Image component (see error in the linked issue). This might be a regression from some changes in the prop processing logic from either https://github.com/facebook/react-native/issues/47710, https://github.com/facebook/react-native/issues/47713 or https://github.com/facebook/react-native/issues/47754.

## Changelog:

[ANDROID] [FIXED] - Fix Image defaultSource runtime error

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

Test Plan:
- Verify it doesn't throw any error on runtime anymore for Android.
- iOS behaviour should not be impacted as changes are Android specific

In the RNTester, you can use the following component:

```tsx
import * as React from 'react';
import {Image, View} from 'react-native';

function Playground() {
  return (
    <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
      <Image
        defaultSource={require('../../assets/bandaged.png')}
        source={{
          uri: 'https://i.natgeofe.com/n/548467d8-c5f1-4551-9f58-6817a8d2c45e/NationalGeographic_2572187_4x3.jpg',
        }}
        style={{width: 200, height: 200}}
      />
    </View>
  );
}
```

Also, this `defaultSource` prop is ignored in debug builds for Android ([as per the docs](https://reactnative.dev/docs/image#defaultsource)) – but I've verified we get the defaultSource as a string, which is what we expect on the native side:

<details>
<summary>Screenshot of the Android logs</summary>

![image](https://github.com/user-attachments/assets/e62ae2c3-6a93-4e44-a2d7-c913f5db2173)

</details>

Reviewed By: javache

Differential Revision: D69052723

Pulled By: cortinico

fbshipit-source-id: 2860dd4c18cefcfcbc4e39f94dfa6305f45773a3
2025-02-04 03:51:29 -08:00
Tim Yung bc4dee94fe Animated: Stabilize allowlist in useAnimatedPropsMemo (#49140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49140

Similar to the change made in `useAnimatedProps`, except for `useAnimatedPropsMemo`. (This is just split out to make the changes easier to review.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D69058338

fbshipit-source-id: 033853673d8fe1442b37bb0c0adc7cb22557c334
2025-02-03 16:49:40 -08:00
Tim Yung 5d4907dde7 Animated: Stabilize allowlist in useAnimatedProps (#49143)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49143

Within the implementation of Animated, the `allowlist` value passed into `unstable_createAnimatedComponent` and `useAnimatedProps` is stable, meaning that it cannot change from commit to commit. However, this semantic is not codified because `allowlist` is a prop.

This refactors `useAnimatedProps` to be created by a new `createAnimatedPropsHook` function which accepts an `allowlist` argument, codifying that its value is stable for the lifetime of the hook returned.

This permits React to avoid checking whether `allowlist` has changed from commit to commit.

For now, I've left `useAnimatedProps` as a deprecated module that returns a hook with an empty `allowlist`.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D69058336

fbshipit-source-id: dbcf4ca4e389f3682864a9794eacbe0af23659db
2025-02-03 16:49:40 -08:00
Nick Gerleman 1e5cc693fc Add equality operators to CSS data types (#48989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48989

tsia

Also added a quick helper to CSSColor used later.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D68741768

fbshipit-source-id: e0b4c75c15891e4957c7e05a7a89820c1bea72c3
2025-02-03 16:04:07 -08:00
Riccardo Cipolleschi 8af482cc4d Add Changelog for 0.78.0-rc3 (#49147)
Summary:
Add Changelog for 0.78.0-rc3

## Changelog:
[Internal] - Add Changelog for 0.78.0-rc3

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

Test Plan: N/A

Reviewed By: NickGerleman

Differential Revision: D69069136

Pulled By: cipolleschi

fbshipit-source-id: 3314a715a82e1af5e4f907bb0f6aad2f6b9b3cd7
2025-02-03 15:31:30 -08:00
Riccardo Cipolleschi 480b2335c9 Remove circleci folder (#49121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49121

This change removes the scripts/circleci folder and the last poll-maven script which was not used.

## Changelog:
[Internal] - Remove the circleci folder script

Reviewed By: cortinico, huntie

Differential Revision: D69047603

fbshipit-source-id: a4f1f100d71d792edf42c8d4cb6a0b8d8e7e5260
2025-02-03 14:07:07 -08:00
Riccardo Cipolleschi ae7175d0ab Move analisys scripts to .github folder (#49123)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49123

Previously, we used to have CI workflows scripts in a `react-native/scripts/circleci` folder.
Now that we are not using CircleCI anymore, we move those scripts to the `.github/workflow-scripts` folder.

## Changelog:
[Internal] - Move ci scripts to the `.github/workflow-scripts` folder

Reviewed By: cortinico, huntie

Differential Revision: D69047581

fbshipit-source-id: 6a5d8525e526cc7521d42e2be9530deb09914fdc
2025-02-03 10:02:19 -08:00
Riccardo Cipolleschi d654ae51bb Remove references from CircleCI from the release scripts (#49122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49122

This change updates the Release testing and the release scripts by removing any reference to CircleCI

## Changelog:
[Internal] - Remove CircleCI references from Release and Release testing scripts

Reviewed By: cortinico, huntie

Differential Revision: D69047479

fbshipit-source-id: 14a394b879c03cd81a8d043036c43839a38602c7
2025-02-03 10:02:19 -08:00
Riccardo Cipolleschi 870aca62de Remove references of CircleCI from the readme (#49120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49120

This change removes any reference of CircleCI from the READMEs in React Native

## Changelog
[Internal] - Remove CircleCI references

Reviewed By: cortinico, huntie

Differential Revision: D69047437

fbshipit-source-id: 602350372c1d869098be0c8da7cb3db2077474d8
2025-02-03 10:02:19 -08:00
Riccardo Cipolleschi 839eb44300 Remove CircleCI configuration (#49119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49119

This change removes the .circleci folder and the workflow that we run on CircleCI

## Changelog:
[Internal] - Remove CircleCI config

Reviewed By: cortinico, huntie

Differential Revision: D69047483

fbshipit-source-id: 0020a4ff69d035e939e01079059ba2743aee55fe
2025-02-03 10:02:19 -08:00
Riccardo Cipolleschi 6c6d3413cf Remove CircleCI references from gradle and android (#49118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49118

We finished the migration away from CircleCI, so we are cleaning up the codebase.

This change updates references to CircleCI from gradle.

## Changelog:
[Internal] - Remove references from CircleCI in RNGP

Reviewed By: cortinico

Differential Revision: D69047484

fbshipit-source-id: 4ab40be62e6769eb3a8f65136464eed6628d47a4
2025-02-03 10:02:19 -08:00
Nicola Corti e0da0fe710 Convert com.facebook.react.devsupport.PausedInDebuggerOverlayDialogManager to Kotlin (#49088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49088

Just another Kotlin migration for the devsupport package.

Changelog:
[Internal] [Changed] -

Reviewed By: huntie

Differential Revision: D68954221

fbshipit-source-id: 40dd1227f6cd042b1ea47b1e5b77347a3cdcb136
2025-02-03 09:41:20 -08:00
Rubén Norte 7e12060420 Move Fantom-related specs to src/private/testing/fantom/specs (#49101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49101

Changelog: [internal]

We can move this out of the deprecated directory. Also added a `.npmignore` entry so this won't be published to npm with the package.

Reviewed By: lenaic

Differential Revision: D68896208

fbshipit-source-id: ec85236aeeabdc9abcd870f0f4c1322eeb3cc659
2025-02-03 09:15:31 -08:00
Rubén Norte 2f27327f33 Rename src/private/specs as src/private/specs_DEPRECATED (#49068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49068

Changelog: [internal]

Renamed directory to better signal it's deprecated and added README.md to clarify intent.

Reviewed By: huntie

Differential Revision: D68895998

fbshipit-source-id: 5bc70d0782194db27c27cc89cc402d99f11aafa4
2025-02-03 09:15:31 -08:00
Rubén Norte c8ecc32ece Move geometry to its own directory outside dom (#49100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49100

Changelog: [internal]

This API isn't part of the DOM standard so can be moved out.

Reviewed By: huntie

Differential Revision: D68896484

fbshipit-source-id: 5d275beb909ce5c5ce0eddb6c6e04cf7491aa1cb
2025-02-03 09:15:31 -08:00
Alex Hunt 4348a57503 Fix build-types script, align internal babel-register (#49133)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49133

Follow up to D68960540.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D69053411

fbshipit-source-id: ffc8aba923aab8f4cd0d74fb61c49893ff09b6c1
2025-02-03 08:32:39 -08:00
Mateo Guzmán 1a67214a3a Make SystraceRequestListener internal (#49107)
Summary:
As part of the initiative to reduce the public API surface, this class can be internalized. I've checked there are [no relevant OSS usages](https://github.com/search?type=code&q=NOT+is%3Afork+NOT+org%3Afacebook+NOT+repo%3Areact-native-tvos%2Freact-native-tvos+NOT+repo%3Anuagoz%2Freact-native+NOT+repo%3A2lambda123%2Freact-native+NOT+repo%3Abeanchips%2Ffacebookreactnative+NOT+repo%3AfabOnReact%2Freact-native-notes+NOT+user%3Ahuntie+com.facebook.react.modules.fresco.SystraceRequestListener).

## Changelog:

[INTERNAL] - Make com.facebook.react.modules.fresco.SystraceRequestListener internal

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

Test Plan:
```bash
yarn test-android
yarn android
```

Reviewed By: cortinico

Differential Revision: D69046100

Pulled By: javache

fbshipit-source-id: 0cb4c6eda385f458c3e4b02068ce77f2dd15af23
2025-02-03 08:15:25 -08:00
kirillzyusko 243aecc095 fix: avoid ConcurrentModificationException (#49109)
Summary:
Fixes a `ConcurrentModificationException` when iterating over `TextWatcher` `mListeners` array.

If you open Android open source code (`TextView` class), then we can see that Android iterates with `for/n` loop (not `for/:`):

```java
    void sendAfterTextChanged(Editable text) {
        if (mListeners != null) {
            final ArrayList<TextWatcher> list = mListeners;
            final int count = list.size();
            for (int i = 0; i < count; i++) {
                list.get(i).afterTextChanged(text);
            }
        }

        notifyListeningManagersAfterTextChanged();

        hideErrorIfUnchanged();
    }
```

<hr>

We can catch the `ConcurrentModificationException` with old code, when for example we have 3 listeners:

- 0 is `EmojiTextWatcher` (seems like it's added by OS);
- 1 is `OnlyChangeIfRequiredMaskedTextChangedListener` (added by `react-native-text-input-mask`);
- 2 is a listener that attached by `react-native-keyboard-controller`.

On every afterTextChanged [input-mask-android](https://github.com/RedMadRobot/input-mask-android/tree/df452edc0c52a37e5082adcfc3d05d77b5aa34e8) [removes](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L212) the listener and [adds](https://github.com/RedMadRobot/input-mask-android/blob/df452edc0c52a37e5082adcfc3d05d77b5aa34e8/inputmask/src/main/kotlin/com/redmadrobot/inputmask/MaskedTextChangedListener.kt#L231) it back.

The oversimplified version of the code can be next:

```java
public class MyClass {
    public static void main(String args[]) {
        ArrayList<Integer> mListeners = new ArrayList<>();
        mListeners.add(0);
        mListeners.add(1);
        mListeners.add(2);

        Iterator<Integer> iterator = mListeners.iterator();

        while (iterator.hasNext()) {
            Integer listener = iterator.next();

            // Check if the listener is equal to 1
            // 1 is OnlyChangeIfRequiredMaskedTextChangedListener and we simulate the behavior of this class
            if (listener == 1) {
                int i = mListeners.indexOf(listener);

                if (i >= 0) {
                    mListeners.remove(i);
                }

                // Add the removed element at the end
                mListeners.add(listener);
            }
        }

        // Print the modified list
        System.out.println(mListeners);
    }
}
```

Key points are:
- if we have only [0, 1] listener, then it works well and `ConcurrentModificationException` will not be thrown, because we modify last element;
- if we have `[0, 1, 2]` then exception will be thrown.

So in this PR I decided to re-work code to match what Android has. With `for/n` approach `ConcurrentModificationException` will not be thrown, because we don't check array immutability in this case.

More information also can be found here: https://github.com/kirillzyusko/react-native-keyboard-controller/issues/324

## Changelog:

[ANDROID] [CHANGED] - avoid `ConcurrentModificationException` when iterating over `mListeners` `TextWatcher` array

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

Reviewed By: cortinico

Differential Revision: D69050984

Pulled By: javache

fbshipit-source-id: 9c6a7a428467fa5e546d70549dfcc91d6b2e58d2
2025-02-03 07:27:58 -08:00
Alex Hunt 880fd927a9 Remove internal XHRInterceptor API (#49132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49132

Follows D68780147 and D68953084. We're able to safely remove this API by relocating the implementation into the one dependent internal test call site.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D69049203

fbshipit-source-id: 82c4b15d7f6736aed21171eeec1c197d2f34b33e
2025-02-03 06:56:08 -08:00
Riccardo Cipolleschi 3bd3f101b9 Be less strict with method parsing of TurboModule Interop Layer (#49072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49072

We have instance of apps crashing when enabling the New Architecture because of the TurboModule interop layer.

What's happening is that when the module is loaded, the TM Interop Layer tries to parse the method definition to expose them in JS. However, for some libraries in the Legacy Architecture, it is possible to define a method in Objective-C and to define a different signature in Swift.

For example, the [`RNBluetoothClassic` library](https://github.com/kenjdavidson/react-native-bluetooth-classic) defines a selector in objective-c which [has the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.m#L134-L136)

```
RCT_EXTERN_METHOD(available: (NSString *)deviceId
                  resolver: (RCTPromiseResolveBlock)resolve
                  rejecter: (RCTPromiseRejectBlock)reject)
```

And the method is inmplemented in Swift with [the signature](https://github.com/kenjdavidson/react-native-bluetooth-classic/blob/main/ios/RNBluetoothClassic.swift#L502-L505):

```
func availableFromDevice(
        _ deviceId: String,
        resolver resolve: RCTPromiseResolveBlock,
        rejecter reject: RCTPromiseRejectBlock
    )
```

When the TurboModule interop layer tries to parse the method, it receives the `accept:resolver:rejecter:` signature, but that signature is not actually defined in as a method in the module instance, and it crashes.

This crash was not happening in the Old Architecture, which was handling this case gracefully. Notice that the specific method from the example is not working in the Old Architecture either. However, the app is not crashing in the old architecture.

This change adds the same graceful behaviors plus it adds a warning in development to notify the developer about which methods couldn't be found in the interface.

Fixes:
- https://github.com/facebook/react-native/issues/47587
- https://github.com/facebook/react-native/issues/48065

## Changelog:
[iOS][Fixed] - Avoid crashing the app when the InteropLayer can't find some methods in the native implementation.

Reviewed By: javache

Differential Revision: D68901734

fbshipit-source-id: 844d1bf29423d5c601b583540e86d57dfffd1428
2025-02-03 06:50:05 -08:00
Pieter De Baets e5ba5791b2 Enable -Wundef for react-native targets (#49041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49041

Prevent the class of issues seen in D68797482 by making `#if FOO` where `FOO` is not defined an error.

Changelog: [Internal]

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D68824244

fbshipit-source-id: 1291c5f2f84ecb023ba76a015716cc7c9ae0f89e
2025-02-03 06:29:28 -08:00
Pieter De Baets 4799463435 Fix incorrect noexcept attributes (#49127)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49127

These tests are marked as noexcept, but they can indeed throw exceptions: they trigger synchronous commits, which may cause exceptions in the mounting layer.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D69049587

fbshipit-source-id: 02c6187c8d0e043c9840aad9c9e4d27866898b4a
2025-02-03 06:15:36 -08:00
Oskar Kwaśniewski ae59702f8e fix(iOS): bring back enableFixForViewCommandRace feature flag (#49126)
Summary:
As pointed out by RyanCommits the ReactNativeFactory PR removed `enableFixForViewCommandRace` feature flag by mistake. Reference: https://github.com/facebook/react-native/pull/46298/files

This PR re-adds the feature flag.

## Changelog:

[IOS] [FIXED] - Re-enable enableFixForViewCommandRace feature flag

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

Test Plan: Not needed, the feature flag was there before refactor.

Reviewed By: huntie

Differential Revision: D69049668

Pulled By: cipolleschi

fbshipit-source-id: b7bf382c76878e72619145283fa8cc2c1046b486
2025-02-03 06:12:12 -08:00
Alex Hunt fb493fd72d Restore XMLHttpRequest setInterceptor API, rename as DO_NOT_USE (#49081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49081

Follows D68780147. We are depending on this API in one internal E2E test. Rename as `__setInterceptor_DO_NOT_USE`.

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D68953084

fbshipit-source-id: 66b685a90b6e7f18646752dc90892963d16f9a83
2025-02-03 05:55:53 -08:00