@module-federation/runtime 0.1.7 → 0.1.9

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/index.cjs.js CHANGED
@@ -1699,7 +1699,7 @@ class FederationHost {
1699
1699
  // not used yet
1700
1700
  afterPreloadRemote: new AsyncHook()
1701
1701
  });
1702
- this.version = "0.1.7";
1702
+ this.version = "0.1.9";
1703
1703
  this.moduleCache = new Map();
1704
1704
  this.loaderHook = new PluginSystem({
1705
1705
  // FIXME: may not be suitable , not open to the public yet
@@ -1756,18 +1756,21 @@ function init(options) {
1756
1756
  }
1757
1757
  function loadRemote(...args) {
1758
1758
  share.assert(FederationInstance, 'Please call init first');
1759
+ const loadRemote1 = FederationInstance.loadRemote;
1759
1760
  // eslint-disable-next-line prefer-spread
1760
- return FederationInstance.loadRemote.apply(FederationInstance, args);
1761
+ return loadRemote1.apply(FederationInstance, args);
1761
1762
  }
1762
1763
  function loadShare(...args) {
1763
1764
  share.assert(FederationInstance, 'Please call init first');
1764
1765
  // eslint-disable-next-line prefer-spread
1765
- return FederationInstance.loadShare.apply(FederationInstance, args);
1766
+ const loadShare1 = FederationInstance.loadShare;
1767
+ return loadShare1.apply(FederationInstance, args);
1766
1768
  }
1767
1769
  function loadShareSync(...args) {
1768
1770
  share.assert(FederationInstance, 'Please call init first');
1771
+ const loadShareSync1 = FederationInstance.loadShareSync;
1769
1772
  // eslint-disable-next-line prefer-spread
1770
- return FederationInstance.loadShareSync.apply(FederationInstance, args);
1773
+ return loadShareSync1.apply(FederationInstance, args);
1771
1774
  }
1772
1775
  function preloadRemote(...args) {
1773
1776
  share.assert(FederationInstance, 'Please call init first');
package/dist/index.esm.js CHANGED
@@ -1697,7 +1697,7 @@ class FederationHost {
1697
1697
  // not used yet
1698
1698
  afterPreloadRemote: new AsyncHook()
1699
1699
  });
1700
- this.version = "0.1.7";
1700
+ this.version = "0.1.9";
1701
1701
  this.moduleCache = new Map();
1702
1702
  this.loaderHook = new PluginSystem({
1703
1703
  // FIXME: may not be suitable , not open to the public yet
@@ -1754,18 +1754,21 @@ function init(options) {
1754
1754
  }
1755
1755
  function loadRemote(...args) {
1756
1756
  assert(FederationInstance, 'Please call init first');
1757
+ const loadRemote1 = FederationInstance.loadRemote;
1757
1758
  // eslint-disable-next-line prefer-spread
1758
- return FederationInstance.loadRemote.apply(FederationInstance, args);
1759
+ return loadRemote1.apply(FederationInstance, args);
1759
1760
  }
1760
1761
  function loadShare(...args) {
1761
1762
  assert(FederationInstance, 'Please call init first');
1762
1763
  // eslint-disable-next-line prefer-spread
1763
- return FederationInstance.loadShare.apply(FederationInstance, args);
1764
+ const loadShare1 = FederationInstance.loadShare;
1765
+ return loadShare1.apply(FederationInstance, args);
1764
1766
  }
1765
1767
  function loadShareSync(...args) {
1766
1768
  assert(FederationInstance, 'Please call init first');
1769
+ const loadShareSync1 = FederationInstance.loadShareSync;
1767
1770
  // eslint-disable-next-line prefer-spread
1768
- return FederationInstance.loadShareSync.apply(FederationInstance, args);
1771
+ return loadShareSync1.apply(FederationInstance, args);
1769
1772
  }
1770
1773
  function preloadRemote(...args) {
1771
1774
  assert(FederationInstance, 'Please call init first');
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js",
package/dist/share.cjs.js CHANGED
@@ -190,7 +190,7 @@ function getGlobalFederationConstructor() {
190
190
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
191
191
  if (isDebug) {
192
192
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
193
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.7";
193
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.9";
194
194
  }
195
195
  }
196
196
  // eslint-disable-next-line @typescript-eslint/ban-types
package/dist/share.esm.js CHANGED
@@ -188,7 +188,7 @@ function getGlobalFederationConstructor() {
188
188
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
189
189
  if (isDebug) {
190
190
  globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
191
- globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.7";
191
+ globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.9";
192
192
  }
193
193
  }
194
194
  // eslint-disable-next-line @typescript-eslint/ban-types
@@ -7,9 +7,9 @@ export { loadScript, loadScriptNode } from '@module-federation/sdk';
7
7
  export type { Federation } from './global';
8
8
  export type { FederationRuntimePlugin };
9
9
  export declare function init(options: UserOptions): FederationHost;
10
- export declare function loadRemote(...args: Parameters<FederationHost['loadRemote']>): ReturnType<FederationHost['loadRemote']>;
11
- export declare function loadShare(...args: Parameters<FederationHost['loadShare']>): ReturnType<FederationHost['loadShare']>;
12
- export declare function loadShareSync(...args: Parameters<FederationHost['loadShareSync']>): ReturnType<FederationHost['loadShareSync']>;
10
+ export declare function loadRemote<T>(...args: Parameters<FederationHost['loadRemote']>): Promise<T | null>;
11
+ export declare function loadShare<T>(...args: Parameters<FederationHost['loadShare']>): Promise<false | (() => T | undefined)>;
12
+ export declare function loadShareSync<T>(...args: Parameters<FederationHost['loadShareSync']>): () => T | never;
13
13
  export declare function preloadRemote(...args: Parameters<FederationHost['preloadRemote']>): ReturnType<FederationHost['preloadRemote']>;
14
14
  export declare function registerRemotes(...args: Parameters<FederationHost['registerRemotes']>): ReturnType<FederationHost['registerRemotes']>;
15
15
  export declare function registerPlugins(...args: Parameters<FederationHost['registerPlugins']>): ReturnType<FederationHost['registerRemotes']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/runtime",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "author": "zhouxiao <codingzx@gmail.com>",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.esm.js",
@@ -45,6 +45,6 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@module-federation/sdk": "0.1.7"
48
+ "@module-federation/sdk": "0.1.9"
49
49
  }
50
50
  }