@nx/rspack 24.0.0-beta.1 → 24.0.0-beta.3

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.
Files changed (79) hide show
  1. package/dist/src/executors/dev-server/dev-server.impl.js +0 -2
  2. package/dist/src/executors/rspack/lib/config.js +18 -8
  3. package/dist/src/generators/configuration/configuration.js +2 -24
  4. package/dist/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.js +78 -45
  5. package/dist/src/generators/convert-config-to-rspack-plugin/lib/extract-rspack-options.d.ts +1 -0
  6. package/dist/src/generators/convert-config-to-rspack-plugin/lib/extract-rspack-options.js +31 -2
  7. package/dist/src/generators/convert-config-to-rspack-plugin/schema.json +2 -2
  8. package/dist/src/generators/convert-to-inferred/convert-to-inferred.js +5 -4
  9. package/dist/src/generators/convert-to-inferred/utils/build-post-target-transformer.js +13 -5
  10. package/dist/src/generators/convert-to-inferred/utils/serve-post-target-transformer.js +8 -14
  11. package/dist/src/generators/convert-webpack/convert-webpack.js +20 -74
  12. package/dist/src/generators/convert-webpack/lib/transform-plugin-config.d.ts +1 -1
  13. package/dist/src/generators/convert-webpack/lib/transform-plugin-config.js +47 -69
  14. package/dist/src/generators/init/init.js +38 -44
  15. package/dist/src/generators/init/schema.d.ts +0 -1
  16. package/dist/src/migrations/update-24-0-0/finish-inferred-conversion.md +11 -0
  17. package/dist/src/migrations/update-24-0-0/inventory.d.ts +9 -0
  18. package/dist/src/migrations/update-24-0-0/inventory.js +53 -0
  19. package/dist/src/migrations/update-24-0-0/migrate-compose-plugins.d.ts +10 -0
  20. package/dist/src/migrations/update-24-0-0/migrate-compose-plugins.js +60 -0
  21. package/dist/src/migrations/update-24-0-0/migrate-compose-plugins.md +95 -0
  22. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.d.ts +6 -0
  23. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.js +36 -0
  24. package/dist/src/migrations/update-24-0-0/remove-deprecated-executors.md +90 -0
  25. package/dist/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.js +4 -1
  26. package/dist/src/utils/config.d.ts +10 -14
  27. package/dist/src/utils/config.js +17 -70
  28. package/dist/src/utils/deprecation.d.ts +1 -6
  29. package/dist/src/utils/deprecation.js +4 -23
  30. package/dist/src/utils/e2e-web-server-info-utils.d.ts +1 -1
  31. package/dist/src/utils/e2e-web-server-info-utils.js +2 -2
  32. package/dist/src/utils/generator-utils.d.ts +0 -2
  33. package/dist/src/utils/generator-utils.js +45 -167
  34. package/dist/src/utils/with-nx.d.ts +5 -9
  35. package/dist/src/utils/with-nx.js +5 -32
  36. package/dist/src/utils/with-react.d.ts +5 -8
  37. package/dist/src/utils/with-react.js +5 -15
  38. package/dist/src/utils/with-web.d.ts +5 -8
  39. package/dist/src/utils/with-web.js +5 -44
  40. package/executors.json +0 -25
  41. package/migrations.json +13 -0
  42. package/package.json +6 -25
  43. package/dist/module-federation.d.ts +0 -4
  44. package/dist/module-federation.js +0 -9
  45. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  46. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  47. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -4
  48. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -19
  49. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -5
  50. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.js +0 -33
  51. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -6
  52. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -74
  53. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -25
  54. package/dist/src/executors/module-federation-dev-server/schema.json +0 -104
  55. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -2
  56. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.js +0 -5
  57. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -4
  58. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -23
  59. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -5
  60. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -34
  61. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -5
  62. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -65
  63. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -29
  64. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -85
  65. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +0 -12
  66. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.js +0 -237
  67. package/dist/src/executors/module-federation-static-server/schema.d.ts +0 -3
  68. package/dist/src/executors/module-federation-static-server/schema.json +0 -16
  69. package/dist/src/executors/rspack/rspack.impl.d.ts +0 -7
  70. package/dist/src/executors/rspack/rspack.impl.js +0 -127
  71. package/dist/src/executors/rspack/schema.json +0 -410
  72. package/dist/src/generators/convert-webpack/lib/transform-cjs.d.ts +0 -2
  73. package/dist/src/generators/convert-webpack/lib/transform-cjs.js +0 -263
  74. package/dist/src/generators/convert-webpack/lib/transform-esm.d.ts +0 -2
  75. package/dist/src/generators/convert-webpack/lib/transform-esm.js +0 -263
  76. package/dist/src/utils/has-plugin.d.ts +0 -2
  77. package/dist/src/utils/has-plugin.js +0 -10
  78. package/dist/src/utils/module-federation-deprecation.d.ts +0 -6
  79. package/dist/src/utils/module-federation-deprecation.js +0 -30
