Commit Graph

38536 Commits

Author SHA1 Message Date
Christoph Purrer 3744349ed7 Add RuntimeSchedulerKey constant for RuntimeScheduler lookup (#48486)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48486

[Changelog] [Internal] - Add RuntimeSchedulerKey constant for RuntimeScheduler lookup

Similar to https://github.com/facebook/react-native/pull/48127 this adds a contant to avoid typos when inserting or retrieving the RuntimeScheduler

Reviewed By: rshest

Differential Revision: D67822346

fbshipit-source-id: af982c6d4b875ffde06aae8e953c4892754a074b
2025-01-06 11:23:04 -08:00
Christoph Purrer c4edfe7323 Remove startEmptySurface from SurfaceManager (#48479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48479

[Changelog] [Internal] - Remove startEmptySurface from SurfaceManager

Most of the logic deleted here does not seem to be needed as the core functionality is in:

https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCommon/react/renderer/scheduler/SurfaceHandler.cpp#L88-L96

And this code path can be reached both via
- `startSurface` (by passing in an empty `moduleModule` OR
- `startEmptySurface`

Reviewed By: shwanton, rubennorte

Differential Revision: D67805569

fbshipit-source-id: e3d06dcaa637996498a6cb52b5c1b98f740326ce
2025-01-06 10:32:16 -08:00
Mykhailo Kravchenko 0154372b93 feat: Manage keyboard shortcuts visibility of TextInput (#47671)
Summary:
**iOS** does offer a native property for **UITextField** called `inputAssistantItem`. According to the [documentation](https://developer.apple.com/documentation/uikit/uitextinputassistantitem), we can hide the **"shortcuts"** by setting the `leadingBarButtonGroups` and `trailingBarButtonGroups` properties to empty arrays.

I propose adding a new property for **TextInput** in **React Native**, which would set these native properties to empty arrays. This new property could be called `disableInputAssistant` or `disableKeyboardShortcuts` and would be a `boolean`.

Developers can manage this behavior (the redo & undo buttons and suggestions pop-up hiding) after applying these native props.

https://github.com/react-native-community/discussions-and-proposals/discussions/830

## Changelog:

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

Pick one each for the category and type tags:

[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.

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

[IOS] [ADDED] - [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads.

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

Test Plan:
Manual
1. Open TextInput examples.
2. Scroll down and reach the "Keyboard shortcuts" section.
3. Test each case.

Note: **TextInput** behaves the same as now when the new prop is not passed or is `false`.

https://github.com/user-attachments/assets/5e814516-9e6c-4495-9d46-8175425c4456

Reviewed By: javache

Differential Revision: D67451609

Pulled By: cipolleschi

fbshipit-source-id: 59ba3a5cc1644ed176420f82dc98232d88341c6e
2025-01-06 09:54:29 -08:00
zhongwuzw a3dfc4984d Fabric: Added ScrollEndDragEvent for scrollEndDrag event (#48319)
Summary:
Fixes https://github.com/facebook/react-native/issues/42533 .

## Changelog:

[IOS] [FIXED] -  Fabric: Added ScrollEndDragEvent for scrollEndDrag event

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

Test Plan: Repro please see https://github.com/facebook/react-native/issues/42533 .

Reviewed By: javache

Differential Revision: D67517912

Pulled By: cipolleschi

fbshipit-source-id: aa1caebfb690d09a207b3ebce382eceb520009e5
2025-01-06 08:44:23 -08:00
Rubén Norte cb308bdc5e Add benchmark for host component class variants (#48450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48450

Changelog: [internal]

This implements a basic benchmark to compare `ReactFabricHostComponent` and `ReactNativeElement` (legacy and DOM implementations for native component instances).

Reviewed By: rshest

Differential Revision: D66698546

fbshipit-source-id: dd4bde833e5c9eb32c79a52d06f3c360fb012e23
2025-01-06 07:10:28 -08:00
Rubén Norte ff7c550a86 Run benchmarks in test mode when not specifying verification functions in CI (#48451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48451

Changelog: [internal]

Modifies the execution of benchmarks in CI to run benchmarks in test mode when they don't define a `verify` method.

If a benchmark uses `verify`, the test is meant to make sure that the benchmark doesn't regress in CI. If it doesn't, then running the benchmark on CI doesn't provide much value. In that case, we run a single iteration of each test case just to make sure things don't break over time.

Reviewed By: rshest

Differential Revision: D67637754

fbshipit-source-id: 33b78a9c809386cf2e040314b0427de6a53da3e3
2025-01-06 07:10:28 -08:00
Rubén Norte 3795f0fb66 Add API to run benchmarks in Fantom (#48452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48452

Changelog: [internal]

Implements a basic API to run benchmarks with Fantom (using `tinybench` under the hood):

```
import {benchmark} from 'react-native/fantom';

benchmark
  .suite('Suite name', {
    // options
  })
  .add(
    'Test name',
    () => {
      // code to benchmark
    },
    {
      beforeAll: () => {},
      beforeEach: () => {},
      afterEach: () => {},
      afterAll: () => {},
    },
  )
  .verify(results => {
    // check results and throw an error if the expectations fail
  });
```

Features:
* Print benchmark results in the console as a table.
* It opts into optimized builds automatically
* Verifies that optimized build is used (unless manually opting out of the check via `disableOptimizedBuildCheck`).
* Supports verification of results (making expectations and making the test fail if the benchmark doesn't meet some expectations).

Reviewed By: rshest

Differential Revision: D66926183

fbshipit-source-id: 61cfa7689ea7684eb870fbbc815b8d236a1871e6
2025-01-06 07:10:28 -08:00
Rubén Norte 96205dd78e Add tinybench to run benchmarks in Fantom (#48453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48453

Changelog: [internal]

Adds tinybench 3.1.0 (which has support for sync execution) and defined Flow types for the package.

Reviewed By: dmytrorykun

Differential Revision: D66698545

fbshipit-source-id: faf44add74e5711ac0d50794ce3360eedc45f0a5
2025-01-06 07:10:28 -08:00
Rubén Norte bc3072eafc Implement native module to measure CPU time (#48454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48454

Changelog: [internal]

This implements a native module for Fantom to provide information about the CPU time used by the current process. This will be used by Fantom as the clock to run benchmarks more accurately.

It provides 2 implementations:
1. One based on `clock_gettime` with `CLOCK_THREAD_CPUTIME_ID` that's available on Linux. This provides the CPU time for the current process with decent precision (tens of nanoseconds).
2. A fallback implementation that uses a monotonic clock (not actually CPU time).

We can add a MacOS equivalent in a following diff.

Reviewed By: rshest

Differential Revision: D67596312

fbshipit-source-id: dd712c0171aa998ddbb6fed9187b3c467cd5417d
2025-01-06 07:10:28 -08:00
Alex Hunt eee2866508 Fix InspectorFlags debug default, clean up legacy Buck opt in (#48504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48504

Following D67857739, fixes accidental change where the removed `ReactNativeFeatureFlags` flag read was not replaced with `true`. This temporarily disabled Fusebox on `main`, where not configured via other build flags.

{F1974195736}

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D67857739

fbshipit-source-id: 2a6fb2e6733035245e7ad959c7d3c650a9fde994
2025-01-06 07:02:22 -08:00
Mateo Guzmán b477cfa0ba Add AppStateModule Android unit tests (#48492)
Summary:
Currently the `AppStateModule` doesn't have any unit tests in the Android implementation. This should make it safer for future changes or refactors.

## Changelog:

[INTERNAL] - Add `AppStateModule` Android unit tests

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

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

Reviewed By: cipolleschi

Differential Revision: D67857498

Pulled By: cortinico

fbshipit-source-id: f90ced1cf02ac12a3438495b425ce7931decf19a
2025-01-06 06:49:27 -08:00
Kræn Hansen 7a85b91125 Fix ruby unit tests (#48498)
Summary:
As a prerequisite of enabling running unit tests on CI again, this PR suggests changes needed to the Ruby unit tests.

I've added comments on the code below, justifying changes where I deem a justification might be needed.

For use internally, I suggest accessing the folly_config and boost_config directly via the `Helpers` class instead of the `get_folly_config` and `get_boost_config` because these global functions are defined in `react_native_pods` which would be result in circular requires. An alternative would be to move these global functions to a separate file.

## Changelog:

[INTERNAL] [FIXED] - Fix Ruby unit tests.

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

Test Plan:
- `cd packages/react-native`
- `./scripts/run_ruby_tests.sh`

Reviewed By: rshest

Differential Revision: D67852809

Pulled By: cipolleschi

fbshipit-source-id: 54d8bd708a9e3fd9aef3569ac89ec6ddcd244437
2025-01-06 02:31:42 -08:00
Ruslan Shestopalyuk 5ce07386e1 Convert FabricEventDispatcher (#48491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48491

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67825655

fbshipit-source-id: e94431ae6978332c0566ab0a500e1a85f1ad9a7d
2025-01-06 01:46:46 -08:00
Ruslan Shestopalyuk a9d86be3a4 Migrate EventDispatcher interface to Kotlin (#48445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48445

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67760373

fbshipit-source-id: 6360ed5b488ec47bdd2e4d0357d0d06e8e42f614
2025-01-06 01:46:46 -08:00
Ruslan Shestopalyuk d470f39d8a Migrate RCTEventEmitter to Kotlin (#48467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48467

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793304

fbshipit-source-id: 39bbdebf8434ad57bab3e1d309915a8132033f5b
2025-01-06 01:46:46 -08:00
Alan Lee d5f33c19cb com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager.java (#47561)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47561

Convert Java to Kotlin

Changelog:

[Android][Breaking] changed visibility of FrescoBasedReactTextInlineImageViewManager to internal

Reviewed By: javache

Differential Revision: D65606954

fbshipit-source-id: bfdb5624a104029c8d667ddb9262c862ab846a61
2025-01-06 01:26:14 -08:00
woxtu 088fcb1e5d Resolve run script build phase warnings (#48495)
Summary:
This PR updates podspecs and resolve the following Xcode warnings:

```
Run script build phase '[CP-User] [RN]Check rncore' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```

```
Run script build phase '[CP-User] [RN]Check FBReactNativeSpec' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
```

Enabling the `always_out_of_date` flag will uncheck "Based on dependency analysis" in a script phase.

## Changelog:

[INTERNAL] [FIXED] - Resolve run script build phase warnings

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

Test Plan:
1. Run `bundle exec pod install` in the RNTester folder
2. Open the Xcode workspace
3. Check "Based on dependency analysis" is unchecked in the '[CP-User] [RN]Check rncore' script phase and the '[CP-User] [RN]Check FBReactNativeSpec' script phase

Reviewed By: cipolleschi

Differential Revision: D67835376

Pulled By: rshest

fbshipit-source-id: 11eec80d8172bc0129bfdcf7c79b5edf40427fab
2025-01-06 00:46:51 -08:00
Ruslan Shestopalyuk e99b47ce48 Use proper mockito/kotlin for RootViewTest and JSPointerDispatcherTest (#48490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48490

## Changelog:
[Internal] -
This makes the `RootViewTest` and `JSPointerDispatcher` tests to use mockito-kotlin instead of the Java Mockito, which is the legacy of the conversion of the corresponding tests from Java.

Which:
* is the right thing to do, as we have more Kotlin-idiomatic tests
* helps with some Kotlin conversion with classes under test down the line, as Kotlin Mockito handles things like nullability etc properly

Reviewed By: javache

Differential Revision: D67824679

fbshipit-source-id: 055e9c7c4a33164ce6f4b9a5c47f16051d2a132f
2025-01-05 08:38:43 -08:00
Ruslan Shestopalyuk b867c01fa6 Convert RCTModernEventEmitter (#48466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48466

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67793108

fbshipit-source-id: 1730f4519f740372bde392236feae23ad4a18f0a
2025-01-04 12:44:48 -08:00
Ruslan Shestopalyuk 4ad6a94c60 Kotlinify EventEmitterWrapper (#48489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48489

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67823110

fbshipit-source-id: 840d15d891066b3fc8e6fa8cd2e856ee51e72ce3
2025-01-04 12:24:50 -08:00
Riccardo Cipolleschi 23780f8cb7 Use the app artifact in E2E tests (#48469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48469

This change downloads the generated artifact and uses it in the E2E tests

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67800932

fbshipit-source-id: 6f3c8bbc42ad95cabab85dafff00e233a936d136
2025-01-04 09:02:17 -08:00
Riccardo Cipolleschi 9bf7aff882 Fix code to record and upload videos (#48444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48444

While debugging why the Debug variant was failing, I realised that the code to store video artifacts and the code to record the videos were not working properly.

This diff fixes that

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67760436

fbshipit-source-id: ee4b034f7c54cbf0b46c0afc16c31389b11353fe
2025-01-04 09:02:17 -08:00
Riccardo Cipolleschi 3d2e5447be Store the RNTester artifacts to speed-up E2E (#48442)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48442

This change stores the RNTester `.app` in an artifact so that E2E tests can reuse it.

## Context

While looking at the recent failures of the E2E tests, I realized that the Hermes, NewArch, Debug variant often fails to build, not to test, for some misconfiguration.

I also realized that we are already building that varaint successfully once, so why not reuse it? To reuse prebuilds, we need a few steps:

1. make sure we build all the variants we need
2. store the .app file as an artifact
3. download the artifact and use it in the E2E tests

## Changelog:
[Internal] - Build release variant for RNTester

Reviewed By: mdvacca

Differential Revision: D67760380

fbshipit-source-id: 8be0bbbadf4240dce1bcf5b44dadb41d49ed4c06
2025-01-04 09:02:17 -08:00
Christoph Purrer 6abcca8374 Stop all surfaces on SurfaceManager destruction (#48481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48481

[Changelog] [Internal] - Stop all surfaces on SurfaceManager destruction

Reviewed By: zeyap

Differential Revision: D67809574

fbshipit-source-id: 150ddd091e6822c3a40f8ea413aa65da50445ede
2025-01-03 19:58:06 -08:00
Ruslan Shestopalyuk a6e6f5e869 ReactEventEmitter -> Kotlin (#48464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48464

# Changelog:
[Internal] -

As in the title.

Reviewed By: christophpurrer

Differential Revision: D67791375

fbshipit-source-id: eca1f999b43c405ce48aa5fa3518ec08363f5836
2025-01-03 16:24:09 -08:00
Ruslan Shestopalyuk 076920647e Migrate PointerEventHelper (#48459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48459

# Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D67762029

fbshipit-source-id: c29010d20aa7a4cbe2d92aeacc1851eec3c7701e
2025-01-03 16:24:09 -08:00
Mateo Guzmán 33aebc34bf Fix RNTester dark mode Android Text examples (#48380)
Summary:
The Android `Text` examples in dark mode are not readable. This PR addresses that by replacing the `Text` usages with `RNTesterText`.

## Changelog:

[INTERNAL] [FIXED] - Fixing dark mode Android `Text` examples

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

Test Plan:
Some screenshots after the fixes.

| Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981250](https://github.com/user-attachments/assets/d9c27ac7-5024-478b-a47c-3c057801eea1) | ![Screenshot_1734981168](https://github.com/user-attachments/assets/92c6e11a-ac30-46f5-8878-3659d9e40f9a) | ![Screenshot_1734981146](https://github.com/user-attachments/assets/8bfba649-e036-473a-a622-2289daf67951) | ![Screenshot_1734981127](https://github.com/user-attachments/assets/9b1e2a68-8b34-463b-8637-f2b5682733d2) | ![Screenshot_1734981115](https://github.com/user-attachments/assets/af0c85c5-6216-4af1-ae92-b818213f3719) |
| Image 6 | Image 7 | Image 8 | Image 9 | Image 10 |
|---------|---------|---------|---------|---------|
| ![Screenshot_1734981101](https://github.com/user-attachments/assets/91a07f43-8b9e-4462-8906-5ee1f68741a5) | ![Screenshot_1734981080](https://github.com/user-attachments/assets/3b8ffe9a-53b9-4863-b332-d3055740aa18) | ![Screenshot_1734980904](https://github.com/user-attachments/assets/c5aa8bb6-f1f6-4693-bc31-74557946f009) | ![Screenshot_1734981057](https://github.com/user-attachments/assets/10c8c785-58b8-401a-ad18-7bdcd91cd28d) | ![Screenshot_1734980876](https://github.com/user-attachments/assets/d9ed3b35-01fe-4311-adf3-7a6e4e13aeab) |

Reviewed By: javache

Differential Revision: D67657571

Pulled By: philIip

fbshipit-source-id: da93d072f4bb32017961ee70c76f6add8a874ae1
2025-01-03 15:44:16 -08:00
Sam Zhou b030418649 Deploy 0.258.0 to xplat (#48482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48482

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D67810693

fbshipit-source-id: 82e858d4d5ef3c9896ea3bd58a4f4364dce5bdd0
2025-01-03 15:37:43 -08:00
Blake Friedman af000b7aaa Remove forward declarations (#48461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48461

Remove forward class or struct declarations.

Changelog: [Internal]

```
$ sl log --stat tools/api/ReactNativeCPP.api
 xplat/js/react-native-github/tools/api/ReactNativeCPP.api |  637
 1 files changed, 96 insertions(+), 541 deletions(-)
```

Reviewed By: cipolleschi

Differential Revision: D67763260

fbshipit-source-id: 396314be9cb6153f6cff1348aa596d4a5b61fbe7
2025-01-03 13:18:48 -08:00
Rubén Norte 1120f88401 Update test for DOM APIs to show current vs. desired behavior for getRootNode (#48439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48439

Changelog: [internal]

This is in preparation for implementing `getRootNode` and `ownerDocument` properly in the DOM APIs.

Reviewed By: rshest

Differential Revision: D67137215

fbshipit-source-id: bda6b1f843f219e03df533797fa9e4adbaa54c60
2025-01-03 12:57:16 -08:00
Rubén Norte 4d2649bac8 Extend tests for ReadOnlyNode.compareDocumentPosition (#48438)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48438

Changelog: [internal]

Just adding tests to make sure we cover the cases where the root is unmounted.

Reviewed By: rshest

Differential Revision: D67752010

fbshipit-source-id: 3cc17cd25878013a26dc407640be00e8dc251eea
2025-01-03 12:57:16 -08:00
Rubén Norte a1b13f6a55 Extract ensureInstance utility from tests (#48434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48434

Changelog: [internal]

We were starting to repeat this logic too much in tests, so extracting so we can reuse it.

Reviewed By: rshest

Differential Revision: D67520443

fbshipit-source-id: 64e4e5b35f83dc45e41bb0efae9685aeaf0cf2e2
2025-01-03 12:57:16 -08:00
Rubén Norte 35d0d7c97b Small refactor to lazy load RendererProxy (#48437)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48437

Changelog: [internal]

Just a small refactor to slightly improve readability (and potentially performance).

Reviewed By: christophpurrer

Differential Revision: D67520444

fbshipit-source-id: 9f53a432c4f4363b42083fb52c3beedb8016ccd4
2025-01-03 12:57:16 -08:00
Rubén Norte 6c383ea7b8 Set more sensible defaults for viewport width and height (#48436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48436

Changelog: [internal]

Changing the defaults to use something that resembles a real device (in this case the iPhone 14 which is a very common device).

Reviewed By: christophpurrer

Differential Revision: D67759914

fbshipit-source-id: 87fe3be19196ece62c412e5076c601be746a4f22
2025-01-03 12:57:16 -08:00
Rubén Norte bac56bf828 Allow configuring viewport width, height and device pixel ratio (#48433)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48433

Changelog: [internal]

Allows customizing the root dimensions.

Reviewed By: christophpurrer

Differential Revision: D67693031

fbshipit-source-id: ddbe426a6492512dc2eb7554f26b63d14d5ce75d
2025-01-03 12:57:16 -08:00
Ruslan Shestopalyuk 13bad5268b Migrate EventDispatcherListener/Provider interfaces to Kotlin (#48463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48463

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D67791241

fbshipit-source-id: 99d937e08a1e4ee1a5bd3f8eda71bc814ddbfffe
2025-01-03 12:38:17 -08:00
Blake Friedman 6d85c7c476 Avoid adding stdlib (#48468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48468

Clang will add this code by default at the preprocessor phase. I'd observed a difference in output on sandcastle where it didn't include `stdlib` by default.

This stops `stdlib` being included locally.  **It isn't important wrt tracking user API changes.**

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67793848

fbshipit-source-id: 0c88aee05a78e2410b308fe10c48db2552b8a148
2025-01-03 10:30:00 -08:00
Blake Friedman 9542b1af55 Starlark needs hg instead of sl (#48460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48460

We can only specify `hg` as a dependency, so have to use it in our shell script.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67718641

fbshipit-source-id: 557d980a9b6c3dbcd2621481d39a24b47075a3f9
2025-01-03 10:30:00 -08:00
Blake Friedman 5f54386a66 Add a BUCK target (#48457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48457

Adding CI support will require executing through buck.  Sandboxing means the package has to be well-formed to work, so this cleans up some earlier mess.

- yarn workspace
- check-api.sh to configure the environment correctly when running form sandcastle
- explicity dependencies in our package.json

This is the first step

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D67726588

fbshipit-source-id: 7f8605695e323ef332550820b23b85d3af5f4d69
2025-01-03 10:30:00 -08:00
Blake Friedman 4f30b94a0d Add snapshot of ObjC/PP API (#48456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48456

This is the current output of running the api snapshotting tool.  I've also shown some test examples that show how trivial changes affect the API file.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D67713415

fbshipit-source-id: f68c7e15b0d1e26878e39f22f49e64cdd7340df2
2025-01-03 10:30:00 -08:00
Alex Hunt 546d21c796 Remove fuseboxEnabledDebug flag (#48435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48435

Cleans up the runtime `fuseboxEnabledDebug` feature flag. The modern CDP backend has been enabled by default in open source since 0.76.

- Updates `ReactInstanceIntegrationTest` to preserve testing under both backend modes (legacy Hermes debugger vs Fusebox).
- Preserves ability to override `ReactNativeFeatureFlags` in tests via `InspectorFlagOverridesGuard` — we anticipate that future CDP features will continue to read from the `ReactNativeFeatureFlags` system (`fuseboxEnabled` was/is a special case).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D67759600

fbshipit-source-id: 5878dd879bae435e59c48823a9b9faf85561b028
2025-01-03 05:56:04 -08:00
Rubén Norte 39757da650 Add environment variable to enable C++ debugging (#48441)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48441

Changelog: [internal]

Adds a new environment variable (`FANTOM_ENABLE_CPP_DEBUGGING`) to enable C++ debugging via `fdb`.

Reviewed By: RSNara

Differential Revision: D67683048

fbshipit-source-id: d074a1a063c5da6b048d5456036e83cc14245eaf
2025-01-03 04:57:43 -08:00
Rubén Norte d28300ad9d Add environment variables to print Fantom output and buck commands (#48440)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48440

Changelog: [internal]

Modifies the Fantom runner to read 2 new environment variables to help with debugging:
- `FANTOM_PRINT_OUTPUT`: prints the output of the CLI to the output of the test.
- `FANTOM_LOG_COMMANDS`: logs the buck commands executed by the runner, so they can be re-run outside the runner for debugging, etc.

Reviewed By: rshest

Differential Revision: D67682750

fbshipit-source-id: aff48c4f47078db1be53e0ee105089fbc921768f
2025-01-03 04:57:43 -08:00
Rubén Norte 42b911b5cb Implement streaming mode for console logs in tests (#48372)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48372

Changelog: [internal]

Implements log streaming in Fantom tests. This allows us to see the logs emitted from tests as they're logged, so we don't need to wait until the test completes to flush all of them at the same time.

Reviewed By: rshest

Differential Revision: D67600609

fbshipit-source-id: efb3125e13fd9aec1800a5f1ddaf0d93dcb29218
2025-01-03 04:57:43 -08:00
Rubén Norte f1ba4ef131 Add async flavors for runCommand and runBuck2 utilities (#48371)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48371

Changelog: [internal]

Adds a new favor for `runCommand` and `runBuck2` that works asynchronously and support parsing their output in real time.

Reviewed By: javache

Differential Revision: D67600614

fbshipit-source-id: 99dd2ce9bff11036829f214bf19208b10c9c1b25
2025-01-03 04:57:43 -08:00
Rubén Norte 8f096ab4f8 Refactor utility to run buck2 commands as a method to run arbitrary commands (#48370)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48370

Changelog: [internal]

Small refactor in preparation for async commands with streaming.

Reviewed By: javache

Differential Revision: D67600611

fbshipit-source-id: 11fe6b6ccd8849f904338ccc9454361ad5923863
2025-01-03 04:57:43 -08:00
Rubén Norte 726a72328e Use structured output for Fantom logs and test results (#48369)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48369

Changelog: [internal]

This improves logs in Fantom by preserving the original log levels. It's also in preparation for adding support for log streaming in tests.

Reviewed By: javache

Differential Revision: D67600616

fbshipit-source-id: 1c4997d5e836a78327f33092527543fe025c90c6
2025-01-03 04:57:43 -08:00
Rubén Norte 5f09c36942 Remove unnecessary filter for AppRegistry logs (#48367)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48367

Changelog: [internal]

We removed the calls to `AppRegistry` in Fantom, so this filter isn't necessary anymore (just a no-op).

Reviewed By: rshest

Differential Revision: D67600610

fbshipit-source-id: d985cc5f0ee1728ac72c567bc091a6c2877f2659
2025-01-03 04:57:43 -08:00
Rubén Norte fb3b87c2b5 Remove existing logs and warnings from tests (#48391)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48391

Changelog: [internal]

When we enabled log streaming in Fantom, we saw a lot of logs that we were previously not forwarding (console.error, console.warn) in existing tests.

This removes all the warnings and errors from those tests.

Reviewed By: rshest

Differential Revision: D67602299

fbshipit-source-id: 111f373eafd8707f2746ff727894f1fa4283b83f
2025-01-03 04:57:43 -08:00
Rubén Norte d7d9e1c090 Use codegen for Fantom native module (#48432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48432

Changelog: [internal]

This moves the native module definition for Fantom to the `react-native` package so we can migrate the module to use the codegen.

Also implements the migration.

Reviewed By: christophpurrer

Differential Revision: D67759729

fbshipit-source-id: d79d078908b05fc4b6f5f26f0144ab7e3485cb83
2025-01-03 04:57:43 -08:00