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 {
671
671
) ;
672
672
if (
673
673
! activeVersion ||
674
- ( ! activeVersion . loaded &&
674
+ ( activeVersion . strategy !== 'loaded-first' &&
675
+ ! activeVersion . loaded &&
675
676
( Boolean ( ! eager ) !== ! activeVersionEager
676
677
? eager
677
678
: hostName > activeVersion . from ) )
@@ -699,7 +700,6 @@ export class FederationHost {
699
700
register ( shareName , shared ) ;
700
701
}
701
702
} ) ;
702
-
703
703
if ( strategy === 'version-first' ) {
704
704
this . options . remotes . forEach ( ( remote ) => {
705
705
if ( remote . shareScope === shareScopeName ) {
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class Module {
91
91
origin : this . host ,
92
92
} ) ;
93
93
94
- remoteEntryExports . init (
94
+ await remoteEntryExports . init (
95
95
initContainerOptions . shareScope ,
96
96
initContainerOptions . initScope ,
97
97
initContainerOptions . remoteEntryInitOptions ,
Original file line number Diff line number Diff line change @@ -130,5 +130,5 @@ export type RemoteEntryExports = {
130
130
shareScope : ShareScopeMap [ string ] ,
131
131
initScope ?: InitScope ,
132
132
remoteEntryInitOPtions ?: RemoteEntryInitOptions ,
133
- ) => void ;
133
+ ) => void | Promise < void > ;
134
134
} ;
You can’t perform that action at this time.
0 commit comments