@module-federation/runtime 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/share.cjs.js CHANGED
@@ -1,10 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  function getBuilderId() {
4
+ //@ts-ignore
4
5
  return typeof FEDERATION_BUILD_IDENTIFIER !== 'undefined' ? FEDERATION_BUILD_IDENTIFIER : '';
5
6
  }
6
7
  function isDebugMode() {
7
- return Boolean('');
8
+ return Boolean("");
8
9
  }
9
10
  function isBrowserEnv() {
10
11
  return typeof window !== 'undefined';
@@ -88,69 +89,71 @@ function _object_without_properties_loose(source, excluded) {
88
89
  }
89
90
  return target;
90
91
  }
91
- var _nativeGlobal___FEDERATION__, _nativeGlobal___FEDERATION__1, _nativeGlobal___FEDERATION__2, _nativeGlobal___FEDERATION__3, _nativeGlobal___FEDERATION__4, _nativeGlobal___FEDERATION__5, _nativeGlobal___FEDERATION__6;
92
92
  // export const nativeGlobal: typeof global = new Function('return this')();
93
93
  const nativeGlobal = new Function('return this')();
94
+ const Global = nativeGlobal;
95
+ function definePropertyGlobalVal(target, key, val) {
96
+ Object.defineProperty(target, key, {
97
+ value: val,
98
+ configurable: false,
99
+ writable: true
100
+ });
101
+ }
102
+ function includeOwnProperty(target, key) {
103
+ return Object.hasOwnProperty.call(target, key);
104
+ }
94
105
  // This section is to prevent encapsulation by certain microfrontend frameworks. Due to reuse policies, sandbox escapes.
95
106
  // The sandbox in the microfrontend does not replicate the value of 'configurable'.
96
107
  // If there is no loading content on the global object, this section defines the loading object.
