@module-federation/runtime 0.1.10 → 0.1.12
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 +22 -6
- package/dist/index.esm.js +22 -6
- package/dist/package.json +1 -1
- package/dist/share.cjs.js +1 -1
- package/dist/share.esm.js +1 -1
- package/dist/src/core.d.ts +2 -0
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -1315,11 +1315,26 @@ class FederationHost {
|
|
|
1315
1315
|
return module;
|
|
1316
1316
|
}
|
|
1317
1317
|
async _getRemoteModuleAndOptions(id) {
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1318
|
+
let loadRemoteArgs;
|
|
1319
|
+
try {
|
|
1320
|
+
loadRemoteArgs = await this.hooks.lifecycle.beforeRequest.emit({
|
|
1321
|
+
id,
|
|
1322
|
+
options: this.options,
|
|
1323
|
+
origin: this
|
|
1324
|
+
});
|
|
1325
|
+
} catch (error) {
|
|
1326
|
+
loadRemoteArgs = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
1327
|
+
id,
|
|
1328
|
+
options: this.options,
|
|
1329
|
+
origin: this,
|
|
1330
|
+
from: 'runtime',
|
|
1331
|
+
error,
|
|
1332
|
+
lifecycle: 'beforeRequest'
|
|
1333
|
+
});
|
|
1334
|
+
if (!loadRemoteArgs) {
|
|
1335
|
+
throw error;
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1323
1338
|
const { id: idRes } = loadRemoteArgs;
|
|
1324
1339
|
const remoteSplitInfo = matchRemoteWithNameAndExpose(this.options.remotes, idRes);
|
|
1325
1340
|
share.assert(remoteSplitInfo, `
|
|
@@ -1396,6 +1411,7 @@ class FederationHost {
|
|
|
1396
1411
|
id,
|
|
1397
1412
|
error,
|
|
1398
1413
|
from,
|
|
1414
|
+
lifecycle: 'onLoad',
|
|
1399
1415
|
origin: this
|
|
1400
1416
|
});
|
|
1401
1417
|
if (!failOver) {
|
|
@@ -1699,7 +1715,7 @@ class FederationHost {
|
|
|
1699
1715
|
// not used yet
|
|
1700
1716
|
afterPreloadRemote: new AsyncHook()
|
|
1701
1717
|
});
|
|
1702
|
-
this.version = "0.1.
|
|
1718
|
+
this.version = "0.1.12";
|
|
1703
1719
|
this.moduleCache = new Map();
|
|
1704
1720
|
this.loaderHook = new PluginSystem({
|
|
1705
1721
|
// FIXME: may not be suitable , not open to the public yet
|
package/dist/index.esm.js
CHANGED
|
@@ -1313,11 +1313,26 @@ class FederationHost {
|
|
|
1313
1313
|
return module;
|
|
1314
1314
|
}
|
|
1315
1315
|
async _getRemoteModuleAndOptions(id) {
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1316
|
+
let loadRemoteArgs;
|
|
1317
|
+
try {
|
|
1318
|
+
loadRemoteArgs = await this.hooks.lifecycle.beforeRequest.emit({
|
|
1319
|
+
id,
|
|
1320
|
+
options: this.options,
|
|
1321
|
+
origin: this
|
|
1322
|
+
});
|
|
1323
|
+
} catch (error) {
|
|
1324
|
+
loadRemoteArgs = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
1325
|
+
id,
|
|
1326
|
+
options: this.options,
|
|
1327
|
+
origin: this,
|
|
1328
|
+
from: 'runtime',
|
|
1329
|
+
error,
|
|
1330
|
+
lifecycle: 'beforeRequest'
|
|
1331
|
+
});
|
|
1332
|
+
if (!loadRemoteArgs) {
|
|
1333
|
+
throw error;
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1321
1336
|
const { id: idRes } = loadRemoteArgs;
|
|
1322
1337
|
const remoteSplitInfo = matchRemoteWithNameAndExpose(this.options.remotes, idRes);
|
|
1323
1338
|
assert(remoteSplitInfo, `
|
|
@@ -1394,6 +1409,7 @@ class FederationHost {
|
|
|
1394
1409
|
id,
|
|
1395
1410
|
error,
|
|
1396
1411
|
from,
|
|
1412
|
+
lifecycle: 'onLoad',
|
|
1397
1413
|
origin: this
|
|
1398
1414
|
});
|
|
1399
1415
|
if (!failOver) {
|
|
@@ -1697,7 +1713,7 @@ class FederationHost {
|
|
|
1697
1713
|
// not used yet
|
|
1698
1714
|
afterPreloadRemote: new AsyncHook()
|
|
1699
1715
|
});
|
|
1700
|
-
this.version = "0.1.
|
|
1716
|
+
this.version = "0.1.12";
|
|
1701
1717
|
this.moduleCache = new Map();
|
|
1702
1718
|
this.loaderHook = new PluginSystem({
|
|
1703
1719
|
// 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.12";
|
|
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.12";
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
package/dist/src/core.d.ts
CHANGED
|
@@ -75,7 +75,9 @@ export declare class FederationHost {
|
|
|
75
75
|
errorLoadRemote: AsyncHook<[{
|
|
76
76
|
id: string;
|
|
77
77
|
error: unknown;
|
|
78
|
+
options?: any;
|
|
78
79
|
from: 'build' | 'runtime';
|
|
80
|
+
lifecycle: 'onLoad' | 'beforeRequest';
|
|
79
81
|
origin: FederationHost;
|
|
80
82
|
}], unknown>;
|
|
81
83
|
beforeLoadShare: AsyncWaterfallHook<{
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"author": "zhouxiao <codingzx@gmail.com>",
|
|
5
|
-
"main": "./dist/index.cjs",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
7
7
|
"types": "./dist/index.cjs.d.ts",
|
|
8
8
|
"license": "MIT",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@module-federation/sdk": "0.1.
|
|
48
|
+
"@module-federation/sdk": "0.1.12"
|
|
49
49
|
}
|
|
50
50
|
}
|