@module-federation/runtime 0.6.15 → 0.6.16

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.
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var share = require('./share.cjs.js');
4
- require('./polyfills.cjs.js');
5
- require('@module-federation/sdk');
6
4
 
7
5
  const ShareUtils = {
8
6
  getRegisteredShare: share.getRegisteredShare,
@@ -1,6 +1,4 @@
1
1
  import { g as getRegisteredShare, a as getGlobalShareScope, G as Global, n as nativeGlobal, r as resetFederationGlobalInfo, b as getGlobalFederationInstance, s as setGlobalFederationInstance, c as getGlobalFederationConstructor, d as setGlobalFederationConstructor, e as getInfoWithoutType, f as getGlobalSnapshot, h as getTargetSnapshotInfoByModuleInfo, i as getGlobalSnapshotInfoByModuleInfo, j as setGlobalSnapshotInfoByModuleInfo, k as addGlobalSnapshot, l as getRemoteEntryExports, m as registerGlobalPlugins, o as getGlobalHostPlugins, p as getPreloaded, q as setPreloaded } from './share.esm.js';
2
- import './polyfills.esm.js';
3
- import '@module-federation/sdk';
4
2
 
5
3
  const ShareUtils = {
6
4
  getRegisteredShare,
package/dist/index.cjs.js CHANGED
@@ -3,6 +3,7 @@
3
3
  var polyfills = require('./polyfills.cjs.js');
4
4
  var sdk = require('@module-federation/sdk');
5
5
  var share = require('./share.cjs.js');
6
+ var errorCodes = require('@module-federation/error-codes');
6
7
 
7
8
  // Function to match a remote with its name and expose
8
9
  // id: pkgName(@federation/app1) + expose(button) = @federation/app1/button
@@ -146,12 +147,11 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
146
147
  }
147
148
  }).then(()=>{
148
149
  const { remoteEntryKey, entryExports } = share.getRemoteEntryExports(name, globalName);
149
- share.assert(entryExports, `
150
- Unable to use the ${name}'s '${entry}' URL with ${remoteEntryKey}'s globalName to get remoteEntry exports.
151
- Possible reasons could be:\n
152
- 1. '${entry}' is not the correct URL, or the remoteEntry resource or name is incorrect.\n
153
- 2. ${remoteEntryKey} cannot be used to get remoteEntry exports in the window object.
154
- `);
150
+ share.assert(entryExports, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_001, errorCodes.runtimeDescMap, {
151
+ remoteName: name,
152
+ remoteEntryUrl: entry,
153
+ remoteEntryKey
154
+ }));
155
155
  return entryExports;
156
156
  }).catch((e)=>{
157
157
  throw e;
@@ -205,12 +205,11 @@ async function loadEntryNode({ remoteInfo, createScriptHook }) {
205
205
  }
206
206
  }).then(()=>{
207
207
  const { remoteEntryKey, entryExports } = share.getRemoteEntryExports(name, globalName);
208
- share.assert(entryExports, `
209
- Unable to use the ${name}'s '${entry}' URL with ${remoteEntryKey}'s globalName to get remoteEntry exports.
210
- Possible reasons could be:\n
211
- 1. '${entry}' is not the correct URL, or the remoteEntry resource or name is incorrect.\n
212
- 2. ${remoteEntryKey} cannot be used to get remoteEntry exports in the window object.
213
- `);
208
+ share.assert(entryExports, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_001, errorCodes.runtimeDescMap, {
209
+ remoteName: name,
210
+ remoteEntryUrl: entry,
211
+ remoteEntryKey
212
+ }));
214
213
  return entryExports;
215
214
  }).catch((e)=>{
216
215
  throw e;
@@ -305,7 +304,11 @@ let Module = class Module {
305
304
  origin: this.host
306
305
  });
307
306
  if (typeof (remoteEntryExports == null ? void 0 : remoteEntryExports.init) === 'undefined') {
308
- share.logger.error('The remote entry interface does not contain "init"', '\n', 'Ensure the name of this remote is not reserved or in use. Check if anything already exists on window[nameOfRemote]', '\n', 'Ensure that window[nameOfRemote] is returning a {get,init} object.');
307
+ share.error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_002, errorCodes.runtimeDescMap, {
308
+ remoteName: name,
309
+ remoteEntryUrl: this.remoteInfo.entry,
310
+ remoteEntryKey: this.remoteInfo.entryGlobalName
311
+ }));
309
312
  }
310
313
  await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