@@ -1,263 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformEsmConfigFile = transformEsmConfigFile;
4
- const tsquery_1 = require("@phenomnomnominal/tsquery");
5
- function transformEsmConfigFile(tree, configPath) {
6
- const configContents = tree.read(configPath, 'utf-8');
7
- const usesJsExtensions = detectJsExtensions(configContents);
8
- ['@nx', '@nrwl'].forEach((scope) => {
9
- transformComposePlugins(tree, configPath, scope);
10
- transformWithNx(tree, configPath, scope);
11
- transformWithWeb(tree, configPath, scope);
12
- transformWithReact(tree, configPath, scope);
13
- transformModuleFederationConfig(tree, configPath, scope);
14
- transformWithModuleFederation(tree, configPath, scope, usesJsExtensions);
15
- transformWithModuleFederationSSR(tree, configPath, scope, usesJsExtensions);
16
- });
17
- // Add useLegacyHtmlPlugin: true to withWeb() calls
18
- transformWithWebCalls(tree, configPath);
19
- }
20
- function detectJsExtensions(configContents) {
21
- // Check if any imports use .js extensions
22
- const importWithJsExtensionRegex = /from\s+['"]@nx\/[^'"]*\.js['"]/;
23
- return importWithJsExtensionRegex.test(configContents);
24
- }
25
- function transformWithWebCalls(tree, configPath) {
26
- const configContents = tree.read(configPath, 'utf-8');
27
- const sourceFile = (0, tsquery_1.ast)(configContents);
28
- // Find withWeb() calls
29
- const withWebCallNodes = (0, tsquery_1.query)(sourceFile, 'CallExpression > Identifier[name=withWeb]');
30
- // If there are withWeb calls, update them
31
- if (withWebCallNodes.length > 0) {
32
- let newContents = configContents;
33
- for (const node of withWebCallNodes) {
34
- const callExpr = node.parent;
35
- if (!callExpr)
36
- continue;
37
- const startPos = callExpr.getStart();
38
- const endPos = callExpr.getEnd();
39
- const callText = configContents.substring(startPos, endPos);
40
- // Skip if useLegacyHtmlPlugin is already present
41
- if (callText.includes('useLegacyHtmlPlugin')) {
42
- continue;
43
- }
44
- // If it's already withWeb({ ... }), add useLegacyHtmlPlugin: true to the options
45
- if (callText.includes('{') && callText.includes('}')) {
46
- const newCallText = callText.replace(/\{\s*/, '{ useLegacyHtmlPlugin: true,\n ');
47
- newContents =
48
- newContents.substring(0, startPos) +
49
- newCallText +
50
- newContents.substring(endPos);
51
- }
52
- else {
53
- // If it's just withWeb(), replace with withWeb({ useLegacyHtmlPlugin: true })
54
- const newCallText = 'withWeb({ useLegacyHtmlPlugin: true })';
55
- newContents =
56
- newContents.substring(0, startPos) +
57
- newCallText +
58
- newContents.substring(endPos);
59
- }
60
- }
61
- if (newContents !== configContents) {
62
- tree.write(configPath, newContents);
63
- }
64
- return;
65
- }
66
- // If no withWeb calls, check for withReact calls
67
- const withReactCallNodes = (0, tsquery_1.query)(sourceFile, 'CallExpression > Identifier[name=withReact]');
68
- if (withReactCallNodes.length === 0) {
69
- return;
70
- }
71
- let newContents = configContents;
72
- for (const node of withReactCallNodes) {
73
- const callExpr = node.parent;
74
- if (!callExpr)
75
- continue;
76
- const startPos = callExpr.getStart();
77
- const endPos = callExpr.getEnd();
78
- const callText = configContents.substring(startPos, endPos);
79
- // Skip if useLegacyHtmlPlugin is already present
80
- if (callText.includes('useLegacyHtmlPlugin')) {
81
- continue;
82
- }
83
- // If it's already withReact({ ... }), add useLegacyHtmlPlugin: true to the options
84
- if (callText.includes('{') && callText.includes('}')) {
85
- const newCallText = callText.replace(/\{\s*/, '{ useLegacyHtmlPlugin: true,\n ');
86
- newContents =
87
- newContents.substring(0, startPos) +
88
- newCallText +
89
- newContents.substring(endPos);
90
- }
91
- else {
92
- // If it's just withReact(), replace with withReact({ useLegacyHtmlPlugin: true })
93
- const newCallText = 'withReact({ useLegacyHtmlPlugin: true })';
94
- newContents =
95
- newContents.substring(0, startPos) +
96
- newCallText +
97
- newContents.substring(endPos);
98
- }
99
- }
100
- if (newContents !== configContents) {
101
- tree.write(configPath, newContents);
102
- }
103
- }
104
- function transformComposePlugins(tree, configPath, scope) {
105
- const configContents = tree.read(configPath, 'utf-8');
106
- const sourceFile = (0, tsquery_1.ast)(configContents);
107
- const HAS_COMPOSE_PLUGINS_FROM_NX_WEBPACK = `ImportDeclaration:has(Identifier[name=composePlugins]) > StringLiteral[value=${scope}/webpack]`;
108
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_COMPOSE_PLUGINS_FROM_NX_WEBPACK);
109
- if (nodes.length === 0) {
110
- return;
111
- }
112
- const COMPOSE_PLUGINS_IMPORT = 'ImportDeclaration:has(Identifier[name=composePlugins]) Identifier[name=composePlugins]';
113
- const composePluginsNodes = (0, tsquery_1.query)(sourceFile, COMPOSE_PLUGINS_IMPORT);
114
- if (nodes.length === 0) {
115
- return;
116
- }
117
- const startIndex = composePluginsNodes[0].getStart();
118
- let endIndex = composePluginsNodes[0].getEnd();
119
- if (configContents.charAt(endIndex) === ',') {
120
- endIndex++;
121
- }
122
- const newContents = `import { composePlugins } from '@nx/rspack';
123
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
124
- tree.write(configPath, newContents);
125
- }
126
- function transformWithNx(tree, configPath, scope) {
127
- const configContents = tree.read(configPath, 'utf-8');
128
- const sourceFile = (0, tsquery_1.ast)(configContents);
129
- const HAS_WITH_NX_FROM_NX_WEBPACK = `ImportDeclaration:has(Identifier[name=withNx]) > StringLiteral[value=${scope}/webpack]`;
130
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_NX_FROM_NX_WEBPACK);
131
- if (nodes.length === 0) {
132
- return;
133
- }
134
- const WITH_NX_IMPORT = 'ImportDeclaration:has(Identifier[name=withNx]) Identifier[name=withNx]';
135
- const withNxNodes = (0, tsquery_1.query)(sourceFile, WITH_NX_IMPORT);
136
- if (nodes.length === 0) {
137
- return;
138
- }
139
- const startIndex = withNxNodes[0].getStart();
140
- let endIndex = withNxNodes[0].getEnd();
141
- if (configContents.charAt(endIndex) === ',') {
142
- endIndex++;
143
- }
144
- const newContents = `import { withNx } from '@nx/rspack';
145
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
146
- tree.write(configPath, newContents);
147
- }
148
- function transformWithWeb(tree, configPath, scope) {
149
- const configContents = tree.read(configPath, 'utf-8');
150
- const sourceFile = (0, tsquery_1.ast)(configContents);
151
- const HAS_WITH_WEB_FROM_NX_WEBPACK = `ImportDeclaration:has(Identifier[name=withWeb]) > StringLiteral[value=${scope}/webpack]`;
152
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_WEB_FROM_NX_WEBPACK);
153
- if (nodes.length === 0) {
154
- return;
155
- }
156
- const WITH_WEB_IMPORT = 'ImportDeclaration:has(Identifier[name=withWeb]) Identifier[name=withWeb]';
157
- const withWebNodes = (0, tsquery_1.query)(sourceFile, WITH_WEB_IMPORT);
158
- if (nodes.length === 0) {
159
- return;
160
- }
161
- const startIndex = withWebNodes[0].getStart();
162
- let endIndex = withWebNodes[0].getEnd();
163
- if (configContents.charAt(endIndex) === ',') {
164
- endIndex++;
165
- }
166
- const newContents = `import { withWeb } from '@nx/rspack';
167
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
168
- tree.write(configPath, newContents);
169
- }
170
- function transformWithReact(tree, configPath, scope) {
171
- const configContents = tree.read(configPath, 'utf-8');
172
- const sourceFile = (0, tsquery_1.ast)(configContents);
173
- const HAS_WITH_REACT_FROM_NX_REACT = `ImportDeclaration:has(Identifier[name=withReact]) > StringLiteral[value=${scope}/react]`;
174
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_REACT_FROM_NX_REACT);
175
- if (nodes.length === 0) {
176
- return;
177
- }
178
- const WITH_REACT_IMPORT = 'ImportDeclaration:has(Identifier[name=withReact]) Identifier[name=withReact]';
179
- const withReactNodes = (0, tsquery_1.query)(sourceFile, WITH_REACT_IMPORT);
180
- if (nodes.length === 0) {
181
- return;
182
- }
183
- const startIndex = withReactNodes[0].getStart();
184
- let endIndex = withReactNodes[0].getEnd();
185
- if (configContents.charAt(endIndex) === ',') {
186
- endIndex++;
187
- }
188
- const newContents = `import { withReact } from '@nx/rspack';
189
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
190
- tree.write(configPath, newContents);
191
- }
192
- function transformWithModuleFederation(tree, configPath, scope, usesJsExtension) {
193
- const configContents = tree.read(configPath, 'utf-8');
194
- const sourceFile = (0, tsquery_1.ast)(configContents);
195
- const HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT = `ImportDeclaration:has(Identifier[name=withModuleFederation]) > StringLiteral[value="${scope}/module-federation/webpack${usesJsExtension ? '.js' : ''}"]`;
196
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT);
197
- if (nodes.length === 0) {
198
- return;
199
- }
200
- const WITH_MODULE_FEDERATION_IMPORT = 'ImportDeclaration:has(Identifier[name=withModuleFederation]) Identifier[name=withModuleFederation]';
201
- const withModuleFederationNodes = (0, tsquery_1.query)(sourceFile, WITH_MODULE_FEDERATION_IMPORT);
202
- if (nodes.length === 0) {
203
- return;
204
- }
205
- const startIndex = withModuleFederationNodes[0].getStart();
206
- let endIndex = withModuleFederationNodes[0].getEnd();
207
- if (configContents.charAt(endIndex) === ',') {
208
- endIndex++;
209
- }
210
- const moduleFederationImport = usesJsExtension
211
- ? '@nx/module-federation/rspack.js'
212
- : '@nx/module-federation/rspack';
213
- const newContents = `import { withModuleFederation } from '${moduleFederationImport}';
214
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
215
- tree.write(configPath, newContents);
216
- }
217
- function transformModuleFederationConfig(tree, configPath, scope) {
218
- const configContents = tree.read(configPath, 'utf-8');
219
- const sourceFile = (0, tsquery_1.ast)(configContents);
220
- const HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT = `ImportDeclaration:has(Identifier[name=ModuleFederationConfig]) > StringLiteral[value=${scope}/webpack]`;
221
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT);
222
- if (nodes.length === 0) {
223
- return;
224
- }
225
- const WITH_MODULE_FEDERATION_IMPORT = 'ImportDeclaration:has(Identifier[name=ModuleFederationConfig]) Identifier[name=ModuleFederationConfig]';
226
- const withModuleFederationNodes = (0, tsquery_1.query)(sourceFile, WITH_MODULE_FEDERATION_IMPORT);
227
- if (nodes.length === 0) {
228
- return;
229
- }
230
- const startIndex = withModuleFederationNodes[0].getStart();
231
- let endIndex = withModuleFederationNodes[0].getEnd();
232
- if (configContents.charAt(endIndex) === ',') {
233
- endIndex++;
234
- }
235
- const newContents = `import { ModuleFederationConfig } from '@nx/module-federation';
236
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
237
- tree.write(configPath, newContents);
238
- }
239
- function transformWithModuleFederationSSR(tree, configPath, scope, usesJsExtensions) {
240
- const configContents = tree.read(configPath, 'utf-8');
241
- const sourceFile = (0, tsquery_1.ast)(configContents);
242
- const HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT = `ImportDeclaration:has(Identifier[name=withModuleFederationForSSR]) > StringLiteral[value="${scope}/module-federation/webpack${usesJsExtensions ? '.js' : ''}"]`;
243
- const nodes = (0, tsquery_1.query)(sourceFile, HAS_WITH_MODULE_FEDERATION_FROM_NX_REACT);
244
- if (nodes.length === 0) {
245
- return;
246
- }
247
- const WITH_MODULE_FEDERATION_IMPORT = 'ImportDeclaration:has(Identifier[name=withModuleFederationForSSR]) Identifier[name=withModuleFederationForSSR]';
248
- const withModuleFederationNodes = (0, tsquery_1.query)(sourceFile, WITH_MODULE_FEDERATION_IMPORT);
249
- if (nodes.length === 0) {
250
- return;
251
- }
252
- const startIndex = withModuleFederationNodes[0].getStart();
253
- let endIndex = withModuleFederationNodes[0].getEnd();
254
- if (configContents.charAt(endIndex) === ',') {
255
- endIndex++;
256
- }
257
- const rspackImport = usesJsExtensions
258
- ? '@nx/module-federation/rspack.js'
259
- : '@nx/module-federation/rspack';
260
- const newContents = `import { withModuleFederationForSSR } from '${rspackImport}';
261
- ${configContents.slice(0, startIndex)}${configContents.slice(endIndex)}`;
262
- tree.write(configPath, newContents);
263
- }
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function hasPlugin(tree: Tree): boolean;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasPlugin = hasPlugin;
4
- const devkit_1 = require("@nx/devkit");
5
- function hasPlugin(tree) {
6
- const nxJson = (0, devkit_1.readNxJson)(tree);
7
- return !!nxJson.plugins?.some((p) => typeof p === 'string'
8
- ? p === '@nx/rspack/plugin'
9
- : p.plugin === '@nx/rspack/plugin');
10
- }
@@ -1,6 +0,0 @@
1
- export declare const RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/rspack:module-federation-dev-server` executor is deprecated and will be removed in Nx v24. Dynamic federation in `@nx/react:consumer` removes the need for host-orchestrated remote serving. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for the v23 migration guide.";
2
- export declare const RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/rspack:module-federation-ssr-dev-server` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see https://nx.dev/docs/technologies/module-federation/consumer-and-provider for guidance on wiring SSR with `@nx/react:consumer`.";
3
- export declare const RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = "The `@nx/rspack:module-federation-static-server` executor is deprecated and will be removed in Nx v24. Use plain `rsbuild preview` / `sirv-cli` via `nx:run-commands` if a static-serve workflow is still needed. See https://nx.dev/docs/technologies/module-federation/consumer-and-provider for details.";
4
- export declare function warnRspackMfDevServerExecutorDeprecation(): void;
5
- export declare function warnRspackMfSsrDevServerExecutorDeprecation(): void;
6
- export declare function warnRspackMfStaticServerExecutorDeprecation(): void;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = void 0;
4
- exports.warnRspackMfDevServerExecutorDeprecation = warnRspackMfDevServerExecutorDeprecation;
5
- exports.warnRspackMfSsrDevServerExecutorDeprecation = warnRspackMfSsrDevServerExecutorDeprecation;
6
- exports.warnRspackMfStaticServerExecutorDeprecation = warnRspackMfStaticServerExecutorDeprecation;
7
- const devkit_1 = require("@nx/devkit");
8
- // TODO(v24): Remove these MF executors. Dynamic federation in the new
9
- // `@nx/react:consumer` generator removes the orchestration need.
10
- const MIGRATION_URL = 'https://nx.dev/docs/technologies/module-federation/consumer-and-provider';
11
- exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-dev-server\` executor is deprecated and will be removed in Nx v24. Dynamic federation in \`@nx/react:consumer\` removes the need for host-orchestrated remote serving. See ${MIGRATION_URL} for the v23 migration guide.`;
12
- exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-ssr-dev-server\` executor is deprecated and will be removed in Nx v24. SSR is not first-classed in the new generators; see ${MIGRATION_URL} for guidance on wiring SSR with \`@nx/react:consumer\`.`;
13
- exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE = `The \`@nx/rspack:module-federation-static-server\` executor is deprecated and will be removed in Nx v24. Use plain \`rsbuild preview\` / \`sirv-cli\` via \`nx:run-commands\` if a static-serve workflow is still needed. See ${MIGRATION_URL} for details.`;
14
- // Executor warnings fire once per process to avoid flooding dev-server loops.
15
- const executorWarned = new Set();
16
- function warnOnce(key, message) {
17
- if (executorWarned.has(key))
18
- return;
19
- executorWarned.add(key);
20
- devkit_1.logger.warn(message);
21
- }
22
- function warnRspackMfDevServerExecutorDeprecation() {
23
- warnOnce('rspack-mf-dev-server', exports.RSPACK_MF_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
24
- }
25
- function warnRspackMfSsrDevServerExecutorDeprecation() {
26
- warnOnce('rspack-mf-ssr-dev-server', exports.RSPACK_MF_SSR_DEV_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
27
- }
28
- function warnRspackMfStaticServerExecutorDeprecation() {
29
- warnOnce('rspack-mf-static-server', exports.RSPACK_MF_STATIC_SERVER_EXECUTOR_DEPRECATION_MESSAGE);
30
- }