Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52235
Adds `organizeDeclarations` transform, replacing `sortTypeDefinitions`.
All `export declare ...` statements are now collected and represented at the end of the snapshot in a single `export {}` block — significantly improving readability and diffing.
Changelog: [Internal]
Reviewed By: j-piasecki
Differential Revision: D77150017
fbshipit-source-id: 1bd451c0e2a18fd6fc0504970b10a5d2502ac872
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52228
To avoid unexpected behaviour, apply all Babel transforms within `build-types` sequentially, so that each transform plugin has an accurate starting AST.
Changelog: [Internal]
Reviewed By: j-piasecki
Differential Revision: D77148444
fbshipit-source-id: f86beac12b7a08ef800e28db1ff88755970cf64e
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
Summary:
Following up from https://github.com/facebook/react-native/pull/52064#discussion_r2151906096, this PR removes lint-java and its related files.
The codebase is moving entirely to Kotlin and a Kotlin linter is being setup as well, the usage of the Java linter will become unnecessary.
## Changelog:
[INTERNAL] - Remove lint-java
Pull Request resolved: https://github.com/facebook/react-native/pull/52092
Test Plan: Relying on CI here to be green.
Reviewed By: cortinico
Differential Revision: D76880712
Pulled By: sbuggay
fbshipit-source-id: 2736772e7347f435b17d007e0322e1afc2fb2d7b
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
Summary:
This diff adds snapshot `diff-api-snapshot` script for public JS API breaking change detection.
### Motivation
Detecting if there are any breaking changes introduced in the commit. It is achieved by comparing `ReactNativeApi.d.ts` rollup from the current and previous revision.
This is a naive implementation with a three possible outcomes:
- BREAKING
- POTENTIALLY_NOT_BREAKING,
- NOT_BREAKING
The algorithm analyses exported top-level statements (after inlining) in both rollups and tries to create a mapping between them by name.
The **BREAKING** outcome happens whenever the statement is:
- removed
- renamed
- changed
- not exported anymore (private)
The **POTENTIALLY_NOT_BREAKING** outcome happens if it's not BREAKING and the new statement is added.
The **NOT_BREAKING** outcome happens if public API snapshot doesn't change.
Changelog:
[General][Added] - Add public JS API breaking change detection under `yarn diff-api-snapshot` script.
Pull Request resolved: https://github.com/facebook/react-native/pull/51972
Test Plan:
Signals, added tests.
In `react-native-github` run:
`yarn test scripts/diff-api-snapshot/__tests__/diffApiSnapshot-test.js`
Rollback Plan:
Reviewed By: j-piasecki
Differential Revision: D76430965
Pulled By: coado
fbshipit-source-id: 095a196aa4f643501db0af9262556ddefff5d30d
Summary:
While testing I notice that `types/react` was not updated in some peer depencies
## Changelog:
[GENERAL] [CHANGED] - Bump types/react to 19.1
Pull Request resolved: https://github.com/facebook/react-native/pull/52059
Test Plan: CI should be green
Reviewed By: christophpurrer
Differential Revision: D76763084
Pulled By: sbuggay
fbshipit-source-id: c078c03aa57ca04040c64986dd7957da8a6f2c2d
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51946
This change simplified the setp disallowing to use JSC from core.
As a side effect, it simplified the setup by always falling back to hermes if the users decides not to use the third party JSC
## Changelog:
[iOS][Removed] - remove the option to use JSC from core
Reviewed By: cortinico
Differential Revision: D76342625
fbshipit-source-id: c925ab4fab1e171e289a1c5f75890c92da1b3f08
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51893
This diff adds `--validate` flag that runs snapshot validation to determine if the `ReactNativeApi.d.ts` rollup has been changed (if JS public API has been touched). There was also an issue with `sortProperties` that reordered some properties (ex. in ImagePropsBase) after removing one of them (ex. accessible) which had negative impact on the displayed result.
### Motivation
Compare previous snapshot with the one built on the current revision to determine the impact of made changes on the public API surface. Display differences in human readable format using `diff` method from the `jest-diff` library.
For now `--validate` flag is not useful on its own. It should be used with `--withSnapshot` flag (which will be removed shortly and generating snapshot will be a default mechanism).
Changelog:
[General][Added] - Add `--validate` flag to `build-types` script for JS API snapshot validation.
Reviewed By: huntie
Differential Revision: D76135158
fbshipit-source-id: 53f5b142c66e3e3931961f741c3f2fab8ccdc228
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51937
Updates the `set-versions` script to also update workspace packages in `private/*`. Unlike with packages in `packages/*`, this does not change their `"version"` fields, though. It only updates their dependencies.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D76358273
fbshipit-source-id: d0e0557d17c355828020a218083b98dd177a6732
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51865
As in 0.81 we're stopping 1st party support for JSC, we can now cleanup the RNTester
flavor for JSC and simplify the setup here.
Changelog:
[Internal] [Changed] -
Reviewed By: rshest
Differential Revision: D76051319
fbshipit-source-id: 79b01cc64af2466a0be47ceaa0cd211cb6b02f53
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51808
Pull Request resolved: https://github.com/facebook/react-native/pull/50292
## This diff
Generates types via `yarn build-types` and verifies them on the basis of react-native/types/__typetests.
Changelog: [Internal]
Reviewed By: robhogan
Differential Revision: D71902007
fbshipit-source-id: 43cb2321e9feea11b0caa4362140c86b1847db85
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51780
Adds `flow` to the remaining files that are lacking it (or `noflow`) in the `scripts` directory.
This also fixes what I believe to be a typo in one of the files.
Changelog:
[Internal]
Reviewed By: SamChou19815
Differential Revision: D75883851
fbshipit-source-id: 928b7a12a08269b6643379d46de888f2c61dcb29
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51653
Changelog: [Internal]
Adds a transform that ensures no types and interfaces named `Props` end up in the generated TypeScript definitions. Those are not descriptive and cause duplicate types in the rollup.
Reviewed By: huntie
Differential Revision: D75508800
fbshipit-source-id: 8d64ec19cbabe57495d6462df9d372ba42cda618
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51745
Changelog: [Internal]
1. Updates debugger-frontend's sync-and-build script to include a simple Markdown changelog inline and -mention authors who are Meta employees.
2. Also adds a `--no-build` flag that is mainly helpful for iterating on changelog generation logic.
Reviewed By: hoxyq
Differential Revision: D75789680
fbshipit-source-id: b30b49a9c50e93e7161a2dad012b92ef124a3a16
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51497
It removes `prepare-flow-api-translator` which is no longer needed as `flow-api-translator` version was bumped already and it blocks `build-types` script from running on CI (due to reference to `flow-api-translator` source). It also removes "Experimental" annotations.
Changelog:
[Internal]
Reviewed By: huntie
Differential Revision: D75138541
fbshipit-source-id: 897009c91adeeeaae21603dbf90020b52b61c5d5
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51426
Fixes a bunch of ESLint warnings across the codebase.
The only remaining warnings are from the `lint/no-commonjs-exports` rule.
Changelog:
[Internal]
Reviewed By: SamChou19815
Differential Revision: D74942686
fbshipit-source-id: 384de34c7297f7f7fcff1827c8b2e46714a5cda7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51415
Adds the `format` annotation to all files that were missing them.
Also, adds `noformat` to generated files, and removed it from files that no longer need them.
Changelog:
[Internal]
Reviewed By: SamChou19815
Differential Revision: D74901034
fbshipit-source-id: 7e0b85ca8ee2de41278f3aa23cb03e9c266d9c28
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