23 Commits

Author SHA1 Message Date
Colum Ferry
5157a0daf9
feat(module-federation): upgrade to latest version of @module-federation/enhanced (#29535)
## Current Behavior
We currently use version `0.7.6` of `@module-federation/enhanced`.
This version does not contain the `externalRuntime` experiment to reduce
the remoteEntry bundle size.

## Expected Behavior
Upgrade Nx dependency of `@module-federation/enhanced` to version
`0.8.8`.
2025-01-08 10:32:38 +00:00
Colum Ferry
16c8ba164c
fix(module-federation): dynamic federation helpers should normalize remote names (#29427)
## Current Behavior
After migration of existing remotes beyond Nx 19.8, dynamic manifest
federation files may be updated to match the normalized names of JS
variables (`_` instead of `-`).
Project names will not have been migrated, and therefore the logic to
find the projects based on the remote names is broken.

## Expected Behavior
Check the project graph for remote names as-is and by transforming `_`
to `-` to see if the project exists
2024-12-19 17:17:27 +00:00
Colum Ferry
7157e7a07c
fix(rspack): align @rspack/core versions (#29199)
Align rspack versions amongst packages and update useLegacyNxPlugin
helper to match new API changes
2024-12-04 18:05:49 +00:00
Colum Ferry
d32ca3788e
docs(module-federation): add link to module-federation.io (#29166)
Add a link to https://module-federation.io from the `@nx/module-federation` README
2024-12-03 14:45:20 +00:00
Colum Ferry
5448046f06
feat(module-federation): move common executor logic to module-federation package (#29151)
## Current Behavior
The logic for the `module-federation-dev-server` and
`module-federation-ssr-dev-server` is duplicated across Angular, React
and Rspack.

The majority of this logic is the same, and the duplication causes an
increased maintenance tax.

## Expected Behavior
Move the logic into a utility that is exposed from
`@nx/module-federation`.
2024-12-03 08:15:20 -05:00
Colum Ferry
182b46ca66
fix(module-federation): use 'hoisted' runtime for node to prevent issues with eager sharing (#29104)
## Current Behavior
SSR with Module Federation frequently encounters issues related to the
eager resolution of shared packages.
This has resulted in numerous erroneous behaviours including but not
limited to:
- Failure to start server
- Failure to resolve remotes
- Failure to server render remotes

## Expected Behavior
Using the `'hoisted'` runtime provided by MF 2.0, we can ensure that SSR
for Module Federation runs in an async environment, removing the issues
surrounding eager consumption and resolution of shared modules.
In testing, this has fixed the issues outlined above

## Related Issue(s)

Fixes #27000
Fixes #27964
2024-11-28 11:38:17 +00:00
Jason Jean
128778e7d1
chore(repo): update nx to 20.2.0-beta.3 and other dependencies (#29049)
<!-- 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 -->

This repo uses Nx `20.2.0-beta.2`.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

This repo uses Nx `20.2.0-beta.3`.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-22 18:49:51 -05:00
Colum Ferry
840d935d2e
feat(module-federation): move withModuleFederation for rspack to new package (#29045)
<!-- 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/rspack`
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/rspack`.
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 #
2024-11-22 13:26:00 -05:00
Colum Ferry
432d9d3b17
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 #
2024-11-22 08:28:13 -05:00
Colum Ferry
9ca15f75b0
feat(module-federation): move withModuleFederation for angular to new package (#29021)
<!-- 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/angular`
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/angular`.
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 #
2024-11-21 11:07:51 -05:00
Colum Ferry
79855a5471
feat(rspack): migrate to latest rspack versions (#29004)
<!-- 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 -->
We're currently installing Rspack 1.0.5. The latest is 1.1.2.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Ensure we install the latest for users, and migrate existing users to
latest

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-20 16:33:04 -05:00
Colum Ferry
7ece24c067
feat(module-federation): migrate to latest (#29005)
<!-- 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 -->
There is a runtime resolve bug in older versions of Module Federation
2.0 Packages.
It is fixed in v0.7.6
We're currently installing 0.6.9


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Migrate to the latest version of MF2.0 packages

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-20 14:03:52 -05:00
Colum Ferry
76d61ea5e6
feat(module-federation): consolidate module federation utils into module-federation package (#28919)
- feat(module-federation): consolidate module federation utils into
module-federation package
- chore(module-federation): fix tests and linting

<!-- 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 -->
Our current support for Module Federation relies on utilities that are
spread and duplicated across the `@nx/webpack` package and the
`@nx/rspack` package.



## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Now that we have a `@nx/module-federation` package, dedupe the utils and
consolidate them into a single package

## Todo
- [x] Migrations for React + Angular to install `@nx/module-federation`
and point `ModuleFederationConfig` export to that package from
webpack.config and rspack.config files
2024-11-18 14:15:10 -05:00
Jason Jean
08953af5ec
chore(module-federation): add public publish access (#28926)
<!-- 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 -->

`@nx/module-federation` cannot be published because it doesn't have
public publish access

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

`@nx/module-federation` can be published.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-13 13:32:51 -05:00
Colum Ferry
06af0ee53b
feat(module-federation): add initial module-federation package (#28783)
<!-- 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 -->
We do not currently have an `@nx/module-federation` package to house the
shared executors and utils for Module Federation across `Webpack`,
`Rspack` and `Angular`.


## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
Create a single package to store the Module Federation capabilities
within Nx

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-11-12 14:04:44 +00:00
Colum Ferry
1ab96b2f0b Revert "feat(module-federation): add module federation package (#12961)"
This reverts commit 377e3bd605f99e3843160b1577efca0ec01313b3.
2022-11-08 12:43:34 +00:00
Colum Ferry
cfd87f0643 Revert "feat(module-federation): add and expose share helpers and types (#12989)"
This reverts commit e08d7848b33c7fc271b470a1251747efd59d33a0.
2022-11-08 12:43:34 +00:00
Colum Ferry
7783fe0c4d Revert "feat(module-federation): expose additional helpers (#12990)"
This reverts commit 080543e76dcd980067e6aa55ae71bc4da905cafc.
2022-11-08 12:43:34 +00:00
Colum Ferry
b4a98dae41 Revert "feat(module-federation): allow package to be published (#12993)"
This reverts commit 142fdb4a7b05cee22c5b7d300c0f9fad90fac42b.
2022-11-08 12:43:34 +00:00
Colum Ferry
142fdb4a7b
feat(module-federation): allow package to be published (#12993) 2022-11-04 14:01:20 +00:00
Colum Ferry
080543e76d
feat(module-federation): expose additional helpers (#12990) 2022-11-04 12:58:10 +00:00
Colum Ferry
e08d7848b3
feat(module-federation): add and expose share helpers and types (#12989) 2022-11-04 12:01:22 +00:00
Colum Ferry
377e3bd605
feat(module-federation): add module federation package (#12961) 2022-11-04 09:33:46 +00:00