Commit Graph

50 Commits

Author SHA1 Message Date
Sam Zhou 89fd398342 Update hermes-parser and related packages in fbsource to 0.32.0 (#53377)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53377

Bump hermes-parser and related packages to [0.32.0](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: gkz

Differential Revision: D80622389

fbshipit-source-id: d35ad5179eacbc83132517e6b9c9436fda972d28
2025-08-20 11:45:16 -07:00
George Zahariev c7591d9b40 Update hermes-parser and related packages in fbsource to 0.31.2 (#53313)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53313

Bump hermes-parser and related packages to [0.31.2](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D80408745

fbshipit-source-id: 38aff450c0e44db23624f4769f1c7856440fb785
2025-08-17 21:45:53 -07:00
Danny Su fb0e4ee6d1 Enable regenerator for Hermes dev mode transform profile (#52651)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52651

Changelog: [Internal]

Last year the `hermes-canary` profile was used to enable certain apps to use Static Hermes by enabling regenerator because debugger support for generator wasn't finished yet. However, we actually could have just keyed off of `options.dev` and still kept using `hermes-stable`.

The `hermes-canary` profile is actually meant to be used to run experiments. We should free up this profile to return it to the original intended purpose.

This diff makes all hermes profiles' dev mode use regenerator. Existing SH apps using `hermes-canary` should be unaffected. And apps using Hermes will change to use regenerator in dev mode, but that should be ok.

Reviewed By: robhogan

Differential Revision: D78450695

fbshipit-source-id: eb6a87fbc1f0e08d490fd0d1baa3611248f95764
2025-07-28 21:44:45 -07:00
Sam Zhou f47da61e51 Bump hermes-parser related packages across fbsource (#52841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52841

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D78949440

fbshipit-source-id: 5c5015f602b9fe591aa68f179163bd37dfb0dcff
2025-07-25 10:46:51 -07:00
Nicola Corti 9f0903780b Bump monorepo packages to 0.82.0-main (#52706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52706

This just prepares the repo for the next branch cut.

Changelog:
[Internal] [Changed] -

Reviewed By: cipolleschi

Differential Revision: D78558445

fbshipit-source-id: 2132d560dad447b3685874438387a519587f8554
2025-07-18 09:23:10 -07:00
Alex Hunt e247be793c Lower minimum Node.js version to 20.19.4 (#52678)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52678

From partner feedback, there's still appetite to support Node 20.x for the next <1y of life. Lower min version to `20.19.4` (Jul 2025) and widen test matrix in CI.

Changelog:
[General][Breaking] - Our new minimum Node version is Node.js 20 (Overrides #51840)

Reviewed By: cortinico

Differential Revision: D78494491

fbshipit-source-id: c8d9dc6250cb11f8a12ca7e761b65f4a8dae9265
2025-07-18 03:32:13 -07:00
Tim Yung 0508eddfe6 RN: Default Hermes Parser to reactRuntimeTarget: "19" (#52625)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52625

Changes `react-native/babel-preset` so that by default, `hermes-parser` is configured with `reactRuntimeTarget: "19"`. This changes the compiled output of Component Syntax to not use `forwardRef` when a `ref` prop is present.

Additionally, this adds a new preset option property, `hermesParserOptions`. This object allows users of `react-native/babel-preset` to supply overrides for any `hermes-parser` options.

Changelog:
[General][Changed] - Configures `react-native/babel-preset` to target React 19 by default, meaning Component Syntax will not compile to `forwardRef` calls when a `ref` prop is present.
[General][Added] - Added support to `react-native/babel-preset` for a `hermesParserOptions` option, that expects an object that enables overriding `hermes-parser` options.

Reviewed By: SamChou19815

Differential Revision: D78383269

fbshipit-source-id: 1e6b66b9bfbeaf8a06fdc39031cb6de7e921765f
2025-07-17 12:53:36 -07:00
Nicola Corti b578a70bd5 Bump packages for next release (#52359)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52359

This is needed ahead of the 81 branch cut.

Changelog:
[Internal] - Bump all packages to 0.81.0-main

Reviewed By: huntie

Differential Revision: D77602196

fbshipit-source-id: 1b52a7d1577783d72aba8d20f98032f29ffcc7df
2025-07-02 03:53:34 -07:00
George Zahariev 2e6cf96e47 Update hermes-parser and related packages in xplat/arvr/socialvr to 0.29.1 (#52316)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52316

Bump hermes-parser and related packages to [0.29.1](https://github.com/facebook/hermes/blob/static_h/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: rshest

Differential Revision: D77431991

fbshipit-source-id: d0ab4d7a338fdb68a529ed8151c7e1924600a809
2025-06-27 21:48:28 -07:00
George Zahariev 3306691d64 Update hermes-parser and related packages in xplat and socialvr to 0.29.0 (#52211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52211

Update hermes-parser and related packages in xplat and socialvr to 0.29.0

Changelog: [Internal]

Blocked on: https://fb.workplace.com/groups/relay.support/posts/28766057099682865

Reviewed By: SamChou19815

Differential Revision: D77004095

fbshipit-source-id: 5400ac07c0cbf1f9709d374929d842af9dd15d08
2025-06-23 19:19:50 -07:00
Tim Yung 742ffa39fb RN: Update Fantom Path in EXCLUDED_FIRST_PARTY_PATHS (#52051)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52051

In {D76368959}, I moved `react-native-fantom` from `packages/` to `private/` and missed this reference.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D76743071

fbshipit-source-id: f99d3f2ac5e14fd23f7cf208ca030541844dddc6
2025-06-17 02:59:42 -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
Tim Yung b344aec2ae RN: Add @noflow to ESLint & Babel Preset Files (#51778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51778

Adds `noflow` to a bunch of ESLint and Babel files that are expected to be evaluated using Node.js without Babel. Additioanlly, these files tend to depend on ESLint and Babel type definitions that are not currently readily available.

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: D75883642

fbshipit-source-id: 54236d123ca8773de42bce81189dfb5c0671563e
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
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
Tim Yung ba092bfaba RN: Add Missing @format Annotations (#51415)
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
2025-05-16 18:09:09 -07:00
Dawid Małecki a120c5c4db Ignore warnings for imports from react-native/Libraries/Core/InitializeCore (#50903)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50903

For now we do not change the way this module is exported to prevent breaking changes (due to high usage in external packages).  It is a tentative mitigation - this case requires more discussion and what could be sufficient. The `no-deep-imports` rule and plugin shouldn't emit a warning when encountered.

Changelog:
[Internal]

Reviewed By: huntie

Differential Revision: D73590627

fbshipit-source-id: 6f85c52373ee6c7c538c632b55cd9e0b9357f2a3
2025-04-28 05:32:11 -07:00
Dawid Małecki 3e14d1638c Add babel plugin to @react-native/babel-preset for console.warn injection under deep react native imports (#50802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50802

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
```

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/894).

Reviewed By: huntie

Differential Revision: D70783145

fbshipit-source-id: ae145db6471d861099566a8faf2fbd93bd136450
2025-04-24 08:04:21 -07:00
George Zahariev 6ad41f9a3f Update hermes-parser and related packages in xplat to 0.28.1 (#50803)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50803

Bump hermes-parser and related packages to [0.28.1](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: panagosg7

Differential Revision: D73242526

fbshipit-source-id: fbe0a233b4ae1315eb0e060c6338eb7156a5c6ea
2025-04-21 07:50:22 -07:00
Alex Hunt 16a61bf2ba Remove .npmignore files from other packages, add lint check (#50786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50786

Follows https://github.com/facebook/react-native/pull/50784. Having any `.npmignore` files is a gotcha — remove and replace with `package.json#files`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D73193257

fbshipit-source-id: de715d74195e4f53c817c11f244a61c79b8ce5bc
2025-04-17 12:48:28 -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
Evghenii Nicolaev d3daabfe2b Revert D71805075: Update hermes-parser and related packages in fbsource to 0.27.0
Differential Revision:
D71805075

Original commit changeset: 685194c12ac0

Original Phabricator Diff: D71805075

fbshipit-source-id: b28f0f83ad8b4f4f6b5e62fdc9ff323af79c1d43
2025-04-01 03:45:23 -07:00
Alex Hunt f13c8a7417 Update hermes-parser and related packages in fbsource to 0.27.0 (#50241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50241

Bump hermes-parser and related packages to [0.27.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D71805075

fbshipit-source-id: 685194c12ac037f74cc4fd54eb0d777a74507727
2025-04-01 01:01:05 -07:00
Joseph Nields 86911003dc Add compact option (#49979)
Summary:
If you use this preset to create library code, it is often helpful to be able to still read the transpiled code, even when sourcemaps are available.

This change adds a compact option which allows for disabling the default behavior that removes whitespace from the transpiled files.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [ADDED] - Add `compact` option to `react-native/babel-preset` to allow disabling whitespace removal

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Reviewed By: rshest

Differential Revision: D71109024

Pulled By: robhogan

fbshipit-source-id: ab205cca2a82b56955d1e1c55e288dcbe7754f8f
2025-03-13 09:22:23 -07:00
Alex Hunt e70961e05c Bump packages for next release (#49972)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49972

Follows the recent `0.79-stable` branch cut.

Changelog: [Internal] - Bump all packages to `0.80.0-main`

Reviewed By: cortinico

Differential Revision: D70976555

fbshipit-source-id: e81e4c45c6a510e114d02853c5bb90a715b7df8b
2025-03-12 05:11:16 -07:00
Riccardo Cipolleschi e77fe5c471 Bump React Native monorepo packages (#48975)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/48975

After cutting 0.78-stable, we need to bump the monorepo packages to `0.79.0-main`

## Changelog:
[Internal] - Bump monorepo packages to `0.79.0-main`

Reviewed By: cortinico, huntie

Differential Revision: D68715005

fbshipit-source-id: cb5abbf05e8638683687be8d61d66b3037111572
2025-01-27 11:01:34 -08:00
Alex Hunt 3de9892353 Skip hermes-parser under Babel for non-Flow JS code (#47568)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47568

Resolves https://github.com/facebook/hermes/issues/1549.

Changelog:
[General][Fixed] - When using Babel with plain JavaScript files, support for additional user syntax plugins should be fixed (now uses Babel's parser instead of hermes-parser). There is no change for JS files annotated with `flow`, where extended JS syntax remains unsupported.

Reviewed By: blakef

Differential Revision: D65816797

fbshipit-source-id: 9f05e86019548ac8727ee65c2e2c417d78a406d8
2024-11-21 05:41:39 -08:00
Alex Hunt 113337f269 Update hermes-parser and related packages in fbsource to 0.25.1 (#47573)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47573

Bump hermes-parser and related packages to [0.25.1](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D65816542

fbshipit-source-id: cb445eb77790fb2632d3bc318c6eb59f097b1518
2024-11-21 05:41:39 -08:00
Sam Zhou 94009f30e0 Update hermes-parser and related packages in fbsource to 0.24.0 (#46802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46802

Bump hermes-parser and related packages to [0.24.0](https://github.com/facebook/hermes/blob/main/tools/hermes-parser/js/CHANGELOG.md).

Changelog: [internal]

Reviewed By: javache

Differential Revision: D63797332

fbshipit-source-id: 98179d3cd777ff6824dfd10ceb7236a02dc6c9d6
2024-10-03 08:20:16 -07:00
Alex Hunt 1387f521fd Switch Babel parsing from legacy Flow plugin to hermes-parser (#46696)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46696

Following D62161923, we began to lose sync with modern Flow syntax when Metro's `transformer.hermesParser` option is disabled. This config option loads Babel for transformation (instead of `hermes-parser`), which requires a Babel plugin to parse (not strip) Flow syntax.

This diff migrates us away from `babel/plugin-syntax-flow` (see also https://github.com/babel/babel/issues/16264) and uses the modern [`babel-plugin-syntax-hermes-parser`](https://www.npmjs.com/package/babel-plugin-syntax-hermes-parser) instead (a component of the modern Hermes Parser stack).

Following this change, new projects that unset `transformer.hermesParser` will compile.

Resolves https://github.com/facebook/react-native/issues/46601.

Changelog:
[General][Fixed] - Fix parsing of modern Flow syntax when `transformer.hermesParser = false` is configured in Metro config

Reviewed By: cipolleschi

Differential Revision: D63535216

fbshipit-source-id: d2c6ddec030d89e2698e03b76194cf3568d04e6b
2024-09-27 10:20:19 -07:00
Riccardo Cipolleschi 120558c0cd Bump main to 0.77
Summary:
This change bumps the React Native version in main to 0.77

bypass-github-export-checks

## Changelog:
[General][Changed] - Bump main to 0.77-main

## Facebook:
generated by running `js1 publish react-native 0.77.0-main`

Reviewed By: cortinico

Differential Revision: D62575939

fbshipit-source-id: 6d239fca2eed6cfe51f8c37f78d8dc8730c18b8c
2024-09-12 09:23:23 -07:00
Vitali Zaidman b37101486b update babel and fix tests accordingly (#46295)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46295

X-link: https://github.com/facebook/metro/pull/1343

Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically):
### (D61336392) updated jest snapshot tests failing
### (D61336393) updated babel types and corrected typings accordingly
The latest babel 7 introduces the following features we need to adjust our types to:
* `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](https://github.com/babel/babel/pull/16421))
  * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense.
* Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](https://github.com/babel/babel/pull/15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings.
  * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later.

### Added a new metro ENV ignore
`BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK`
and then ignored in
`js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js`

Reviewed By: robhogan

Differential Revision: D61543660

fbshipit-source-id: abbcab72642cf6dc03eed5142eb78dbcc7f63a86
2024-09-05 07:11:17 -07:00
Alex Hunt ebf1a7b79b Bump packages for next major release (#45015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45015

Set package versions to `0.76.0-main` (`0.75-stable` branch was cut).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58687399

fbshipit-source-id: 27ed987e4557705845d57d64e7547cddbd982a03
2024-06-26 07:59:49 -07:00
Aakash Patel a0237e96f1 Enable regenerator transform for hermes-canary (#44668)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44668

Enables regenerator for `hermes-canary`. Along with the previous diff, regenerator is the only difference between `hermes-stable` and `hermes-canary`.

Reviewed By: motiz88

Differential Revision: D57742907

fbshipit-source-id: ca14cb50fe976744c7fa2c0b3397e81661359f15
2024-05-31 12:03:04 -07:00
Aakash Patel b5b497ff10 Align hermes-canary and hermes-stable profiles (#44728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44728

This makes them identical so the diff that makes them diverge is clear.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D57970711

fbshipit-source-id: 8586ef202ad27796918378832fa62df1708a0218
2024-05-31 12:03:04 -07:00
Tim Yung cdc3b9cdfc RN: Disable Babel Plugin for Arrow Functions for Hermes (#44534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44534

Reapplies {D50818568} (reverted by D50885400).

Changelog:
[General][Changed] - Disable Babel plugin for arrow functions for Hermes

Reviewed By: robhogan

Differential Revision: D57242622

fbshipit-source-id: 63ec2aeb7562dbb1a049dedd6a35b10aa822193c
2024-05-13 08:45:14 -07:00
kaganece 6213b2a62a fix: deprecated babel plugins issue fixed (#44416)
Summary:
In this pr, I updated the deprecated babel-plugins with their new library. When you enter the npm page of the relevant plugins, it is recommended to implement new packages instead of the deprecated package.
For example :

<img width="1305" alt="Screenshot 2024-05-05 at 17 50 16" src="https://github.com/facebook/react-native/assets/113903710/a58fdac3-79db-4b53-98bd-4c5325a1e560">

## Motivation:

We use the react-native package in our project and aim to upgrade pnpm to the latest version. First, we wanted to clear deprecated warnings. Babel plugin deprecated warnings were caused by the react-native package, so I created this pull request.
Deprecation Warnings from package installing :

<img width="581" alt="Screenshot 2024-05-05 at 17 53 05" src="https://github.com/facebook/react-native/assets/113903710/9c5859a5-f194-43ab-ae35-417dfaacebab">

## Changelog:

[GENERAL][FIXED] - Replace deprecated babel-plugin libraries to fix deprecation warnings on installation

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

Test Plan: CI should pass

Reviewed By: huntie

Differential Revision: D57056843

Pulled By: robhogan

fbshipit-source-id: b75b329bbc2105c31da85e861ef71ffdcbbb0623
2024-05-08 12:51:00 -07:00
Blake Friedman a380ea55fb Summary: minor fix found in nightly logs from Publish NPM job (#43519)
Summary:
Minor fix to package.json which newer version of npm warn about when publishing, after running `npm pkg fix -ws` on the workspace.

{F1470070110}

## Changelog: [Internal] npm pkg fix -ws

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

Test Plan: eyescloseddog

Reviewed By: cortinico

Differential Revision: D55012872

Pulled By: blakef

fbshipit-source-id: ff3c63a3eefaf56d369219a3d4b32d44d6d842c9
2024-03-18 08:29:10 -07:00
Alex Hunt f57be12977 Bump packages for next major release (#43132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43132

Command run:

```
node scripts/releases/set-version 0.75.0-main --skip-react-native-version
```

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54006327

fbshipit-source-id: 7afe9e7ca3020faf399fdba2221fab8a102c56c7
2024-03-04 07:54:37 -08:00
Saad Najmi 6d77d7b895 Format package.json files in the monorepo (#42256)
Summary:
Over in React Native macOS land, I opened https://github.com/microsoft/react-native-macos/pull/2030 to update our mono repo to use Yarn 4. As a side effect, all the `package.json` files are formatted as a side effect of running `yarn install`. So that React Native macOS doesn't maintain this diff (and because they should only be good / no harm), let's upstream the formatting changes.

## Changelog:

[INTERNAL] [CHANGED] - Format package.json files in the monorepo

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

Test Plan: This change should be a no-op, CI should pass.

Reviewed By: cortinico

Differential Revision: D52727623

Pulled By: huntie

fbshipit-source-id: 67862b16d576b0903abd91e016d7add4c19853dc
2024-01-22 07:15:05 -08:00
Luna Wei b5e08e80d9 Remove * dependencies on @react-native (#42081)
Summary:
See https://github.com/facebook/react-native/issues/41929 for an issue on multiple monorepo packages being installed. The reason is that `*` resolves to whatever is tagged `latest` on npm.

We still need to fix the fact that our monorepo publish script will update the latest tag everytime we publish. For now, we should remove these from `main` and we will also update this in the 0.73 release branch.

I've left the two peer dependencies on `react-native` to keep at `*`.
```
virtualized-lists/package.json
30:    "react-native": "*"

rn-tester/package.json
32:    "react-native": "*"
```

As a peer-dependency this won't be a problem in terms of installing a second `react-native`. I thought about updating these to `nightly`, but that would install multiple nightly react-natives as the tag will be updated with each nightly release. I think for now this is fine and something we can revisit.

Things left to do
[ ] Fix monorepo publish script to not update `--latest`
[ ] Remove ^ dependencies on monorepo packages: https://github.com/facebook/react-native/pull/41958
[ ] Re-evaluate how we bump and align monorepo packages when we cut a release branch. I forget if we manually update this when we cut or if there is a script. We may want to change the script and have `main` dependencies point to some fake version like `1000.0.0` and only update these on nightly publishes. Regardless, this will need some discussion.

## Changelog:

[GENERAL] [CHANGED] - Be explicit about what monorepo versions we are using

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

Test Plan: N/A

Reviewed By: cortinico, cipolleschi

Differential Revision: D52435234

Pulled By: lunaleaps

fbshipit-source-id: 67da029d2b637e3997c12c21fe2a9ab9bc344399
2023-12-28 09:54:00 -08:00
Jon Thysell (JAUNTY) c90485eb10 Add detection of logical assignment operators to react-native-babel-preset (#39186)
Summary:
Though not currently in use in the RN code, when `react-native-windows` tried to integrate changes up to 7/28/23 (see PR https://github.com/microsoft/react-native-windows/pull/11970) there happened to be a `??=` operator in the `virtualized-lists` package (see [diff here](https://github.com/facebook/react-native/compare/ccc50ddd2...c168a4f88#diff-abeff2daf5909e54a23562e43569de1d5b8db1d7170119eed485b618cdf04ec7R322)). (The offending line was removed in a later commit).

The default RNW engine is still Chakra and it couldn't handle the syntax. It looks like the `babel/plugin-proposal-nullish-coalescing-operator` plugin only handles `??`, so to handle `??=` I've added `babel/plugin-proposal-logical-assignment-operators`, which also happens to handle the logical assignment operators `||=` and `&&=`.

Closes https://github.com/facebook/react-native/issues/31704

## Changelog:

[GENERAL] [FIXED] - Add detection of logical assignment operators to `react-native-babel-preset`

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

Test Plan: We started using these plugins in RNW's babel config to resolve the issue in our integrate PR.

Reviewed By: motiz88

Differential Revision: D50936554

Pulled By: rozele

fbshipit-source-id: 0a924b6085524d8c9551a158b91195b1f7448c19
2023-11-06 08:52:25 -08:00
Gijs Weterings f3a916f3ae Back out "Apply Babel arrow transform only when needed" (#41282)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41282

Original commit changeset: ad96540bb777

Original Phabricator Diff: D50818568

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D50885400

fbshipit-source-id: b5039b6430e48a3b87456758bf4fef6cc182ee8f
2023-11-01 09:22:33 -07:00
dan 9a3b75c782 Apply Babel arrow transform only when needed (#41253)
Summary:
Hermes supports arrows. I assume the only reason the transform wasn't dropped is due to the scary TODO.

Originally, the arrow transform was conditional like this:

```js
  if (isNull || src.indexOf('=>') !== -1) {
    extraPlugins.push(es2015ArrowFunctions);
  }
```

I made it unconditional in https://github.com/facebook/metro/commit/beb3d1ab5dc46a856e0810f3c0787f8885c8f654 (D15947985) to work around an issue where React Refresh Babel plugin emitted arrow functions. However, I fixed that plugin to _not_ emit arrow functions a long time ago in https://github.com/facebook/react/pull/15956. So this TODO is effectively solved, and has been, for ages.

In this commit, we:

- Skip the transform for Hermes altogether
- For non-Hermes, revert to the old conditional behavior

Possible alternatives:

- We could skip it for Hermes but apply unconditionally otherwise (a bit simpler)
- Or, if all target non-Hermes runtimes already support it natively, we could completely remove it

## Changelog:

[GENERAL] [CHANGED] - Apply Babel arrow transform only on non-Hermes

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

Test Plan: Run fbsource tests (that's for you, not for me :)

Reviewed By: NickGerleman

Differential Revision: D50818568

Pulled By: robhogan

fbshipit-source-id: ad96540bb7778792d38a6ddec06999d2acf620d0
2023-10-31 05:55:26 -07:00
Alex Hunt f40bb9331c Bump package versions for next major (#39764)
Summary:
#publish-packages-to-npm

Bump all package versions to `0.74.0` (next major release) for `main`, following instructions at https://reactnative.dev/contributing/release-branch-cut-and-rc0#12-bump-minor-version-of-all-monorepo-packages-in-main.

```sh
yarn bump-all-updated-packages --release-branch-cutoff
```

Changelog: [Internal]

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

Test Plan: —

Reviewed By: robhogan

Differential Revision: D49871039

Pulled By: huntie

fbshipit-source-id: f4df6efeae4d8a9209e7aae7b9e6fea3d15793b5
2023-10-11 08:36:23 -07:00
evanbacon 030663bb06 bump react-refresh to latest (#39486)
Summary:
- Companion PR to https://github.com/facebook/metro/pull/1085
- The Fast Refresh changes appear to be required for using static rendering and React DOM. In frameworks like Expo Router which support both native and web, this causes users to not be able to use Fast Refresh on web.

## Changelog:

[GENERAL] [CHANGED] - Upgrade React Refresh package from 0.4.0 to 0.14.0

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

Test Plan:
1. In a React Native project's `package.json`:
```json
 "resolutions": {
    "react-refresh": "~0.14.0"
  },
```
2. Start the server with a clear Metro cache.
3. Changes should update while preserving React state.

Reviewed By: huntie

Differential Revision: D49348078

Pulled By: robhogan

fbshipit-source-id: ac3dcb096c35c6c29c6e6a919cf263559bceaa7c
2023-09-24 07:16:28 -07:00
Dmitry Rykun 59e6b11fbc Add @react-native/babel-plugin-codegen to the preset if src is null (#39159)
Summary:
X-link: https://github.com/facebook/metro/pull/1078

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

Source is not required for `getPreset` of `react-native/babel-preset`. There is a codition that adds `react-native/babel-plugin-codegen` to the preset only if source is passing certain regex. This condition fails if source is null, but that's wrong because the plugin may still be requred for this transformation even though source is not provided.
This diff changes the condition so the regexp tests source only if it is not null, and `react-native/babel-plugin-codegen` automatically added to the preset otherwise.
Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D48684443

fbshipit-source-id: 7cea69c91c0175ac0374d72e91f58e20fe75fd53
2023-09-14 08:25:40 -07:00
Tim Yung db4a253c1e RN: Support Private Methods & Properties (#39318)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39318

Updates `react-native/babel-preset` to support private methods and properties.

Changelog:
[General][Added] Added plugins for private methods and properties to `react-native/babel-preset`.

Reviewed By: asiandrummer

Differential Revision: D49029339

fbshipit-source-id: 2e0578886b22770d3f037ce184b842ee15a59c8e
2023-09-11 13:39:50 -07:00
Dmitry Rykun 1c3b3a09b6 Add @react-native/babel-plugin-codegen to @react-native/babel-preset (#38227)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38227

X-link: https://github.com/facebook/metro/pull/1023

This diff enables react-native/babel-plugin-codegen to react-native/babel-preset. This will enable static view configs generation for properly schematized native components.

Changelog: [General][Changed] - react-native/babel-plugin-codegen to react-native/babel-preset

Reviewed By: christophpurrer

Differential Revision: D46688516

fbshipit-source-id: ebecc5fd610ca4b86c55355879ad3fd36d51cae9
2023-08-01 07:49:23 -07:00
Dmitry Rykun d380bb8473 Move react-native-babel-transformer and react-native-babel-preset from Metro to React Native repo (#38228)
Summary:
X-link: https://github.com/facebook/metro/pull/1024

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

Changelog: [General][Changed] - Move react-native-babel-transformer and react-native-babel-preset from Metro to React Native repo.

Metro Changelog:  **[Breaking]** - Remove `metro-react-native-babel-transformer` and `metro-react-native-babel-preset`, to be published as `react-native/metro-babel-transformer` and `react-native/babel-preset` instead.

This diff does the following:
- Move `metro/packages/metro-react-native-babel-preset` to `react-native/packages/react-native-babel-preset`.
- Rename `metro-react-native-babel-preset` package to `react-native/babel-preset`.
- Move `metro/packages/metro-react-native-babel-transformer` to `react-native/packages/react-native-babel-transformer`.
- Rename `metro-react-native-babel-transformer` package to `react-native/metro-babel-transformer`.
- Upadate dependencies.

Reviewed By: robhogan

Differential Revision: D46977466

fbshipit-source-id: 32478f63a0442b61a1804f12ef814c8b29d7f8bb
2023-07-27 11:48:16 -07:00