Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/54009
Packages haven't been bumped on main ahead of 0.83. This takes care of it.
Changelog:
[Internal] [Changed] -
Reviewed By: cipolleschi, huntie
Differential Revision: D83580515
fbshipit-source-id: 7471e77f74e3fb3b4ee6538a49369b5df1393098
Summary:
`react-native/codegen` uses `babel/parser` and `babel/core` but does not declare dependency on them. Depending on how packages are hoisted (and especially in pnpm setups), this causes crashes during codegen.
Resolves https://github.com/facebook/react-native/issues/52883
## Changelog:
[GENERAL] [FIXED] - Add missing Babel dependencies
Pull Request resolved: https://github.com/facebook/react-native/pull/52884
Test Plan: See https://github.com/facebook/react-native/issues/52883
Reviewed By: cortinico, christophpurrer
Differential Revision: D79103092
Pulled By: robhogan
fbshipit-source-id: ecaf690f994393a652ea7f0d4f30bbabeb23a434
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
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
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
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:
- Update ignore micromatch pattern to filter out `__test_fixtures__` from build output
- Remove `babel/plugin-transform-object-rest-spread`
- Remove `babel/plugin-transform-async-to-generator`
- Remove `babel/plugin-transform-destructuring`
The `package.json:engines:node` field is already set to `>=18` which makes the three Babel transforms that were removed redundant.
## Changelog:
[INTERNAL] [CHANGED] - Remove fixtures files and outdated Babel transforms from `react-native/codegen` build output
Pull Request resolved: https://github.com/facebook/react-native/pull/49916
Test Plan: - Ran against Node 18
Reviewed By: robhogan
Differential Revision: D70885090
Pulled By: cortinico
fbshipit-source-id: 328b75a6031a7ca6a9b3ed170061ffb0a47d6d93
Summary:
`jscodeshift` is only used in one module (`src/generators/components/GenerateViewConfigJs.js`, but depends on a rather complex dependency chain and has a rather large maintenance burden relative to what it's used for and the value it adds in the codebase.
Since the `GenerateViewConfigJs` module creates simple templates, using `babel/core` (and implicitly `babel/template` and `babel/types`) is a lot simpler and changes little code. The only change this introduces to the output are formatting changes (`singleQuote` and `trailingCommas` options are discarded). The code is otherwise functionally identical.
## Changelog:
[INTERNAL] [CHANGED] - Drop jscodeshift dependency from react-native/codegen
Pull Request resolved: https://github.com/facebook/react-native/pull/49641
Test Plan:
This was tested against a React Native build with the `react-native/babel-plugin-codegen` plugina active and using the snapshots in the repo itself. While the snapshots have changed in formatting, none of the outputs change the code's AST.
<details>
<summary>
Example output from <code>react-native/babel-plugin-codegen</code> to supplement the snapshot tests
</summary>
This is the example bundling output of `AndroidSwipeRefreshLayout`. This demonstrates that both the view config output and the `Commands` export continue to be generated correctly.
```js
var _interopRequireDefault = require(_dependencyMap[0]);
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.__INTERNAL_VIEW_CONFIG = exports.Commands = undefined;
var _codegenNativeCommands = _interopRequireDefault(require(_dependencyMap[1]));
var _codegenNativeComponent = _interopRequireDefault(require(_dependencyMap[2]));
var React = _interopRequireWildcard(require(_dependencyMap[3]));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
var NativeComponentRegistry = require(_dependencyMap[4]);
var _require = require(_dependencyMap[5]),
ConditionallyIgnoredEventHandlers = _require.ConditionallyIgnoredEventHandlers;
var _require2 = require(_dependencyMap[6]),
dispatchCommand = _require2.dispatchCommand;
var nativeComponentName = 'AndroidSwipeRefreshLayout';
var __INTERNAL_VIEW_CONFIG = exports.__INTERNAL_VIEW_CONFIG = {
uiViewClassName: "AndroidSwipeRefreshLayout",
directEventTypes: {
topRefresh: {
registrationName: "onRefresh"
}
},
validAttributes: {
enabled: true,
colors: {
process: (req => 'default' in req ? req.default : req)(require(_dependencyMap[7]))
},
progressBackgroundColor: {
process: require(_dependencyMap[8]).default
},
size: true,
progressViewOffset: true,
refreshing: true,
...ConditionallyIgnoredEventHandlers({
onRefresh: true
})
}
};
var _default = exports.default = NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);
var Commands = exports.Commands = {
setNativeRefreshing(ref, value) {
dispatchCommand(ref, "setNativeRefreshing", [value]);
}
};
```
</details>
Reviewed By: yungsters
Differential Revision: D70580474
Pulled By: elicwhite
fbshipit-source-id: 85bc6578b685f19a1565ded8d7e56dc2a1ff1999
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
Summary:
This pull request replaces the use of mkdirp with Node.js's built-in fs.mkdirSync({ recursive: true }) function, which is available in Node.js version 10.12.0 and above. This change reduces the number of external dependencies and simplifies the codebase by using the native capabilities of Node.js.
The motivation behind this change is to remove the unnecessary mkdirp dependency, as Node.js natively supports recursive directory creation since version 10.12.0. This streamlines the code and reduces the reliance on external libraries.
## Changelog:
[INTERNAL] [REMOVED] - Replaced mkdirp with fs.mkdirSync({ recursive: true }) in build scripts and codegen. Requires Node.js 10.12.0 and above.
Pull Request resolved: https://github.com/facebook/react-native/pull/46388
Test Plan: I ran the build and codegen scripts locally with Node.js version 10.12.0 and above after replacing mkdirp, ensuring the scripts work as expected. No issues were encountered, and all processes, including directory creation and file handling, function correctly.
Reviewed By: cortinico
Differential Revision: D62852488
Pulled By: huntie
fbshipit-source-id: 76f44102a80b499521c156308d276a17d279ce38
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
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
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
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
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41924
`utils.parseArgs` are only available in Node >=18.3, we can't use this function because we target Node >=18.0.
This diff replaces `utils.parseArgs` with `yargs`.
Changelog: [Internal]
Reviewed By: cipolleschi
Differential Revision: D52117818
fbshipit-source-id: 79223997874b6cfdea2ce38243b615a0dbb704a6
Summary:
In pnpm setups, codegen will fail during build because it cannot find its dependencies. Some of the dependencies it relies on at runtime are currently declared under `devDependencies`. This change moves them to `dependencies`.
## Changelog:
[GENERAL] [FIXED] - Fix `react-native/codegen` not being able to resolve dependencies in pnpm setups
Pull Request resolved: https://github.com/facebook/react-native/pull/41398
Test Plan: We are currently trying to [enable pnpm mode](https://github.com/microsoft/rnx-kit/pull/2811) in rnx-kit and hit this issue. We've patched this package locally and it works.
Reviewed By: christophpurrer
Differential Revision: D51169116
Pulled By: NickGerleman
fbshipit-source-id: 28906a0de412c660d2fc42f62deaf77240d27a58