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(react): setup mf env var as input for rspack #29584

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

Coly010
Copy link
Contributor

@Coly010 Coly010 commented Jan 10, 2025

Current Behavior

The Module Federation NxRuntimeLibraryControlPlugin relies on an environment variable that is set during the build/serve process.
This could potentially lead to issues with cache restoration.

The impact should be minimal as the runtime control plugin should only be added to the module federation config when the env var is set.
It should only be set by the module-federation-dev-server executor which is invoked during serve - a non-cacheable task already.

Expected Behavior

Ensure the env var is set as an input to ensure maximum accuracy with module federation builds via rspack executor

@Coly010 Coly010 requested a review from a team as a code owner January 10, 2025 16:09
@Coly010 Coly010 requested a review from jaysoo January 10, 2025 16:09
Copy link

vercel bot commented Jan 10, 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 10, 2025 4:11pm

@Coly010 Coly010 self-assigned this Jan 10, 2025
Copy link

nx-cloud bot commented Jan 10, 2025

View your CI Pipeline Execution ↗ for commit c4c5597.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 26m 33s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m 6s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=cbfc6... ✅ Succeeded 23s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 22s View ↗
nx documentation --no-dte ✅ Succeeded 42s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-10 16:42:05 UTC

@@ -8,10 +8,11 @@ import {
import { addMfEnvToTargetDefaultInputs } from '../../utils/add-mf-env-to-inputs';

export default async function (tree: Tree) {
if (!hasModuleFederationProject(tree)) {
const bundler = hasModuleFederationProject(tree);
Copy link
Member

Choose a reason for hiding this comment

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

Should there be another migration for 20.4 for projects created after v18?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Coly010 Coly010 merged commit dbdb72a into master Jan 10, 2025
6 checks passed
@Coly010 Coly010 deleted the fix/rspack-mf-defaults branch January 10, 2025 17:15
jaysoo pushed a commit that referenced this pull request Jan 10, 2025
## Current Behavior
The Module Federation `NxRuntimeLibraryControlPlugin` relies on an
environment variable that is set during the build/serve process.
This could potentially lead to issues with cache restoration.

The impact should be minimal as the runtime control plugin should only
be added to the module federation config when the env var is set.
It should only be set by the `module-federation-dev-server` executor
which is invoked during serve - a non-cacheable task already.

## Expected Behavior
Ensure the env var is set as an input to ensure maximum accuracy with
module federation builds via rspack executor
FrozenPandaz pushed a commit that referenced this pull request Jan 15, 2025
## Current Behavior
The Module Federation `NxRuntimeLibraryControlPlugin` relies on an
environment variable that is set during the build/serve process.
This could potentially lead to issues with cache restoration.

The impact should be minimal as the runtime control plugin should only
be added to the module federation config when the env var is set.
It should only be set by the `module-federation-dev-server` executor
which is invoked during serve - a non-cacheable task already.

## Expected Behavior
Ensure the env var is set as an input to ensure maximum accuracy with
module federation builds via rspack executor

(cherry picked from commit dbdb72a)
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants