Commit Graph

38536 Commits

Author SHA1 Message Date
Riccardo Cipolleschi 6cbd6ff0a0 Add Changelog for 0.78.1 (#50128)
Summary:
Changelog for 0.78.1

## Changelog:
[Internal] - Changelog for 0.78.1

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D71469118

Pulled By: cipolleschi

fbshipit-source-id: afbab9f2d23539ba7306d2d95964876be8a35190
2025-03-19 07:43:16 -07:00
Ajit 81e47af764 fix performance and memory usage of creating blob on Android (#50121)
Summary:
This PR fixes https://github.com/facebook/react-native/issues/48657
- Memory usage for creating a blob lowered from _( nearest 2^N greater than the file size)+1KB_ previously To _(file size)+1KB_. This is achieved by avoiding internal calls to java.io.ByteArrayOutputStream.ensureCapacity by creating a buffer based on file size.
- Increases the max file size a Blob can be  created from before hitting a OutOfMemoryException.
- Major performance increase by avoiding buffer copying

## Changelog:

[ANDROID] [CHANGED] - Speed and Memory usage improvements to Android Blob support
[ANDROID] [FIXED] - Creating of Blobs from large files now works. File size can now be upto available (free) heap size.

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

Test Plan: Used the App here to test Android Blob creation. https://github.com/giantslogik/blob-large-file-fetch.

Reviewed By: cortinico

Differential Revision: D71464835

Pulled By: javache

fbshipit-source-id: 38de7d83bcaee265fc6e7183f6b1160027cd4cb2
2025-03-19 06:03:26 -07:00
Christian Falch fd1e57b0c0 moved resources to correct location (#50101)
Summary:
In the final XCFramework we no longer need to place resource bundles in a subfolder called Resources - they should be located directly in the framework folder.

This commit fixes this by removing copying to the Resources folder. I also removed a few unneeded tests since we know that we are in a valid folder at this point.

bypass-github-export-checks

## Changelog:

[INTERNAL]  - Moved resource bundles up one level

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

Test Plan: Run RNTester with RCT_USE_RN_DEP=1 and verify that it launches

Reviewed By: cortinico

Differential Revision: D71464608

Pulled By: cipolleschi

fbshipit-source-id: 6cfdda0c6785ffeb13c170f9fd2dd9f5b889d490
2025-03-19 05:07:36 -07:00
Luna Wei df300387e6 Create IntersectionObserver benchmark (#50023)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50023

Changelog: [Internal] - Add benchmarks for Intersection Observer

Reviewed By: rubennorte

Differential Revision: D66847629

fbshipit-source-id: 01cb7994ddb007ecce29593b6ab4b1d359d68bd0
2025-03-19 00:01:35 -07:00
Eric Rozell ff4537c15e Allow listeners in EventEmitter (#49998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49998

We have listeners for EventDispatcher, but we don't have any listener capabilities for synchronous hooks from events on the UI thread.

This proposal adds an affordance for generic event listeners that can be attached by the host platform mounting manager, e.g., to wire events to NativeAnimated event drivers.

## Changelog

[General][Added] - EventEmitter `addListener` and `removeListener` APIs

Reviewed By: javache

Differential Revision: D71050838

fbshipit-source-id: a7f298c71bd882a573781c2fe1fb5a1ae79f301c
2025-03-18 12:12:03 -07:00
Eric Rozell 9d7cdfef17 Allow value extraction from folly::dynamic events (#50032)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50032

In the new architecture, Android dispatches all events with folly::dynamic payloads. Various other callsites in some host platforms similarly dispatch events with folly::dynamic payloads.

Events disptached with folly::dynamic payloads have alignment with the `EventPayload::extractValue` method, added for integration with other capabilities like native animations.

When combined with a general pupose synchronous listener on facebook::react::EventEmitter, this should allow easier integration with host platform native event animation drivers.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D71198197

fbshipit-source-id: 5e49e3b0fb01079870fbc7fc7e74ca0db354cda5
2025-03-18 12:12:03 -07:00
Eric Rozell be92588a7f Add EventPayload::extractValue for NativeAnimated (#49988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49988

NativeAnimated currently depends on folly::dynamic event payloads for event-driven animations. While some events (e.g., ScrollEvent.h) have an `asDynamic` implementation, not all events do. In practice, NativeAnimated just needs to be able to extract an numeric value from a path to drive an animation.

Rather than converting events to dynamic, or otherwise special casing event handling, this change allows arbitrary payloads to implement `EventPayload::extractValue` to retrieve JS property path values directly from events, without intermediate conversions to dynamic.

## Changelog

[Internal]

Reviewed By: javache

Differential Revision: D71046682

fbshipit-source-id: 3544335ff9d50da87ced015de587b97204173b57
2025-03-18 12:12:03 -07:00
Peter Abbondanzo c99e3a8e60 Remove packager settings preference on empty host information (#49848)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49848

Adds a new method to reset the server host in PackageConnectionSettings to its default state rather than relying on providing a blank string

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D70584220

fbshipit-source-id: 2862eee5f71bfe318da7199f2288367433d6f887
2025-03-18 11:59:12 -07:00
Riccardo Cipolleschi 88155fd0c4 Avoid generating <appname>, folders when running pod install (#50100)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50100

While moving the generation of `ReactCodegen.podspec` from Cocoapods to Codegen, we wrongly copied some parts of the script and now it is generating folders with a `,` as a suffix.

This change fixes the problem and prevent the generation of such folders.

## Changelog:
[Internal] -  Avoid generating `ios,` folders

Reviewed By: fabriziocucci

Differential Revision: D71395049

fbshipit-source-id: 1e6024af6e24834a682865792e64d056fb94e027
2025-03-18 09:18:07 -07:00
Alex Hunt a00963d1d5 Update debugger-frontend from 97e9912...46feed4 (#50094)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50094

Changelog: [Internal] - Update `react-native/debugger-frontend` from 97e9912...46feed4

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/97e9912605ce73b06f67fc607c1a5c434a67d6de...46feed41c15bcaafa086c1397562fa2af7cc503b).

Reviewed By: hoxyq

Differential Revision: D71391122

fbshipit-source-id: f7c201c407d417ec84509ae05a881bfc770009a0
2025-03-18 07:23:02 -07:00
Gijs Weterings adbcaef1e1 Fix Nullsafe FIXMEs for DevSupportManagerBase.java (#50068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50068

Note: this involved tightening up some signatures in Kotlin files

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made DevSupportManagerBase.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126381

fbshipit-source-id: 01c08e2fc61eff885911fa9c295d504fa7ea334c
2025-03-18 06:08:17 -07:00
Gijs Weterings a00f884496 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java (#50067)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50067

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126382

fbshipit-source-id: d90966e62372395e864425c82321dc1fc04c1413
2025-03-18 06:08:17 -07:00
Gijs Weterings 61d4b04159 Fix Nullsafe FIXMES for BundleDownloader.java (#50066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50066

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made BundleDownloader.java nullsafe

Reviewed By: alanleedev

Differential Revision: D71126383

fbshipit-source-id: 94e9e9dfc1db83d32046e370c895fa889dabf116
2025-03-18 06:08:17 -07:00
Gijs Weterings bdfa0085b7 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/BundleDownloader.java (#50065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50065

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126388

fbshipit-source-id: a9f08b4ce101202cebe13107cc9c6a660deaf58f
2025-03-18 06:08:17 -07:00
Gijs Weterings e9e4c2adaf Fix Nullsafe FIXMEs for DebugOverlayController.java and mark nullsafe (#50064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50064

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made DebugOverlayController.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126394

fbshipit-source-id: 77bba33f4f14566e133fa9e9649631bcffa3f0c9
2025-03-18 06:08:17 -07:00
Gijs Weterings cc00722b4a Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DebugOverlayController.java (#50063)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50063

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126397

fbshipit-source-id: b1cdea896d6cd9d25f9075e0bf35b9e16bf6ef65
2025-03-18 06:08:17 -07:00
Gijs Weterings fd23a08a3a Fix Nullsafe FIXMEs for CxxInspectorPackagerConnection.java and mark nullsafe (#50062)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50062

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made CxxInspectorPackagerConnection.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126386

fbshipit-source-id: 94b6fca6972e5f08c22df7bebe6f853b5ceb20a7
2025-03-18 06:08:17 -07:00
Gijs Weterings 0ba17b49f8 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/CxxInspectorPackagerConnection.java (#50061)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50061

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126390

fbshipit-source-id: 8ab63944b0e6ce3c78b14414e8a992c1321114f1
2025-03-18 06:08:17 -07:00
Gijs Weterings 311cef3c0d Fix Nullsafe FIXMEs for DevServerHelper.java and mark nullsafe (#50060)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50060

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made DevServerHelper.java nullsafe

Reviewed By: rshest

Differential Revision: D71126391

fbshipit-source-id: 0d39b23d0d96f32f25ac1003d849428000777852
2025-03-18 06:08:17 -07:00
Gijs Weterings e9af9a1793 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevServerHelper.java (#50059)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50059

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126395

fbshipit-source-id: fb42b12dae542bde6e0e9e58baeaab054ed8c49e
2025-03-18 06:08:17 -07:00
Gijs Weterings 3289569747 Fix Nullsafe FIXMEs for JSDebuggerWebSocketClient.java and mark nullsafe (#50058)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50058

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made JSDebuggerWebsocketClient.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126385

fbshipit-source-id: 8707e8c6b8092c0c301dc81a363758b60f38086a
2025-03-18 06:08:17 -07:00
Gijs Weterings 34a9ed049f Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/JSDebuggerWebSocketClient.java (#50057)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50057

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126392

fbshipit-source-id: 96464734a2edc7ec242cd3f3646222587d89eb2c
2025-03-18 06:08:17 -07:00
Gijs Weterings b40b1e679e Fix Nullsafe FIXMEs for MultipartStreamReader.java (#50056)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50056

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made MultipartStreamReader.java nullsafe

Reviewed By: mdvacca

Differential Revision: D71126393

fbshipit-source-id: 3b621be82cd874c608cb610ba35dff0be7cbd195
2025-03-18 06:08:17 -07:00
Gijs Weterings aa9dc3e924 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/MultipartStreamReader.java (#50055)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50055

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126389

fbshipit-source-id: f41d3fbdfdfcde28a8bfc1d52efaca6a8b0fcb1a
2025-03-18 06:08:17 -07:00
Gijs Weterings 14de1c1cba Fix Nullsafe FIXMEs for StackTraceHelper.java and mark Nullsafe (#50054)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50054

Gone trough all the FIXMEs added in the previous diff by the nullsafe tool, marked the class as nullsafe and ensured no remaining violations.

Changelog: [Android][Fixed] Made StackTraceHelper.java nullsafe

Reviewed By: javache

Differential Revision: D71126387

fbshipit-source-id: 3456dde049b50e48ad703fe8312cf57b8d849515
2025-03-18 06:08:17 -07:00
Gijs Weterings 3c795e4ac6 Apply Nullsafe FIXMEs for xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/StackTraceHelper.java (#50053)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50053

Note this diff is only adding FIXMEs that will be removed in the next diff. This diff exists to make the next diff easily reviewable

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D71126384

fbshipit-source-id: 6a2e348f75b0b589de080bf060c4669db82a69c6
2025-03-18 06:08:17 -07:00
Fabrizio Cucci ff518d799b Fix changelog entry for v0.79.0-rc.2 (#50093)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50093

As per title.

Reviewed By: cortinico

Differential Revision: D71387134

fbshipit-source-id: a2705d448a1e81412c29405459428f8c6fa2d994
2025-03-18 06:02:50 -07:00
Rubén Norte 17da3cbbf4 Avoid errors when dispatching mount operations within mount hooks (#50091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50091

Changelog: [internal]

If a library uses mount hooks to perform mount operations, it's possible to get concurrent modifications of the list of pending surface IDs to report.

This fixes that potential error by making a copy of the list before dispatching the mount notifications.

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

Reviewed By: javache

Differential Revision: D71387739

fbshipit-source-id: 96c723ef2d6bcc659c4452434b7a4d5af26117ef
2025-03-18 05:59:50 -07:00
Rubén Norte e4d51cd866 Correctly batch reportMount calls (#50090)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50090

Changelog: [internal]

I refactored `FabricUIManager` in D54547194 / https://github.com/facebook/react-native/pull/43337 and accidentally removed setting this flag to avoid scheduling redundant tasks in the UI thread to report mount. This fixes it.

Reviewed By: javache

Differential Revision: D71387374

fbshipit-source-id: cad8a3ead2434738325560902cbab817e5d5dde7
2025-03-18 05:59:50 -07:00
Christian Falch b7e046e345 change header structure rn deps in XCFrameworks (#50085)
Summary:
Headers are currently copied into each arch in the final xcframework. This is not necessary and will cause a lot of duplication since these files are the same for all archs.

This commit fixes this by only copying headers when we build the final XCFramework:

- ReactNativeDependencies.podspec: Changed the prepare script to be more resilient to different header structs, since we have multiple ways of packaging our tarballs locally and on the servers
- build.js: Removed copying headers when building frameworks
- compose-framework.js: Added copying headers once to the root of the XCFramework.
- rndependencies.rb: updated docs with correct ENV vars

bypass-github-export-checks

## Changelog:

[INTERNAL] - Changes the header structure in our XCFramework to avoid duplication

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

Test Plan: Run RNTester with RCT_USE_RN_DEPS=1 to use prebuilt RN Deps.

Reviewed By: javache

Differential Revision: D71385183

Pulled By: cipolleschi

fbshipit-source-id: 160d56dea7f61d1b8d0a45b80f6c0789647358e6
2025-03-18 05:24:56 -07:00
Christian Falch 9cf138310d fixed inclusion of resources in swift package (#50050)
Summary:
We had some issues with the Swift package build step where we saw an error message when we included resources and couldn't find out why this was happening.

After systematically going through the generated swift package file and looking for a reason I found a mistake.

When we generate the Package.swift file we pass all compilerFlags from the configuration of the target to both cpp/c flags - which in the case of the folly target ends up being passed to the dependency scanner which isn't too happy about this c++ flag.

The solution was to split `compilerFlags` into `cCompilerFlags` and `cxxCompilerFlags`.

This commit fixes this by:
- split `compilerFlags` into `cCompilerFlags` and `cxxCompilerFlags`.
- Updated configuration with correct settings
- Updated Package.swift generation to use these new flags
- Fixed issue with the copy bundles step that didn't copy the directory in some cases.

## Changelog:

[INTERNAL]  - Fixed processing resources in the generated swift package for the RN Dependencies/prebuild

## Test-plan

Test by prebuilding RNDependencies, include the XCFramework in a new app and try to load resource bundles:

```obj-c
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  std::string input = "3.1416 xyz ";
  double_conversion::DoubleToStringConverter::EcmaScriptConverter();
  LOG(INFO) << "Hello from GLOG";
  fmt::print("Hello, world from FMT!\n");
  BOOST_ASSERT(100 == 100);
  double result;
  fast_float::from_chars(input.data(), input.data() + input.size(), result);
  LOG(INFO) << "Answer :" << result;

  NSArray *frameworks = [NSBundle allFrameworks];

  for (NSBundle *framework in frameworks) {
    NSString *frameworkName = framework.bundleURL.lastPathComponent;
    if ([frameworkName isEqualToString: @"ReactNativeDependencies.framework"]) {
      [self loadBundle:framework bundleName:@"ReactNativeDependencies_glog"];
      [self loadBundle:framework bundleName:@"ReactNativeDependencies_boost"];
      [self loadBundle:framework bundleName:@"ReactNativeDependencies_folly"];
      break;
    }
  }
  return YES;
}

- (void) loadBundle:(NSBundle*)framework bundleName: (NSString*)bundleName {
  NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
  NSURL *bundleURL = [bundle URLForResource:bundleName withExtension:@"bundle"];
  NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
  NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
  if (url == nil) {
    LOG(ERROR) << "Could not find PrivacyInfo.xcprivacy in the " << [bundleName UTF8String] << " bundle";
  } else {
    LOG(INFO) << "Found PrivacyInfo.xcprivacy in " << [bundleName UTF8String] << ".";
  }
}
```

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

Reviewed By: javache

Differential Revision: D71316215

Pulled By: cipolleschi

fbshipit-source-id: 53093f962874101f5618997fdac3dd4550768da5
2025-03-18 05:24:56 -07:00
Pieter De Baets fab7fa88e3 Correctly compare oldProps in RCTPullToRefreshViewComponentView (#50092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50092

`oldProps` can be null, so this is an unsafe dereference. We also typically compare with `_props`, which represents the previous state of the component.

Changelog: [General][Fixed] Fixed crash in RCTPullToRefreshViewComponentView#updateProps

Reviewed By: cipolleschi

Differential Revision: D71388015

fbshipit-source-id: deff9c581ee207c4481056a720c10dfd661f088d
2025-03-18 05:23:29 -07:00
Rubén Norte 1f0b27ae86 Fix crash in fixMountingCoordinatorReportedPendingTransactionsOnAndroid feature flag (#50088)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50088

Changelog: [internal]

This fixes a crash when using the `fixMountingCoordinatorReportedPendingTransactionsOnAndroid` feature flag. The problem was that we were accessing the surface handler registry safely, but there were cases where invalid surface handler references were being kept in the registry.

Reviewed By: javache

Differential Revision: D71387111

fbshipit-source-id: 643fcdf10c4c5751d77e276efb37795b7af726bb
2025-03-18 05:22:12 -07:00
Mateo Guzmán ac97177651 Migrate ShadowNodeRegistry to Kotlin (#50081)
Summary:
Migrate com.facebook.react.uimanager.ShadowNodeRegistry to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.ShadowNodeRegistry to Kotlin

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

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

Reviewed By: cortinico, rshest

Differential Revision: D71385038

Pulled By: javache

fbshipit-source-id: 155c9d5b60e3e4b4436424577c1868d60dfb4014
2025-03-18 04:33:24 -07:00
Mateo Guzmán d6ca25b0c1 Migrate UIManagerModuleConstants to Kotlin (#50045)
Summary:
Migrate com.facebook.react.uimanager.UIManagerModuleConstants to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.UIManagerModuleConstants to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D71307448

Pulled By: javache

fbshipit-source-id: 63b8e54a0020d68d127c07f605a91a0dda403975
2025-03-18 04:29:19 -07:00
Mateo Guzmán 00105b8054 Migrate OnLayoutEvent to Kotlin (#50082)
Summary:
Migrate com.facebook.react.uimanager.OnLayoutEvent to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.uimanager.OnLayoutEvent to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D71385027

Pulled By: javache

fbshipit-source-id: 19985a494a68e63a2e3404ce2972c03161d61527
2025-03-18 04:22:48 -07:00
Fabrizio Cucci 2259db6d4b Add changelog entry for v0.79.0-rc.2 (#50084)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50084

As per title.

Reviewed By: cortinico

Differential Revision: D71375255

fbshipit-source-id: 6f346d94d7189314852bf9409919d879a05d5c95
2025-03-18 01:39:52 -07:00
Sam Zhou 796cc43ec4 Deploy 0.265.3 to xplat (#50083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50083

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D71354083

fbshipit-source-id: 33fe2c11ad8cba88d3d206a15976510991d3663e
2025-03-17 19:58:21 -07:00
Tim Yung cf67427406 RN: Trim Leading Slash in DevServerHelper (#50077)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50077

Currently, `DevServerHelper` will fetch malformed URLs if the supplied `resourcePath` has a leading slash.

This diff adds a warning and automatically trims the leading slash when this happens.

Changelog:
[Android][Changed] - Leading slash supplied to `DevServerHelper.downloadBundleResourceFromUrlSync` will now be trimmed and emit a warning.

Reviewed By: robhogan

Differential Revision: D71333088

fbshipit-source-id: 636c9c6c6919d1e9d4a829ed5ae7253f829e549c
2025-03-17 15:58:45 -07:00
Vitali Zaidman f4d2d39ccb add dev middleware ws socket close reasons (#50071)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50071

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

Changelog:
[General][Internal] Send code and close reasons when we close the connection to any websockets from the dev middleware

This should improve the debuggability of our code.

Reviewed By: robhogan

Differential Revision: D71314509

fbshipit-source-id: 1d6fc57a8601bcea78e95a87d423c7c46c51e799
2025-03-17 10:41:47 -07:00
zhongwuzw a802be0224 iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false (#50049)
Summary:
Fixes https://github.com/facebook/react-native/issues/50026

## Changelog:

[IOS] [FIXED] - [Fabric] iOS: Fixes Switch component incorrectly renders as toggled on even though value prop is hardcoded to false

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

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

Reviewed By: javache

Differential Revision: D71307864

Pulled By: cipolleschi

fbshipit-source-id: 57238296842229cf2f23a3f44134f43e27b54609
2025-03-17 09:10:58 -07:00
Jakub Piasecki 5349b7c7b5 Update codegen to support namespaced types (#49950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49950

Changelog: [GENERAL][CHANGED] - Changed `react-native-codegen` to support types under `CodegenTypes` namespace

## Summary

Currently, codegen relies on deep importing types under `react-native/Libraries/Types/CodegenTypes` to be properly type-checked. Updating codegen to support types under a single namespace will enable us to provide a single import from the package with access to all relevant types.

Reviewed By: huntie

Differential Revision: D70967809

fbshipit-source-id: 41241dcc51965f4243acd34e8b63475cb56ca67a
2025-03-17 07:26:17 -07:00
Dawid Małecki 321efa9448 Add lint rule preventing "Node" imports from react and migrate "Node" types to use React namespace in react-native (#50030)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50030

In Flow importing Node from react is equivalent importing ReactNode in Typescript. During translation Node is not translated to ReactNode but React.Node is translated to React.ReactNode. The easiest solution is to migrate all "Node" types to "React.Node"  so that the translation is correct. To make sure that everyone follow the lint rule is added that checks for Node imports from react.

Changelog:
[Internal] - Added lint rule preventing "Node" imports from react and migrated "Node" types to use React namespace in react-native

Reviewed By: javache, huntie

Differential Revision: D71189533

fbshipit-source-id: baea8feb46be3dc30b6e58bcefe140655ec0530a
2025-03-17 06:47:23 -07:00
Mateo Guzmán 8ae4bbc9a5 Migrate ReactAndroidHWInputDeviceHelper to Kotlin (#50046)
Summary:
Migrate com.facebook.react.ReactAndroidHWInputDeviceHelper to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.ReactAndroidHWInputDeviceHelper to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D71307536

Pulled By: javache

fbshipit-source-id: 60c458127b7a7e99d9c8bbb4715cab04452984da
2025-03-17 06:14:18 -07:00
Jakub Piasecki 850760ab61 Overwrite betterHitTest in RCTScrollViewComponentView instead of changing layout metrics of the container view (#50027)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50027

Changelog: [IOS][CHANGED] - Overwrite betterHitTest in RCTScrollViewComponentView instead of changing layout metrics of the container view

## Summary:

In https://github.com/facebook/react-native/pull/49855 I changed the container view of `RCTScrollViewComponentView` to be `RCTViewComponentView` instead of `UIView` so the touches would bass through its `betterHitTest` implementation (along with udating its layout metrics so the right path in the function is chosen). This resulted in some issues and the alternative approach of customizing the hit testing of the ScrollView itself might be a better approach.

This PR changes overwrites the `betterHitTest` method in a way that the `containerView` is entirely skipped during hit testing, instead forwarding the call to its children. This way, it won't prevent touches outside its frame from being delivered to children that extend out of the frame.

Reviewed By: cipolleschi

Differential Revision: D71187882

fbshipit-source-id: 9d0c79048f389b9bee37dea1e59226b54ddbe6f2
2025-03-17 05:03:25 -07:00
Mateo Guzmán d350b69608 Migrate MemoryPressureRouter to Kotlin (#50048)
Summary:
Migrate com.facebook.react.MemoryPressureRouter to Kotlin.

## Changelog:

[INTERNAL] - Migrate com.facebook.react.MemoryPressureRouter to Kotlin

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

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

Reviewed By: cortinico

Differential Revision: D71307420

Pulled By: javache

fbshipit-source-id: f85efe0a0dc2828cdc128eed952d5298c546b116
2025-03-17 04:42:37 -07:00
Jakub Piasecki 77cdaa8733 Remove the workaround used for measuring multiline text on iOS (#50028)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50028

Changelog: [IOS][CHANGED] - Replace a workaround for measuring multiline text with `maximumNumberOfLines` on iOS with a proper solution

## Summary:

In https://github.com/facebook/react-native/pull/49549 support for `numberOfLines` was added to iOS `TextInput`. Along that, a workaround for measuring multiline text with limited number of lines was added to avoid an edge case coming from `NSTextContainer` measuring empty lines even if they are over the line limit.

This PR handles that case properly by counting and measuring individual lines to properly handle the offending edge case.

Reviewed By: NickGerleman

Differential Revision: D71111841

fbshipit-source-id: 6adb4450a13fcc845604622ea76576658a7537aa
2025-03-17 00:14:29 -07:00
Jorge Cabiedes Acosta fc7385c1ea Back out "Fix keyboard navigation for FlatList with removeClippedSubviews enabled"
Summary:
Original commit changeset: 1df7f90066df

Original Phabricator Diff: D69618406

Original diff caused unintended scrolling on some interactions that trigger focus searching

Changelog: [Internal]

Reviewed By: Abbondanzo

Differential Revision: D71217683

fbshipit-source-id: faa977ba0fddbf776868d6204d283555e169ba96
2025-03-14 15:15:01 -07:00
Sam Zhou bcd6b5fbd9 Deploy 0.265.2 to xplat (#50041)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50041

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D71200832

fbshipit-source-id: a2f267c5b2beabe527f958bfc4557bafc04d27de
2025-03-14 14:57:39 -07:00
David Vacca 7ce628277e Fix typos on featureflags/types.js (#50037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50037

Fix typos on featureflags/types.js

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D71210260

fbshipit-source-id: 4a4eabf7ab6b73dca2bdcb42dcd36f2168b2f0e0
2025-03-14 12:46:24 -07:00