Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module-federation): ensure @nx/module-federation package is installed for users #29416

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Dec 19, 2024

Current Behavior

The @nx/module-federation package is a direct dependency of some of the other packages in the Nx Plugin ecosystem.
It should be resolved correctly by package managers such that it can be used when setting up MF projects.

However, some users are facing issues with module resolutions where the package is not found as expected.

Expected Behavior

Install the package directly for the user to ensure module resolution works as expected.

Related Issue(s)

Fixes #29269

@Coly010 Coly010 requested review from a team as code owners December 19, 2024 10:35
@Coly010 Coly010 self-assigned this Dec 19, 2024
Copy link

vercel bot commented Dec 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Dec 19, 2024 11:52am

Copy link

nx-cloud bot commented Dec 19, 2024

View your CI Pipeline Execution ↗ for commit 4ef4c0d.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 7m 39s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 25s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx format:check --base=2eb52... ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗
nx documentation --no-dte ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2024-12-19 13:20:36 UTC

@Coly010 Coly010 force-pushed the module-federation/force-install-package branch from 7f385c1 to 4ef4c0d Compare December 19, 2024 11:50
@Coly010 Coly010 requested a review from leosvelperez December 19, 2024 11:50
@@ -5,6 +5,12 @@
"version": "20.2.0-beta.3",
"description": "Update the withModuleFederation import use @nx/module-federation/rspack.",
"factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package"
},
"ensure-nx-module-federation-package": {
Copy link
Member

@jaysoo jaysoo Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically already handled by Angular and React plugins right? Is there a scenario where those aren't installed by Rspack is? We don't do this for Webpack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each plugin is finding its own set of module-federation-dev-server executors to determine if MF projects exists.

I could combine the rspack ones into the react one, i just had them separated based on location of the executor

@Coly010 Coly010 merged commit 656d69b into master Dec 19, 2024
6 checks passed
@Coly010 Coly010 deleted the module-federation/force-install-package branch December 19, 2024 14:09
ndcunningham pushed a commit that referenced this pull request Dec 20, 2024
…lled for users (#29416)

## Current Behavior
The `@nx/module-federation` package is a direct dependency of some of
the other packages in the Nx Plugin ecosystem.
It should be resolved correctly by package managers such that it can be
used when setting up MF projects.

However, some users are facing issues with module resolutions where the
package is not found as expected.

## Expected Behavior
Install the package directly for the user to ensure module resolution
works as expected.

## Related Issue(s)

Fixes #29269
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NX 20.2.1, Newly created react-monorepo & module federation setup doesn't work
3 participants