Commit Graph

27 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 6b354155ed Replace $FlowFixMe(Props|State|Empty) with just $FlowFixMe (#53002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53002

Changelog: [Internal]

Reviewed By: marcoww6

Differential Revision: D79524515

fbshipit-source-id: 18b96538a62c7ae5912b1e89d2b50c1420c7eaf5
2025-08-04 11:43:00 -07:00
Tim Yung ad652cf99c sort-imports: Update Rule Definition (#51880)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51880

Updates the `sort-imports` lint rule.

The main change is that it enforces newlines after the last import statement.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D76149902

fbshipit-source-id: 928871655c5de0613b18334d6fc0d71b3a971a18
2025-06-09 20:30:32 -07:00
Tim Yung 3e6423fe65 RN: Flowify packages/rn-tester (#51788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51788

Adds `flow` to the remaining files that are lacking it in the `packages/rn-tester` directory.

This also adds any necessary type annotations and fixes lint warnings.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75899307

fbshipit-source-id: 27a74ed0007b3b754446a45931c2c148312d5e3a
2025-06-04 12:03:52 -07:00
Tim Yung 1977dd6596 RN: Sort Pragmas in Headers (#51554)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51554

Sorts pragma directives file headers in React Native.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75264593

fbshipit-source-id: 9e4b253dd0fc94dc2fc469d7114b93a8aae305f4
2025-05-22 21:18:53 -07:00
Panos Vekris 50ca7e5730 manual annotations in preparation of natural inference rollout in react-native, tools, etc.
Summary:
The Flow team is improving the way Flow infers type for primitive literals. This diff prepares the codebase for the new behavior by adding type annotations, or annotations of the form `'abc' as const`.

Changelog: [internal]

Reviewed By: marcoww6

Differential Revision: D75188179

fbshipit-source-id: be50990f23f79cf2d8dae7576af5190218adcafe
2025-05-21 20:06:46 -07:00
Dawid Małecki ddcab831b1 Migrate already root exported deep imports in rn-tester. (#50958)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50958

In rn-tester package there are many react-native deep imports which will be deprecated in the future. It is a starter for migrating rn-tester to using root imports instead. Only deep imports that are already root exported are changed. This diff avoids using `CodegenTypes` as it causes build errors and will be resolved in next stages.

Besides import changes, `PointerEvent` type is now also exported from the root.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73656526

fbshipit-source-id: 5814a3d9c6a04b1236581dbbe291cd109e2c71c0
2025-04-28 07:24:46 -07:00
Jakub Piasecki ebbb241bf8 Align layout event names with OSS (#49423)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49423

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D69655570

fbshipit-source-id: bd9b3dbc70b93c5be49e6a2b1b0487d11bf5b3f1
2025-02-18 07:26:13 -08:00
Iwo Plaza 2b30aa5cc8 Migrate Libraries/Utilities/differ/*.js to export syntax (#49332)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49332

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

## This diff
- Migrates `Libraries/Utilities/differ/*.js` to use the export syntax.
- Updates deep-imports of these files to use `.default`
- Updates codegen with a compat layer
- Updates the current iteration of API snapshots (intended).

Changelog:
[General][Breaking] - Deep imports to `Libraries/Utilities/differ/...` with `require` syntax need to be appended with '.default'.

Reviewed By: yungsters

Differential Revision: D69467423

fbshipit-source-id: 2e58a0b9711e9bdf5ca907a5b2252584f6fec9bc
2025-02-12 05:30:20 -08:00
Alex Hunt 45cd63c259 Back out "Migrate Libraries/Utilities/*.js to use export syntax." (#48976)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48976

Changelog: [Internal] - Will reattempt

Differential Revision: D68713280

fbshipit-source-id: 069d7dfd9846ab6272865b83163e772a6b17936a
2025-01-27 11:18:56 -08:00
Iwo Plaza 52ffda7e55 Migrate Libraries/Utilities/*.js to use export syntax. (#48665)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48665

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling

## This diff
- Updates files in Libraries/Utilities to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks of the `Platform` module, which happened to touch a lot of test files.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/Utilities` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: huntie

Differential Revision: D68152910

fbshipit-source-id: 07f3a0957f1dbaf44f53974c6f28b273558406eb
2025-01-24 09:17:55 -08:00
Iwo Plaza 135277ace1 Migrate AppState and BatchedBridge files to use export syntax. (#48737)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48737

## Motivation
Modernising the react-native codebase to allow for ingestion by modern Flow tooling.

## This diff
- Updates files in Libraries/AppState and Libraries/BatchedBridge to use `export` syntax
  - `export default` for qualified objects, many `export` statements for collections (determined by how it's imported)
- Appends `.default` to requires of the changed files.
- Updates Jest mocks.
- Updates the public API snapshot (intented breaking change)

Changelog:
[General][Breaking] - Files inside `Libraries/BatchedBridge` and `Libraries/AppState` use `export` syntax, which requires the addition of `.default` when imported with the CJS `require` syntax.

Reviewed By: robhogan

Differential Revision: D68275767

fbshipit-source-id: 97dc84c04a8dd9c9022e53fc4595302efc848338
2025-01-17 11:19:43 -08:00
Dawid Małecki f36bfe5dfa Remove redundant {||} syntax (#48686)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48686

Changelog:
[Internal] - Removed redundant `{||}` syntax

Reviewed By: javache

Differential Revision: D68205038

fbshipit-source-id: f7d3271142b6443a5859c3b668b7aebd3ce3ef3f
2025-01-15 07:07:01 -08:00
Fabrizio Cucci e8a64fd638 Migrate rn-tester/IntegrationTests/ImageCachePolicyTest.js to function components (#48701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48701

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68153254

fbshipit-source-id: 24789c814550cd592cb68a0576c5037088734a75
2025-01-15 06:11:21 -08:00
Fabrizio Cucci 8c64e0868e Migrate rn-tester/IntegrationTests/SimpleSnapshotTest.js to function components (#48700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48700

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152855

fbshipit-source-id: 121cb5dd65673121a021da12d10c7a7e118bd0dc
2025-01-15 06:11:21 -08:00
Fabrizio Cucci 086e93d227 Migrate rn-tester/IntegrationTests/AppEventsTest.js to function components (#48699)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48699

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152557

fbshipit-source-id: 9fa6cad408f6fbd3da513623379b864d0c33c63d
2025-01-15 06:11:21 -08:00
Fabrizio Cucci f864d6b533 Migrate rn-tester/IntegrationTests/ImageSnapshotTest.js to function components (#48698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48698

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152467

fbshipit-source-id: 0f747f1646be5a3ca010c2c0e0591f13bfcaf2f4
2025-01-15 06:11:21 -08:00
Fabrizio Cucci d1153ff468 Migrate rn-tester/IntegrationTests/PromiseTest.js to function components (#48697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48697

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152416

fbshipit-source-id: 32d6d503ed119f8d7e5b9c139060b61ef44b8768
2025-01-15 06:11:21 -08:00
Fabrizio Cucci 1a1714300e Migrate rn-tester/IntegrationTests/SyncMethodTest.js to function components (#48696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48696

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152294

fbshipit-source-id: 16b36d4702159528fe99c1a7d54c2c7b58d30349
2025-01-15 06:11:21 -08:00
Fabrizio Cucci c33954c80d Migrate rn-tester/IntegrationTests/GlobalEvalWithSourceUrlTest.js to function components (#48695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48695

As per title.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D68152232

fbshipit-source-id: 918236f8c9789efab9cc43b85e53fa398909808c
2025-01-15 06:11:21 -08:00
Fabrizio Cucci 9d1e24cb2f Migrate rn-tester/IntegrationTests/IntegrationTestHarnessTest.js to function components (#48671)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48671

As per title.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D68151272

fbshipit-source-id: 5d42da93ab4fe8aaf34b8916a6d0a234f51c235a
2025-01-14 12:18:41 -08:00
Fabrizio Cucci 51fb5ab87a Migrate rn-tester/IntegrationTests/AccessibilityManagerTest.js to function components (#48663)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48663

As per title.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D68151132

fbshipit-source-id: 6fd9c4999a95a6888795c5200aafb15ff623479f
2025-01-14 08:45:21 -08:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Gijs Weterings 67c1a806e6 Flow strictify xplat/js/react-native-github where possible (#41051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41051

Strictifies flow to flow strict-local in files where doing that doesn't cause new flow errors.

Changelog: Internal

Reviewed By: yungsters

Differential Revision: D50369011

fbshipit-source-id: b4a5a26b839b7327a3178e6f5b35246dea365a38
2023-10-18 05:36:33 -07:00
Phillip Pan 97efa25afa kill RCTRootViewIntegrationTests (#38871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38871

Changelog: [Internal]

these tests are the last callsite where we are getting event emitter off of RCTRootView... these particular tests have been disabled and they're like 8 years old, sooooooo i think it's just easier for me to delete them

Reviewed By: cipolleschi

Differential Revision: D48179389

fbshipit-source-id: 9fe36323606f53c9b6fde8b4c20d51a2cb1f6c9c
2023-08-22 19:45:27 -07:00
Alex Hunt f2316ed2a0 Add Flow typedefs for ws, fix usages
Summary: Changelog: Internal

Reviewed By: motiz88

Differential Revision: D48064192

fbshipit-source-id: d90736a4980464b8847929de763657b52abd2c08
2023-08-04 07:17:23 -07:00
Riccardo Cipolleschi bdeb09bada Re-enable iOS integration tests (#37571)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37571

During the RC.0 of 0.72, we disabled the iOS integration tests because they were not working with Metro and the new Monorepo setup.

This change tries to re-enable them so we can be more protected in CI

## Changelog:
[internal] - Re-enable integration tests

Reviewed By: cortinico

Differential Revision: D46178840

fbshipit-source-id: a5239fa7067b8fb68d997dd0cc63b67fb54d2d7e
2023-05-25 06:28:29 -07:00