Skip to content

The @nx/react plugin provides various migrations to help you migrate to newer versions of react projects within your Nx workspace. Below is a complete reference for all available migrations.

Version: 22.3.4-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
react-router-dom6.30.3Updated only
react-router7.12.0Updated only
@react-router/dev7.12.0Updated only
@react-router/node7.12.0Updated only
@react-router/serve7.12.0Updated only
@react-router/express7.12.0Updated only
@react-router/fs-routes7.12.0Updated only
@react-router/cloudflare7.12.0Updated only
@react-router/architect7.12.0Updated only
@react-router/remix-routes-option-adapter7.12.0Updated only

Version: 22.2.0-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
@module-federation/enhanced^0.21.2Updated only
@module-federation/runtime^0.21.2Updated only
@module-federation/sdk^0.21.2Updated only
@module-federation/node^2.7.21Updated only

Version: 22.2.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
@emotion/react11.14.0Updated only
@emotion/styled11.14.1Updated only
@emotion/babel-plugin11.13.5Updated only

Version: 22.0.0-beta.0

Updates webpack configs using React to use the new withSvgr composable function instead of the svgr option in withReact or NxReactWebpackPlugin.

Version: 21.4.0-beta.8

The following packages will be updated:

NameVersionAlways add to package.json
http-proxy-middleware^3.0.5Updated only

Version: 21.0.0-beta.11

Replaces classProperties.loose option with loose.

Replace classProperties.loose option in .babelrc

Section titled “Replace classProperties.loose option in .babelrc”

The classProperties.loose option is replaced by loose in .babelrc files.

.babelrc
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"classProperties": {
"loose": true
},
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
.babelrc
{
"presets": [
[
"@nx/react/babel",
{
"runtime": "automatic",
"loose": true,
"useBuiltIns": "usage"
}
]
],
"plugins": []
}

Version: 20.4.0-beta.0

Add NX_MF_DEV_REMOTES to inputs for task hashing when ‘@nx/webpack:webpack’ or ‘@nx/rspack:rspack’ is used for Module Federation.

Add Module Federation Env Var to Target Defaults

Section titled “Add Module Federation Env Var to Target Defaults”

Add NX_MF_DEV_REMOTES to inputs for task hashing when @nx/webpack:webpack or @nx/rspack:rspack is used for Module Federation.

nx.json
{
"targetDefaults": {
"@nx/webpack:webpack": {
"inputs": ["^build"]
}
}
}
nx.json
{
"targetDefaults": {
"@nx/webpack:webpack": {
"cache": true,
"dependsOn": ["^build"],
"inputs": [
"^build",
{
"env": "NX_MF_DEV_REMOTES"
}
]
}
}
}

Version: 20.3.0-beta.2

If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.

Ensure the @nx/module-federation Package is Installed

Section titled “Ensure the @nx/module-federation Package is Installed”

If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.

package.json
{
"dependencies": {}
}
package.json
{
"dependencies": {
"@nx/module-federation": "20.3.0"
}
}

Version: 20.3.0-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
@testing-library/react16.1.0Updated only

update-20-2-0-update-module-federation-config-import

Section titled “update-20-2-0-update-module-federation-config-import”

Version: 20.2.0-beta.2

Update the ModuleFederationConfig import use @nx/module-federation.

Migrate Module Federation Imports to New Package

Section titled “Migrate Module Federation Imports to New Package”

Update the ModuleFederationConfig imports to use @nx/module-federation.

Update import paths for ModuleFederationConfig.

apps/shell/webpack.config.js
import { ModuleFederationConfig } from '@nx/webpack';
apps/shell/rspack.config.js
import { ModuleFederationConfig } from '@nx/rspack/module-federation';
apps/shell/webpack.config.js
import { ModuleFederationConfig } from '@nx/module-federation';
apps/shell/rspack.config.js
import { ModuleFederationConfig } from '@nx/module-federation';

update-20-2-0-update-with-module-federation-import

Section titled “update-20-2-0-update-with-module-federation-import”

Version: 20.2.0-beta.2

Update the withModuleFederation import use @nx/module-federation/webpack.

Migrate withModuleFederation Import to New Package

Section titled “Migrate withModuleFederation Import to New Package”

Update the withModuleFederation import to use @nx/module-federation/webpack.

Update import paths for withModuleFederation and withModuleFederationForSSR.

apps/shell/webpack.config.ts
import {
withModuleFederation,
withModuleFederationForSSR,
} from '@nx/react/module-federation';
apps/shell/webpack.config.ts
import {
withModuleFederation,
withModuleFederationForSSR,
} from '@nx/module-federation/webpack';

Version: 20.2.0-beta.3

The following packages will be updated:

NameVersionAlways add to package.json
@module-federation/enhanced0.7.6Updated only
@module-federation/runtime0.7.6Updated only
@module-federation/sdk0.7.6Updated only
@module-federation/node2.6.11Updated only

Version: 20.1.0-beta.0

The following packages will be updated:

NameVersionAlways add to package.json
eslint-plugin-react-hooks5.0.0Updated only
eslint-plugin-jsx-a11y6.10.1Updated only

Version: 20.0.0-beta.8

The following packages will be updated:

NameVersionAlways add to package.json
eslint-plugin-import2.31.0Updated only