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

chore(runtime): remove duplicate registerRemotes warn #3325

Merged
merged 4 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/funny-drinks-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@module-federation/runtime': patch
---

chore(runtime): remove duplicate registerRemotes warn
6 changes: 2 additions & 4 deletions packages/runtime/src/remote/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,16 @@ export class RemoteHandler {
} else {
const messages = [
`The remote "${remote.name}" is already registered.`,
options?.force
? 'Hope you have known that OVERRIDE it may have some unexpected errors'
: 'If you want to merge the remote, you can set "force: true".',
'Hope you have known that OVERRIDE it may have some unexpected errors',
];
if (options?.force) {
// remove registered remote
this.removeRemote(registeredRemote);
normalizeRemote();
targetRemotes.push(remote);
this.hooks.lifecycle.registerRemote.emit({ remote, origin: host });
warn(messages.join(' '));
}
warn(messages.join(' '));
}
}

Expand Down
Loading