311
314
  await this.host.hooks.lifecycle.initContainer.emit(polyfills._extends({}, initContainerOptions, {
@@ -1109,12 +1112,11 @@ class SnapshotHandler {
1109
1112
  globalSnapshot: globalSnapshotRes
1110
1113
  };
1111
1114
  } else {
1112
- share.error(`
1113
- Cannot get remoteSnapshot with the name: '${moduleInfo.name}', version: '${moduleInfo.version}' from __FEDERATION__.moduleInfo. The following reasons may be causing the problem:\n
1114
- 1. The Deploy platform did not deliver the correct data. You can use __FEDERATION__.moduleInfo to check the remoteInfo.\n
1115
- 2. The remote '${moduleInfo.name}' version '${moduleInfo.version}' is not released.\n
1116
- The transformed module info: ${JSON.stringify(globalSnapshotRes)}
1117
- `);
1115
+ share.error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_007, errorCodes.runtimeDescMap, {
1116
+ hostName: moduleInfo.name,
1117
+ hostVersion: moduleInfo.version,
1118
+ globalSnapshot: JSON.stringify(globalSnapshotRes)
1119
+ }));
1118
1120
  }
1119
1121
  }
1120
1122
  }
@@ -1138,9 +1140,10 @@ class SnapshotHandler {
1138
1140
  return manifestJson;
1139
1141
  } catch (err) {
1140
1142
  delete this.manifestLoading[manifestUrl];
1141
- share.error(`Failed to get manifestJson for ${moduleInfo.name}. The manifest URL is ${manifestUrl}. Please ensure that the manifestUrl is accessible.
1142
- \n Error message:
1143
- \n ${err}`);
1143
+ share.error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_003, errorCodes.runtimeDescMap, {
1144
+ manifestUrl,
1145
+ moduleName: moduleInfo.name
1146
+ }, `${err}`));
1144
1147
  }
1145
1148
  };