97
- if (!Object.hasOwnProperty.call(globalThis, '__GLOBAL_LOADING_REMOTE_ENTRY__')) {
98
- Object.defineProperty(globalThis, '__GLOBAL_LOADING_REMOTE_ENTRY__', {
99
- value: {},
100
- configurable: false
101
- });
108
+ if (!includeOwnProperty(globalThis, '__GLOBAL_LOADING_REMOTE_ENTRY__')) {
109
+ definePropertyGlobalVal(globalThis, '__GLOBAL_LOADING_REMOTE_ENTRY__', {});
102
110
  }
103
111
  const globalLoading = globalThis.__GLOBAL_LOADING_REMOTE_ENTRY__;
104
- //
105
- if (nativeGlobal.__VMOK__) {
106
- nativeGlobal.__FEDERATION__ = nativeGlobal.__VMOK__;
107
- } else if (!nativeGlobal.__FEDERATION__) {
108
- nativeGlobal.__FEDERATION__ = {
109
- __GLOBAL_PLUGIN__: [],
110
- __INSTANCES__: [],
111
- moduleInfo: {},
112
- __SHARE__: {},
113
- __MANIFEST_LOADING__: {},
114
- __SHARE_SCOPE_LOADING__: {},
115
- __PRELOADED_MAP__: new Map()
116
- };
117
- nativeGlobal.__VMOK__ = nativeGlobal.__FEDERATION__;
118
- }
119
- var ___GLOBAL_PLUGIN__;
120
- (___GLOBAL_PLUGIN__ = (_nativeGlobal___FEDERATION__ = nativeGlobal.__FEDERATION__).__GLOBAL_PLUGIN__) != null ? ___GLOBAL_PLUGIN__ : _nativeGlobal___FEDERATION__.__GLOBAL_PLUGIN__ = [];
121
- var ___INSTANCES__;
122
- (___INSTANCES__ = (_nativeGlobal___FEDERATION__1 = nativeGlobal.__FEDERATION__).__INSTANCES__) != null ? ___INSTANCES__ : _nativeGlobal___FEDERATION__1.__INSTANCES__ = [];
123
- var _moduleInfo;
124
- (_moduleInfo = (_nativeGlobal___FEDERATION__2 = nativeGlobal.__FEDERATION__).moduleInfo) != null ? _moduleInfo : _nativeGlobal___FEDERATION__2.moduleInfo = {};
125
- var ___SHARE__;
126
- (___SHARE__ = (_nativeGlobal___FEDERATION__3 = nativeGlobal.__FEDERATION__).__SHARE__) != null ? ___SHARE__ : _nativeGlobal___FEDERATION__3.__SHARE__ = {};
127
- var ___MANIFEST_LOADING__;
128
- (___MANIFEST_LOADING__ = (_nativeGlobal___FEDERATION__4 = nativeGlobal.__FEDERATION__).__MANIFEST_LOADING__) != null ? ___MANIFEST_LOADING__ : _nativeGlobal___FEDERATION__4.__MANIFEST_LOADING__ = {};
129
- var ___SHARE_SCOPE_LOADING__;
130
- (___SHARE_SCOPE_LOADING__ = (_nativeGlobal___FEDERATION__5 = nativeGlobal.__FEDERATION__).__SHARE_SCOPE_LOADING__) != null ? ___SHARE_SCOPE_LOADING__ : _nativeGlobal___FEDERATION__5.__SHARE_SCOPE_LOADING__ = {};
131
- var ___PRELOADED_MAP__;
132
- (___PRELOADED_MAP__ = (_nativeGlobal___FEDERATION__6 = nativeGlobal.__FEDERATION__).__PRELOADED_MAP__) != null ? ___PRELOADED_MAP__ : _nativeGlobal___FEDERATION__6.__PRELOADED_MAP__ = new Map();
133
- const Global = {
134
- get __FEDERATION__ () {
135
- const globalThisVal = new Function('return globalThis')();
136
- return globalThisVal.__FEDERATION__;
112
+ function setGlobalDefaultVal(target) {
113
+ var _target___FEDERATION__, _target___FEDERATION__1, _target___FEDERATION__2, _target___FEDERATION__3, _target___FEDERATION__4, _target___FEDERATION__5;
114
+ if (includeOwnProperty(target, '__VMOK__') && !includeOwnProperty(target, '__FEDERATION__')) {
115
+ definePropertyGlobalVal(target, '__FEDERATION__', target.__VMOK__);
137
116
  }
138
- };
117
+ if (!includeOwnProperty(target, '__FEDERATION__')) {
118
+ definePropertyGlobalVal(target, '__FEDERATION__', {
119
+ __GLOBAL_PLUGIN__: [],
120
+ __INSTANCES__: [],
121
+ moduleInfo: {},
122
+ __SHARE__: {},
123
+ __MANIFEST_LOADING__: {},
124
+ __PRELOADED_MAP__: new Map()
125
+ });
126
+ definePropertyGlobalVal(target, '__VMOK__', target.__FEDERATION__);
127
+ }
128
+ var ___GLOBAL_PLUGIN__;
129
+ (___GLOBAL_PLUGIN__ = (_target___FEDERATION__ = target.__FEDERATION__).__GLOBAL_PLUGIN__) != null ? ___GLOBAL_PLUGIN__ : _target___FEDERATION__.__GLOBAL_PLUGIN__ = [];
130
+ var ___INSTANCES__;
131
+ (___INSTANCES__ = (_target___FEDERATION__1 = target.__FEDERATION__).__INSTANCES__) != null ? ___INSTANCES__ : _target___FEDERATION__1.__INSTANCES__ = [];
132
+ var _moduleInfo;
133
+ (_moduleInfo = (_target___FEDERATION__2 = target.__FEDERATION__).moduleInfo) != null ? _moduleInfo : _target___FEDERATION__2.moduleInfo = {};
134
+ var ___SHARE__;
135
+ (___SHARE__ = (_target___FEDERATION__3 = target.__FEDERATION__).__SHARE__) != null ? ___SHARE__ : _target___FEDERATION__3.__SHARE__ = {};
136
+ var ___MANIFEST_LOADING__;
137
+ (___MANIFEST_LOADING__ = (_target___FEDERATION__4 = target.__FEDERATION__).__MANIFEST_LOADING__) != null ? ___MANIFEST_LOADING__ : _target___FEDERATION__4.__MANIFEST_LOADING__ = {};
138
+ var ___PRELOADED_MAP__;
139
+ (___PRELOADED_MAP__ = (_target___FEDERATION__5 = target.__FEDERATION__).__PRELOADED_MAP__) != null ? ___PRELOADED_MAP__ : _target___FEDERATION__5.__PRELOADED_MAP__ = new Map();
140
+ }
141
+ setGlobalDefaultVal(globalThis);
142
+ setGlobalDefaultVal(nativeGlobal);
139
143
  function resetFederationGlobalInfo() {
140
- nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__ = [];
141
- nativeGlobal.__FEDERATION__.__INSTANCES__ = [];
142
- nativeGlobal.__FEDERATION__.moduleInfo = {};
143
- nativeGlobal.__FEDERATION__.__SHARE__ = {};
144
- nativeGlobal.__FEDERATION__.__MANIFEST_LOADING__ = {};
145
- nativeGlobal.__FEDERATION__.__SHARE_SCOPE_LOADING__ = {};
144
+ globalThis.__FEDERATION__.__GLOBAL_PLUGIN__ = [];
145
+ globalThis.__FEDERATION__.__INSTANCES__ = [];
146
+ globalThis.__FEDERATION__.moduleInfo = {};
147
+ globalThis.__FEDERATION__.__SHARE__ = {};
148
+ globalThis.__FEDERATION__.__MANIFEST_LOADING__ = {};
146
149
  }
147
150
  function getGlobalFederationInstance(name, version) {
148
151
  const buildId = getBuilderId();
149
- return Global.__FEDERATION__.__INSTANCES__.find((GMInstance)=>{
152
+ return globalThis.__FEDERATION__.__INSTANCES__.find((GMInstance)=>{
150
153
  if (buildId && GMInstance.options.id === getBuilderId()) {
151
154
  return true;
152
155
  }
153
- if (GMInstance.options.name === name && !version) {
156
+ if (GMInstance.options.name === name && !GMInstance.options.version && !version) {
154
157
  return true;
155
158
  }
156
159
  if (GMInstance.options.name === name && version && GMInstance.options.version === version) {
@@ -160,15 +163,15 @@ function getGlobalFederationInstance(name, version) {
160
163
  });
161
164
  }
162
165
  function setGlobalFederationInstance(FederationInstance) {
163
- Global.__FEDERATION__.__INSTANCES__.push(FederationInstance);
166
+ globalThis.__FEDERATION__.__INSTANCES__.push(FederationInstance);
164
167
  }
165
168
  function getGlobalFederationConstructor() {
166
- return Global.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
169
+ return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__;
167
170
  }
168
171
  function setGlobalFederationConstructor(FederationConstructor) {
169
172
  if (isDebugMode()) {
170
- Global.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
171
- Global.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = '0.0.6';
173
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
174
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.8";
172
175
  }
173
176
  }
174
177
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -183,7 +186,7 @@ function getInfoWithoutType(target, key, getModuleInfoHook) {
183
186
  }
184
187
  return res;
185
188
  }
186
- const getGlobalSnapshot = ()=>Global.__FEDERATION__.moduleInfo;
189
+ const getGlobalSnapshot = ()=>nativeGlobal.__FEDERATION__.moduleInfo;
187
190
  const getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot, getModuleInfoHook)=>{
188
191
  // Check if the remote is included in the hostSnapshot
189
192
  const moduleKey = getFMId(moduleInfo);
@@ -201,25 +204,25 @@ const getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot, getModuleInfoHo
201
204
  "version"
202
205
  ]);
203
206
  const moduleKeyWithoutVersion = getFMId(resModuleInfo);
204
- const getModuleInfoWithoutVersion = getInfoWithoutType(Global.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion, getModuleInfoHook).value;
207
+ const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion, getModuleInfoHook).value;
205
208
  if ((getModuleInfoWithoutVersion == null ? void 0 : getModuleInfoWithoutVersion.version) === version) {
206
209
  return getModuleInfoWithoutVersion;
207
210
  }
208
211
  }
209
212
  return;
210
213
  };
211
- const getGlobalSnapshotInfoByModuleInfo = (moduleInfo, extraOptions)=>getTargetSnapshotInfoByModuleInfo(moduleInfo, Global.__FEDERATION__.moduleInfo, extraOptions == null ? void 0 : extraOptions.getModuleInfoHook);
214
+ const getGlobalSnapshotInfoByModuleInfo = (moduleInfo, extraOptions)=>getTargetSnapshotInfoByModuleInfo(moduleInfo, nativeGlobal.__FEDERATION__.moduleInfo, extraOptions == null ? void 0 : extraOptions.getModuleInfoHook);
212
215
  const setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo)=>{
213
216
  const moduleKey = getFMId(remoteInfo);
214
- Global.__FEDERATION__.moduleInfo[moduleKey] = moduleDetailInfo;
215
- return Global.__FEDERATION__.moduleInfo;
217
+ nativeGlobal.__FEDERATION__.moduleInfo[moduleKey] = moduleDetailInfo;
218
+ return nativeGlobal.__FEDERATION__.moduleInfo;
216
219
  };
