-
-
Notifications
You must be signed in to change notification settings - Fork 266
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: Fix call undefined delegate #1149
Conversation
75d7a16
to
d657030
Compare
re-export underlaying utilities to allow for less fragmentation of package versions for the sake of access to these tools
apps/3000-home/remote-delegate.js
Outdated
@@ -1,13 +1,11 @@ | |||
import {importDelegatedModule} from "@module-federation/utilities/src/utils/importDelegatedModule"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing eager import which should break application
@@ -457,7 +457,9 @@ class FederationStatsPlugin { | |||
// Iterate over each dependency within the block. | |||
for (const dep of blockmodule.dependencies) { | |||
// Get the module that corresponds to the dependency. | |||
const { module } = compilation.moduleGraph.getConnection(dep); | |||
const connection = compilation.moduleGraph.getConnection(dep); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only search valid module connections to relocate in graph
@@ -2,7 +2,7 @@ | |||
|
|||
import type { Compiler, container } from 'webpack'; | |||
import type { ModuleFederationPluginOptions } from '../types'; | |||
import { extractUrlAndGlobal } from '@module-federation/utilities'; | |||
import { extractUrlAndGlobal } from '@module-federation/utilities/src/utils/pure'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move pure utils to pure folder for smaller footprint of code moved into runtime module as eager
* fix: prevent module graph connection conflict I remove eager modules from remote, but in doing so also removes dependencies of delegate moduels, this preserves dependency tree of delegate module and removes all other eager references from eager:true * test: fix mock of delegate module eager flag * test: fix mock of delegate module eager flag * test: fix mock of delegate module eager flag
* fix: thrown error during chunk correlation of empty graph connection * fix: call of undefined errors in delegate modules * test: fix tests of delegate plugin * chore: prettier * refactor: improve package fragmentation re-export underlaying utilities to allow for less fragmentation of package versions for the sake of access to these tools * fix: prevent module graph connection conflict (module-federation#1151) * fix: prevent module graph connection conflict I remove eager modules from remote, but in doing so also removes dependencies of delegate moduels, this preserves dependency tree of delegate module and removes all other eager references from eager:true * test: fix mock of delegate module eager flag * test: fix mock of delegate module eager flag * test: fix mock of delegate module eager flag * feat: support next/image * style:lint fix * style:lint fix * style:lint fix
🎉 This PR is included in version 1.0.0-canary.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
If delegate module contains additional dependency modules that are not in module cache at time of invocation, webpack will crash with "call of undefined" error when attempting to execute missing module reference