@nx/react 23.0.0-beta.21 → 23.0.0-beta.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/migrations.json CHANGED
@@ -4,31 +4,36 @@
4
4
  "cli": "nx",
5
5
  "version": "20.2.0-beta.2",
6
6
  "description": "Update the ModuleFederationConfig import use @nx/module-federation.",
7
- "factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package"
7
+ "factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package",
8
+ "documentation": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.md"
8
9
  },
9
10
  "update-20-2-0-update-with-module-federation-import": {
10
11
  "cli": "nx",
11
12
  "version": "20.2.0-beta.2",
12
13
  "description": "Update the withModuleFederation import use @nx/module-federation/webpack.",
13
- "factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package"
14
+ "factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package",
15
+ "documentation": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.md"
14
16
  },
15
17
  "ensure-nx-module-federation-package": {
16
18
  "cli": "nx",
17
19
  "version": "20.3.0-beta.2",
18
20
  "description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
19
- "factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
21
+ "factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package",
22
+ "documentation": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package.md"
20
23
  },
21
24
  "add-mf-env-var-to-target-defaults": {
22
25
  "cli": "nx",
23
26
  "version": "20.4.0-beta.0",
24
27
  "description": "Add NX_MF_DEV_REMOTES to inputs for task hashing when '@nx/webpack:webpack' or '@nx/rspack:rspack' is used for Module Federation.",
25
- "factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults"
28
+ "factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults",
29
+ "documentation": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.md"
26
30
  },
27
31
  "update-21-0-0-update-babel-loose": {
28
32
  "cli": "nx",
29
33
  "version": "21.0.0-beta.11",
30
34
  "description": "Replaces `classProperties.loose` option with `loose`.",
31
- "factory": "./src/migrations/update-21-0-0/update-babel-loose"
35
+ "factory": "./src/migrations/update-21-0-0/update-babel-loose",
36
+ "documentation": "./src/migrations/update-21-0-0/update-babel-loose.md"
32
37
  },
33
38
  "update-22-0-0-add-svgr-to-webpack-config": {
34
39
  "cli": "nx",
@@ -40,7 +45,8 @@
40
45
  "cli": "nx",
41
46
  "version": "23.0.0-beta.10",
42
47
  "description": "Rewrites imports of NxReactWebpackPlugin from '@nx/react' to the sub-path '@nx/react/webpack-plugin'.",
43
- "factory": "./src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import"
48
+ "factory": "./src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import",
49
+ "documentation": "./src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.md"
44
50
  }
45
51
  },
46
52
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "23.0.0-beta.21",
3
+ "version": "23.0.0-beta.22",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -37,28 +37,28 @@
37
37
  "@svgr/webpack": "^8.0.1",
38
38
  "minimatch": "10.2.5",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "23.0.0-beta.21",
41
- "@nx/js": "23.0.0-beta.21",
42
- "@nx/eslint": "23.0.0-beta.21",
43
- "@nx/web": "23.0.0-beta.21",
44
- "@nx/module-federation": "23.0.0-beta.21",
45
- "@nx/rollup": "23.0.0-beta.21",
40
+ "@nx/devkit": "23.0.0-beta.22",
41
+ "@nx/js": "23.0.0-beta.22",
42
+ "@nx/eslint": "23.0.0-beta.22",
43
+ "@nx/web": "23.0.0-beta.22",
44
+ "@nx/module-federation": "23.0.0-beta.22",
45
+ "@nx/rollup": "23.0.0-beta.22",
46
46
  "express": "^4.21.2",
47
47
  "http-proxy-middleware": "^3.0.5",
48
48
  "semver": "^7.6.3"
49
49
  },
