File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @module-federation/runtime ' : patch
3+ ---
4+
5+ fix(runtime): runtime should not pre-register shared while strategy is 'loaded-first'
Original file line number Diff line number Diff line change @@ -671,7 +671,8 @@ export class FederationHost {
671671 ) ;
672672 if (
673673 ! activeVersion ||
674- ( ! activeVersion . loaded &&
674+ ( activeVersion . strategy !== 'loaded-first' &&
675+ ! activeVersion . loaded &&
675676 ( Boolean ( ! eager ) !== ! activeVersionEager
676677 ? eager
677678 : hostName > activeVersion . from ) )
@@ -699,7 +700,6 @@ export class FederationHost {
699700 register ( shareName , shared ) ;
700701 }
701702 } ) ;
702-
703703 if ( strategy === 'version-first' ) {
704704 this . options . remotes . forEach ( ( remote ) => {
705705 if ( remote . shareScope === shareScopeName ) {
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class Module {
9191 origin : this . host ,
9292 } ) ;
9393
94- remoteEntryExports . init (
94+ await remoteEntryExports . init (
9595 initContainerOptions . shareScope ,
9696 initContainerOptions . initScope ,
9797 initContainerOptions . remoteEntryInitOptions ,
Original file line number Diff line number Diff line change @@ -130,5 +130,5 @@ export type RemoteEntryExports = {
130130 shareScope : ShareScopeMap [ string ] ,
131131 initScope ?: InitScope ,
132132 remoteEntryInitOPtions ?: RemoteEntryInitOptions ,
133- ) => void ;
133+ ) => void | Promise < void > ;
134134} ;
You can’t perform that action at this time.
0 commit comments