Commit Graph

1177 Commits

Author SHA1 Message Date
Nicola Corti 6f3948fc48 Publish, Close and Release the Maven repository during build_npm_package
Summary:
Due to us moving to central.sonatype.com for publishing, we cannot publish and release the Maven repository in 2 distinct invocations.
This consolidates all the publishing job to happen during build_npm_package

Changelog:
[Internal] [Changed] -

Reviewed By: fabriziocucci

Differential Revision: D76888543

fbshipit-source-id: 3cb0db6176ed2221a12b4f3f1f575232aa006a6c
2025-06-18 13:58:52 +01:00
Dawid Małecki f9a851fc31 Remove dtslint from type tests (#51382)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51382

This diff replaces `dtslint` which is obsolete and [It is not intended to be used on its own, but as part of the definitelytyped set of packages](https://github.com/microsoft/dtslint) in favor of `tsc` type tests.

It's probably not necessary to have `test-typescript-offline` as tsc does that out of the box but doesn't test with multiple TS versions.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74804967

fbshipit-source-id: 4c581ba5debf6fd0bb8dcddbb95f3c85b05082d4
2025-05-20 14:00:19 +01:00
Riccardo Cipolleschi 79e2298230 [RN][Release] Fix set-rn-version to consider also the codegen snapshot tests (#51156) 2025-05-12 15:17:36 +01:00
Dawid Małecki 241b1a6462 Add transform that moves comments for default exported variable declarations (#51135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51135

In generated types default exported variables are re-declared which shadows attached tags and doc blocks. This transform moves necessary comments on top of re-declarations to keep them accessible.

Example output for SafeAreaView:

```ts
import type { ViewProps } from "../View/ViewPropTypes";
import View from "../View/View";
import * as React from "react";
declare const exported: (props: Omit<ViewProps, keyof {
  ref?: React.Ref<React.ComponentRef<typeof View>>;
}> & {
  ref?: React.Ref<React.ComponentRef<typeof View>>;
}) => React.ReactNode;
/**
 * Renders nested content and automatically applies paddings reflect the portion
 * of the view that is not covered by navigation bars, tab bars, toolbars, and
 * other ancestor views.
 *
 * Moreover, and most importantly, Safe Area's paddings reflect physical
 * limitation of the screen, such as rounded corners or camera notches (aka
 * sensor housing area on iPhone X).
 */
declare const SafeAreaView_DEFAULT: typeof exported;
declare type SafeAreaView_DEFAULT = typeof SafeAreaView_DEFAULT;
export default SafeAreaView_DEFAULT;
```

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74249424

fbshipit-source-id: 5cdd1c746e7fed99e3d3427d6ebf4c0e7ba3f3fd
2025-05-12 13:52:49 +00:00
Dawid Małecki d5c6afaae0 Fix suggesting components from types_generated directory (#51101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51101

TS LSP suggests importing/using components from `types_generated` directory which are exported under slightly different name than root exports. Prefixing default exports with `$$` fixes the issue.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D74177107

fbshipit-source-id: 86a6869c2aa7a113915184e4857a7882710b1db4
2025-05-12 13:18:20 +00:00
Riccardo Cipolleschi 9a448736c1 Fix E2E tests for template (#50990)
Summary:
With the redesign of the new app screen, the E2E tests against the template started failing because we don't have a `Step One` string anymore.

This change should fix them.

## Changelog:
[Internal] - Fix Template E2E tests

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

Test Plan: tested by running the E2E tests on this PR

Reviewed By: huntie

Differential Revision: D73855988

Pulled By: cipolleschi

fbshipit-source-id: d0d72e5a07cd88923e310767eae27f5df376d637
2025-04-29 09:14:11 -07:00
Riccardo Cipolleschi 3f41fe2948 Make fmt and SocketRocket compatible with Swift (#50874)
Summary:
`SocketRocket` and `fmt` are part of React Native dependencies.
If a library is written in swift and depends on them, it will fail to install the pods because these pods are not compatible with Swift.

This change makes sure that the pods are installed in a way that is swift compatible.

## Changelog:
[iOS][Fixed] - Make fmt and SocketRocket Swift friendly

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

Test Plan:
Tested locally in a nightly app.

### Before the change:

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script resulted in this error:

```
[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `react-native-video` depends upon `fmt` and `SocketRocket`, which do not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.
```

### After the change

```
yarn add react-native-video
cd ios
bundle exec pod install
```

This script installed pods successfully.

Reviewed By: cortinico

Differential Revision: D73512109

Pulled By: cipolleschi

fbshipit-source-id: 222d85dba1cbdf4044e3c8459008a4083a720016
2025-04-23 12:07:20 -07:00
Tim Yung cd031e5693 RNCI: Migrate OSS CI to Flow DotSlash Binary (#50743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50743

Expose `--flowBinary` on React Native CI script.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D73062734

fbshipit-source-id: 6501b6ff2976e4e7e0bbc1c6025205cde4169679
2025-04-15 16:09:45 -07:00
Jakub Piasecki 86bede9c60 Update hermes-parser and related packages in fbsource to 0.28.0 (#50695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50695

Bump hermes-parser and related packages to 0.28.0.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D72693713

fbshipit-source-id: f529b78a933ae7a6497f67f1f616c1acb95995c3
2025-04-15 03:56:39 -07:00
Rubén Norte 0173839f42 Remove dependency on event-target-shim (#50494)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50494

Changelog: [internal]

Removes the dependency on the `event-target-shim` npm package now that we're using a custom implementation within `react-native`.

Reviewed By: yungsters

Differential Revision: D67828636

fbshipit-source-id: 8727f8caa2bd4badd7162eb7b993dcc768e74b85
2025-04-07 05:15:37 -07:00
Jakub Piasecki 3579a89c15 Create a transform for sorting types inside a union (#50468)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50468

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72381049

fbshipit-source-id: 9b72f6617b8ac090be9bfd3503d66d89bb701029
2025-04-03 22:45:54 -07:00
Jakub Piasecki 87f08ca6e9 Create a transform for sorting the object properties and methods (#50467)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50467

Changelog: [Internal]

Adds a transform that is able to divide properies of interaces, types and classes into sections:
- properties
- properties typed as functions
- methods
ands sorts them alphabetically within the groups.

Reviewed By: huntie

Differential Revision: D72381050

fbshipit-source-id: 20781dc44e19e63cbb5706a02e513fc0e9bb2412
2025-04-03 22:45:54 -07:00
Jakub Piasecki 847757cd27 Create a transform for dividing type definitions into exported and non-exported sections (#50466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50466

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72314520

fbshipit-source-id: 3a3cf5852768c1f0937f11b3fa7e7d4c442a54b9
2025-04-03 22:45:54 -07:00
Alex Hunt d32ca8e899 Move build-types config into own module (#50450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50450

Intends to be reused by the incoming `buildApiSnapshot` behaviour.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72306509

fbshipit-source-id: 9e03c95f2469e10c05bdd0be39d4e217a6cc197f
2025-04-03 08:31:23 -07:00
Alex Hunt 293e89e7f6 Move build-types script into separate dir (#50448)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50448

In preparation for API snapshot generation and README documentation, move into dedicated dir.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72306094

fbshipit-source-id: 3663f9ba9987a59918bae54cfc5a27555b90a9f9
2025-04-03 08:31:23 -07:00
Alex Hunt 3587f57192 Add error code exit for build-types with nonempty errors (#50449)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50449

Productionisation step before we enable in CI.

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D72303190

fbshipit-source-id: 15dcd85a817549a3a20aa8a56cb8855a68ed5839
2025-04-02 07:50:22 -07:00
Jakub Piasecki b4e64546fd Add a post transform to rename the default export names (#50397)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50397

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72170157

fbshipit-source-id: 9067a83c5e941ef8ade7b846799d9a09f7dc4e62
2025-04-02 07:03:15 -07:00
Jakub Piasecki 53b210079b Remove leftover ignored entrypoints (#50445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50445

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D72302085

fbshipit-source-id: 6d35452a8b2f630388080bbfa56ef50abf048221
2025-04-02 03:45:58 -07:00
Jakub Piasecki a4282a7cc3 Add pre-transform that replaces nullable types with undefined for object types (#50213)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50213

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D71730936

fbshipit-source-id: c126d461fda4ab9758a41421d8300dd92a5cd9af
2025-03-24 07:21:58 -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
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
Dawid Małecki ef0de0e848 Move event-target-shim types to react-native package (#50013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50013

The diff incorporates event-target-shim types that will be referenced by generated TS types to make sure that the public API does not change unexpectedly. The generated tsconfig contains path property which tells Typescript to use copied types instead of the downloaded event-target-shims types.

Changelog:
[internal] - Moved event-target-shim types to react-native package.

Reviewed By: huntie

Differential Revision: D71044389

fbshipit-source-id: b2837cc880a2161f7ff716470fd6eb4644d514e2
2025-03-14 01:54:14 -07:00
Riccardo Cipolleschi a663731ddd Add Support for local tarball to ReactNativeDependencies (#49970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49970

This change add supports to pass a tarball from a local file to the ReactNativeDependencies podspec, so that we can build React Native using a local copy or the RNDependencies and we can use it also in CI.

## Changelog:

[INTERNAL] - Add support for local tarballs

Reviewed By: cortinico

Differential Revision: D71032641

fbshipit-source-id: d83c96c8c12f3add45f8f5ea15fa0eac06d0bedf
2025-03-13 08:40:14 -07:00
Christian Falch e876e4926f Improve RCT-Folly so that other dependencies don't have to specify the folly flags (#49969)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49969

Improved RCT-Folly podspec by configuring it as a prepare step, so that we don't need to forward the folly flags to all the others pods and to 3rd party dependencies.

## Changelog:

[INTERNAL] - Configure folly in a prepare step

Test Plan:
 Run Rn-Tester and  verify that it works as expected both building deps from source and using prebuilt tarballs
 Add third-party library (react-native-reanimated) and perform the same tests to verify that it works with the changed podspec and utilities

Reviewed By: javache

Differential Revision: D71032640

Pulled By: cipolleschi

fbshipit-source-id: a34a9b38fa5d5b37a0a193a73659f0d45dd3d660
2025-03-13 08:40:14 -07:00
Dawid Małecki c50465c637 Add support for triple-slash directives in generated .d.ts files (#50008)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50008

The diff adds extraction of triple-slash directives using regex to match and retrieve following reference.

Changelog:
[internal] - Added support for triple-slash directives in generated .d.ts files

Reviewed By: huntie

Differential Revision: D71113674

fbshipit-source-id: 2207d5b455515c44ba585ffecc063914e0818e58
2025-03-13 08:00:59 -07:00
Rob Hogan 0967a821b1 Test fixtures - don't reference Metro versions (#49895)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49895

Minor thing, but the fact that these fixture `package.json`s for testing a release script reference real Metro packages and versions always trips me up when I'm updating Metro (grepping, etc).

There's no need for them to mention Metro - any non-RN package is sufficient to test that the script preserves other dependencies. This swaps them for dummy packages.

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D70789598

fbshipit-source-id: 32f394bf1f783534b76d260908538d7b5716ef1f
2025-03-07 10:29:38 -08:00
Iwo Plaza fef7933f63 Align Animated/Easing with OSS types (#49842)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49842

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70623703

fbshipit-source-id: c02a0b17d257fa4eb0dbb38db8842c1755384239
2025-03-07 07:19:01 -08:00
Riccardo Cipolleschi e23d7106d5 Add function to sign XCFramework (#49863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49863

After the creation of the XCFramework, that needs to be signed. After the XCFramework is signed, no further modification can happen or they would break the signature.

## Changelog:
[Internal] - Add function to sign the XCFramework

Reviewed By: cortinico

Differential Revision: D70697279

fbshipit-source-id: c2411ca7d12d4679ba55f124cbb445367b15945a
2025-03-06 12:04:23 -08:00
Dawid Małecki 2cbb54e956 Add TextInput to buildTypes and align Flow with TS types (#49720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49720

Changelog:
[Internal] - Added TextInput to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D70180918

fbshipit-source-id: 2ea815153cbff47af534d80faec5db98e4a4a0e8
2025-03-06 08:54:21 -08:00
Iwo Plaza dc689aa415 Skip redundant reparsing when translating Flow defs to TS defs (#49840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49840

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70620551

fbshipit-source-id: d526c1de733f19ab6106ae586632709fd1a389dc
2025-03-05 05:39:22 -08:00
Mateo Guzmán 71fbf51979 Migrate ReactNativeVersion Android template to Kotlin (#49758)
Summary:
Added a new template `ReactNativeVersion.kt-template.js` to be used to generate the Kotlin template for Android. Updating also the set-rn-artifacts-version script to use this template instead of the Java one.

## Changelog:

[INTERNAL] - Migrate ReactNativeVersion Android template to Kotlin

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

Test Plan:
```bash
yarn test-android
yarn android
node ./scripts/releases/set-version.js 1000.0.0
```

Reviewed By: huntie, rshest

Differential Revision: D70486775

Pulled By: cortinico

fbshipit-source-id: 5dd1e0e2ecf4d848dc24e6c47df243a1259ab559
2025-03-04 07:38:18 -08:00
Pieter De Baets 3dc78f804a Update fast_float dependency to 8.0.0 (#49775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49775

Upgrading this dependency to match folly and to enable using this for number parsing across Fabric.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D70482373

fbshipit-source-id: 64429595c1126e6a06436701a7562bdf6dd962d5
2025-03-04 07:25:59 -08:00
Alex Hunt 9c6af97ff8 Include root entry point, switch to excludes (#49806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49806

Changelog: [Internal]

Reviewed By: iwoplaza

Differential Revision: D70488623

fbshipit-source-id: 72f10da4082754dea7d8675f09559607ac96905e
2025-03-04 05:35:34 -08:00
Alex Hunt ec851ccf4f Simplify type source file resolution logic (#49785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49785

Changelog: [Internal]

Reviewed By: cipolleschi, iwoplaza

Differential Revision: D70487265

fbshipit-source-id: ed4654e975f5fec0fe76f8d5f156fef611e24d14
2025-03-04 05:35:34 -08:00
Jakub Piasecki 13ac1a9a88 Align FlatList types with OSS (#49713)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49713

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70317013

fbshipit-source-id: f131cb204135a2a41aa7d3bafe13fc7b44446036
2025-03-03 04:06:39 -08:00
Dawid Małecki 569c01e141 Add Text to buildTypes and align Flow with TS (#49774)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49774

Changelog:
[Internal] - Added Text to buildTypes and aligned Flow with TS

Reviewed By: huntie

Differential Revision: D70324061

fbshipit-source-id: 2a032317acdc0a119f5d33da86a40461f8c60ab1
2025-03-03 04:02:18 -08:00
Alex Hunt 2acb407562 Update references to relocated react-native-devtools-frontend repo (#49777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49777

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D70485084

fbshipit-source-id: d6243b3bc607af39c67c3f1cebdf0b53a3502538
2025-03-03 03:49:04 -08:00
Riccardo Cipolleschi da88bf0030 Add job to build the slices for ios prebuilds (#49528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49528

This change introduces a job to prebuild iOS slices.

## Changelog:
[Internal] - Create prepare artifacts workflows

Reviewed By: cortinico

Differential Revision: D69855542

fbshipit-source-id: 54d5b24b55f9e7bebdbb201073524dc4f3748e07
2025-02-28 09:05:37 -08:00
Iwo Plaza 5fc2484440 Align useAnimatedValue with OSS types (#49643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49643

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Aligns `useAnimatedValue.js` with its manual .d.ts types.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70096210

fbshipit-source-id: c3cd517eccf1cb68400772ddde6e5891861c927d
2025-02-28 06:33:21 -08:00
Jakub Piasecki be59427448 Align ProgressBarAndroid types with OSS (#49663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49663

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70176068

fbshipit-source-id: 0a1febb390affc2a3123e49e88b039b390a34387
2025-02-28 05:46:48 -08:00
Iwo Plaza 42cea2dc9c (reattempt) Use implicit namespace to better align Animated module with OSS types (#49685)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49685

## Motivation
Modernising the RN codebase to allow for modern Flow tooling to process it.

## This diff
Renames `Animated.js` to `AnimatedExports.js`, and introduces an intermediate file that reexports `* as Animated` as a default. This should have equivalent runtime behavior, but allows for a common interface file: `Animated.js.flow` to reinterpret the module as having single exports. TypeScript treats this as a namespace.

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70237239

fbshipit-source-id: f552490cb6bb721c6163272689ec9b6c68386574
2025-02-28 05:03:55 -08:00
Dawid Małecki 38e1444162 Add TouchableOpacity to buildTypes and align Flow with TS types (#49700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49700

Changelog:
[Internal] - Added TouchableOpacity to buildTypes and aligned Flow with TS types

Reviewed By: huntie

Differential Revision: D69922731

fbshipit-source-id: 852b8afe99469512c0951d2fd3818fca744102fe
2025-02-27 03:02:16 -08:00
Riccardo Cipolleschi 9e64099df6 Cleanup script and move the index to release (#49666)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49666

This change moves the index.js file to the `releases` folder, giving it a meaningful name.

It also rename the prebuild folder to ios-prebuild to be more descriptive.

It finally removes the old scripts that this refactoring supersedes.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Move the infdex.js to the prepare-ios-prebuilds script.

Reviewed By: cortinico

Differential Revision: D70176043

fbshipit-source-id: e0c3f3bd53adf97fa388c37a746d274fd678f690
2025-02-26 08:19:39 -08:00
Christian Falch 8b984ca2c4 Glue all the scripts together. (#49671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49671

This change refactors the script to prebuild ios dependencies by adding a script that glues all the steps together.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Add script to orchestrate all the steps

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```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"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175842

Pulled By: cipolleschi

fbshipit-source-id: e4bb4ad5d12e7ceaaca0eeee7ce6dc7269aa7bad
2025-02-26 08:19:39 -08:00
Christian Falch 2fdb6c9832 Refactor compose-framework script (#49665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49665

This change refactors the script to prebuild ios dependencies by factoring out the code that creates the XCFrameworks

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out flow types, constants and gitignore

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```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"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175797

Pulled By: cipolleschi

fbshipit-source-id: 8eb07fd3ff9f309d5f6e4b55156c5d5cbbd41235
2025-02-26 08:19:39 -08:00
Christian Falch 1cf751ed58 Refactor build script (#49669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49669

This change refactors the script to prebuild ios dependencies by factoring out the script that builds the frameworks

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out the script to build the frameworks.

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```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"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175778

Pulled By: cipolleschi

fbshipit-source-id: 987ea8922ab566c6601a77084226df2b6456243f
2025-02-26 08:19:39 -08:00
Christian Falch f7970cddf2 Add code to generate the Swift Package
Summary:
This change refactors the script to prebuild ios dependencies by:
- remove the manually maintained Package.swift
- add script to generate it starting from the configurations that we have
bypass-github-export-checks
## Changelog:

[INTERNAL] - Factor out script to generate  Package.swift file

Reviewed By: cortinico

Differential Revision: D70175760

Pulled By: cipolleschi

fbshipit-source-id: a1b0fc6dcdc1860b04ab260697f259c297338f41
2025-02-26 08:19:39 -08:00
Christian Falch 7aa5df32a4 Refactor setupDependencies script (#49670)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49670

This change refactors the script to prebuild ios dependencies by factoring out the code that setups native dependencies.

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out code to setup native dependencies

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```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"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175729

Pulled By: cipolleschi

fbshipit-source-id: 4e1c19b5482b4335ab66c2b605abcb9db47091d3
2025-02-26 08:19:39 -08:00
Christian Falch 339b0b5653 Add utils: CLI arg validation and folders utils (#49668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49668

This change refactors the script to prebuild ios dependencies by:
- factoring out CLI validation in a separate file
- factoring out the folder utilities in a separate file

bypass-github-export-checks

## Changelog:

[INTERNAL] - Factor out CLI and folder utilities

Test Plan:
Tested in this `AppDelegate.mm`:

Imports:

```obj-c
#import "AppDelegate.h"
#import <glog/logging.h>
#import <double-conversion.h>
#include <fmt/core.h>
#include <boost/assert.hpp>
#include <fast_float/fast_float.h>
#include <string>
#import <SocketRocket/SRWebSocket.h>
```

Code:
```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"]) {
      NSBundle *bundle = [NSBundle bundleWithURL:[framework bundleURL]];
      NSURL *bundleURL = [bundle URLForResource:@"ReactNativeDependencies_glog" withExtension:@"bundle"];
      NSBundle *resourceBundle = [NSBundle bundleWithURL:bundleURL];
      NSURL* url = [resourceBundle URLForResource:@"PrivacyInfo" withExtension:@"xcprivacy"];
      if (url == nil) {
        throw [NSException exceptionWithName:@"ResourceNotFoundException"
                                       reason:@"Could not find PrivacyInfo.xcprivacy in ReactNativeDependencies_glog bundle"
                                     userInfo:nil];
      }
      break;
    }
  }
  return YES;
}
```

Reviewed By: cortinico

Differential Revision: D70175663

Pulled By: cipolleschi

fbshipit-source-id: 5c6653aed7054658c5e265675766a28415da3918
2025-02-26 08:19:39 -08:00