50
50
  "devDependencies": {
51
- "@nx/cypress": "23.0.0-beta.21",
52
- "@nx/playwright": "23.0.0-beta.21",
53
- "@nx/rsbuild": "23.0.0-beta.21",
54
- "@nx/vite": "23.0.0-beta.21",
55
- "@nx/vitest": "23.0.0-beta.21",
56
- "@nx/webpack": "23.0.0-beta.21",
57
- "@nx/storybook": "23.0.0-beta.21",
58
- "nx": "23.0.0-beta.21"
51
+ "@nx/cypress": "23.0.0-beta.22",
52
+ "@nx/playwright": "23.0.0-beta.22",
53
+ "@nx/rsbuild": "23.0.0-beta.22",
54
+ "@nx/vite": "23.0.0-beta.22",
55
+ "@nx/vitest": "23.0.0-beta.22",
56
+ "@nx/webpack": "23.0.0-beta.22",
57
+ "@nx/storybook": "23.0.0-beta.22",
58
+ "nx": "23.0.0-beta.22"
59
59
  },
60
60
  "optionalDependencies": {
61
- "@nx/vite": "23.0.0-beta.21"
61
+ "@nx/vite": "23.0.0-beta.22"
62
62
  },
63
63
  "publishConfig": {
64
64
  "access": "public"
@@ -0,0 +1,36 @@
1
+ #### Add Module Federation Env Var to Target Defaults
2
+
3
+ Add NX_MF_DEV_REMOTES to inputs for task hashing when `@nx/webpack:webpack` or `@nx/rspack:rspack` is used for Module Federation.
4
+
5
+ #### Sample Code Changes
6
+
7
+ ##### Before
8
+
9
+ ```json title="nx.json"
10
+ {
11
+ "targetDefaults": {
12
+ "@nx/webpack:webpack": {
13
+ "inputs": ["^build"]
14
+ }
15
+ }
16
+ }
17
+ ```
18
+
19
+ ##### After
20
+
21
+ ```json title="nx.json" {4-6}
22
+ {
23
+ "targetDefaults": {
24
+ "@nx/webpack:webpack": {
25
+ "cache": true,
26
+ "dependsOn": ["^build"],
27
+ "inputs": [
28
+ "^build",
29
+ {
30
+ "env": "NX_MF_DEV_REMOTES"
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ }
36
+ ```
@@ -0,0 +1,27 @@
1
+ #### Migrate Module Federation Imports to New Package
2
+
3
+ Update the ModuleFederationConfig imports to use @nx/module-federation.
4
+
5
+ #### Sample Code Changes
6
+
7
+ Update import paths for ModuleFederationConfig.
8
+
9
+ ##### Before
10
+
11
+ ```js title="apps/shell/webpack.config.js"
12
+ import { ModuleFederationConfig } from '@nx/webpack';
13
+ ```
14
+
15
+ ```js title="apps/shell/rspack.config.js"
16
+ import { ModuleFederationConfig } from '@nx/rspack/module-federation';
17
+ ```
18
+
19
+ ##### After
20
+
21
+ ```js title="apps/shell/webpack.config.js"
22
+ import { ModuleFederationConfig } from '@nx/module-federation';
23
+ ```
24
+
25
+ ```js title="apps/shell/rspack.config.js"
26
+ import { ModuleFederationConfig } from '@nx/module-federation';
27
+ ```
@@ -0,0 +1,25 @@
1
+ #### Migrate withModuleFederation Import to New Package
2
+
3
+ Update the withModuleFederation import to use @nx/module-federation/webpack.
4
+
5
+ #### Sample Code Changes
6
+
7
+ Update import paths for `withModuleFederation` and `withModuleFederationForSSR`.
8
+
9
+ ##### Before
10
+
11
+ ```ts title="apps/shell/webpack.config.ts"
12
+ import {
13
+ withModuleFederation,
14
+ withModuleFederationForSSR,
15
+ } from '@nx/react/module-federation';
16
+ ```
17
+
18
+ ##### After
19
+
20
+ ```ts title="apps/shell/webpack.config.ts"
21
+ import {
22
+ withModuleFederation,
23
+ withModuleFederationForSSR,
24
+ } from '@nx/module-federation/webpack';
25
+ ```
@@ -0,0 +1,23 @@
1
+ #### Ensure the @nx/module-federation Package is Installed
2
+
3
+ If workspace includes Module Federation projects, ensure the new `@nx/module-federation` package is installed.
4
+
5
+ #### Sample Code Changes
6
+
7
+ ##### Before
8
+
9
+ ```json title="package.json"
10
+ {
11
+ "dependencies": {}
12
+ }
13
+ ```
14
+
15
+ ##### After
16
+
17
+ ```json title="package.json"
18
+ {
19
+ "dependencies": {
20
+ "@nx/module-federation": "20.3.0"
21
+ }
22
+ }
23
+ ```
@@ -0,0 +1,43 @@
1
+ #### Replace `classProperties.loose` option in `.babelrc`
2
+
3
+ The `classProperties.loose` option is replaced by `loose` in `.babelrc` files.
4
+
5
+ #### Sample Code Changes
6
+
7
+ ##### Before
8
+
9
+ ```json title=".babelrc"
10
+ {
11
+ "presets": [
12
+ [
13
+ "@nx/react/babel",
14
+ {
15
+ "runtime": "automatic",
16
+ "classProperties": {
17
+ "loose": true
18
+ },
19
+ "useBuiltIns": "usage"
20
+ }
21
+ ]
22
+ ],
23
+ "plugins": []
24
+ }
25
+ ```
26
+
27
+ ##### After
28
+
29
+ ```json title=".babelrc" {7}
30
+ {
31
+ "presets": [
32
+ [
33
+ "@nx/react/babel",
34
+ {
35
+ "runtime": "automatic",
36
+ "loose": true,
37
+ "useBuiltIns": "usage"
38
+ }
39
+ ]
40
+ ],
41
+ "plugins": []
42
+ }
43
+ ```
@@ -0,0 +1,52 @@
1
+ #### Rewrite `NxReactWebpackPlugin` Imports to the `@nx/react/webpack-plugin` Sub-path
2
+
3
+ The deprecated re-export of `NxReactWebpackPlugin` from `@nx/react` is removed in v23. The migration rewrites both ES module imports and CJS `require()` calls to use the `@nx/react/webpack-plugin` sub-path. Imports that combine the deprecated symbol with other named imports are split into two declarations so the rest of the original import still resolves from `@nx/react`. Aliases (`as Plugin`, `: Plugin`) are preserved.
4
+
5
+ #### Sample Code Changes
6
+
7
+ ES module import.
8
+
9
+ ##### Before
10
+
11
+ ```ts title="apps/my-app/webpack.config.ts" {1}
12
+ import { NxReactWebpackPlugin } from '@nx/react';
13
+
14
+ export default { plugins: [new NxReactWebpackPlugin()] };
15
+ ```
16
+
17
+ ##### After
18
+
19
+ ```ts title="apps/my-app/webpack.config.ts"
20
+ import { NxReactWebpackPlugin } from '@nx/react/webpack-plugin';
21
+
22
+ export default { plugins: [new NxReactWebpackPlugin()] };
23
+ ```
24
+
25
+ ES module import combined with other named imports.
26
+
27
+ ##### Before
28
+
29
+ ```ts title="apps/my-app/webpack.config.ts" {1}
30
+ import { NxReactWebpackPlugin, withReact } from '@nx/react';
31
+ ```
32
+
33
+ ##### After
34
+
35
+ ```ts title="apps/my-app/webpack.config.ts"
36
+ import { NxReactWebpackPlugin } from '@nx/react/webpack-plugin';
37
+ import { withReact } from '@nx/react';
38
+ ```
39
+
40
+ CJS `require()`.
41
+
42
+ ##### Before
43
+
44
+ ```js title="apps/my-app/webpack.config.js" {1}
45
+ const { NxReactWebpackPlugin } = require('@nx/react');
46
+ ```
47
+
48
+ ##### After
49
+
50
+ ```js title="apps/my-app/webpack.config.js"
51
+ const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin');
52
+ ```