Skip to content

Commit

Permalink
chore(runtime): remove duplicate registerRemotes warn (#3325)
Browse files Browse the repository at this point in the history
Co-authored-by: Zack Jackson <[email protected]>
Co-authored-by: ScriptedAlchemy <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent 70c07d5 commit f817674
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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".',
'Please note that overriding it may cause 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

0 comments on commit f817674

Please sign in to comment.