Commit Graph

25 Commits

Author SHA1 Message Date
Sam Zhou 0530ea3349 Migrate to suppression with error code in xplat: 1/n (#53439)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53439

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D80809220

fbshipit-source-id: 6f432d8302934b9fee9780ac1d6ba6c87c0b3899
2025-08-22 10:35:39 -07:00
Sam Zhou 16fa3d5da4 Update prettier-plugin-hermes-parser in fbsource to 0.31.1 (#52996)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52996

Bump prettier-plugin-hermes-parser to 0.31.1.

Changelog: [internal]

Reviewed By: pieterv

Differential Revision: D79481936

fbshipit-source-id: 4decd5c92722f935a6a03b6d2205bc31b864fb5d
2025-08-01 20:18:36 -07:00
Moti Zilberman 2d68a733f8 Fix run-ci-javascript-tests script (#52364)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52364

Changelog: [Internal]

D76512374 broke error reporting in `run-ci-javascript-tests.js`. This is partly because the file was untyped and we missed that the `.code` check on the result of `execSync` was always going to be falsy. Also, `execSync`'s default error handling mechanism is not human-friendly - it throws an `Error` with `Buffer`s for stdout and stderr (see [example](https://github.com/facebook/react-native/actions/runs/16003656383/job/45144825919?pr=52357&fbclid=IwY2xjawLRyfpleHRuA2FlbQIxMQBicmlkETFZSG1xeWhTWWczR1paS0lKAR4pF46Z-J2CbSk7YdHZJ-N3F9eQJ7hR4EowfLV6mUtzMLg8j-EWdZiGY1la6A_aem_1Zbvn6fD5NS9YO-B7QJssg)).

Here, I'm adding types, removing dead code and preserving stdout and stderr from all child processes in a human-readable format.

Reviewed By: huntie

Differential Revision: D77648312

fbshipit-source-id: c6d98e668d6edf15729fa02fecb3408b9dd6debc
2025-07-02 03:09:18 -07:00
Dawid Małecki 128f5eb9ac Validate RN JS API snapshot on CI (#52352)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52352

This diff adds excution of `yarn build-types --validate` to run RN JS API snapshot validation on CI.

### Motivation

Detect react-native public API changes before they land.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76340729

fbshipit-source-id: 10c465418e0ba4eb05cf557a16119f9756843d9e
2025-07-01 08:58:15 -07:00
Dawid Małecki 76e04fac82 Replace shelljs in run-ci-javascript-tests.js (#52095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52095

This diff removes `shelljs` from `run-ci-javascript-tests.js` and replaces `echo, exec, and exit` methods.

### Motivation

Decrease number of references to `shelljs` across the react-native-github.

Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D76512374

fbshipit-source-id: 6e02901b570cf9a36bd13a075106a7066a85a2d9
2025-06-23 09:39:44 -07:00
Tim Yung 1b0851515e RN: Move {packages => private}/react-native-codegen-typescript-test (#51936)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51936

Moves `packages/react-native-codegen-typescript-test` to `private/react-native-codegen-typescript-test`.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D76357099

fbshipit-source-id: c00d19d1393aa9bc8059e30f837a045169776b50
2025-06-11 17:39:26 -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
Tim Yung cc9074884a RN: Add @noflow to Node.js Scripts (#51779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51779

Adds `noflow` to a bunch of Node.js script files.

In the future, these files could be migrated to use `flow strict-local` or `flow strict` using comment syntax for type annotations. But for now, adding `noflow` makes it explicit that these are known to not be typechecked.

Changelog:
[Internal]

Reviewed By: SamChou19815

Differential Revision: D75883703

fbshipit-source-id: a8fed3aaa9c55ecda919a705940f8b34504cb07c
2025-06-04 12:03:52 -07:00
Dawid Małecki 2e0c2c6df1 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-16 08:08:25 -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
Blake Friedman 05b4146270 ci: verify JS build artifacts aren't committed (#48091)
Summary:
Building our JS packages dirties the repo. This makes sure we don't
accidentally commit these to the repo, as it'll break Flow tests with an
obscure error message.

Changelog: [Internal]

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

Test Plan:
Ran this locally, the GH lint action should run on this PR.
I'll intentionally add a build artifact to validate.
| A | B | C |
| - | - | - |
| ![CleanShot 2024-12-04 at 14 11 16@2x](https://github.com/user-attachments/assets/11c05c32-12c8-4d85-9a28-b3bdffb42ea0) | ![CleanShot 2024-12-04 at 14 11 22@2x](https://github.com/user-attachments/assets/b4c4f1dc-2cb9-4138-8931-13e71c015a6d) | ![CleanShot 2024-12-04 at 14 19 31@2x](https://github.com/user-attachments/assets/953bf783-57ba-4832-bbd8-b36e23a2ccb4) |

Reviewed By: cipolleschi

Differential Revision: D66760144

Pulled By: blakef

fbshipit-source-id: 81f20fa0a83d5f17b5773d1608664b683ba74409
2024-12-06 13:21:23 -08:00
Rubén Norte 66df63d3b5 Generalize feature flags script (#47208)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47208

Changelog: [internal]

Small change to unify the yarn commands for feature flags into a single `featureflags` command with options.

Reviewed By: NickGerleman, mdvacca

Differential Revision: D64982509

fbshipit-source-id: 3f9d7ac35f61950bd03fef243e1a95625144a0cd
2024-10-29 08:02:54 -07:00
Tim Yung e175912e7d RN: Fix Open Source Test Scripts
Summary:
Changelog:
[Internal]

Reviewed By: NickGerleman

Differential Revision: D55502889

fbshipit-source-id: aabba96bd816982f7bce9cbd752ba9eee409bbf6
2024-03-29 01:42:24 -07:00
Rubén Norte 5e66f41697 Implement new feature flag system (re-land) (#42678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42678

Changelog: [internal]

This is a re-application of https://github.com/facebook/react-native/pull/42430, which had to be reverted because of crashes in optimized builds on Android:

```
Abort Reason: terminating due to uncaught exception of type facebook::jni::JniException: java.lang.ClassNotFoundException: com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsProvider
```

The root cause of that was that that class was removed because it wasn't statically referenced from Kotlin/Java, but it was dynamically referenced from C++ (in `ReactNativeFeatureFlagsProviderHolder.cpp`).

This applies the same changes + adds `DoNotStrip` annotations for the affected class and all its methods.

Reviewed By: huntie

Differential Revision: D53122992

fbshipit-source-id: efc4d5636a3f2d39b86e9c098bff408b6688b80b
2024-01-26 09:55:27 -08:00
David Vacca ffaeaba213 Back out "Implement new feature flag system"
Summary:
Original commit changeset: 0ba95803f61e

Original Phabricator Diff: D52806730

bypass-github-export-checks

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D53113947

fbshipit-source-id: ace1222a861a739fcd3f4b0e12c135db47a93344
2024-01-25 21:52:59 -08:00
Rubén Norte 705c675d51 Implement new feature flag system (#42430)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42430

This PR creates a new internal feature flags system for React Native. This is only meant to be used internally within the framework, but we might expose it externally in some form in the future to allow customizing specific feature flags in frameworks and applications.

Features:
* 2 types of flags:
  * Common: can be overridden from native and are accessible from all layers of the stack (Objective-C/Swift, Java/Kotlin, C++ and JavaScript).
  * JS-only: flags that can only be defined and accessed from JS (to allow things like hot reloading without a native build).
* 1 source of truth for each flag.
* Feature flags are application/process scoped (using C++ singletons).

See the `README.md` file in this PR for additional information.

This also adds modifies `run-ci-javascript-tests` to run a new check to make sure that the generate files are in sync with the JSON file that contains the definitions.

Changelog: [internal]

Reviewed By: huntie

Differential Revision: D52806730

fbshipit-source-id: 0ba95803f61ec2f05266ee535921321bf6d3dc6a
2024-01-25 13:55:11 -08:00
Gijs Weterings d4ad19c969 Revert D49370200: Migrate codegen to shared build setup, remove package build pre-step from RNTester
Differential Revision:
D49370200

Original commit changeset: 992913155169

Original Phabricator Diff: D49370200

fbshipit-source-id: e8232c97c22065fb54ac940ee2351b2155eb51e0
2023-10-23 12:00:54 -07:00
Alex Hunt 4db31a3110 Migrate codegen to shared build setup, remove package build pre-step from RNTester (#39540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39540

This simplifies the use of Codegen when creating dev builds of `rn-tester` in the monorepo. It now runs from source for this internal scenario, and this package is now built using the shared monorepo build setup.

Changes:
- Migrate `packages/react-native-codegen` to the shared `yarn build` setup.
    - Update package to use `"exports"` field and wrap entry point modules with `babel-register` (NOTE: This is only required for each entry point internally used in the monorepo).
- Fixup small Flow syntax quirks that fail under `hermes-parser`.
- Remove `BuildCodegenCLITask` task from Android build.
- Remove Codegen `build.sh` call from iOS build, use `require.resolve` for `combine-js-to-schema-cli.js` entry point.

Externally significant FYIs:
- `react-native/codegen` is converted to use the `"exports"` field — it should export all `.js` files, as before.
- `codegenPath` is now ignored and marked as deprecated on `ReactExtensions.kt`.

NOTE: TypeScript auto-generation is not yet enabled on this package, since it uses CommonJS `module.exports` syntax (unsupported by `flow-api-translator`).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D49370200

fbshipit-source-id: 992913155169912ea1a3cb24cb26efbd3f783058
2023-10-23 08:32:33 -07:00
Sam Zhou 246b5cf414 Remove CI check jobs on .flowconfig.android in react-native (#39158)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39158

.flowconfig.android is the same as .flowconfig now. The check is meaningless. This diff removes it and the flowconfig.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D48629137

fbshipit-source-id: bc1bee9426eed7bc41dc7a1efe75333e1191e066
2023-08-26 10:00:22 -07:00
Zihan Chen (MSFT) 9bb71650c9 Add @react-native/codegen-typescript-test to verify .d.ts files in @react-native/codegen (1) (#36562)
Summary:
- Add a typescript project to test `CodegenSchema.d.ts`. More tests for other .d.ts files will be added in future pull requests.
- The build script scans all snapshots from `react-native/codegen`'s typescript frontend and generates .ts files for each snapshot, but they are .gitignore-ed.
- `npm run build` will build these .ts files against `CodegenSchema.d.ts` after generating them.
- A failed jest case is included to ensure CI catch it, it will be removed before merged.

bypass-github-export-checks

## Changelog:

[General] [Added] - Add react-native/codegen-typescript-test to verify .d.ts files in react-native/codegen (1)

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

Test Plan:
`npm run build` in `packages/react-native-codegen-typescript-test` and see all test files appear in `__generated__`.

## Screenshot

![Untitled](https://user-images.githubusercontent.com/53799235/226757755-cab4cb29-7d22-46a1-9ecb-d6732122ed38.png)

Reviewed By: rshest

Differential Revision: D44292277

Pulled By: cipolleschi

fbshipit-source-id: 8d79fe913f9563d64c92aae7c4f4e97a24ae9a21
2023-04-05 07:38:25 -07:00
Nick Gerleman c4862a2322 Fix Errors with TypeScript Tests
Summary:
This fixes some style errors found by dtslint, along with some test cases for StyleSheet.compose() where the recent change made it slightly too permissive when explicit return types are given. I also added runs of the TS tests to a script which runs in sandcastle so we can catch this at diff-submission time in the future.

Changelog:
[General][Fixed] - Fix Errors with TypeScript Tests

Reviewed By: lunaleaps

Differential Revision: D42085257

fbshipit-source-id: 7e6ca49d3c3aef822c61c97ecc07b55b0a949d51
2022-12-15 19:17:58 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Luna Wei 8583d39327 Clean up: remove eslint-disable no-undef in test_js* scripts
Summary: Changelog: [Internal] - Clean up - Remove `eslint-disable no-undef` by not requiring `shelljs/global`

Reviewed By: cortinico

Differential Revision: D33197964

fbshipit-source-id: 2e36fc10bf4e3230b8ae914f48d244446da43973
2021-12-21 11:49:40 -08:00
Héctor Ramos d65daa0d3f Add react-native-oss-e2e job to Sandcastle, running JavaScript e2e tests from open source
Summary: Remove unused path variable from open source JavaScript test script.

Reviewed By: cpojer

Differential Revision: D14899083

fbshipit-source-id: 880102d404ca72c352a20654cb12263d98945a8b
2019-04-15 11:07:54 -07:00
Héctor Ramos 5bac2b761e Run the same JavaScript test script in Sandcastle and Circle (#24422)
Summary:
Consolidate JavaScript tests from open source into a single script that can be executed by both Circle CI and Sandcastle, the internal Facebook CI.

[General] [Changed] - Switch internal and external CI to use the same script when running JavaScript tests

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

Reviewed By: cpojer

Differential Revision: D14895773

fbshipit-source-id: d428929cc4e5219e02f5920259e08e0b3d24874c
2019-04-12 09:54:09 -07:00