@nx/react 23.0.0-beta.23 → 23.0.0-beta.24
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 +39 -1
- package/package.json +20 -16
- package/plugins/component-testing/index.js +2 -5
- package/plugins/storybook/index.d.ts.map +1 -1
- package/plugins/storybook/index.js +15 -9
- package/plugins/with-react.d.ts +4 -0
- package/plugins/with-react.d.ts.map +1 -1
- package/plugins/with-react.js +6 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +7 -9
- package/src/executors/module-federation-dev-server/schema.d.ts +1 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +6 -7
- package/src/executors/module-federation-ssr-dev-server/schema.d.ts +2 -2
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +1 -1
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts.map +1 -1
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +9 -12
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +2 -0
- package/src/generators/application/lib/add-linting.d.ts.map +1 -1
- package/src/generators/application/lib/add-linting.js +1 -1
- package/src/generators/application/lib/add-routing.d.ts.map +1 -1
- package/src/generators/application/lib/add-routing.js +1 -1
- package/src/generators/application/lib/bundlers/add-rsbuild.js +1 -1
- package/src/generators/application/lib/bundlers/add-webpack.d.ts.map +1 -1
- package/src/generators/application/lib/bundlers/add-webpack.js +1 -1
- package/src/generators/application/lib/install-common-dependencies.d.ts.map +1 -1
- package/src/generators/application/lib/install-common-dependencies.js +5 -5
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +4 -2
- package/src/generators/component-story/component-story.d.ts.map +1 -1
- package/src/generators/component-story/component-story.js +2 -0
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +2 -0
- package/src/generators/consumer/consumer.d.ts.map +1 -1
- package/src/generators/consumer/consumer.js +3 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -0
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/lib/add-files.js +2 -2
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +2 -0
- package/src/generators/hook/hook.d.ts.map +1 -1
- package/src/generators/hook/hook.js +2 -0
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +3 -1
- package/src/generators/host/lib/setup-ssr-for-host.d.ts.map +1 -1
- package/src/generators/host/lib/setup-ssr-for-host.js +1 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +3 -1
- package/src/generators/init/schema.json +1 -1
- package/src/generators/library/lib/add-linting.d.ts.map +1 -1
- package/src/generators/library/lib/add-linting.js +1 -1
- package/src/generators/library/lib/add-rollup-build-target.d.ts.map +1 -1
- package/src/generators/library/lib/add-rollup-build-target.js +1 -1
- package/src/generators/library/lib/install-common-dependencies.d.ts.map +1 -1
- package/src/generators/library/lib/install-common-dependencies.js +2 -2
- package/src/generators/library/lib/update-app-routes.d.ts.map +1 -1
- package/src/generators/library/lib/update-app-routes.js +1 -1
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +2 -0
- package/src/generators/provider/provider.d.ts.map +1 -1
- package/src/generators/provider/provider.js +3 -1
- package/src/generators/redux/redux.d.ts.map +1 -1
- package/src/generators/redux/redux.js +3 -1
- package/src/generators/remote/lib/setup-ssr-for-remote.d.ts.map +1 -1
- package/src/generators/remote/lib/setup-ssr-for-remote.js +1 -1
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +3 -1
- package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
- package/src/generators/setup-ssr/setup-ssr.js +3 -1
- package/src/generators/stories/stories.d.ts.map +1 -1
- package/src/generators/stories/stories.js +2 -0
- package/src/generators/storybook-configuration/configuration.d.ts.map +1 -1
- package/src/generators/storybook-configuration/configuration.js +3 -1
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +10 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts.map +1 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +136 -0
- package/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.md +25 -0
- package/src/utils/assert-supported-react-version.d.ts +3 -0
- package/src/utils/assert-supported-react-version.d.ts.map +1 -0
- package/src/utils/assert-supported-react-version.js +8 -0
- package/src/utils/deprecation.d.ts +4 -0
- package/src/utils/deprecation.d.ts.map +1 -0
- package/src/utils/deprecation.js +33 -0
- package/src/utils/version-utils.d.ts +1 -0
- package/src/utils/version-utils.d.ts.map +1 -1
- package/src/utils/version-utils.js +3 -0
- package/src/utils/versions.d.ts +3 -2
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +6 -3
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateCreateNodesV2ToCreateNodes;
|
|
4
|
+
exports.rewriteCreateNodesV2Imports = rewriteCreateNodesV2Imports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const DEPRECATED_NAME = 'createNodesV2';
|
|
8
|
+
const CANONICAL_NAME = 'createNodes';
|
|
9
|
+
// Module specifiers from which `@nx/react` publicly exposes `createNodesV2`.
|
|
10
|
+
// A named import or re-export of `createNodesV2` from one of these is rewritten
|
|
11
|
+
// to the canonical `createNodes` export.
|
|
12
|
+
const TARGET_SPECIFIERS = new Set([
|
|
13
|
+
'@nx/react/router-plugin',
|
|
14
|
+
]);
|
|
15
|
+
let ts;
|
|
16
|
+
async function migrateCreateNodesV2ToCreateNodes(tree) {
|
|
17
|
+
let touchedCount = 0;
|
|
18
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
19
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const original = tree.read(filePath, 'utf-8');
|
|
23
|
+
if (!original || !original.includes(DEPRECATED_NAME)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const updated = rewriteCreateNodesV2Imports(original, TARGET_SPECIFIERS);
|
|
27
|
+
if (updated !== original) {
|
|
28
|
+
tree.write(filePath, updated);
|
|
29
|
+
touchedCount += 1;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
if (touchedCount > 0) {
|
|
33
|
+
devkit_1.logger.info(`Renamed \`${DEPRECATED_NAME}\` imports to \`${CANONICAL_NAME}\` in ${touchedCount} file(s).`);
|
|
34
|
+
}
|
|
35
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
39
|
+
* when they come from one of the given module specifiers. Only the named
|
|
40
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
41
|
+
* any `type` modifier, and any default import are left untouched.
|
|
42
|
+
*/
|
|
43
|
+
function rewriteCreateNodesV2Imports(source, specifiers) {
|
|
44
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
45
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
46
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
47
|
+
const changes = [];
|
|
48
|
+
for (const stmt of sourceFile.statements) {
|
|
49
|
+
if (ts.isImportDeclaration(stmt)) {
|
|
50
|
+
collectImportRewrite(sourceFile, stmt, specifiers, changes);
|
|
51
|
+
}
|
|
52
|
+
else if (ts.isExportDeclaration(stmt)) {
|
|
53
|
+
collectExportRewrite(sourceFile, stmt, specifiers, changes);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
57
|
+
}
|
|
58
|
+
function isTargetSpecifier(node, specifiers) {
|
|
59
|
+
return ts.isStringLiteral(node) && specifiers.has(node.text);
|
|
60
|
+
}
|
|
61
|
+
function collectImportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
62
|
+
if (!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const namedBindings = stmt.importClause?.namedBindings;
|
|
66
|
+
// Only `import { ... }` carries renameable named bindings. `import x`,
|
|
67
|
+
// `import * as ns`, and side-effect imports reference the module wholesale
|
|
68
|
+
// and keep working through the `createNodesV2` runtime alias, so we leave
|
|
69
|
+
// them be. A mixed `import def, { createNodesV2 }` still has its named
|
|
70
|
+
// bindings rewritten below — the default binding is untouched.
|
|
71
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
rewriteNamedBindings(sourceFile, namedBindings, changes);
|
|
75
|
+
}
|
|
76
|
+
function collectExportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
77
|
+
if (!stmt.moduleSpecifier ||
|
|
78
|
+
!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// `export { ... } from '...'` can be rewritten; `export * from '...'` has no
|
|
82
|
+
// named bindings to rename.
|
|
83
|
+
if (!stmt.exportClause || !ts.isNamedExports(stmt.exportClause)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
rewriteNamedBindings(sourceFile, stmt.exportClause, changes);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Re-renders the `{ ... }` of a named import/export, renaming any
|
|
90
|
+
* `createNodesV2` specifier to `createNodes`. If renaming would collide with a
|
|
91
|
+
* `createNodes` that is already present (e.g. `{ createNodes, createNodesV2 }`),
|
|
92
|
+
* the duplicate is dropped. Returns without recording a change when the binding
|
|
93
|
+
* list contains no `createNodesV2`.
|
|
94
|
+
*/
|
|
95
|
+
function rewriteNamedBindings(sourceFile, namedBindings, changes) {
|
|
96
|
+
const elements = namedBindings.elements;
|
|
97
|
+
const hasDeprecated = elements.some((el) => (el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
98
|
+
if (!hasDeprecated) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
const rendered = [];
|
|
103
|
+
for (const el of elements) {
|
|
104
|
+
const text = renderSpecifier(el);
|
|
105
|
+
if (!seen.has(text)) {
|
|
106
|
+
seen.add(text);
|
|
107
|
+
rendered.push(text);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const start = namedBindings.getStart(sourceFile);
|
|
111
|
+
changes.push({
|
|
112
|
+
type: devkit_1.ChangeType.Delete,
|
|
113
|
+
start,
|
|
114
|
+
length: namedBindings.getEnd() - start,
|
|
115
|
+
}, {
|
|
116
|
+
type: devkit_1.ChangeType.Insert,
|
|
117
|
+
index: start,
|
|
118
|
+
text: `{ ${rendered.join(', ')} }`,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function renderSpecifier(el) {
|
|
122
|
+
const typePrefix = el.isTypeOnly ? 'type ' : '';
|
|
123
|
+
const rename = (name) => name === DEPRECATED_NAME ? CANONICAL_NAME : name;
|
|
124
|
+
// `{ name }` — no alias, so the local binding follows the rename.
|
|
125
|
+
if (!el.propertyName) {
|
|
126
|
+
return `${typePrefix}${rename(el.name.text)}`;
|
|
127
|
+
}
|
|
128
|
+
// `{ propertyName as name }` — only the imported (left) side is renamed; the
|
|
129
|
+
// local alias is preserved. A now-redundant alias such as
|
|
130
|
+
// `createNodesV2 as createNodes` collapses to `createNodes`.
|
|
131
|
+
const canonicalImported = rename(el.propertyName.text);
|
|
132
|
+
const localName = el.name.text;
|
|
133
|
+
return canonicalImported === localName
|
|
134
|
+
? `${typePrefix}${localName}`
|
|
135
|
+
: `${typePrefix}${canonicalImported} as ${localName}`;
|
|
136
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#### Rename `createNodesV2` imports to `createNodes`
|
|
2
|
+
|
|
3
|
+
`@nx/react` renamed its primary inferred-plugin export from `createNodesV2` to `createNodes`. The `createNodesV2` name is preserved as a deprecated alias for now, but new code should use `createNodes`.
|
|
4
|
+
|
|
5
|
+
This migration scans every `.ts`, `.tsx`, `.cts`, and `.mts` file in your workspace and rewrites named imports and re-exports of `createNodesV2` from `@nx/react/router-plugin` to `createNodes`.
|
|
6
|
+
|
|
7
|
+
#### Sample Code Changes
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createNodesV2 } from '@nx/react/router-plugin';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { createNodes } from '@nx/react/router-plugin';
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Aliases are preserved (`createNodesV2 as cn` becomes `createNodes as cn`), and if a file already imports both names (`{ createNodes, createNodesV2 }`) the redundant binding is dropped.
|
|
22
|
+
|
|
23
|
+
#### What is not rewritten
|
|
24
|
+
|
|
25
|
+
Only static `import`/`export` named bindings from `@nx/react/router-plugin` are rewritten. Namespace imports, dynamic `import(...)`, `require(...)` destructuring, and property access such as `plugin.createNodesV2` are left untouched — they keep working through the `createNodesV2` runtime alias. Update those by hand if you want to drop the deprecated name everywhere.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-supported-react-version.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/assert-supported-react-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE5D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedReactVersion = assertSupportedReactVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function assertSupportedReactVersion(tree) {
|
|
7
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, 'react', versions_1.minSupportedReactVersion);
|
|
8
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const REACT_WITH_REACT_DEPRECATION_MESSAGE = "The `withReact` config helper from `@nx/react` is deprecated and will be removed in Nx v24. It produces an Nx-specific webpack config function that only runs under the `@nx/webpack:webpack` executor. Migrate to a standard webpack config that uses `NxReactWebpackPlugin` (from `@nx/react/webpack-plugin`) under the inferred `@nx/webpack/plugin` by running `nx g @nx/webpack:convert-to-inferred`. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.";
|
|
2
|
+
export declare function suppressReactComposeHelperWarnings<T>(fn: () => T): T;
|
|
3
|
+
export declare function warnReactWithReactDeprecation(): void;
|
|
4
|
+
//# sourceMappingURL=deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecation.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/deprecation.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oCAAoC,8dAC4a,CAAC;AAQ9d,wBAAgB,kCAAkC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAOpE;AAID,wBAAgB,6BAA6B,IAAI,IAAI,CAIpD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REACT_WITH_REACT_DEPRECATION_MESSAGE = void 0;
|
|
4
|
+
exports.suppressReactComposeHelperWarnings = suppressReactComposeHelperWarnings;
|
|
5
|
+
exports.warnReactWithReactDeprecation = warnReactWithReactDeprecation;
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
// TODO(v24): Remove the webpack `withReact` config helper. It emits an
|
|
8
|
+
// Nx-specific webpack config function that only runs under the
|
|
9
|
+
// @nx/webpack:webpack executor; the inferred @nx/webpack/plugin works with
|
|
10
|
+
// standard webpack configs built around NxReactWebpackPlugin instead.
|
|
11
|
+
exports.REACT_WITH_REACT_DEPRECATION_MESSAGE = 'The `withReact` config helper from `@nx/react` is deprecated and will be removed in Nx v24. It produces an Nx-specific webpack config function that only runs under the `@nx/webpack:webpack` executor. Migrate to a standard webpack config that uses `NxReactWebpackPlugin` (from `@nx/react/webpack-plugin`) under the inferred `@nx/webpack/plugin` by running `nx g @nx/webpack:convert-to-inferred`. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.';
|
|
12
|
+
let withReactWarned = false;
|
|
13
|
+
let suppressDepth = 0;
|
|
14
|
+
// Nx-internal entry points compose `withReact` themselves (e.g. the storybook
|
|
15
|
+
// and component-testing presets). They wrap their synchronous composition in
|
|
16
|
+
// this so the warning fires only for user-authored configs.
|
|
17
|
+
function suppressReactComposeHelperWarnings(fn) {
|
|
18
|
+
suppressDepth++;
|
|
19
|
+
try {
|
|
20
|
+
return fn();
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
suppressDepth--;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Warn once per process so HMR reloads and repeated config evaluation don't
|
|
27
|
+
// repeat the message.
|
|
28
|
+
function warnReactWithReactDeprecation() {
|
|
29
|
+
if (suppressDepth > 0 || withReactWarned)
|
|
30
|
+
return;
|
|
31
|
+
withReactWarned = true;
|
|
32
|
+
devkit_1.logger.warn(exports.REACT_WITH_REACT_DEPRECATION_MESSAGE);
|
|
33
|
+
}
|
|
@@ -6,6 +6,7 @@ type ReactDependenciesVersions = {
|
|
|
6
6
|
'@types/react': string;
|
|
7
7
|
'@types/react-dom': string;
|
|
8
8
|
'@types/react-is': string;
|
|
9
|
+
'react-router': string;
|
|
9
10
|
};
|
|
10
11
|
export declare function getReactDependenciesVersionsToInstall(tree: Tree): Promise<ReactDependenciesVersions>;
|
|
11
12
|
export declare function isReact18(tree: Tree): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/version-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/version-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AAkBpB,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAE1B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,yBAAyB,CAAC,CAuBpC;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,IAAI,oBAMzC;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAe3D;AAED,wBAAsB,iCAAiC,oBAOtD;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,IAAI,GACT,MAAM,GAAG,SAAS,CAWpB;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAU5D"}
|
|
@@ -18,6 +18,8 @@ async function getReactDependenciesVersionsToInstall(tree) {
|
|
|
18
18
|
'@types/react': versions_1.typesReactV18Version,
|
|
19
19
|
'@types/react-dom': versions_1.typesReactDomV18Version,
|
|
20
20
|
'@types/react-is': versions_1.typesReactIsV18Version,
|
|
21
|
+
// react-router v7 is the SSR package regardless of React version
|
|
22
|
+
'react-router': versions_1.reactRouterVersion,
|
|
21
23
|
};
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
@@ -28,6 +30,7 @@ async function getReactDependenciesVersionsToInstall(tree) {
|
|
|
28
30
|
'@types/react': versions_1.typesReactVersion,
|
|
29
31
|
'@types/react-dom': versions_1.typesReactDomVersion,
|
|
30
32
|
'@types/react-is': versions_1.typesReactIsVersion,
|
|
33
|
+
'react-router': versions_1.reactRouterVersion,
|
|
31
34
|
};
|
|
32
35
|
}
|
|
33
36
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
+
export declare const minSupportedReactVersion = "18.0.0";
|
|
2
3
|
export declare const reactVersion = "^19.0.0";
|
|
3
4
|
export declare const reactV18Version = "18.3.1";
|
|
4
5
|
export declare const reactDomVersion = "^19.0.0";
|
|
@@ -21,8 +22,8 @@ export declare const reactRouterVersion = "^7.14.2";
|
|
|
21
22
|
export declare const reactRouterIsBotVersion = "^4.4.0";
|
|
22
23
|
export declare const testingLibraryReactVersion = "16.3.0";
|
|
23
24
|
export declare const testingLibraryDomVersion = "10.4.0";
|
|
24
|
-
export declare const reduxjsToolkitVersion = "
|
|
25
|
-
export declare const reactReduxVersion = "
|
|
25
|
+
export declare const reduxjsToolkitVersion = "^2.5.0";
|
|
26
|
+
export declare const reactReduxVersion = "^9.2.0";
|
|
26
27
|
export declare const eslintPluginImportVersion = "2.31.0";
|
|
27
28
|
export declare const eslintPluginJsxA11yVersion = "6.10.1";
|
|
28
29
|
export declare const eslintPluginReactVersion = "7.35.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAGzC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,wBAAwB,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAEjD,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AACzC,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAC7C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAC9C,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAGzC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAEhD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AAIjD,eAAO,MAAM,qBAAqB,WAAW,CAAC;AAC9C,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAClD,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,6BAA6B,UAAU,CAAC;AAErD,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAG7C,eAAO,MAAM,cAAc,YAAY,CAAC;AACxC,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,eAAO,MAAM,YAAY,WAAW,CAAC;AACrC,eAAO,MAAM,WAAW,WAAW,CAAC;AACpC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AACrD,eAAO,MAAM,+BAA+B,WAAW,CAAC;AAGxD,eAAO,MAAM,WAAW,YAAY,CAAC;AAGrC,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,iBAAiB,WAAW,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.postcssVersion = exports.tsLibVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryDomVersion = exports.testingLibraryReactVersion = exports.reactRouterIsBotVersion = exports.reactRouterVersion = exports.reactRouterDomVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.reactViteVersion = exports.typesReactIsVersion = exports.typesReactIsV18Version = exports.typesReactDomVersion = exports.typesReactDomV18Version = exports.typesReactVersion = exports.typesReactV18Version = exports.swcLoaderVersion = exports.reactIsV18Version = exports.reactIsVersion = exports.reactDomV18Version = exports.reactDomVersion = exports.reactV18Version = exports.reactVersion = exports.nxVersion = void 0;
|
|
3
|
+
exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.postcssVersion = exports.tsLibVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryDomVersion = exports.testingLibraryReactVersion = exports.reactRouterIsBotVersion = exports.reactRouterVersion = exports.reactRouterDomVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.reactViteVersion = exports.typesReactIsVersion = exports.typesReactIsV18Version = exports.typesReactDomVersion = exports.typesReactDomV18Version = exports.typesReactVersion = exports.typesReactV18Version = exports.swcLoaderVersion = exports.reactIsV18Version = exports.reactIsVersion = exports.reactDomV18Version = exports.reactDomVersion = exports.reactV18Version = exports.reactVersion = exports.minSupportedReactVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
+
exports.minSupportedReactVersion = '18.0.0';
|
|
5
6
|
exports.reactVersion = '^19.0.0';
|
|
6
7
|
exports.reactV18Version = '18.3.1';
|
|
7
8
|
exports.reactDomVersion = '^19.0.0';
|
|
@@ -25,8 +26,10 @@ exports.reactRouterVersion = '^7.14.2';
|
|
|
25
26
|
exports.reactRouterIsBotVersion = '^4.4.0';
|
|
26
27
|
exports.testingLibraryReactVersion = '16.3.0';
|
|
27
28
|
exports.testingLibraryDomVersion = '10.4.0';
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
// RTK 2 / react-redux 9 peer on react ^18 || ^19 — cover the full support window.
|
|
30
|
+
// react-redux 8.0.5 / RTK 1.9.3 peer-cap at react ^18, breaking `nx g redux` on React 19.
|
|
31
|
+
exports.reduxjsToolkitVersion = '^2.5.0';
|
|
32
|
+
exports.reactReduxVersion = '^9.2.0';
|
|
30
33
|
exports.eslintPluginImportVersion = '2.31.0';
|
|
31
34
|
exports.eslintPluginJsxA11yVersion = '6.10.1';
|
|
32
35
|
exports.eslintPluginReactVersion = '7.35.0';
|