-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(module-federation): move withModuleFederation for webpack to new…
… package (#29031) <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> The `withModuleFederation` helper currently lives in the `@nx/react` package. With the goal of consolidating the module federation support into a single package, this introduces a divergence in where module-federation support lies ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> Move `withModuleFederation` helper for angular into the `@nx/module-federation` package, exposed via `@nx/module-federation/webpack`. Adds a migration to migrate existing projects to use the new package ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
- Loading branch information
Showing
25 changed files
with
249 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...-federation/with-module-federation-ssr.ts → ...ion/webpack/with-module-federation-ssr.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 2 additions & 4 deletions
6
...dule-federation/with-module-federation.ts → ...eration/webpack/with-module-federation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './src/with-module-federation/webpack/with-module-federation'; | ||
export * from './src/with-module-federation/webpack/with-module-federation-ssr'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,23 @@ | ||
import { withModuleFederation } from './src/module-federation/with-module-federation'; | ||
import { withModuleFederationForSSR } from './src/module-federation/with-module-federation-ssr'; | ||
import { withModuleFederation } from '@nx/module-federation/webpack'; | ||
import { withModuleFederationForSSR } from '@nx/module-federation/webpack'; | ||
|
||
export { withModuleFederation }; | ||
export { withModuleFederationForSSR }; | ||
/** | ||
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22. | ||
*/ | ||
export { withModuleFederation, withModuleFederationForSSR }; | ||
|
||
// Support for older generated code: `const withModuleFederation = require('@nx/react/module-federation')` | ||
/** | ||
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22. | ||
*/ | ||
module.exports = withModuleFederation; | ||
|
||
// Allow newer generated code to work: `const { withModuleFederation } = require(...)`; | ||
/** | ||
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22. | ||
*/ | ||
module.exports.withModuleFederation = withModuleFederation; | ||
/** | ||
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22. | ||
*/ | ||
module.exports.withModuleFederationForSSR = withModuleFederationForSSR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...c/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...act/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/react/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/react/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../react/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../react/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ges/react/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.