1146
1149
  const asyncLoadProcess = async ()=>{
@@ -1443,12 +1446,11 @@ class SharedHandler {
1443
1446
  if (shareInfo.get) {
1444
1447
  const module = shareInfo.get();
1445
1448
  if (module instanceof Promise) {
1446
- throw new Error(`
1447
- The loadShareSync function was unable to load ${pkgName}. The ${pkgName} could not be found in ${host.options.name}.
1448
- Possible reasons for failure: \n
1449
- 1. The ${pkgName} share was registered with the 'get' attribute, but loadShare was not used beforehand.\n
1450
- 2. The ${pkgName} share was not registered with the 'lib' attribute.\n
1451
- `);
1449
+ const errorCode = (extraOptions == null ? void 0 : extraOptions.from) === 'build' ? errorCodes.RUNTIME_005 : errorCodes.RUNTIME_006;
1450
+ throw new Error(errorCodes.getShortErrorMsg(errorCode, errorCodes.runtimeDescMap, {
1451
+ hostName: host.options.name,
1452
+ sharedPkgName: pkgName
1453
+ }));
1452
1454
  }
1453
1455
  shareInfo.lib = module;
1454
1456
  this.setShared({
@@ -1460,12 +1462,10 @@ class SharedHandler {
1460
1462
  });
1461
1463
  return shareInfo.lib;
1462
1464
  }
1463
- throw new Error(`
1464
- The loadShareSync function was unable to load ${pkgName}. The ${pkgName} could not be found in ${host.options.name}.
1465
- Possible reasons for failure: \n
1466
- 1. The ${pkgName} share was registered with the 'get' attribute, but loadShare was not used beforehand.\n
1467
- 2. The ${pkgName} share was not registered with the 'lib' attribute.\n
1468
- `);
1465
+ throw new Error(errorCodes.getShortErrorMsg(errorCodes.RUNTIME_006, errorCodes.runtimeDescMap, {
1466
+ hostName: host.options.name,
1467
+ sharedPkgName: pkgName
1468
+ }));
1469
1469
  }
1470
1470
  initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
1471
1471
  const { host } = this;
@@ -1685,14 +1685,10 @@ class RemoteHandler {
1685
1685
  }
1686
1686
  const { id: idRes } = loadRemoteArgs;
1687
1687
  const remoteSplitInfo = matchRemoteWithNameAndExpose(host.options.remotes, idRes);
1688
- share.assert(remoteSplitInfo, `
1689
- Unable to locate ${idRes} in ${host.options.name}. Potential reasons for failure include:\n
1690
- 1. ${idRes} was not included in the 'remotes' parameter of ${host.options.name || 'the host'}.\n
1691
- 2. ${idRes} could not be found in the 'remotes' of ${host.options.name} with either 'name' or 'alias' attributes.
1692
- 3. ${idRes} is not online, injected, or loaded.
1693
- 4. ${idRes} cannot be accessed on the expected.
1694
- 5. The 'beforeRequest' hook was provided but did not return the correct 'remoteInfo' when attempting to load ${idRes}.
1695
- `);
1688
+ share.assert(remoteSplitInfo, errorCodes.getShortErrorMsg(errorCodes.RUNTIME_004, errorCodes.runtimeDescMap, {
1689
+ hostName: host.options.name,
1690
+ requestId: idRes
1691
+ }));
1696
1692
  const { remote: rawRemote } = remoteSplitInfo;
1697
1693
  const remoteInfo = getRemoteInfo(rawRemote);
1698
1694
  const matchInfo = await host.sharedHandler.hooks.lifecycle.afterResolve.emit(polyfills._extends({
@@ -2000,7 +1996,7 @@ class FederationHost {
2000
1996
  // maybe will change, temporarily for internal use only
2001
1997
  initContainer: new AsyncWaterfallHook('initContainer')
2002
1998
  });
2003
- this.version = "0.6.15";
1999
+ this.version = "0.6.16";
2004
2000
  this.moduleCache = new Map();
2005
2001
  this.loaderHook = new PluginSystem({
2006
2002
  // FIXME: may not be suitable , not open to the public yet
package/dist/index.esm.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { a as _extends, _ as _object_without_properties_loose } from './polyfills.esm.js';
2
2
  import { isBrowserEnv, loadScriptNode, composeKeyWithSeparator, loadScript, safeToString, createLink, createScript, getResourceUrl, isManifestProvider, generateSnapshotFromManifest, warn as warn$1 } from '@module-federation/sdk';
3
3
  export { loadScript, loadScriptNode } from '@module-federation/sdk';
4
- import { o as getGlobalHostPlugins, t as globalLoading, D as DEFAULT_REMOTE_TYPE, u as DEFAULT_SCOPE, l as getRemoteEntryExports, v as assert, w as logger, x as getFMId, y as isObject, z as error, A as warn, B as isPlainObject, C as isRemoteInfoWithEntry, E as isPureRemoteEntry, F as getRemoteEntryInfoFromSnapshot, e as getInfoWithoutType, p as getPreloaded, q as setPreloaded, g as getRegisteredShare, H as arrayOptions, i as getGlobalSnapshotInfoByModuleInfo, k as addGlobalSnapshot, j as setGlobalSnapshotInfoByModuleInfo, G as Global, f as getGlobalSnapshot, I as formatShareConfigs, J as getTargetSharedOptions, a as getGlobalShareScope, K as addUniqueItem, L as getBuilderId, d as setGlobalFederationConstructor, b as getGlobalFederationInstance, c as getGlobalFederationConstructor, s as setGlobalFederationInstance } from './share.esm.js';
4
+ import { o as getGlobalHostPlugins, t as globalLoading, D as DEFAULT_REMOTE_TYPE, u as DEFAULT_SCOPE, l as getRemoteEntryExports, v as assert, w as error, x as getFMId, y as isObject, z as warn, A as isPlainObject, B as isRemoteInfoWithEntry, C as isPureRemoteEntry, E as getRemoteEntryInfoFromSnapshot, e as getInfoWithoutType, p as getPreloaded, q as setPreloaded, g as getRegisteredShare, F as arrayOptions, i as getGlobalSnapshotInfoByModuleInfo, k as addGlobalSnapshot, j as setGlobalSnapshotInfoByModuleInfo, G as Global, f as getGlobalSnapshot, H as formatShareConfigs, I as getTargetSharedOptions, a as getGlobalShareScope, J as addUniqueItem, K as logger, L as getBuilderId, d as setGlobalFederationConstructor, b as getGlobalFederationInstance, c as getGlobalFederationConstructor, s as setGlobalFederationInstance } from './share.esm.js';
5
5
  export { m as registerGlobalPlugins } from './share.esm.js';
6
+ import { getShortErrorMsg, RUNTIME_001, runtimeDescMap, RUNTIME_002, RUNTIME_007, RUNTIME_003, RUNTIME_005, RUNTIME_006, RUNTIME_004 } from '@module-federation/error-codes';
6
7
 
7
8
  // Function to match a remote with its name and expose
8
9
  // id: pkgName(@federation/app1) + expose(button) = @federation/app1/button
@@ -146,12 +147,11 @@ async function loadEntryScript({ name, globalName, entry, createScriptHook }) {
146
147
  }
147
148
  }).then(()=>{
148
149
  const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
149
- assert(entryExports, `
150
- Unable to use the ${name}'s '${entry}' URL with ${remoteEntryKey}'s globalName to get remoteEntry exports.
151
- Possible reasons could be:\n
152
- 1. '${entry}' is not the correct URL, or the remoteEntry resource or name is incorrect.\n
153
- 2. ${remoteEntryKey} cannot be used to get remoteEntry exports in the window object.
154
- `);
150
+ assert(entryExports, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
151
+ remoteName: name,
152
+ remoteEntryUrl: entry,
153
+ remoteEntryKey
154
+ }));
155
155
  return entryExports;
156
156
  }).catch((e)=>{
157
157
  throw e;
@@ -205,12 +205,11 @@ async function loadEntryNode({ remoteInfo, createScriptHook }) {
205
205
  }
206
206
  }).then(()=>{
207
207
  const { remoteEntryKey, entryExports } = getRemoteEntryExports(name, globalName);
208
- assert(entryExports, `
209
- Unable to use the ${name}'s '${entry}' URL with ${remoteEntryKey}'s globalName to get remoteEntry exports.
210
- Possible reasons could be:\n
211
- 1. '${entry}' is not the correct URL, or the remoteEntry resource or name is incorrect.\n
212
- 2. ${remoteEntryKey} cannot be used to get remoteEntry exports in the window object.
213
- `);
208
+ assert(entryExports, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
209
+ remoteName: name,
210
+ remoteEntryUrl: entry,
211
+ remoteEntryKey
212
+ }));
214
213
  return entryExports;
215
214
  }).catch((e)=>{
216
215
  throw e;
@@ -305,7 +304,11 @@ let Module = class Module {
305
304
  origin: this.host
306
305
  });
307
306
  if (typeof (remoteEntryExports == null ? void 0 : remoteEntryExports.init) === 'undefined') {
308
- logger.error('The remote entry interface does not contain "init"', '\n', 'Ensure the name of this remote is not reserved or in use. Check if anything already exists on window[nameOfRemote]', '\n', 'Ensure that window[nameOfRemote] is returning a {get,init} object.');
307
+ error(getShortErrorMsg(RUNTIME_002, runtimeDescMap, {
308
+ remoteName: name,
309
+ remoteEntryUrl: this.remoteInfo.entry,
310
+ remoteEntryKey: this.remoteInfo.entryGlobalName
311
+ }));
309
312
  }
310
313
  await remoteEntryExports.init(initContainerOptions.shareScope, initContainerOptions.initScope, initContainerOptions.remoteEntryInitOptions);
311
314
  await this.host.hooks.lifecycle.initContainer.emit(_extends({}, initContainerOptions, {
@@ -1109,12 +1112,11 @@ class SnapshotHandler {
1109
1112
  globalSnapshot: globalSnapshotRes
1110
1113
  };
1111
1114
  } else {
1112
- error(`
1113
- Cannot get remoteSnapshot with the name: '${moduleInfo.name}', version: '${moduleInfo.version}' from __FEDERATION__.moduleInfo. The following reasons may be causing the problem:\n
1114
- 1. The Deploy platform did not deliver the correct data. You can use __FEDERATION__.moduleInfo to check the remoteInfo.\n
1115
- 2. The remote '${moduleInfo.name}' version '${moduleInfo.version}' is not released.\n
1116
- The transformed module info: ${JSON.stringify(globalSnapshotRes)}
1117
- `);
1115
+ error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1116
+ hostName: moduleInfo.name,
1117
+ hostVersion: moduleInfo.version,
1118
+ globalSnapshot: JSON.stringify(globalSnapshotRes)
1119
+ }));
1118
1120
  }
