Commit Graph

130 Commits

Author SHA1 Message Date
Sam Zhou cf664c65e2 Standardize subtyping error code into incompatible-type in react native and metro (#53312)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53312

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D80400976

fbshipit-source-id: 196af69c0b9621b2a2675b232406639773e04933
2025-08-18 09:04:31 -07:00
Sam Zhou c43a39925f Replace $FlowIssue with $FlowFixMe (#52976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52976

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D79400163

fbshipit-source-id: b0c4f10b18b99550bdf95be620187f011b62f2f7
2025-08-01 07:50:00 -07:00
Sam Zhou 6c8bcad054 Make functions async and add await to prepare for prettier v3 upgrade: 1/n (#52768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52768

Prettier v3 has an async API. This diff adds in await ahead of the upgrade to prepare for the API change.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D78752354

fbshipit-source-id: c0d27a6c863747b71852e72a22687d1fe1d9f76f
2025-07-22 13:28:03 -07:00
Alex Hunt fc5e33b582 Reorganise shared script utils (#52473)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52473

Shared utils that were located in the root of `scripts/` are now colocated closer to their dependencies or moved to `scripts/shared/` — simplifying the root directory layout.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D77873875

fbshipit-source-id: e04dba41a1ef811d32793931033fdfa93afad0cd
2025-07-08 06:10:36 -07:00
Alex Hunt 26c042724c Replace chalk in build scripts (#51904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51904

Replaces `chalk` with Node's `util.styleText` in `scripts/build/` and `scripts/build-types/`.

Will follow up with replacing across the entire repo at a later point.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76037191

fbshipit-source-id: c28352853f22d455a709f4b752f566626e6fb3fe
2025-06-09 18:21:18 -07:00
Alex Hunt df39eadc03 Bump minimum Node.js version to 22.14.0 (#51840)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51840

Bumps the minimum version of Node.js in React Native to the current active LTS release (22.x, upgraded from 18.x which is now out of support).

- CI configurations are reduced from `[22, 20, 18]` to `[24, 22]`.

{F1978909878}

See https://nodejs.org/en/about/previous-releases.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 22

Reviewed By: yungsters, cortinico

Differential Revision: D76037015

fbshipit-source-id: b6e4b3ee279a9a93d716a13297420bba73f45250
2025-06-06 05:21:39 -07:00
Alex Hunt 9616a83c8b Rename --validate arg on yarn build (#51834)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51834

Aligning with incoming flag on `yarn build-types`.

Changelog: [Internal]

Reviewed By: coado

Differential Revision: D76034414

fbshipit-source-id: 726858145811227efe23bc2f8344dceeb69944b2
2025-06-06 01:14:43 -07:00
Jakub Piasecki 8d1bcd8aeb Update Typescript version (#51831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51831

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D76018604

fbshipit-source-id: b16be849d155d608306a8778cea540f0096a66b0
2025-06-06 00:29:36 -07:00
Moti Zilberman 188221052d Support conditional exports when enumerating entry points (#51698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51698

Changelog: [Internal]

TSIA

Reviewed By: hoxyq

Differential Revision: D75682786

fbshipit-source-id: 3d70c36f26d87f0be003784aa76bec34640b38d2
2025-05-30 08:36:29 -07:00
Moti Zilberman 63f4fb129f Scaffold debugger-shell package (#51688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51688

Changelog: [Internal]

# Context

See D74904547.

## This diff

Creates the `react-native/debugger-shell` package, containing a basic implementation of an Electron-based shell for React Native DevTools. At this point, there is no direct dependency on the new package from the rest of React Native - it's designed to be used as part of a Meta-internal experimental rollout of the new debugger shell via the `BrowserLauncher` interface in `dev-middleware`.

Reviewed By: huntie

Differential Revision: D74820232

fbshipit-source-id: cb06ea9e2ed8c8822019cad8296cc19e69f9db0b
2025-05-30 02:23:12 -07:00
Moti Zilberman 6d0e5b0c9d Improve reporting of API translation errors (#51683)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51683

TSIA

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D75604640

fbshipit-source-id: 05fa76fb9a3a4d97fe9bbee17b756f74dbdb746e
2025-05-29 10:05:04 -07:00
Panos Vekris 0c70c0166e pre-suppress errors for natural inference rollout in xplat/js (#51524)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51524

Links in error suppressions will point to the announcement post in Flow FYI.

Changelog: [Internal]

drop-conflicts

Reviewed By: marcoww6

Differential Revision: D75188177

fbshipit-source-id: 27ea1fbee848e9371e679cf423e30bc9608edea0
2025-05-22 02:50:47 -07:00
Tim Yung 84de8a075e RN: Delete @oncall Annotations (#51416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51416

Deletes `oncall` annotations from the `facebook/react-native` repository.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D74902524

fbshipit-source-id: 32a6a5b2ff27281792d572f151e2b094d9a79029
2025-05-17 16:18:05 -07:00
Jakub Piasecki 32ce95cc01 Move transforms to build-types (#50982)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50982

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D73667539

fbshipit-source-id: dc9ab6f3efef17f8ffd58a854363b39a31ec59d7
2025-05-11 22:49:43 -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 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
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
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
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
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
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
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
Jakub Piasecki 65242998ca Align Pressable types with OSS (#49631)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49631

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70091770

fbshipit-source-id: 8a2fb448984fccf31c473002ffccd5ddb174b7e1
2025-02-26 07:21:43 -08:00
Dawid Małecki dbbdb985f5 Add SafeAreaView to buildTypes and align Flow with TS types (#49664)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49664

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

Reviewed By: huntie

Differential Revision: D70176107

fbshipit-source-id: 5da4ef4751c2d4a57b3ffd736294587836babecf
2025-02-26 03:15:02 -08:00
Iwo Plaza 9d92b277bf Optional post-transform pipeline for .d.ts files generated by build-types script (#49634)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49634

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69992512

fbshipit-source-id: 7fc004e9460498de236a833aea5265a5fac5f490
2025-02-26 03:06:57 -08:00
Dawid Małecki 7856ef8409 Add Image and ImageBackground to buildTypes and align Flow with TS defs (#49659)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49659

Changelog:
[Internal] - Added Image and ImageBackground to buildTypes and aligned Flow with TS defs

Reviewed By: huntie

Differential Revision: D70099485

fbshipit-source-id: 6000fc7099a4f811c451a08c4d5cf505d84ec0c9
2025-02-25 09:12:52 -08:00
Jakub Piasecki edfc73d1a1 Align DrawerLayoutAndroid type definitions with OSS (#49620)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49620

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70081361

fbshipit-source-id: 203a9a984fddef6dfd2fce7e84ae44e8e68e8fcc
2025-02-25 05:51:21 -08:00
Dawid Małecki 4e79ca4464 Add Touchable to buildTypes and align Flow with TS types (#49562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49562

Changelog:
[Internal]: Added Touchable to buildTypes and aligned Flow with TS types.

Reviewed By: huntie

Differential Revision: D69843245

fbshipit-source-id: 578987a277c3407890a541e442bb347311f71efa
2025-02-25 01:49:28 -08:00
Jakub Piasecki dee6168027 Align Keyboard types with OSS (#49623)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49623

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70083211

fbshipit-source-id: c91d3cd7e8f4ad8770bc686768103b43611d4ebb
2025-02-25 01:23:04 -08:00
Jakub Piasecki 091f542a2e Add a pretransform replacing Stringish with string (#49636)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49636

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70094483

fbshipit-source-id: 3ec23f19af437e28e82f73f03541cbf38469d670
2025-02-25 01:22:31 -08:00
Shawn Dempsey f17c26437b Revert D69849314: Use implicit namespace to better align Animated module with OSS types
Differential Revision:
D69849314

Original commit changeset: cdaa605ba536

Original Phabricator Diff: D69849314

fbshipit-source-id: b97b049cf5f3728568a55abfb93dc67cadfa26ba
2025-02-24 15:40:33 -08:00
Iwo Plaza b56548969a Use implicit namespace to better align Animated module with OSS types (#49559)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49559

## 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: D69849314

fbshipit-source-id: cdaa605ba5361d3349c6dd0e84fd0fbfee263941
2025-02-24 09:20:04 -08:00
Jakub Piasecki c66728dc35 Add ButtonProps export (#49593)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49593

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69984581

fbshipit-source-id: 1a9607866dee564718081a15f9f6740dfb8dd0e4
2025-02-24 08:50:19 -08:00
Dawid Małecki 92e21688db Add RefreshControl to buildTypes and align Flow with TS types (#49564)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49564

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

Reviewed By: huntie

Differential Revision: D69924368

fbshipit-source-id: 1a01ede28f9d0729c483036f8d3f9c9eced58286
2025-02-24 07:08:03 -08:00
Jakub Piasecki f8627e5627 Align ActivityIndicator with OSS types (#49519)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49519

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69661567

fbshipit-source-id: 35e3849eeea188f8bdfa0664c90d3d9e5328ef80
2025-02-24 06:36:56 -08:00
Jakub Piasecki db4086de97 Align LayoutConformance types with OSS (#49625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49625

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D70084487

fbshipit-source-id: f4f0a06f3d7cf87659696ac41a27be5f5972d99f
2025-02-24 06:19:45 -08:00
Jakub Piasecki 0a87f0cf5c Align ScrollView with the OSS types (#49617)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49617

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69981167

fbshipit-source-id: d4b2661b9ec746f30b512bad2c84d4dd0c1755c7
2025-02-24 05:03:18 -08:00