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): tuple remotes should have global identifier added if missing #29811

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jan 30, 2025

Current Behavior

Our Module Federation Config allows passing tuple remotes:

remotes: [
  ["remote1", "http://localhost:4201/remoteEntry.js"]
]

However, if the Module Federation system is expecting the remotes to be loaded as Global variables in the browser, then we erroneously pass just the url to webpack/rspack's extractUrlAndGlobal method.

This expects a string of format name@url. For non-tuple remote configurations, we create this correctly.
However, when a tuple is passed, we simply return the url.

Expected Behavior

We should ensure that the string is massaged to name@url even when a tuple is provided.

@Coly010 Coly010 requested a review from a team as a code owner January 30, 2025 10:57
@Coly010 Coly010 requested a review from leosvelperez January 30, 2025 10:57
@Coly010 Coly010 self-assigned this Jan 30, 2025
Copy link

vercel bot commented Jan 30, 2025

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 Jan 30, 2025 11:05am

Copy link

nx-cloud bot commented Jan 30, 2025

View your CI Pipeline Execution ↗ for commit 91c05d3.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 29m 8s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 12s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=10c14... ✅ 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 2025-01-30 11:37:23 UTC

@Coly010 Coly010 force-pushed the mf/ensure-mapped-remotes-include-global branch from 44c0905 to 91c05d3 Compare January 30, 2025 11:03
@Coly010 Coly010 merged commit 07f1215 into master Jan 30, 2025
5 checks passed
@Coly010 Coly010 deleted the mf/ensure-mapped-remotes-include-global branch January 30, 2025 12:52
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.

2 participants