217
220
  const addGlobalSnapshot = (moduleInfos)=>{
218
- Global.__FEDERATION__.moduleInfo = _extends$1({}, Global.__FEDERATION__.moduleInfo, moduleInfos);
221
+ nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
219
222
  return ()=>{
220
223
  const keys = Object.keys(moduleInfos);
221
224
  for (const key of keys){
222
- delete Global.__FEDERATION__.moduleInfo[key];
225
+ delete nativeGlobal.__FEDERATION__.moduleInfo[key];
223
226
  }
224
227
  };
225
228
  };
@@ -236,7 +239,7 @@ const getRemoteEntryExports = (name, globalName)=>{
236
239
  // If a plugin is not registered, it is added to the global plugins.
237
240
  // If a plugin is already registered, a warning message is logged.
238
241
  const registerGlobalPlugins = (plugins)=>{
239
- const { __GLOBAL_PLUGIN__ } = Global.__FEDERATION__;
242
+ const { __GLOBAL_PLUGIN__ } = nativeGlobal.__FEDERATION__;
240
243
  plugins.forEach((plugin)=>{
241
244
  if (__GLOBAL_PLUGIN__.findIndex((p)=>p.name === plugin.name) === -1) {
242
245
  __GLOBAL_PLUGIN__.push(plugin);
@@ -245,9 +248,9 @@ const registerGlobalPlugins = (plugins)=>{
245
248
  }
246
249
  });
247
250
  };
248
- const getGlobalHostPlugins = ()=>Global.__FEDERATION__.__GLOBAL_PLUGIN__;
249
- const getPreloaded = (id)=>Global.__FEDERATION__.__PRELOADED_MAP__.get(id);
250
- const setPreloaded = (id)=>Global.__FEDERATION__.__PRELOADED_MAP__.set(id, true);
251
+ const getGlobalHostPlugins = ()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__;
252
+ const getPreloaded = (id)=>globalThis.__FEDERATION__.__PRELOADED_MAP__.get(id);
253
+ const setPreloaded = (id)=>globalThis.__FEDERATION__.__PRELOADED_MAP__.set(id, true);
251
254
 
252
255
  const DEFAULT_SCOPE = 'default';
253
256
  const DEFAULT_REMOTE_TYPE = 'global';
@@ -617,14 +620,16 @@ function formatShare(shareArgs, from) {
617
620
  deps: [],
618
621
  useIn: [],
619
622
  from,
620
- shareConfig: {
621
- requiredVersion: `^${shareArgs.version}`,
622
- singleton: false,
623
- eager: false
624
- },
625
623
  loading: null
626
624
  }, shareArgs, {
625
+ shareConfig: _extends({
626
+ requiredVersion: `^${shareArgs.version}`,
627
+ singleton: false,
628
+ eager: false,
629
+ strictVersion: false
630
+ }, shareArgs.shareConfig),
627
631
  get,
632
+ loaded: 'lib' in shareArgs ? true : undefined,
628
633
  scope: Array.isArray(shareArgs.scope) ? shareArgs.scope : [
629
634
  'default'
630
635
  ],
@@ -641,15 +646,26 @@ function formatShareConfigs(shareArgs, from) {
641
646
  }, {});
642
647
  }
643
648
  function versionLt(a, b) {
644
- if (satisfy(a, `<=${b}`)) {
649
+ const transformInvalidVersion = (version)=>{
650
+ const isNumberVersion = !Number.isNaN(Number(version));
651
+ if (isNumberVersion) {
652
+ const splitArr = version.split('.');
653
+ let validVersion = version;
654
+ for(let i = 0; i < 3 - splitArr.length; i++){
655
+ validVersion += '.0';
656
+ }
657
+ return validVersion;
658
+ }
659
+ return version;
660
+ };
661
+ if (satisfy(transformInvalidVersion(a), `<=${transformInvalidVersion(b)}`)) {
645
662
  return true;
646
663
  } else {
647
664
  return false;
648
665
  }
649
666
  }
650
- const findVersion = (scope, pkgName, cb)=>{
651
- const globalShares = Global.__FEDERATION__.__SHARE__;
652
- const versions = globalShares[scope][pkgName];
667
+ const findVersion = (shareScopeMap, scope, pkgName, cb)=>{
668
+ const versions = shareScopeMap[scope][pkgName];
653
669
  const callback = cb || function(prev, cur) {
654
670
  return versionLt(prev, cur);
655
671
  };
@@ -660,20 +676,22 @@ const findVersion = (scope, pkgName, cb)=>{
660
676
  if (callback(prev, cur)) {
661
677
  return cur;
662
678
  }
679
+ // default version is '0' https://github.com/webpack/webpack/blob/main/lib/sharing/ProvideSharedModule.js#L136
680
+ if (prev === '0') {
681
+ return cur;
682
+ }
663
683
  return prev;
664
684
  }, 0);
665
685
  };
666
- function findSingletonVersionOrderByVersion(scope, pkgName) {
667
- const globalShares = Global.__FEDERATION__.__SHARE__;
668
- const versions = globalShares[scope][pkgName];
686
+ function findSingletonVersionOrderByVersion(shareScopeMap, scope, pkgName) {
687
+ const versions = shareScopeMap[scope][pkgName];
669
688
  const callback = function(prev, cur) {
670
689
  return !versions[prev].loaded && versionLt(prev, cur);
671
690
  };
672
- return findVersion(scope, pkgName, callback);
691
+ return findVersion(shareScopeMap, scope, pkgName, callback);
673
692
  }
674
- function findSingletonVersionOrderByLoaded(scope, pkgName) {
675
- const globalShares = Global.__FEDERATION__.__SHARE__;
676
- const versions = globalShares[scope][pkgName];
693
+ function findSingletonVersionOrderByLoaded(shareScopeMap, scope, pkgName) {
694
+ const versions = shareScopeMap[scope][pkgName];
677
695
  const callback = function(prev, cur) {
678
696
  if (versions[cur].loaded) {
679
697
  if (versions[prev].loaded) {
@@ -687,45 +705,63 @@ function findSingletonVersionOrderByLoaded(scope, pkgName) {
687
705
  }
688
706
  return versionLt(prev, cur);
689
707
  };
690
- return findVersion(scope, pkgName, callback);
708
+ return findVersion(shareScopeMap, scope, pkgName, callback);
709
+ }
710
+ function getFindShareFunction(strategy) {
711
+ if (strategy === 'loaded-first') {
712
+ return findSingletonVersionOrderByLoaded;
713
+ }
714
+ return findSingletonVersionOrderByVersion;
691
715
  }
692
- // Details about shared resources
693
- // TODO: Implement strictVersion for alignment with module federation.
694
- function getGlobalShare(pkgName, shareInfo) {
695
- const globalShares = Global.__FEDERATION__.__SHARE__;
716
+ function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare) {
717
+ if (!localShareScopeMap) {
718
+ return;
719
+ }
696
720
  const { shareConfig, scope = DEFAULT_SCOPE, strategy } = shareInfo;
697
721
  const scopes = Array.isArray(scope) ? scope : [
698
722
  scope
699
723
  ];
700
724
  for (const sc of scopes){
701
- if (shareConfig && globalShares[sc] && globalShares[sc][pkgName]) {
725
+ if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
702
726
  const { requiredVersion } = shareConfig;
703
- // eslint-disable-next-line max-depth
704
- if (shareConfig.singleton) {
705
- const singletonVersion = strategy === 'loaded-first' ? findSingletonVersionOrderByLoaded(sc, pkgName) : findSingletonVersionOrderByVersion(sc, pkgName);
706
- // eslint-disable-next-line max-depth
707
- if (typeof requiredVersion === 'string' && !satisfy(singletonVersion, requiredVersion)) {
708
- warn(`Version ${singletonVersion} from ${singletonVersion && globalShares[sc][pkgName][singletonVersion].from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`);
709
- }
710
- return globalShares[sc][pkgName][singletonVersion];
711
- } else {
712
- const maxVersion = findSingletonVersionOrderByLoaded(sc, pkgName);
713
- // eslint-disable-next-line max-depth
714
- if (requiredVersion === false || requiredVersion === '*') {
715
- return globalShares[sc][pkgName][maxVersion];
716
- }
717
- // eslint-disable-next-line max-depth
718
- if (satisfy(maxVersion, requiredVersion)) {
719
- return globalShares[sc][pkgName][maxVersion];
720
- }
721
- // eslint-disable-next-line max-depth
722
- for (const [versionKey, versionValue] of Object.entries(globalShares[sc][pkgName])){
723
- // eslint-disable-next-line max-depth
724
- if (satisfy(versionKey, requiredVersion)) {
725
- return versionValue;
727
+ const findShareFunction = getFindShareFunction(strategy);
728
+ const maxOrSingletonVersion = findShareFunction(localShareScopeMap, sc, pkgName);
729
+ //@ts-ignore
730
+ const defaultResolver = ()=>{
731
+ if (shareConfig.singleton) {
732
+ if (typeof requiredVersion === 'string' && !satisfy(maxOrSingletonVersion, requiredVersion)) {
733
+ const msg = `Version ${maxOrSingletonVersion} from ${maxOrSingletonVersion && localShareScopeMap[sc][pkgName][maxOrSingletonVersion].from} of shared singleton module ${pkgName} does not satisfy the requirement of ${shareInfo.from} which needs ${requiredVersion})`;
734
+ if (shareConfig.strictVersion) {
735
+ error(msg);
736
+ } else {
737
+ warn(msg);
738
+ }
739
+ }
740
+ return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
741
+ } else {
742
+ if (requiredVersion === false || requiredVersion === '*') {
743
+ return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
744
+ }
745
+ if (satisfy(maxOrSingletonVersion, requiredVersion)) {
746
+ return localShareScopeMap[sc][pkgName][maxOrSingletonVersion];
747
+ }
748
+ for (const [versionKey, versionValue] of Object.entries(localShareScopeMap[sc][pkgName])){
749
+ if (satisfy(versionKey, requiredVersion)) {
750
+ return versionValue;
751
+ }
726
752
  }
727
753
  }
728
- }
754
+ };
755
+ const params = {
756
+ shareScopeMap: localShareScopeMap,
757
+ scope: sc,
758
+ pkgName,
759
+ version: maxOrSingletonVersion,
760
+ GlobalFederation: Global.__FEDERATION__,
761
+ resolver: defaultResolver
762
+ };
763
+ const resolveShared = resolveShare.emit(params) || params;
764
+ return resolveShared.resolver();
729
765
  }
730
766
  }
731
767
  }
@@ -746,12 +782,12 @@ exports.getFMId = getFMId;
746
782
  exports.getGlobalFederationConstructor = getGlobalFederationConstructor;
747
783
  exports.getGlobalFederationInstance = getGlobalFederationInstance;
748
784
  exports.getGlobalHostPlugins = getGlobalHostPlugins;
749
- exports.getGlobalShare = getGlobalShare;
750
785
  exports.getGlobalShareScope = getGlobalShareScope;
751
786
  exports.getGlobalSnapshot = getGlobalSnapshot;
752
787
  exports.getGlobalSnapshotInfoByModuleInfo = getGlobalSnapshotInfoByModuleInfo;
753
788
  exports.getInfoWithoutType = getInfoWithoutType;
754
789
  exports.getPreloaded = getPreloaded;
790
+ exports.getRegisteredShare = getRegisteredShare;
755
791
  exports.getRemoteEntryExports = getRemoteEntryExports;
756
792
  exports.getTargetSnapshotInfoByModuleInfo = getTargetSnapshotInfoByModuleInfo;
757
793
  exports.globalLoading = globalLoading;