1119
1121
  }
1120
1122
  }
@@ -1138,9 +1140,10 @@ class SnapshotHandler {
1138
1140
  return manifestJson;
1139
1141
  } catch (err) {
1140
1142
  delete this.manifestLoading[manifestUrl];
1141
- error(`Failed to get manifestJson for ${moduleInfo.name}. The manifest URL is ${manifestUrl}. Please ensure that the manifestUrl is accessible.
1142
- \n Error message:
1143
- \n ${err}`);
1143
+ error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
1144
+ manifestUrl,
1145
+ moduleName: moduleInfo.name
1146
+ }, `${err}`));
1144
1147
  }
1145
1148
  };
1146
1149
  const asyncLoadProcess = async ()=>{
@@ -1443,12 +1446,11 @@ class SharedHandler {
1443
1446
  if (shareInfo.get) {
1444
1447
  const module = shareInfo.get();
1445
1448
  if (module instanceof Promise) {
1446
- throw new Error(`
1447
- The loadShareSync function was unable to load ${pkgName}. The ${pkgName} could not be found in ${host.options.name}.
1448
- Possible reasons for failure: \n
1449
- 1. The ${pkgName} share was registered with the 'get' attribute, but loadShare was not used beforehand.\n
1450
- 2. The ${pkgName} share was not registered with the 'lib' attribute.\n
1451
- `);
1449
+ const errorCode = (extraOptions == null ? void 0 : extraOptions.from) === 'build' ? RUNTIME_005 : RUNTIME_006;
1450
+ throw new Error(getShortErrorMsg(errorCode, runtimeDescMap, {
1451
+ hostName: host.options.name,
1452
+ sharedPkgName: pkgName
1453
+ }));
1452
1454
  }
1453
1455
  shareInfo.lib = module;
1454
1456
  this.setShared({
@@ -1460,12 +1462,10 @@ class SharedHandler {
1460
1462
  });
1461
1463
  return shareInfo.lib;
1462
1464
  }
1463
- throw new Error(`
1464
- The loadShareSync function was unable to load ${pkgName}. The ${pkgName} could not be found in ${host.options.name}.
1465
- Possible reasons for failure: \n
1466
- 1. The ${pkgName} share was registered with the 'get' attribute, but loadShare was not used beforehand.\n
1467
- 2. The ${pkgName} share was not registered with the 'lib' attribute.\n
1468
- `);
1465
+ throw new Error(getShortErrorMsg(RUNTIME_006, runtimeDescMap, {
1466
+ hostName: host.options.name,
1467
+ sharedPkgName: pkgName
1468
+ }));
1469
1469
  }
1470
1470
  initShareScopeMap(scopeName, shareScope, extraOptions = {}) {
1471
1471
  const { host } = this;
@@ -1685,14 +1685,10 @@ class RemoteHandler {
1685
1685
  }
1686
1686
  const { id: idRes } = loadRemoteArgs;
1687
1687
  const remoteSplitInfo = matchRemoteWithNameAndExpose(host.options.remotes, idRes);
1688
- assert(remoteSplitInfo, `
1689
- Unable to locate ${idRes} in ${host.options.name}. Potential reasons for failure include:\n
1690
- 1. ${idRes} was not included in the 'remotes' parameter of ${host.options.name || 'the host'}.\n
1691
- 2. ${idRes} could not be found in the 'remotes' of ${host.options.name} with either 'name' or 'alias' attributes.
1692
- 3. ${idRes} is not online, injected, or loaded.
1693
- 4. ${idRes} cannot be accessed on the expected.
1694
- 5. The 'beforeRequest' hook was provided but did not return the correct 'remoteInfo' when attempting to load ${idRes}.
1695
- `);
1688
+ assert(remoteSplitInfo, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
1689
+ hostName: host.options.name,
1690
+ requestId: idRes
1691
+ }));
1696
1692
  const { remote: rawRemote } = remoteSplitInfo;
1697
1693
  const remoteInfo = getRemoteInfo(rawRemote);
1698
1694
  const matchInfo = await host.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends({
@@ -2000,7 +1996,7 @@ class FederationHost {
2000
1996
  // maybe will change, temporarily for internal use only
2001
1997
  initContainer: new AsyncWaterfallHook('initContainer')
2002
1998
  });
2003
- this.version = "0.6.15";
1999
+ this.version = "0.6.16";
2004
2000
  this.moduleCache = new Map();
2005
2001
  this.loaderHook = new PluginSystem({
2006
2002
  // FIXME: may not be suitable , not open to the public yet
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
@@ -50,6 +50,7 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@module-federation/sdk": "workspace:*"
53
+ "@module-federation/sdk": "workspace:*",
54
+ "@module-federation/error-codes": "workspace:*"
54
55
  }
55
56
  }
package/dist/share.cjs.js CHANGED
@@ -177,7 +177,7 @@ function getGlobalFederationConstructor() {
177
177
  function setGlobalFederationConstructor(FederationConstructor, isDebug = sdk.isDebugMode()) {
178
178
  if (isDebug) {
179
179
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
180
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.15";
180
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.16";
181
181
  }
182
182
  }
183
183
  // eslint-disable-next-line @typescript-eslint/ban-types
package/dist/share.esm.js CHANGED
@@ -175,7 +175,7 @@ function getGlobalFederationConstructor() {
175
175
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
176
176
  if (isDebug) {
177
177
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
178
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.15";
178
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.16";
179
179
  }
180
180
  }
181
181
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -867,4 +867,4 @@ function getTargetSharedOptions(options) {
867
867
  return Object.assign({}, resolver(shareInfos[pkgName]), extraOptions == null ? void 0 : extraOptions.customShareInfo);
868
868
  }
869
869
 
870
- export { warn as A, isPlainObject as B, isRemoteInfoWithEntry as C, DEFAULT_REMOTE_TYPE as D, isPureRemoteEntry as E, getRemoteEntryInfoFromSnapshot as F, Global as G, arrayOptions as H, formatShareConfigs as I, getTargetSharedOptions as J, addUniqueItem as K, getBuilderId as L, getGlobalShareScope as a, getGlobalFederationInstance as b, getGlobalFederationConstructor as c, setGlobalFederationConstructor as d, getInfoWithoutType as e, getGlobalSnapshot as f, getRegisteredShare as g, getTargetSnapshotInfoByModuleInfo as h, getGlobalSnapshotInfoByModuleInfo as i, setGlobalSnapshotInfoByModuleInfo as j, addGlobalSnapshot as k, getRemoteEntryExports as l, registerGlobalPlugins as m, nativeGlobal as n, getGlobalHostPlugins as o, getPreloaded as p, setPreloaded as q, resetFederationGlobalInfo as r, setGlobalFederationInstance as s, globalLoading as t, DEFAULT_SCOPE as u, assert as v, logger as w, getFMId as x, isObject as y, error as z };
870
+ export { isPlainObject as A, isRemoteInfoWithEntry as B, isPureRemoteEntry as C, DEFAULT_REMOTE_TYPE as D, getRemoteEntryInfoFromSnapshot as E, arrayOptions as F, Global as G, formatShareConfigs as H, getTargetSharedOptions as I, addUniqueItem as J, logger as K, getBuilderId as L, getGlobalShareScope as a, getGlobalFederationInstance as b, getGlobalFederationConstructor as c, setGlobalFederationConstructor as d, getInfoWithoutType as e, getGlobalSnapshot as f, getRegisteredShare as g, getTargetSnapshotInfoByModuleInfo as h, getGlobalSnapshotInfoByModuleInfo as i, setGlobalSnapshotInfoByModuleInfo as j, addGlobalSnapshot as k, getRemoteEntryExports as l, registerGlobalPlugins as m, nativeGlobal as n, getGlobalHostPlugins as o, getPreloaded as p, setPreloaded as q, resetFederationGlobalInfo as r, setGlobalFederationInstance as s, globalLoading as t, DEFAULT_SCOPE as u, assert as v, error as w, getFMId as x, isObject as y, warn as z };
@@ -74,6 +74,7 @@ export declare class FederationHost {
74
74
  }): Promise<false | (() => T | undefined)>;
75
75
  loadShareSync<T>(pkgName: string, extraOptions?: {
76
76
  customShareInfo?: Partial<Shared>;
77
+ from?: 'build' | 'runtime';
77
78
  resolver?: (sharedOptions: ShareInfos[string]) => Shared;
78
79
  }): () => T | never;
79
80
  initializeSharing(shareScopeName?: string, extraOptions?: {
@@ -54,6 +54,7 @@ export declare class SharedHandler {
54
54
  strategy?: ShareStrategy;
55
55
  }): Array<Promise<void>>;
56
56
  loadShareSync<T>(pkgName: string, extraOptions?: {
57
+ from?: 'build' | 'runtime';
57
58
  customShareInfo?: Partial<Shared>;
58
59
  resolver?: (sharedOptions: ShareInfos[string]) => Shared;
59
60
  }): () => T | never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.6.15",
3
+ "version": "0.6.16",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -50,6 +50,7 @@
50
50
  }
51
51
  },
52
52
  "dependencies": {
53
- "@module-federation/sdk": "0.6.15"
53
+ "@module-federation/sdk": "0.6.16",
54
+ "@module-federation/error-codes": "0.6.14"
54
55
  }
55
56
  }