@module-federation/runtime 0.1.15 → 0.1.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.
- package/dist/index.cjs.js +5 -4
- package/dist/index.esm.js +5 -4
- package/dist/package.json +1 -1
- package/dist/share.cjs.js +1 -1
- package/dist/share.esm.js +1 -1
- package/dist/src/remote/index.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1537,7 +1537,7 @@ class RemoteHandler {
|
|
|
1537
1537
|
async preloadRemote(preloadOptions) {
|
|
1538
1538
|
const { host } = this;
|
|
1539
1539
|
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
1540
|
-
preloadOptions,
|
|
1540
|
+
preloadOps: preloadOptions,
|
|
1541
1541
|
options: host.options,
|
|
1542
1542
|
origin: host
|
|
1543
1543
|
});
|
|
@@ -1678,9 +1678,10 @@ class RemoteHandler {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
const loadedModule = host.moduleCache.get(remote.name);
|
|
1680
1680
|
if (loadedModule) {
|
|
1681
|
+
var _Object_getOwnPropertyDescriptor;
|
|
1681
1682
|
const remoteInfo = loadedModule.remoteInfo;
|
|
1682
1683
|
const key = remoteInfo.entryGlobalName;
|
|
1683
|
-
if (globalThis[key]) {
|
|
1684
|
+
if (globalThis[key] && ((_Object_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(globalThis, key)) == null ? void 0 : _Object_getOwnPropertyDescriptor.configurable)) {
|
|
1684
1685
|
delete globalThis[key];
|
|
1685
1686
|
}
|
|
1686
1687
|
const remoteEntryUniqueKey = getRemoteEntryUniqueKey(loadedModule.remoteInfo);
|
|
@@ -1752,7 +1753,7 @@ class RemoteHandler {
|
|
|
1752
1753
|
onLoad: new AsyncHook('onLoad'),
|
|
1753
1754
|
handlePreloadModule: new SyncHook('handlePreloadModule'),
|
|
1754
1755
|
errorLoadRemote: new AsyncHook('errorLoadRemote'),
|
|
1755
|
-
beforePreloadRemote: new AsyncHook(),
|
|
1756
|
+
beforePreloadRemote: new AsyncHook('beforePreloadRemote'),
|
|
1756
1757
|
generatePreloadAssets: new AsyncHook('generatePreloadAssets'),
|
|
1757
1758
|
// not used yet
|
|
1758
1759
|
afterPreloadRemote: new AsyncHook()
|
|
@@ -1880,7 +1881,7 @@ class FederationHost {
|
|
|
1880
1881
|
// maybe will change, temporarily for internal use only
|
|
1881
1882
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
1882
1883
|
});
|
|
1883
|
-
this.version = "0.1.
|
|
1884
|
+
this.version = "0.1.16";
|
|
1884
1885
|
this.moduleCache = new Map();
|
|
1885
1886
|
this.loaderHook = new PluginSystem({
|
|
1886
1887
|
// FIXME: may not be suitable , not open to the public yet
|
package/dist/index.esm.js
CHANGED
|
@@ -1535,7 +1535,7 @@ class RemoteHandler {
|
|
|
1535
1535
|
async preloadRemote(preloadOptions) {
|
|
1536
1536
|
const { host } = this;
|
|
1537
1537
|
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
1538
|
-
preloadOptions,
|
|
1538
|
+
preloadOps: preloadOptions,
|
|
1539
1539
|
options: host.options,
|
|
1540
1540
|
origin: host
|
|
1541
1541
|
});
|
|
@@ -1676,9 +1676,10 @@ class RemoteHandler {
|
|
|
1676
1676
|
}
|
|
1677
1677
|
const loadedModule = host.moduleCache.get(remote.name);
|
|
1678
1678
|
if (loadedModule) {
|
|
1679
|
+
var _Object_getOwnPropertyDescriptor;
|
|
1679
1680
|
const remoteInfo = loadedModule.remoteInfo;
|
|
1680
1681
|
const key = remoteInfo.entryGlobalName;
|
|
1681
|
-
if (globalThis[key]) {
|
|
1682
|
+
if (globalThis[key] && ((_Object_getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor(globalThis, key)) == null ? void 0 : _Object_getOwnPropertyDescriptor.configurable)) {
|
|
1682
1683
|
delete globalThis[key];
|
|
1683
1684
|
}
|
|
1684
1685
|
const remoteEntryUniqueKey = getRemoteEntryUniqueKey(loadedModule.remoteInfo);
|
|
@@ -1750,7 +1751,7 @@ class RemoteHandler {
|
|
|
1750
1751
|
onLoad: new AsyncHook('onLoad'),
|
|
1751
1752
|
handlePreloadModule: new SyncHook('handlePreloadModule'),
|
|
1752
1753
|
errorLoadRemote: new AsyncHook('errorLoadRemote'),
|
|
1753
|
-
beforePreloadRemote: new AsyncHook(),
|
|
1754
|
+
beforePreloadRemote: new AsyncHook('beforePreloadRemote'),
|
|
1754
1755
|
generatePreloadAssets: new AsyncHook('generatePreloadAssets'),
|
|
1755
1756
|
// not used yet
|
|
1756
1757
|
afterPreloadRemote: new AsyncHook()
|
|
@@ -1878,7 +1879,7 @@ class FederationHost {
|
|
|
1878
1879
|
// maybe will change, temporarily for internal use only
|
|
1879
1880
|
initContainer: new AsyncWaterfallHook('initContainer')
|
|
1880
1881
|
});
|
|
1881
|
-
this.version = "0.1.
|
|
1882
|
+
this.version = "0.1.16";
|
|
1882
1883
|
this.moduleCache = new Map();
|
|
1883
1884
|
this.loaderHook = new PluginSystem({
|
|
1884
1885
|
// FIXME: may not be suitable , not open to the public yet
|
package/dist/package.json
CHANGED
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.
|
|
193
|
+
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.16";
|
|
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.
|
|
191
|
+
globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.1.16";
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
@@ -48,11 +48,11 @@ export declare class RemoteHandler {
|
|
|
48
48
|
lifecycle: 'onLoad' | 'beforeRequest';
|
|
49
49
|
origin: FederationHost;
|
|
50
50
|
}], unknown>;
|
|
51
|
-
beforePreloadRemote: AsyncHook<{
|
|
51
|
+
beforePreloadRemote: AsyncHook<[{
|
|
52
52
|
preloadOps: Array<PreloadRemoteArgs>;
|
|
53
53
|
options: Options;
|
|
54
54
|
origin: FederationHost;
|
|
55
|
-
}, false | void | Promise<false | void>>;
|
|
55
|
+
}], false | void | Promise<false | void>>;
|
|
56
56
|
generatePreloadAssets: AsyncHook<[{
|
|
57
57
|
origin: FederationHost;
|
|
58
58
|
preloadOptions: PreloadOptions[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@module-federation/sdk": "0.1.
|
|
48
|
+
"@module-federation/sdk": "0.1.16"
|
|
49
49
|
}
|
|
50
50
|
}
|