@module-federation/webpack-bundler-runtime 1.0.0-canary.1 → 1.0.0-canary.3
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/index.cjs.js +109 -115
- package/index.esm.js +109 -115
- package/package.json +2 -2
package/index.cjs.js
CHANGED
|
@@ -296,18 +296,18 @@ function isPlainObject(val) {
|
|
|
296
296
|
}
|
|
297
297
|
function isStaticResourcesEqual(url1, url2) {
|
|
298
298
|
var REG_EXP = /^(https?:)?\/\//i;
|
|
299
|
-
//
|
|
299
|
+
// Transform url1 and url2 into relative paths
|
|
300
300
|
var relativeUrl1 = url1.replace(REG_EXP, "").replace(/\/$/, "");
|
|
301
301
|
var relativeUrl2 = url2.replace(REG_EXP, "").replace(/\/$/, "");
|
|
302
|
-
//
|
|
302
|
+
// Check if the relative paths are identical
|
|
303
303
|
return relativeUrl1 === relativeUrl2;
|
|
304
304
|
}
|
|
305
305
|
var _nativeGlobal___FEDERATION__, _nativeGlobal___FEDERATION__1, _nativeGlobal___FEDERATION__2, _nativeGlobal___FEDERATION__3, _nativeGlobal___FEDERATION__4, _nativeGlobal___FEDERATION__5, _nativeGlobal___FEDERATION__6;
|
|
306
306
|
// export const nativeGlobal: typeof global = new Function('return this')();
|
|
307
307
|
var nativeGlobal = new Function("return this")();
|
|
308
|
-
//
|
|
309
|
-
// The sandbox in the
|
|
310
|
-
// If no loading content
|
|
308
|
+
// This section is to prevent encapsulation by certain microfrontend frameworks. Due to reuse policies, sandbox escapes.
|
|
309
|
+
// The sandbox in the microfrontend does not replicate the value of 'configurable'.
|
|
310
|
+
// If there is no loading content on the global object, this section defines the loading object.
|
|
311
311
|
if (!Object.hasOwnProperty.call(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__")) {
|
|
312
312
|
Object.defineProperty(globalThis, "__GLOBAL_LOADING_REMOTE_ENTRY__", {
|
|
313
313
|
value: {},
|
|
@@ -374,23 +374,15 @@ function getGlobalFederationConstructor() {
|
|
|
374
374
|
function setGlobalFederationConstructor(FederationConstructor) {
|
|
375
375
|
if (isDebugMode$1()) {
|
|
376
376
|
Global.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
|
|
377
|
-
Global.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "1.0.0-canary.
|
|
377
|
+
Global.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "1.0.0-canary.4";
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
381
381
|
function getInfoWithoutType(target, key, getModuleInfoHook) {
|
|
382
|
-
var res
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
key: key
|
|
387
|
-
};
|
|
388
|
-
} else {
|
|
389
|
-
res = {
|
|
390
|
-
value: undefined,
|
|
391
|
-
key: key
|
|
392
|
-
};
|
|
393
|
-
}
|
|
382
|
+
var res = {
|
|
383
|
+
value: target[key],
|
|
384
|
+
key: key
|
|
385
|
+
};
|
|
394
386
|
if (getModuleInfoHook) {
|
|
395
387
|
var hookRes = getModuleInfoHook(target, key);
|
|
396
388
|
res = hookRes || res;
|
|
@@ -401,18 +393,17 @@ var getGlobalSnapshot = function() {
|
|
|
401
393
|
return Global.__FEDERATION__.moduleInfo;
|
|
402
394
|
};
|
|
403
395
|
var getTargetSnapshotInfoByModuleInfo = function(moduleInfo, snapshot, getModuleInfoHook) {
|
|
404
|
-
// remote
|
|
396
|
+
// Check if the remote is included in the hostSnapshot
|
|
405
397
|
var moduleKey = getFMId(moduleInfo);
|
|
406
398
|
var getModuleInfo = getInfoWithoutType(snapshot, moduleKey, getModuleInfoHook).value;
|
|
407
|
-
// remoteSnapshot
|
|
399
|
+
// The remoteSnapshot might not include a version
|
|
408
400
|
if (getModuleInfo && !getModuleInfo.version && "version" in moduleInfo && moduleInfo["version"]) {
|
|
409
401
|
getModuleInfo.version = moduleInfo["version"];
|
|
410
402
|
}
|
|
411
403
|
if (getModuleInfo) {
|
|
412
404
|
return getModuleInfo;
|
|
413
405
|
}
|
|
414
|
-
// remote
|
|
415
|
-
// deploy micro app snapshot
|
|
406
|
+
// If the remote is not included in the hostSnapshot, deploy a micro app snapshot
|
|
416
407
|
if ("version" in moduleInfo && moduleInfo["version"]) {
|
|
417
408
|
var version = moduleInfo.version, resModuleInfo = _object_without_properties_loose(moduleInfo, [
|
|
418
409
|
"version"
|
|
@@ -441,7 +432,10 @@ var getRemoteEntryExports = function(name, globalName) {
|
|
|
441
432
|
entryExports: entryExports
|
|
442
433
|
};
|
|
443
434
|
};
|
|
444
|
-
// global
|
|
435
|
+
// This function is used to register global plugins.
|
|
436
|
+
// It iterates over the provided plugins and checks if they are already registered.
|
|
437
|
+
// If a plugin is not registered, it is added to the global plugins.
|
|
438
|
+
// If a plugin is already registered, a warning message is logged.
|
|
445
439
|
var registerGlobalPlugins = function(plugins) {
|
|
446
440
|
var __GLOBAL_PLUGIN__ = Global.__FEDERATION__.__GLOBAL_PLUGIN__;
|
|
447
441
|
plugins.forEach(function(plugin) {
|
|
@@ -913,8 +907,8 @@ function findSingletonVersionOrderByLoaded(scope, pkgName) {
|
|
|
913
907
|
};
|
|
914
908
|
return findVersion(scope, pkgName, callback);
|
|
915
909
|
}
|
|
916
|
-
//
|
|
917
|
-
// TODO:
|
|
910
|
+
// Details about shared resources
|
|
911
|
+
// TODO: Implement strictVersion for alignment with module federation.
|
|
918
912
|
function getGlobalShare(pkgName, shareInfo) {
|
|
919
913
|
var globalShares = Global.__FEDERATION__.__SHARE__;
|
|
920
914
|
var shareConfig = shareInfo.shareConfig, _shareInfo_scope = shareInfo.scope, scope = _shareInfo_scope === void 0 ? DEFAULT_SCOPE : _shareInfo_scope, strategy = shareInfo.strategy;
|
|
@@ -932,7 +926,7 @@ function getGlobalShare(pkgName, shareInfo) {
|
|
|
932
926
|
var singletonVersion = strategy === "loaded-first" ? findSingletonVersionOrderByLoaded(sc, pkgName) : findSingletonVersionOrderByVersion(sc, pkgName);
|
|
933
927
|
// eslint-disable-next-line max-depth
|
|
934
928
|
if (typeof requiredVersion === "string" && !satisfy(singletonVersion, requiredVersion)) {
|
|
935
|
-
warn("
|
|
929
|
+
warn("Version ".concat(singletonVersion, " from ").concat(singletonVersion && globalShares[sc][pkgName][singletonVersion].from, " of shared singleton module ").concat(pkgName, " does not satisfy the requirement of ").concat(shareInfo.from, " which needs ").concat(requiredVersion, ")"));
|
|
936
930
|
}
|
|
937
931
|
return globalShares[sc][pkgName][singletonVersion];
|
|
938
932
|
} else {
|
|
@@ -1245,6 +1239,7 @@ function _ts_generator(thisArg, body) {
|
|
|
1245
1239
|
};
|
|
1246
1240
|
}
|
|
1247
1241
|
}
|
|
1242
|
+
// Function to get the URL of a resource
|
|
1248
1243
|
function getResourceUrl(module, sourceUrl) {
|
|
1249
1244
|
if ("getPublicPath" in module) {
|
|
1250
1245
|
var publicPath = new Function(module.getPublicPath)();
|
|
@@ -1252,10 +1247,11 @@ function getResourceUrl(module, sourceUrl) {
|
|
|
1252
1247
|
} else if ("publicPath" in module) {
|
|
1253
1248
|
return "".concat(module.publicPath).concat(sourceUrl);
|
|
1254
1249
|
} else {
|
|
1255
|
-
console.warn("
|
|
1250
|
+
console.warn("Unable to retrieve resource URL. If in debug mode, this warning can be disregarded.", module, sourceUrl);
|
|
1256
1251
|
return "";
|
|
1257
1252
|
}
|
|
1258
1253
|
}
|
|
1254
|
+
// Function to match a remote with its name and expose
|
|
1259
1255
|
// id: pkgName(@federation/app1) + expose(button) = @federation/app1/button
|
|
1260
1256
|
// id: alias(app1) + expose(button) = app1/button
|
|
1261
1257
|
// id: alias(app1/utils) + expose(loadash/sort) = app1/utils/loadash/sort
|
|
@@ -1265,9 +1261,9 @@ function matchRemoteWithNameAndExpose(remotes, id) {
|
|
|
1265
1261
|
for(var _iterator = remotes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1266
1262
|
var remote = _step.value;
|
|
1267
1263
|
// match pkgName
|
|
1268
|
-
var
|
|
1264
|
+
var isNameMatched = id.startsWith(remote.name);
|
|
1269
1265
|
var expose = id.replace(remote.name, "");
|
|
1270
|
-
if (
|
|
1266
|
+
if (isNameMatched) {
|
|
1271
1267
|
if (expose.startsWith("/")) {
|
|
1272
1268
|
var pkgNameOrAlias = remote.name;
|
|
1273
1269
|
expose = ".".concat(expose);
|
|
@@ -1285,9 +1281,9 @@ function matchRemoteWithNameAndExpose(remotes, id) {
|
|
|
1285
1281
|
}
|
|
1286
1282
|
}
|
|
1287
1283
|
// match alias
|
|
1288
|
-
var
|
|
1284
|
+
var isAliasMatched = remote.alias && id.startsWith(remote.alias);
|
|
1289
1285
|
var exposeWithAlias = remote.alias && id.replace(remote.alias, "");
|
|
1290
|
-
if (remote.alias &&
|
|
1286
|
+
if (remote.alias && isAliasMatched) {
|
|
1291
1287
|
if (exposeWithAlias && exposeWithAlias.startsWith("/")) {
|
|
1292
1288
|
var pkgNameOrAlias1 = remote.alias;
|
|
1293
1289
|
exposeWithAlias = ".".concat(exposeWithAlias);
|
|
@@ -1321,17 +1317,18 @@ function matchRemoteWithNameAndExpose(remotes, id) {
|
|
|
1321
1317
|
}
|
|
1322
1318
|
return;
|
|
1323
1319
|
}
|
|
1320
|
+
// Function to match a remote with its name or alias
|
|
1324
1321
|
function matchRemote(remotes, nameOrAlias) {
|
|
1325
1322
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1326
1323
|
try {
|
|
1327
1324
|
for(var _iterator = remotes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1328
1325
|
var remote = _step.value;
|
|
1329
|
-
var
|
|
1330
|
-
if (
|
|
1326
|
+
var isNameMatched = nameOrAlias === remote.name;
|
|
1327
|
+
if (isNameMatched) {
|
|
1331
1328
|
return remote;
|
|
1332
1329
|
}
|
|
1333
|
-
var
|
|
1334
|
-
if (
|
|
1330
|
+
var isAliasMatched = remote.alias && nameOrAlias === remote.alias;
|
|
1331
|
+
if (isAliasMatched) {
|
|
1335
1332
|
return remote;
|
|
1336
1333
|
}
|
|
1337
1334
|
}
|
|
@@ -1352,7 +1349,7 @@ function matchRemote(remotes, nameOrAlias) {
|
|
|
1352
1349
|
return;
|
|
1353
1350
|
}
|
|
1354
1351
|
function createScript(url, cb, attrs, createScriptHook) {
|
|
1355
|
-
//
|
|
1352
|
+
// Retrieve the existing script element by its src attribute
|
|
1356
1353
|
var script = null;
|
|
1357
1354
|
var needAttach = true;
|
|
1358
1355
|
var scripts = document.getElementsByTagName("script");
|
|
@@ -1388,7 +1385,7 @@ function createScript(url, cb, attrs, createScriptHook) {
|
|
|
1388
1385
|
});
|
|
1389
1386
|
}
|
|
1390
1387
|
var onScriptComplete = function(prev, event) {
|
|
1391
|
-
//
|
|
1388
|
+
// Prevent memory leaks in IE.
|
|
1392
1389
|
if (script) {
|
|
1393
1390
|
script.onerror = null;
|
|
1394
1391
|
script.onload = null;
|
|
@@ -1420,7 +1417,7 @@ function loadScript(url, info) {
|
|
|
1420
1417
|
}
|
|
1421
1418
|
function registerPlugins(plugins, hookInstances) {
|
|
1422
1419
|
var globalPlugins = getGlobalHostPlugins();
|
|
1423
|
-
//
|
|
1420
|
+
// Incorporate global plugins
|
|
1424
1421
|
if (globalPlugins.length > 0) {
|
|
1425
1422
|
globalPlugins.forEach(function(plugin) {
|
|
1426
1423
|
if (plugins == null ? void 0 : plugins.find(function(item) {
|
|
@@ -1692,7 +1689,7 @@ var simpleJoinRemoteEntry = function simpleJoinRemoteEntry(rPath, rName) {
|
|
|
1692
1689
|
}
|
|
1693
1690
|
return "".concat(transformedPath, "/").concat(rName);
|
|
1694
1691
|
};
|
|
1695
|
-
//
|
|
1692
|
+
// Priority: overrides > remotes
|
|
1696
1693
|
// eslint-disable-next-line max-lines-per-function
|
|
1697
1694
|
function generateSnapshotFromManifest(manifest) {
|
|
1698
1695
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -1707,13 +1704,13 @@ function generateSnapshotFromManifest(manifest) {
|
|
|
1707
1704
|
};
|
|
1708
1705
|
var overridesKeys = Object.keys(overrides);
|
|
1709
1706
|
var remotesInfo = {};
|
|
1710
|
-
// If remotes are not
|
|
1707
|
+
// If remotes are not provided, only the remotes in the manifest will be read
|
|
1711
1708
|
if (!Object.keys(remotes).length) {
|
|
1712
1709
|
var _manifest_remotes;
|
|
1713
1710
|
remotesInfo = ((_manifest_remotes = manifest.remotes) === null || _manifest_remotes === void 0 ? void 0 : _manifest_remotes.reduce(function(res, next) {
|
|
1714
1711
|
var matchedVersion;
|
|
1715
1712
|
var name1 = next.federationContainerName;
|
|
1716
|
-
// overrides
|
|
1713
|
+
// overrides have higher priority
|
|
1717
1714
|
if (overridesKeys.includes(name1)) {
|
|
1718
1715
|
matchedVersion = overrides[name1];
|
|
1719
1716
|
} else {
|
|
@@ -1729,7 +1726,7 @@ function generateSnapshotFromManifest(manifest) {
|
|
|
1729
1726
|
return res;
|
|
1730
1727
|
}, {})) || {};
|
|
1731
1728
|
}
|
|
1732
|
-
// If remotes (deploy scenario) are specified,
|
|
1729
|
+
// If remotes (deploy scenario) are specified, they need to be traversed again
|
|
1733
1730
|
Object.keys(remotes).forEach(function(key) {
|
|
1734
1731
|
return remotesInfo[key] = {
|
|
1735
1732
|
// overrides will override dependencies
|
|
@@ -1827,7 +1824,7 @@ function _loadEntryScript() {
|
|
|
1827
1824
|
createScriptHook: createScriptHook
|
|
1828
1825
|
}).then(function() {
|
|
1829
1826
|
var _getRemoteEntryExports = getRemoteEntryExports(name1, globalName), remoteEntryKey = _getRemoteEntryExports.remoteEntryKey, entryExports = _getRemoteEntryExports.entryExports;
|
|
1830
|
-
assert(entryExports, "\n
|
|
1827
|
+
assert(entryExports, "\n Unable to use the ".concat(name1, "'s '").concat(entry, "' URL with ").concat(remoteEntryKey, "'s globalName to get remoteEntry exports.\n Possible reasons could be:\n\n 1. '").concat(entry, "' is not the correct URL, or the remoteEntry resource or name is incorrect.\n\n 2. ").concat(remoteEntryKey, " cannot be used to get remoteEntry exports in the window object.\n "));
|
|
1831
1828
|
return entryExports;
|
|
1832
1829
|
})
|
|
1833
1830
|
];
|
|
@@ -2115,14 +2112,14 @@ var AsyncHook = /*#__PURE__*/ function(SyncHook) {
|
|
|
2115
2112
|
return AsyncHook;
|
|
2116
2113
|
}(SyncHook);
|
|
2117
2114
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
2118
|
-
function checkReturnData(
|
|
2119
|
-
if (!isObject(
|
|
2115
|
+
function checkReturnData(originalData, returnedData) {
|
|
2116
|
+
if (!isObject(returnedData)) {
|
|
2120
2117
|
return false;
|
|
2121
2118
|
}
|
|
2122
|
-
if (
|
|
2119
|
+
if (originalData !== returnedData) {
|
|
2123
2120
|
// eslint-disable-next-line no-restricted-syntax
|
|
2124
|
-
for(var key in
|
|
2125
|
-
if (!(key in
|
|
2121
|
+
for(var key in originalData){
|
|
2122
|
+
if (!(key in returnedData)) {
|
|
2126
2123
|
return false;
|
|
2127
2124
|
}
|
|
2128
2125
|
}
|
|
@@ -2145,7 +2142,7 @@ var SyncWaterfallHook = /*#__PURE__*/ function(SyncHook) {
|
|
|
2145
2142
|
key: "emit",
|
|
2146
2143
|
value: function emit(data) {
|
|
2147
2144
|
if (!isObject(data)) {
|
|
2148
|
-
error('"'.concat(this.type, '" hook
|
|
2145
|
+
error('The data for the "'.concat(this.type, '" hook should be an object.'));
|
|
2149
2146
|
}
|
|
2150
2147
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2151
2148
|
try {
|
|
@@ -2156,7 +2153,7 @@ var SyncWaterfallHook = /*#__PURE__*/ function(SyncHook) {
|
|
|
2156
2153
|
if (checkReturnData(data, tempData)) {
|
|
2157
2154
|
data = tempData;
|
|
2158
2155
|
} else {
|
|
2159
|
-
this.onerror('
|
|
2156
|
+
this.onerror('A plugin returned an unacceptable value for the "'.concat(this.type, '" type.'));
|
|
2160
2157
|
break;
|
|
2161
2158
|
}
|
|
2162
2159
|
} catch (e) {
|
|
@@ -2201,7 +2198,7 @@ var AsyncWaterfallHook = /*#__PURE__*/ function(SyncHook) {
|
|
|
2201
2198
|
value: function emit(data) {
|
|
2202
2199
|
var _this = this;
|
|
2203
2200
|
if (!isObject(data)) {
|
|
2204
|
-
error('"'.concat(this.type, '" hook
|
|
2201
|
+
error('The response data for the "'.concat(this.type, '" hook must be an object.'));
|
|
2205
2202
|
}
|
|
2206
2203
|
var ls = Array.from(this.listeners);
|
|
2207
2204
|
if (ls.length > 0) {
|
|
@@ -2222,7 +2219,7 @@ var AsyncWaterfallHook = /*#__PURE__*/ function(SyncHook) {
|
|
|
2222
2219
|
}
|
|
2223
2220
|
}
|
|
2224
2221
|
} else {
|
|
2225
|
-
_this.onerror('
|
|
2222
|
+
_this.onerror('A plugin returned an incorrect value for the "'.concat(_this.type, '" type.'));
|
|
2226
2223
|
}
|
|
2227
2224
|
return data;
|
|
2228
2225
|
};
|
|
@@ -2246,10 +2243,10 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
2246
2243
|
key: "usePlugin",
|
|
2247
2244
|
value: function usePlugin(plugin) {
|
|
2248
2245
|
var _this = this;
|
|
2249
|
-
assert(isPlainObject(plugin), "
|
|
2250
|
-
// The plugin name is
|
|
2246
|
+
assert(isPlainObject(plugin), "Plugin configuration is invalid.");
|
|
2247
|
+
// The plugin's name is mandatory and must be unique
|
|
2251
2248
|
var pluginName = plugin.name;
|
|
2252
|
-
assert(pluginName, "
|
|
2249
|
+
assert(pluginName, "A name must be provided by the plugin.");
|
|
2253
2250
|
if (!this.registerPlugins[pluginName]) {
|
|
2254
2251
|
this.registerPlugins[pluginName] = plugin;
|
|
2255
2252
|
Object.keys(this.lifecycle).forEach(function(key) {
|
|
@@ -2265,9 +2262,9 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
2265
2262
|
key: "removePlugin",
|
|
2266
2263
|
value: function removePlugin(pluginName) {
|
|
2267
2264
|
var _this = this;
|
|
2268
|
-
assert(pluginName, "
|
|
2265
|
+
assert(pluginName, "A name is required.");
|
|
2269
2266
|
var plugin = this.registerPlugins[pluginName];
|
|
2270
|
-
assert(plugin, 'plugin "'.concat(pluginName, '" is not registered.'));
|
|
2267
|
+
assert(plugin, 'The plugin "'.concat(pluginName, '" is not registered.'));
|
|
2271
2268
|
Object.keys(plugin).forEach(function(key) {
|
|
2272
2269
|
if (key !== "name") {
|
|
2273
2270
|
_this.lifecycle[key].remove(plugin[key]);
|
|
@@ -2282,11 +2279,11 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
2282
2279
|
var lifecycle = param.lifecycle, registerPlugins = param.registerPlugins;
|
|
2283
2280
|
var _this = this;
|
|
2284
2281
|
Object.keys(lifecycle).forEach(function(hookName) {
|
|
2285
|
-
assert(!_this.lifecycle[hookName], '"'.concat(hookName, '"
|
|
2282
|
+
assert(!_this.lifecycle[hookName], 'The hook "'.concat(hookName, '" has a conflict and cannot be inherited.'));
|
|
2286
2283
|
_this.lifecycle[hookName] = lifecycle[hookName];
|
|
2287
2284
|
});
|
|
2288
2285
|
Object.keys(registerPlugins).forEach(function(pluginName) {
|
|
2289
|
-
assert(!_this.registerPlugins[pluginName], '"'.concat(pluginName, '"
|
|
2286
|
+
assert(!_this.registerPlugins[pluginName], 'The plugin "'.concat(pluginName, '" has a conflict and cannot be inherited.'));
|
|
2290
2287
|
_this.usePlugin(registerPlugins[pluginName]);
|
|
2291
2288
|
});
|
|
2292
2289
|
}
|
|
@@ -2302,13 +2299,12 @@ function defaultPreloadArgs(preloadConfig) {
|
|
|
2302
2299
|
}, preloadConfig);
|
|
2303
2300
|
}
|
|
2304
2301
|
function formatPreloadArgs(remotes, preloadArgs) {
|
|
2305
|
-
// let preloadOps: PreloadOptions;
|
|
2306
2302
|
return preloadArgs.map(function(args) {
|
|
2307
2303
|
var remoteInfo = matchRemote(remotes, args.nameOrAlias);
|
|
2308
|
-
assert(remoteInfo, "
|
|
2304
|
+
assert(remoteInfo, "Unable to preload ".concat(args.nameOrAlias, " as it is not included in ").concat(!remoteInfo && safeToString$1({
|
|
2309
2305
|
remoteInfo: remoteInfo,
|
|
2310
2306
|
remotes: remotes
|
|
2311
|
-
})
|
|
2307
|
+
})));
|
|
2312
2308
|
return {
|
|
2313
2309
|
remote: remoteInfo,
|
|
2314
2310
|
preloadConfig: defaultPreloadArgs(args)
|
|
@@ -2371,7 +2367,6 @@ function preloadAssets(remoteInfo, host, assets) {
|
|
|
2371
2367
|
cssEl.setAttribute("rel", "preload");
|
|
2372
2368
|
cssEl.setAttribute("href", cssUrl);
|
|
2373
2369
|
cssEl.setAttribute("as", "style");
|
|
2374
|
-
cssEl.setAttribute("crossorigin", "anonymous");
|
|
2375
2370
|
fragment.appendChild(cssEl);
|
|
2376
2371
|
});
|
|
2377
2372
|
document.head.appendChild(fragment);
|
|
@@ -2393,7 +2388,7 @@ function preloadAssets(remoteInfo, host, assets) {
|
|
|
2393
2388
|
}
|
|
2394
2389
|
function assignRemoteInfo(remoteInfo, remoteSnapshot) {
|
|
2395
2390
|
if (!("remoteEntry" in remoteSnapshot) || !remoteSnapshot.remoteEntry) {
|
|
2396
|
-
error("The remoteEntry
|
|
2391
|
+
error("The attribute remoteEntry of ".concat(name, " must not be undefined."));
|
|
2397
2392
|
}
|
|
2398
2393
|
var remoteEntry = remoteSnapshot.remoteEntry;
|
|
2399
2394
|
var entryUrl = getResourceUrl(remoteSnapshot, remoteEntry);
|
|
@@ -2424,7 +2419,7 @@ function snapshotPlugin() {
|
|
|
2424
2419
|
case 1:
|
|
2425
2420
|
_ref = _state.sent(), remoteSnapshot = _ref.remoteSnapshot, globalSnapshot = _ref.globalSnapshot;
|
|
2426
2421
|
assignRemoteInfo(remoteInfo, remoteSnapshot);
|
|
2427
|
-
//
|
|
2422
|
+
// preloading assets
|
|
2428
2423
|
preloadOptions = {
|
|
2429
2424
|
remote: remote,
|
|
2430
2425
|
preloadConfig: {
|
|
@@ -2486,16 +2481,16 @@ function splitId(id) {
|
|
|
2486
2481
|
};
|
|
2487
2482
|
}
|
|
2488
2483
|
}
|
|
2489
|
-
// Traverse all nodes
|
|
2484
|
+
// Traverse all nodes in moduleInfo and traverse the entire snapshot
|
|
2490
2485
|
function traverseModuleInfo(globalSnapshot, remoteInfo, traverse, isRoot) {
|
|
2491
2486
|
var memo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {}, remoteSnapshot = arguments.length > 5 ? arguments[5] : void 0, getModuleInfoHook = arguments.length > 6 ? arguments[6] : void 0;
|
|
2492
2487
|
var id = getFMId(remoteInfo);
|
|
2493
2488
|
var _getInfoWithoutType = getInfoWithoutType(globalSnapshot, id, getModuleInfoHook), snapshotValue = _getInfoWithoutType.value;
|
|
2494
|
-
var
|
|
2495
|
-
if (
|
|
2496
|
-
traverse(
|
|
2497
|
-
if (
|
|
2498
|
-
var remoteKeys = Object.keys(
|
|
2489
|
+
var effectiveRemoteSnapshot = remoteSnapshot || snapshotValue;
|
|
2490
|
+
if (effectiveRemoteSnapshot && !isManifestProvider(effectiveRemoteSnapshot)) {
|
|
2491
|
+
traverse(effectiveRemoteSnapshot, remoteInfo, isRoot);
|
|
2492
|
+
if (effectiveRemoteSnapshot.remotesInfo) {
|
|
2493
|
+
var remoteKeys = Object.keys(effectiveRemoteSnapshot.remotesInfo);
|
|
2499
2494
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2500
2495
|
try {
|
|
2501
2496
|
for(var _iterator = remoteKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
@@ -2505,7 +2500,7 @@ function traverseModuleInfo(globalSnapshot, remoteInfo, traverse, isRoot) {
|
|
|
2505
2500
|
}
|
|
2506
2501
|
memo[key] = true;
|
|
2507
2502
|
var subRemoteInfo = splitId(key);
|
|
2508
|
-
var remoteValue =
|
|
2503
|
+
var remoteValue = effectiveRemoteSnapshot.remotesInfo[key];
|
|
2509
2504
|
traverseModuleInfo(globalSnapshot, {
|
|
2510
2505
|
name: subRemoteInfo.name,
|
|
2511
2506
|
version: remoteValue.matchedVersion
|
|
@@ -2540,7 +2535,7 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
|
|
|
2540
2535
|
var depsRemote = rootPreloadConfig.depsRemote;
|
|
2541
2536
|
var memo = {};
|
|
2542
2537
|
traverseModuleInfo(globalSnapshot, remote, function(moduleInfoSnapshot, remoteInfo, isRoot) {
|
|
2543
|
-
var
|
|
2538
|
+
var handleAssets = function handleAssets(assets) {
|
|
2544
2539
|
var assetsRes = assets.map(function(asset) {
|
|
2545
2540
|
return getResourceUrl(moduleInfoSnapshot, asset);
|
|
2546
2541
|
});
|
|
@@ -2601,7 +2596,6 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
|
|
|
2601
2596
|
var assetsLength = moduleAssetsInfo.length;
|
|
2602
2597
|
for(var index = 0; index < assetsLength; index++){
|
|
2603
2598
|
var assetsInfo = moduleAssetsInfo[index];
|
|
2604
|
-
// for (const assetsInfo of moduleAssetsInfo) {
|
|
2605
2599
|
var exposeFullPath = "".concat(remoteInfo.name, "/").concat(assetsInfo.moduleName);
|
|
2606
2600
|
var preloaded = getPreloaded(exposeFullPath);
|
|
2607
2601
|
if (preloaded) {
|
|
@@ -2609,15 +2603,15 @@ function generatePreloadAssets(origin, preloadOptions, remote, globalSnapshot, r
|
|
|
2609
2603
|
}
|
|
2610
2604
|
if (preloadConfig.resourceCategory === "all") {
|
|
2611
2605
|
var _cssAssets, _cssAssets1, _jsAssets, _jsAssets1;
|
|
2612
|
-
(_cssAssets = cssAssets).push.apply(_cssAssets, _to_consumable_array(
|
|
2613
|
-
(_cssAssets1 = cssAssets).push.apply(_cssAssets1, _to_consumable_array(
|
|
2614
|
-
(_jsAssets = jsAssets).push.apply(_jsAssets, _to_consumable_array(
|
|
2615
|
-
(_jsAssets1 = jsAssets).push.apply(_jsAssets1, _to_consumable_array(
|
|
2606
|
+
(_cssAssets = cssAssets).push.apply(_cssAssets, _to_consumable_array(handleAssets(assetsInfo.assets.css.async)));
|
|
2607
|
+
(_cssAssets1 = cssAssets).push.apply(_cssAssets1, _to_consumable_array(handleAssets(assetsInfo.assets.css.sync)));
|
|
2608
|
+
(_jsAssets = jsAssets).push.apply(_jsAssets, _to_consumable_array(handleAssets(assetsInfo.assets.js.async)));
|
|
2609
|
+
(_jsAssets1 = jsAssets).push.apply(_jsAssets1, _to_consumable_array(handleAssets(assetsInfo.assets.js.sync)));
|
|
2616
2610
|
// eslint-disable-next-line no-constant-condition
|
|
2617
2611
|
} else if (preloadConfig.resourceCategory = "sync") {
|
|
2618
2612
|
var _cssAssets2, _jsAssets2;
|
|
2619
|
-
(_cssAssets2 = cssAssets).push.apply(_cssAssets2, _to_consumable_array(
|
|
2620
|
-
(_jsAssets2 = jsAssets).push.apply(_jsAssets2, _to_consumable_array(
|
|
2613
|
+
(_cssAssets2 = cssAssets).push.apply(_cssAssets2, _to_consumable_array(handleAssets(assetsInfo.assets.css.sync)));
|
|
2614
|
+
(_jsAssets2 = jsAssets).push.apply(_jsAssets2, _to_consumable_array(handleAssets(assetsInfo.assets.js.sync)));
|
|
2621
2615
|
}
|
|
2622
2616
|
setPreloaded(exposeFullPath);
|
|
2623
2617
|
}
|
|
@@ -2789,10 +2783,8 @@ var SnapshotHandler = /*#__PURE__*/ function() {
|
|
|
2789
2783
|
];
|
|
2790
2784
|
case 1:
|
|
2791
2785
|
_state.sent();
|
|
2792
|
-
// In
|
|
2793
|
-
//
|
|
2794
|
-
// In the dynamic loadRemote scenario, incomplete remotesInfo delivery may occur. In this case, the remotesInfo in the host needs to be completed in the snapshot at runtime.
|
|
2795
|
-
// Ensure the integrity of the snapshot, and at the same time help the chrome plug-in correctly identify all producer modules, ensuring that proxyable producer modules will not be missing
|
|
2786
|
+
// In dynamic loadRemote scenarios, incomplete remotesInfo delivery may occur. In such cases, the remotesInfo in the host needs to be completed in the snapshot at runtime.
|
|
2787
|
+
// This ensures the snapshot's integrity and helps the chrome plugin correctly identify all producer modules, ensuring that proxyable producer modules will not be missing.
|
|
2796
2788
|
if (hostSnapshot && "remotesInfo" in hostSnapshot && !getInfoWithoutType(hostSnapshot.remotesInfo, moduleInfo.name, function(target, key) {
|
|
2797
2789
|
var res = _this.HostInstance.loaderHook.lifecycle.getModuleInfo.emit({
|
|
2798
2790
|
target: target,
|
|
@@ -3024,7 +3016,7 @@ var SnapshotHandler = /*#__PURE__*/ function() {
|
|
|
3024
3016
|
];
|
|
3025
3017
|
case 3:
|
|
3026
3018
|
manifestJson = _state.sent();
|
|
3027
|
-
assert(manifestJson.metaData && manifestJson.exposes && manifestJson.shared, "".concat(manifestUrl, " is not federation manifest"));
|
|
3019
|
+
assert(manifestJson.metaData && manifestJson.exposes && manifestJson.shared, "".concat(manifestUrl, " is not a federation manifest"));
|
|
3028
3020
|
_this.manifestCache.set(manifestUrl, manifestJson);
|
|
3029
3021
|
return [
|
|
3030
3022
|
2,
|
|
@@ -3119,7 +3111,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3119
3111
|
generatePreloadAssets: new AsyncHook("generatePreloadAssets"),
|
|
3120
3112
|
afterPreloadRemote: new AsyncHook()
|
|
3121
3113
|
});
|
|
3122
|
-
this.version = "1.0.0-canary.
|
|
3114
|
+
this.version = "1.0.0-canary.4";
|
|
3123
3115
|
this.moduleCache = new Map();
|
|
3124
3116
|
this.loaderHook = new PluginSystem({
|
|
3125
3117
|
// FIXME: may not be suitable
|
|
@@ -3127,8 +3119,8 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3127
3119
|
createScript: new SyncHook()
|
|
3128
3120
|
});
|
|
3129
3121
|
this.loadingShare = {};
|
|
3130
|
-
// TODO:
|
|
3131
|
-
//
|
|
3122
|
+
// TODO: Validate the details of the options
|
|
3123
|
+
// Initialize options with default values
|
|
3132
3124
|
var defaultOptions = {
|
|
3133
3125
|
id: getBuilderId(),
|
|
3134
3126
|
name: userOptions.name,
|
|
@@ -3166,9 +3158,10 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3166
3158
|
return _ts_generator(this, function(_state) {
|
|
3167
3159
|
switch(_state.label){
|
|
3168
3160
|
case 0:
|
|
3169
|
-
//
|
|
3170
|
-
//
|
|
3171
|
-
//
|
|
3161
|
+
// This function performs the following steps:
|
|
3162
|
+
// 1. Checks if the currently loaded share already exists, if not, it throws an error
|
|
3163
|
+
// 2. Searches globally for a matching share, if found, it uses it directly
|
|
3164
|
+
// 3. If not found, it retrieves it from the current share and stores the obtained share globally.
|
|
3172
3165
|
shareInfo = Object.assign({}, (_this_options_shared = _this.options.shared) == null ? void 0 : _this_options_shared[pkgName], customShareInfo);
|
|
3173
3166
|
return [
|
|
3174
3167
|
4,
|
|
@@ -3182,8 +3175,9 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3182
3175
|
case 1:
|
|
3183
3176
|
loadShareRes = _state.sent();
|
|
3184
3177
|
shareInfoRes = loadShareRes.shareInfo;
|
|
3185
|
-
|
|
3186
|
-
|
|
3178
|
+
// Assert that shareInfoRes exists, if not, throw an error
|
|
3179
|
+
assert(shareInfoRes, "Cannot find ".concat(pkgName, " Share in the ").concat(_this.options.name, ". Please ensure that the ").concat(pkgName, " Share parameters have been injected"));
|
|
3180
|
+
// Retrieve from cache
|
|
3187
3181
|
globalShare = getGlobalShare(pkgName, shareInfoRes);
|
|
3188
3182
|
if (!(globalShare && globalShare.lib)) return [
|
|
3189
3183
|
3,
|
|
@@ -3314,10 +3308,10 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3314
3308
|
}
|
|
3315
3309
|
},
|
|
3316
3310
|
{
|
|
3317
|
-
//
|
|
3318
|
-
// 1. If the loaded shared already exists globally, then
|
|
3319
|
-
// 2. If lib exists in local shared,
|
|
3320
|
-
// 3. If the local get returns something other than Promise, then
|
|
3311
|
+
// The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
|
|
3312
|
+
// 1. If the loaded shared already exists globally, then it will be reused
|
|
3313
|
+
// 2. If lib exists in local shared, it will be used directly
|
|
3314
|
+
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
3321
3315
|
key: "loadShareSync",
|
|
3322
3316
|
value: function loadShareSync(pkgName) {
|
|
3323
3317
|
var _this_options_shared;
|
|
@@ -3342,7 +3336,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3342
3336
|
if (shareInfo.get) {
|
|
3343
3337
|
var module = shareInfo.get();
|
|
3344
3338
|
if (_instanceof(module, Promise)) {
|
|
3345
|
-
throw new Error("\n The loadShareSync function
|
|
3339
|
+
throw new Error("\n The loadShareSync function was unable to load ".concat(pkgName, ". The ").concat(pkgName, " could not be found in ").concat(this.options.name, ".\n Possible reasons for failure: \n\n 1. The ").concat(pkgName, " share was registered with the 'get' attribute, but loadShare was not used beforehand.\n\n 2. The ").concat(pkgName, " share was not registered with the 'lib' attribute.\n\n "));
|
|
3346
3340
|
}
|
|
3347
3341
|
shareInfo.lib = module;
|
|
3348
3342
|
this.setShared({
|
|
@@ -3354,7 +3348,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3354
3348
|
});
|
|
3355
3349
|
return shareInfo.lib;
|
|
3356
3350
|
}
|
|
3357
|
-
throw new Error("\n The loadShareSync function
|
|
3351
|
+
throw new Error("\n The loadShareSync function was unable to load ".concat(pkgName, ". The ").concat(pkgName, " could not be found in ").concat(this.options.name, ".\n Possible reasons for failure: \n\n 1. The ").concat(pkgName, " share was registered with the 'get' attribute, but loadShare was not used beforehand.\n\n 2. The ").concat(pkgName, " share was not registered with the 'lib' attribute.\n\n "));
|
|
3358
3352
|
}
|
|
3359
3353
|
},
|
|
3360
3354
|
{
|
|
@@ -3378,7 +3372,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3378
3372
|
loadRemoteArgs = _state.sent();
|
|
3379
3373
|
idRes = loadRemoteArgs.id;
|
|
3380
3374
|
remoteSplitInfo = matchRemoteWithNameAndExpose(_this.options.remotes, idRes);
|
|
3381
|
-
assert(remoteSplitInfo, "\n
|
|
3375
|
+
assert(remoteSplitInfo, "\n Unable to locate ".concat(idRes, " in ").concat(_this.options.name, ". Potential reasons for failure include:\n\n 1. ").concat(idRes, " was not included in the 'remotes' parameter of ").concat(_this.options.name, ".\n\n 2. ").concat(idRes, " could not be found in the 'remotes' of ").concat(_this.options.name, " with either 'name' or 'alias' attributes.\n 3. The 'beforeLoadRemote' hook was provided but did not return the correct 'remoteInfo' when attempting to load ").concat(idRes, ".\n "));
|
|
3382
3376
|
rawRemote = remoteSplitInfo.remote;
|
|
3383
3377
|
remoteInfo = getRemoteInfo(rawRemote);
|
|
3384
3378
|
return [
|
|
@@ -3394,7 +3388,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3394
3388
|
case 2:
|
|
3395
3389
|
matchInfo = _state.sent();
|
|
3396
3390
|
remote = matchInfo.remote, expose = matchInfo.expose;
|
|
3397
|
-
assert(remote && expose, "The 'beforeLoadRemote' hook was
|
|
3391
|
+
assert(remote && expose, "The 'beforeLoadRemote' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ".concat(idRes, "."));
|
|
3398
3392
|
module = _this.moduleCache.get(remote.name);
|
|
3399
3393
|
moduleOptions = {
|
|
3400
3394
|
hostInfo: {
|
|
@@ -3571,9 +3565,9 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3571
3565
|
},
|
|
3572
3566
|
{
|
|
3573
3567
|
/**
|
|
3574
|
-
*
|
|
3575
|
-
*
|
|
3576
|
-
*
|
|
3568
|
+
* This function initializes the sharing sequence (executed only once per share scope).
|
|
3569
|
+
* It accepts one argument, the name of the share scope.
|
|
3570
|
+
* If the share scope does not exist, it creates one.
|
|
3577
3571
|
*/ // eslint-disable-next-line @typescript-eslint/member-ordering
|
|
3578
3572
|
key: "initializeSharing",
|
|
3579
3573
|
value: function initializeSharing() {
|
|
@@ -3582,15 +3576,15 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3582
3576
|
var shareScopeLoading = Global.__FEDERATION__.__SHARE_SCOPE_LOADING__;
|
|
3583
3577
|
var shareScope = Global.__FEDERATION__.__SHARE__;
|
|
3584
3578
|
var hostName = this.options.name;
|
|
3585
|
-
// only
|
|
3579
|
+
// Executes only once
|
|
3586
3580
|
if (shareScopeLoading[shareScopeName]) {
|
|
3587
3581
|
return shareScopeLoading[shareScopeName];
|
|
3588
3582
|
}
|
|
3589
|
-
//
|
|
3583
|
+
// Creates a new share scope if necessary
|
|
3590
3584
|
if (!shareScope[shareScopeName]) {
|
|
3591
3585
|
shareScope[shareScopeName] = {};
|
|
3592
3586
|
}
|
|
3593
|
-
//
|
|
3587
|
+
// Executes all initialization snippets from all accessible modules
|
|
3594
3588
|
var scope = shareScope[shareScopeName];
|
|
3595
3589
|
var register = function(name1, shared) {
|
|
3596
3590
|
var version = shared.version, eager = shared.eager;
|
|
@@ -3673,8 +3667,8 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3673
3667
|
return item.name === remote.name;
|
|
3674
3668
|
})) {
|
|
3675
3669
|
if (remote.alias) {
|
|
3676
|
-
//
|
|
3677
|
-
//
|
|
3670
|
+
// Validate if alias equals the prefix of remote.name and remote.alias, if so, throw an error
|
|
3671
|
+
// As multi-level path references cannot guarantee unique names, alias being a prefix of remote.name is not supported
|
|
3678
3672
|
var findEqual = res.find(function(item) {
|
|
3679
3673
|
var _item_alias;
|
|
3680
3674
|
return remote.alias && (item.name.startsWith(remote.alias) || ((_item_alias = item.alias) == null ? void 0 : _item_alias.startsWith(remote.alias)));
|
|
@@ -3691,7 +3685,7 @@ var FederationHost = /*#__PURE__*/ function() {
|
|
|
3691
3685
|
remote.shareScope = DEFAULT_SCOPE;
|
|
3692
3686
|
}
|
|
3693
3687
|
if (!remote.type) {
|
|
3694
|
-
// FIXME: The build plugin
|
|
3688
|
+
// FIXME: The build plugin needs to support this field
|
|
3695
3689
|
remote.type = DEFAULT_REMOTE_TYPE;
|
|
3696
3690
|
}
|
|
3697
3691
|
res.push(remote);
|
|
@@ -3979,7 +3973,7 @@ function consumes(options) {
|
|
|
3979
3973
|
try {
|
|
3980
3974
|
var federationInstance = webpackRequire.federation.instance;
|
|
3981
3975
|
if (!federationInstance) {
|
|
3982
|
-
throw new Error("
|
|
3976
|
+
throw new Error("Federation instance not found!");
|
|
3983
3977
|
}
|
|
3984
3978
|
var _moduleToHandlerMapping_id = moduleToHandlerMapping[id], shareKey = _moduleToHandlerMapping_id.shareKey, getter = _moduleToHandlerMapping_id.getter, shareInfo = _moduleToHandlerMapping_id.shareInfo;
|
|
3985
3979
|
var promise = federationInstance.loadShare(shareKey, shareInfo).then(function(factory) {
|
|
@@ -3991,7 +3985,7 @@ function consumes(options) {
|
|
|
3991
3985
|
if (promise.then) {
|
|
3992
3986
|
promises.push(installedModules[id] = promise.then(onFactory).catch(onError));
|
|
3993
3987
|
} else {
|
|
3994
|
-
// @ts-ignore
|
|
3988
|
+
// @ts-ignore maintain previous logic
|
|
3995
3989
|
onFactory(promise);
|
|
3996
3990
|
}
|
|
3997
3991
|
} catch (e) {
|
|
@@ -4009,11 +4003,11 @@ function handleInitialConsumes(options) {
|
|
|
4009
4003
|
var moduleId = options.moduleId, moduleToHandlerMapping = options.moduleToHandlerMapping, webpackRequire = options.webpackRequire;
|
|
4010
4004
|
var federationInstance = webpackRequire.federation.instance;
|
|
4011
4005
|
if (!federationInstance) {
|
|
4012
|
-
throw new Error("
|
|
4006
|
+
throw new Error("Federation instance not found!");
|
|
4013
4007
|
}
|
|
4014
4008
|
var _moduleToHandlerMapping_moduleId = moduleToHandlerMapping[moduleId], shareKey = _moduleToHandlerMapping_moduleId.shareKey, shareInfo = _moduleToHandlerMapping_moduleId.shareInfo;
|
|
4015
4009
|
if (!shareInfo.shareConfig.eager) {
|
|
4016
|
-
throw new Error('
|
|
4010
|
+
throw new Error('Shared: "'.concat(shareKey, '" cannot be loaded synchronously unless "eager:true" is set or async entry is enabled.'));
|
|
4017
4011
|
}
|
|
4018
4012
|
return federationInstance.loadShareSync(shareKey);
|
|
4019
4013
|
}
|
|
@@ -4021,7 +4015,7 @@ function installInitialConsumes(options) {
|
|
|
4021
4015
|
var moduleToHandlerMapping = options.moduleToHandlerMapping, webpackRequire = options.webpackRequire, installedModules = options.installedModules, initialConsumes = options.initialConsumes;
|
|
4022
4016
|
initialConsumes.forEach(function(id) {
|
|
4023
4017
|
webpackRequire.m[id] = function(module) {
|
|
4024
|
-
// Handle
|
|
4018
|
+
// Handle scenario when module is used synchronously
|
|
4025
4019
|
installedModules[id] = 0;
|
|
4026
4020
|
delete webpackRequire.c[id];
|
|
4027
4021
|
var factory = handleInitialConsumes({
|