@module-federation/bridge-vue3 0.0.0-next-20241212120314 → 0.0.0-next-20241212123451
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/CHANGELOG.md +5 -4
- package/dist/index.cjs.js +7 -7
- package/dist/index.es.js +714 -705
- package/package.json +4 -4
package/dist/index.es.js
CHANGED
|
@@ -2,15 +2,15 @@ import * as Vue from "vue";
|
|
|
2
2
|
import { defineComponent, ref, watch, onMounted, onBeforeUnmount, createVNode, defineAsyncComponent, h } from "vue";
|
|
3
3
|
import * as VueRouter from "vue-router";
|
|
4
4
|
import { useRoute } from "vue-router";
|
|
5
|
-
var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __export = (
|
|
6
|
-
for (var
|
|
7
|
-
__defProp(
|
|
8
|
-
}, __copyProps = (
|
|
5
|
+
var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __export = (r, t) => {
|
|
6
|
+
for (var o in t)
|
|
7
|
+
__defProp(r, o, { get: t[o], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (r, t, o, n) => {
|
|
9
9
|
if (t && typeof t == "object" || typeof t == "function")
|
|
10
10
|
for (let s of __getOwnPropNames(t))
|
|
11
|
-
!__hasOwnProp.call(
|
|
12
|
-
return
|
|
13
|
-
}, __toCommonJS = (
|
|
11
|
+
!__hasOwnProp.call(r, s) && s !== o && __defProp(r, s, { get: () => t[s], enumerable: !(n = __getOwnPropDesc(t, s)) || n.enumerable });
|
|
12
|
+
return r;
|
|
13
|
+
}, __toCommonJS = (r) => __copyProps(__defProp({}, "__esModule", { value: !0 }), r), browser_exports = {};
|
|
14
14
|
__export(browser_exports, {
|
|
15
15
|
createLogger: () => createLogger2,
|
|
16
16
|
logger: () => logger$1
|
|
@@ -19,10 +19,10 @@ var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, sup
|
|
|
19
19
|
if (typeof supportsSubstitutions < "u")
|
|
20
20
|
return supportsSubstitutions;
|
|
21
21
|
try {
|
|
22
|
-
const
|
|
22
|
+
const r = "color test", t = "color: red;", o = console.log;
|
|
23
23
|
console.log = (...n) => {
|
|
24
|
-
n[0] === `%c${
|
|
25
|
-
}, console.log(`%c${
|
|
24
|
+
n[0] === `%c${r}` && n[1] === t && (supportsSubstitutions = !0);
|
|
25
|
+
}, console.log(`%c${r}`, t), console.log = o;
|
|
26
26
|
} catch {
|
|
27
27
|
supportsSubstitutions = !1;
|
|
28
28
|
}
|
|
@@ -35,20 +35,20 @@ var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, sup
|
|
|
35
35
|
dodgerblue: "color: dodgerblue;",
|
|
36
36
|
magenta: "color: magenta;",
|
|
37
37
|
gray: "color: gray;"
|
|
38
|
-
}, formatter = (
|
|
38
|
+
}, formatter = (r) => supportColor() ? (t) => {
|
|
39
39
|
if (Array.isArray(t)) {
|
|
40
|
-
const [
|
|
41
|
-
return [`%c${
|
|
40
|
+
const [o, n] = t;
|
|
41
|
+
return [`%c${o.replace("%c", "")}`, n ? `${ansiToCss[r]}${n}` : `${ansiToCss[r] || ""}`];
|
|
42
42
|
}
|
|
43
|
-
return [`%c${String(t).replace("%c", "")}`, ansiToCss[
|
|
43
|
+
return [`%c${String(t).replace("%c", "")}`, ansiToCss[r] || ""];
|
|
44
44
|
} : (t) => [String(t)], bold = formatter("bold"), red = formatter("red"), green = formatter("green"), orange = formatter("orange"), dodgerblue = formatter("dodgerblue"), magenta = formatter("magenta");
|
|
45
45
|
formatter("gray");
|
|
46
|
-
function getLabel(
|
|
46
|
+
function getLabel(r, t, o) {
|
|
47
47
|
let n = [""];
|
|
48
|
-
return "label" in t && (n = [r
|
|
48
|
+
return "label" in t && (n = [o[r] || t.label || ""], n = bold(t.color ? t.color(n) : n[0])), n = n.filter(Boolean), n;
|
|
49
49
|
}
|
|
50
|
-
function finalLog(
|
|
51
|
-
|
|
50
|
+
function finalLog(r, t, o, n) {
|
|
51
|
+
r.length ? Array.isArray(n) ? console.log(...r, ...n) : console.log(...r, t) : Array.isArray(n) ? console.log(...n) : console.log(t, ...o);
|
|
52
52
|
}
|
|
53
53
|
var LOG_LEVEL = {
|
|
54
54
|
error: 0,
|
|
@@ -56,26 +56,26 @@ var LOG_LEVEL = {
|
|
|
56
56
|
info: 2,
|
|
57
57
|
log: 3,
|
|
58
58
|
verbose: 4
|
|
59
|
-
}, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (
|
|
60
|
-
let a =
|
|
59
|
+
}, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r), createLogger$1 = (r = {}, { getLabel: t, handleError: o, finalLog: n, greet: s, LOG_TYPES: l }) => {
|
|
60
|
+
let a = r.level || "log", i = r.labels || {}, c = (d, p, ...m) => {
|
|
61
61
|
if (LOG_LEVEL[l[d].level] > LOG_LEVEL[a])
|
|
62
62
|
return;
|
|
63
63
|
if (p == null)
|
|
64
64
|
return console.log();
|
|
65
|
-
let
|
|
66
|
-
const R = t(d,
|
|
65
|
+
let g = l[d], _ = "";
|
|
66
|
+
const R = t(d, g, i);
|
|
67
67
|
if (p instanceof Error)
|
|
68
68
|
if (p.stack) {
|
|
69
|
-
let [
|
|
69
|
+
let [y, ...E] = p.stack.split(`
|
|
70
70
|
`);
|
|
71
|
-
|
|
72
|
-
${
|
|
71
|
+
y.startsWith("Error: ") && (y = y.slice(7)), _ = `${y}
|
|
72
|
+
${o(E.join(`
|
|
73
73
|
`))}`;
|
|
74
74
|
} else
|
|
75
75
|
_ = p.message;
|
|
76
76
|
else
|
|
77
|
-
|
|
78
|
-
`).map((E) => isErrorStackMessage(E) ?
|
|
77
|
+
g.level === "error" && typeof p == "string" ? _ = p.split(`
|
|
78
|
+
`).map((E) => isErrorStackMessage(E) ? o(E) : E).join(`
|
|
79
79
|
`) : _ = `${p}`;
|
|
80
80
|
n(R, _, m, p);
|
|
81
81
|
}, u = {
|
|
@@ -97,17 +97,17 @@ ${r(E.join(`
|
|
|
97
97
|
}), u.override = (d) => {
|
|
98
98
|
Object.assign(u, d);
|
|
99
99
|
}, u;
|
|
100
|
-
}, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (
|
|
101
|
-
function gradient(
|
|
100
|
+
}, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (r) => !/[\s\n]/.test(r);
|
|
101
|
+
function gradient(r) {
|
|
102
102
|
if (!supportColor())
|
|
103
|
-
return [
|
|
104
|
-
const t = [...
|
|
103
|
+
return [r];
|
|
104
|
+
const t = [...r], o = t.filter(isWord), n = o.length - 1;
|
|
105
105
|
if (n === 0)
|
|
106
|
-
return console.log(`%c${
|
|
106
|
+
return console.log(`%c${r}`, `color: rgb(${startColor.join(",")}); font-weight: bold;`), [r];
|
|
107
107
|
let s = "", l = [];
|
|
108
108
|
return t.forEach((a) => {
|
|
109
109
|
if (isWord(a)) {
|
|
110
|
-
const i =
|
|
110
|
+
const i = o.indexOf(a) / n, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), d = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
|
|
111
111
|
s += `%c${a}`, l.push(`color: rgb(${c},${u},${d}); font-weight: bold;`);
|
|
112
112
|
} else
|
|
113
113
|
s += a;
|
|
@@ -158,8 +158,8 @@ var LOG_TYPES = {
|
|
|
158
158
|
color: magenta
|
|
159
159
|
}
|
|
160
160
|
};
|
|
161
|
-
function createLogger2(
|
|
162
|
-
return createLogger$1(
|
|
161
|
+
function createLogger2(r = {}) {
|
|
162
|
+
return createLogger$1(r, {
|
|
163
163
|
handleError: (t) => t,
|
|
164
164
|
getLabel,
|
|
165
165
|
gradient,
|
|
@@ -171,8 +171,8 @@ function createLogger2(o = {}) {
|
|
|
171
171
|
var logger$1 = createLogger2();
|
|
172
172
|
function _extends$2() {
|
|
173
173
|
return _extends$2 = Object.assign || function(t) {
|
|
174
|
-
for (var
|
|
175
|
-
var n = arguments[
|
|
174
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
175
|
+
var n = arguments[o];
|
|
176
176
|
for (var s in n)
|
|
177
177
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
178
178
|
}
|
|
@@ -196,11 +196,11 @@ function isDebugMode() {
|
|
|
196
196
|
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : isBrowserDebug();
|
|
197
197
|
}
|
|
198
198
|
const PREFIX = "[ Module Federation ]";
|
|
199
|
-
function setDebug(
|
|
200
|
-
isDebugMode() && (
|
|
199
|
+
function setDebug(r) {
|
|
200
|
+
isDebugMode() && (r.level = "verbose");
|
|
201
201
|
}
|
|
202
|
-
function setPrefix(
|
|
203
|
-
|
|
202
|
+
function setPrefix(r, t) {
|
|
203
|
+
r.labels = {
|
|
204
204
|
warn: `${t} Warn`,
|
|
205
205
|
error: `${t} Error`,
|
|
206
206
|
success: `${t} Success`,
|
|
@@ -209,7 +209,7 @@ function setPrefix(o, t) {
|
|
|
209
209
|
debug: `${t} Debug`
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function createLogger(
|
|
212
|
+
function createLogger(r) {
|
|
213
213
|
const t = browser.createLogger({
|
|
214
214
|
labels: {
|
|
215
215
|
warn: `${PREFIX} Warn`,
|
|
@@ -220,29 +220,29 @@ function createLogger(o) {
|
|
|
220
220
|
debug: `${PREFIX} Debug`
|
|
221
221
|
}
|
|
222
222
|
});
|
|
223
|
-
return setDebug(t), setPrefix(t,
|
|
223
|
+
return setDebug(t), setPrefix(t, r), t;
|
|
224
224
|
}
|
|
225
225
|
createLogger(PREFIX);
|
|
226
|
-
const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...
|
|
227
|
-
return
|
|
228
|
-
}, getResourceUrl = (
|
|
229
|
-
if ("getPublicPath" in
|
|
230
|
-
let
|
|
231
|
-
return
|
|
226
|
+
const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...r) {
|
|
227
|
+
return r.length ? r.reduce((t, o) => o ? t ? `${t}${SEPARATOR}${o}` : o : t, "") : "";
|
|
228
|
+
}, getResourceUrl = (r, t) => {
|
|
229
|
+
if ("getPublicPath" in r) {
|
|
230
|
+
let o;
|
|
231
|
+
return r.getPublicPath.startsWith("function") ? o = new Function("return " + r.getPublicPath)()() : o = new Function(r.getPublicPath)(), `${o}${t}`;
|
|
232
232
|
} else
|
|
233
|
-
return "publicPath" in
|
|
234
|
-
}, warn$1 = (
|
|
235
|
-
console.warn(`${LOG_CATEGORY$1}: ${
|
|
233
|
+
return "publicPath" in r ? `${r.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", r, t), "");
|
|
234
|
+
}, warn$1 = (r) => {
|
|
235
|
+
console.warn(`${LOG_CATEGORY$1}: ${r}`);
|
|
236
236
|
};
|
|
237
|
-
function safeToString(
|
|
237
|
+
function safeToString(r) {
|
|
238
238
|
try {
|
|
239
|
-
return JSON.stringify(
|
|
239
|
+
return JSON.stringify(r, null, 2);
|
|
240
240
|
} catch {
|
|
241
241
|
return "";
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
const simpleJoinRemoteEntry = (
|
|
245
|
-
if (!
|
|
244
|
+
const simpleJoinRemoteEntry = (r, t) => {
|
|
245
|
+
if (!r)
|
|
246
246
|
return t;
|
|
247
247
|
const n = ((s) => {
|
|
248
248
|
if (s === ".")
|
|
@@ -254,21 +254,21 @@ const simpleJoinRemoteEntry = (o, t) => {
|
|
|
254
254
|
return l.endsWith("/") ? l.slice(0, -1) : l;
|
|
255
255
|
}
|
|
256
256
|
return s;
|
|
257
|
-
})(
|
|
257
|
+
})(r);
|
|
258
258
|
return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
|
|
259
259
|
};
|
|
260
|
-
function inferAutoPublicPath(
|
|
261
|
-
return
|
|
260
|
+
function inferAutoPublicPath(r) {
|
|
261
|
+
return r.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
262
262
|
}
|
|
263
|
-
function generateSnapshotFromManifest(
|
|
264
|
-
var
|
|
263
|
+
function generateSnapshotFromManifest(r, t = {}) {
|
|
264
|
+
var o, n;
|
|
265
265
|
const { remotes: s = {}, overrides: l = {}, version: a } = t;
|
|
266
266
|
let i;
|
|
267
|
-
const c = () => "publicPath" in
|
|
267
|
+
const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && a ? inferAutoPublicPath(a) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(l);
|
|
268
268
|
let d = {};
|
|
269
269
|
if (!Object.keys(s).length) {
|
|
270
270
|
var p;
|
|
271
|
-
d = ((p =
|
|
271
|
+
d = ((p = r.remotes) == null ? void 0 : p.reduce((b, $) => {
|
|
272
272
|
let w;
|
|
273
273
|
const O = $.federationContainerName;
|
|
274
274
|
return u.includes(O) ? w = l[O] : "version" in $ ? w = $.version : w = $.entry, b[O] = {
|
|
@@ -280,183 +280,188 @@ function generateSnapshotFromManifest(o, t = {}) {
|
|
|
280
280
|
// overrides will override dependencies
|
|
281
281
|
matchedVersion: u.includes(b) ? l[b] : s[b]
|
|
282
282
|
});
|
|
283
|
-
const { remoteEntry: { path: m, name:
|
|
283
|
+
const { remoteEntry: { path: m, name: g, type: _ }, types: R, buildInfo: { buildVersion: y }, globalName: E, ssrRemoteEntry: v } = r.metaData, { exposes: I } = r;
|
|
284
284
|
let S = {
|
|
285
285
|
version: a || "",
|
|
286
|
-
buildVersion:
|
|
286
|
+
buildVersion: y,
|
|
287
287
|
globalName: E,
|
|
288
|
-
remoteEntry: simpleJoinRemoteEntry(m,
|
|
288
|
+
remoteEntry: simpleJoinRemoteEntry(m, g),
|
|
289
289
|
remoteEntryType: _,
|
|
290
290
|
remoteTypes: simpleJoinRemoteEntry(R.path, R.name),
|
|
291
291
|
remoteTypesZip: R.zip || "",
|
|
292
292
|
remoteTypesAPI: R.api || "",
|
|
293
293
|
remotesInfo: d,
|
|
294
|
-
shared:
|
|
294
|
+
shared: r == null ? void 0 : r.shared.map((b) => ({
|
|
295
295
|
assets: b.assets,
|
|
296
296
|
sharedName: b.name,
|
|
297
297
|
version: b.version
|
|
298
298
|
})),
|
|
299
|
-
modules:
|
|
299
|
+
modules: I == null ? void 0 : I.map((b) => ({
|
|
300
300
|
moduleName: b.name,
|
|
301
301
|
modulePath: b.path,
|
|
302
302
|
assets: b.assets
|
|
303
303
|
}))
|
|
304
304
|
};
|
|
305
|
-
if ((
|
|
306
|
-
const b =
|
|
305
|
+
if ((o = r.metaData) != null && o.prefetchInterface) {
|
|
306
|
+
const b = r.metaData.prefetchInterface;
|
|
307
307
|
S = _extends$2({}, S, {
|
|
308
308
|
prefetchInterface: b
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
if ((n =
|
|
312
|
-
const { path: b, name: $, type: w } =
|
|
311
|
+
if ((n = r.metaData) != null && n.prefetchEntry) {
|
|
312
|
+
const { path: b, name: $, type: w } = r.metaData.prefetchEntry;
|
|
313
313
|
S = _extends$2({}, S, {
|
|
314
314
|
prefetchEntry: simpleJoinRemoteEntry(b, $),
|
|
315
315
|
prefetchEntryType: w
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
if ("publicPath" in
|
|
318
|
+
if ("publicPath" in r.metaData ? i = _extends$2({}, S, {
|
|
319
319
|
publicPath: c()
|
|
320
320
|
}) : i = _extends$2({}, S, {
|
|
321
321
|
getPublicPath: c()
|
|
322
|
-
}),
|
|
323
|
-
const b = simpleJoinRemoteEntry(
|
|
324
|
-
i.ssrRemoteEntry = b, i.ssrRemoteEntryType =
|
|
322
|
+
}), v) {
|
|
323
|
+
const b = simpleJoinRemoteEntry(v.path, v.name);
|
|
324
|
+
i.ssrRemoteEntry = b, i.ssrRemoteEntryType = v.type || "commonjs-module";
|
|
325
325
|
}
|
|
326
326
|
return i;
|
|
327
327
|
}
|
|
328
|
-
function isManifestProvider(
|
|
329
|
-
return !!("remoteEntry" in
|
|
328
|
+
function isManifestProvider(r) {
|
|
329
|
+
return !!("remoteEntry" in r && r.remoteEntry.includes(MANIFEST_EXT));
|
|
330
330
|
}
|
|
331
|
-
async function safeWrapper(
|
|
331
|
+
async function safeWrapper(r, t) {
|
|
332
332
|
try {
|
|
333
|
-
return await
|
|
334
|
-
} catch (
|
|
335
|
-
warn$1(
|
|
333
|
+
return await r();
|
|
334
|
+
} catch (o) {
|
|
335
|
+
warn$1(o);
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function isStaticResourcesEqual(
|
|
340
|
-
const
|
|
339
|
+
function isStaticResourcesEqual(r, t) {
|
|
340
|
+
const o = /^(https?:)?\/\//i, n = r.replace(o, "").replace(/\/$/, ""), s = t.replace(o, "").replace(/\/$/, "");
|
|
341
341
|
return n === s;
|
|
342
342
|
}
|
|
343
|
-
function createScript(
|
|
344
|
-
let t = null,
|
|
343
|
+
function createScript(r) {
|
|
344
|
+
let t = null, o = !0, n = 6e4, s;
|
|
345
345
|
const l = document.getElementsByTagName("script");
|
|
346
346
|
for (let i = 0; i < l.length; i++) {
|
|
347
347
|
const c = l[i], u = c.getAttribute("src");
|
|
348
|
-
if (u && isStaticResourcesEqual(u,
|
|
349
|
-
t = c,
|
|
348
|
+
if (u && isStaticResourcesEqual(u, r.url)) {
|
|
349
|
+
t = c, o = !1;
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
if (!t) {
|
|
354
|
-
const i =
|
|
354
|
+
const i = r.attrs;
|
|
355
355
|
t = document.createElement("script"), t.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
|
|
356
356
|
let c;
|
|
357
|
-
|
|
357
|
+
r.createScriptHook && (c = r.createScriptHook(r.url, r.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (n = c.timeout))), t.src || (t.src = r.url), i && !c && Object.keys(i).forEach((u) => {
|
|
358
358
|
t && (u === "async" || u === "defer" ? t[u] = i[u] : t.getAttribute(u) || t.setAttribute(u, i[u]));
|
|
359
359
|
});
|
|
360
360
|
}
|
|
361
361
|
const a = async (i, c) => {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
clearTimeout(s);
|
|
363
|
+
const u = () => {
|
|
364
|
+
c.type === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(c)) : r != null && r.cb && (r == null || r.cb());
|
|
365
|
+
};
|
|
366
|
+
if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
|
|
367
|
+
const { needDeleteScript: d = !0 } = r;
|
|
368
|
+
d && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
366
369
|
}), i && typeof i == "function")) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
const y = await m;
|
|
372
|
-
return o == null || (p = o.cb) == null || p.call(o), y;
|
|
370
|
+
const d = i(c);
|
|
371
|
+
if (d instanceof Promise) {
|
|
372
|
+
const p = await d;
|
|
373
|
+
return u(), p;
|
|
373
374
|
}
|
|
374
|
-
return
|
|
375
|
+
return u(), d;
|
|
375
376
|
}
|
|
376
|
-
|
|
377
|
+
u();
|
|
377
378
|
};
|
|
378
379
|
return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), s = setTimeout(() => {
|
|
379
|
-
a(null, new Error(`Remote script "${
|
|
380
|
+
a(null, new Error(`Remote script "${r.url}" time-outed.`));
|
|
380
381
|
}, n), {
|
|
381
382
|
script: t,
|
|
382
|
-
needAttach:
|
|
383
|
+
needAttach: o
|
|
383
384
|
};
|
|
384
385
|
}
|
|
385
|
-
function createLink(
|
|
386
|
-
let t = null,
|
|
386
|
+
function createLink(r) {
|
|
387
|
+
let t = null, o = !0;
|
|
387
388
|
const n = document.getElementsByTagName("link");
|
|
388
389
|
for (let l = 0; l < n.length; l++) {
|
|
389
390
|
const a = n[l], i = a.getAttribute("href"), c = a.getAttribute("ref");
|
|
390
|
-
if (i && isStaticResourcesEqual(i,
|
|
391
|
-
t = a,
|
|
391
|
+
if (i && isStaticResourcesEqual(i, r.url) && c === r.attrs.ref) {
|
|
392
|
+
t = a, o = !1;
|
|
392
393
|
break;
|
|
393
394
|
}
|
|
394
395
|
}
|
|
395
396
|
if (!t) {
|
|
396
|
-
t = document.createElement("link"), t.setAttribute("href",
|
|
397
|
+
t = document.createElement("link"), t.setAttribute("href", r.url);
|
|
397
398
|
let l;
|
|
398
|
-
const a =
|
|
399
|
-
|
|
399
|
+
const a = r.attrs;
|
|
400
|
+
r.createLinkHook && (l = r.createLinkHook(r.url, a), l instanceof HTMLLinkElement && (t = l)), a && !l && Object.keys(a).forEach((i) => {
|
|
400
401
|
t && !t.getAttribute(i) && t.setAttribute(i, a[i]);
|
|
401
402
|
});
|
|
402
403
|
}
|
|
403
404
|
const s = (l, a) => {
|
|
405
|
+
const i = () => {
|
|
406
|
+
a.type === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(a)) : r != null && r.cb && (r == null || r.cb());
|
|
407
|
+
};
|
|
404
408
|
if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
|
|
405
|
-
const { needDeleteLink:
|
|
406
|
-
|
|
409
|
+
const { needDeleteLink: c = !0 } = r;
|
|
410
|
+
c && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
407
411
|
}), l)) {
|
|
408
|
-
const
|
|
409
|
-
return
|
|
412
|
+
const c = l(a);
|
|
413
|
+
return i(), c;
|
|
410
414
|
}
|
|
411
|
-
|
|
415
|
+
i();
|
|
412
416
|
};
|
|
413
417
|
return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
|
|
414
418
|
link: t,
|
|
415
|
-
needAttach:
|
|
419
|
+
needAttach: o
|
|
416
420
|
};
|
|
417
421
|
}
|
|
418
|
-
function loadScript(
|
|
419
|
-
const { attrs:
|
|
422
|
+
function loadScript(r, t) {
|
|
423
|
+
const { attrs: o = {}, createScriptHook: n } = t;
|
|
420
424
|
return new Promise((s, l) => {
|
|
421
425
|
const { script: a, needAttach: i } = createScript({
|
|
422
|
-
url:
|
|
426
|
+
url: r,
|
|
423
427
|
cb: s,
|
|
428
|
+
onErrorCallback: l,
|
|
424
429
|
attrs: _extends$2({
|
|
425
430
|
fetchpriority: "high"
|
|
426
|
-
},
|
|
431
|
+
}, o),
|
|
427
432
|
createScriptHook: n,
|
|
428
433
|
needDeleteScript: !0
|
|
429
434
|
});
|
|
430
435
|
i && document.head.appendChild(a);
|
|
431
436
|
});
|
|
432
437
|
}
|
|
433
|
-
function importNodeModule(
|
|
434
|
-
if (!
|
|
438
|
+
function importNodeModule(r) {
|
|
439
|
+
if (!r)
|
|
435
440
|
throw new Error("import specifier is required");
|
|
436
|
-
return new Function("name", "return import(name)")(
|
|
437
|
-
throw console.error(`Error importing module ${
|
|
441
|
+
return new Function("name", "return import(name)")(r).then((o) => o).catch((o) => {
|
|
442
|
+
throw console.error(`Error importing module ${r}:`, o), o;
|
|
438
443
|
});
|
|
439
444
|
}
|
|
440
445
|
const loadNodeFetch = async () => {
|
|
441
|
-
const
|
|
442
|
-
return
|
|
443
|
-
}, lazyLoaderHookFetch = async (
|
|
444
|
-
const s = await ((l, a) =>
|
|
445
|
-
return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(
|
|
446
|
+
const r = await importNodeModule("node-fetch");
|
|
447
|
+
return r.default || r;
|
|
448
|
+
}, lazyLoaderHookFetch = async (r, t, o) => {
|
|
449
|
+
const s = await ((l, a) => o.lifecycle.fetch.emit(l, a))(r, t || {});
|
|
450
|
+
return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(r, t || {}) : s;
|
|
446
451
|
};
|
|
447
452
|
function createScriptNode(url, cb, attrs, loaderHook) {
|
|
448
453
|
if (loaderHook != null && loaderHook.createScriptHook) {
|
|
449
|
-
const
|
|
450
|
-
|
|
454
|
+
const r = loaderHook.createScriptHook(url);
|
|
455
|
+
r && typeof r == "object" && "url" in r && (url = r.url);
|
|
451
456
|
}
|
|
452
457
|
let urlObj;
|
|
453
458
|
try {
|
|
454
459
|
urlObj = new URL(url);
|
|
455
|
-
} catch (
|
|
456
|
-
console.error("Error constructing URL:",
|
|
460
|
+
} catch (r) {
|
|
461
|
+
console.error("Error constructing URL:", r), cb(new Error(`Invalid URL: ${r}`));
|
|
457
462
|
return;
|
|
458
463
|
}
|
|
459
|
-
const getFetch = async () => loaderHook != null && loaderHook.fetch ? (
|
|
464
|
+
const getFetch = async () => loaderHook != null && loaderHook.fetch ? (r, t) => lazyLoaderHookFetch(r, t, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
|
|
460
465
|
try {
|
|
461
466
|
var _vm_constants;
|
|
462
467
|
const res = await f(urlObj.href), data = await res.text(), [path, vm] = await Promise.all([
|
|
@@ -477,131 +482,131 @@ function createScriptNode(url, cb, attrs, loaderHook) {
|
|
|
477
482
|
script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
|
|
478
483
|
const exportedInterface = scriptContext.module.exports || scriptContext.exports;
|
|
479
484
|
if (attrs && exportedInterface && attrs.globalName) {
|
|
480
|
-
const
|
|
481
|
-
cb(void 0,
|
|
485
|
+
const r = exportedInterface[attrs.globalName] || exportedInterface;
|
|
486
|
+
cb(void 0, r);
|
|
482
487
|
return;
|
|
483
488
|
}
|
|
484
489
|
cb(void 0, exportedInterface);
|
|
485
|
-
} catch (
|
|
486
|
-
cb(
|
|
490
|
+
} catch (r) {
|
|
491
|
+
cb(r instanceof Error ? r : new Error(`Script execution error: ${r}`));
|
|
487
492
|
}
|
|
488
493
|
};
|
|
489
|
-
getFetch().then(async (
|
|
494
|
+
getFetch().then(async (r) => {
|
|
490
495
|
if ((attrs == null ? void 0 : attrs.type) === "esm" || (attrs == null ? void 0 : attrs.type) === "module")
|
|
491
496
|
return loadModule(urlObj.href, {
|
|
492
|
-
fetch:
|
|
497
|
+
fetch: r,
|
|
493
498
|
vm: await importNodeModule("vm")
|
|
494
499
|
}).then(async (t) => {
|
|
495
500
|
await t.evaluate(), cb(void 0, t.namespace);
|
|
496
501
|
}).catch((t) => {
|
|
497
502
|
cb(t instanceof Error ? t : new Error(`Script execution error: ${t}`));
|
|
498
503
|
});
|
|
499
|
-
handleScriptFetch(
|
|
500
|
-
}).catch((
|
|
501
|
-
cb(
|
|
504
|
+
handleScriptFetch(r, urlObj);
|
|
505
|
+
}).catch((r) => {
|
|
506
|
+
cb(r);
|
|
502
507
|
});
|
|
503
508
|
}
|
|
504
|
-
function loadScriptNode(
|
|
505
|
-
return new Promise((
|
|
506
|
-
createScriptNode(
|
|
509
|
+
function loadScriptNode(r, t) {
|
|
510
|
+
return new Promise((o, n) => {
|
|
511
|
+
createScriptNode(r, (s, l) => {
|
|
507
512
|
if (s)
|
|
508
513
|
n(s);
|
|
509
514
|
else {
|
|
510
515
|
var a, i;
|
|
511
516
|
const c = (t == null || (a = t.attrs) == null ? void 0 : a.globalName) || `__FEDERATION_${t == null || (i = t.attrs) == null ? void 0 : i.name}:custom__`, u = globalThis[c] = l;
|
|
512
|
-
|
|
517
|
+
o(u);
|
|
513
518
|
}
|
|
514
519
|
}, t.attrs, t.loaderHook);
|
|
515
520
|
});
|
|
516
521
|
}
|
|
517
|
-
async function loadModule(
|
|
518
|
-
const { fetch:
|
|
522
|
+
async function loadModule(r, t) {
|
|
523
|
+
const { fetch: o, vm: n } = t, l = await (await o(r)).text(), a = new n.SourceTextModule(l, {
|
|
519
524
|
// @ts-ignore
|
|
520
525
|
importModuleDynamically: async (i, c) => {
|
|
521
|
-
const u = new URL(i,
|
|
526
|
+
const u = new URL(i, r).href;
|
|
522
527
|
return loadModule(u, t);
|
|
523
528
|
}
|
|
524
529
|
});
|
|
525
530
|
return await a.link(async (i) => {
|
|
526
|
-
const c = new URL(i,
|
|
531
|
+
const c = new URL(i, r).href;
|
|
527
532
|
return await loadModule(c, t);
|
|
528
533
|
}), a;
|
|
529
534
|
}
|
|
530
535
|
const LoggerInstance = createLogger("[ Module Federation Bridge Vue3 ]");
|
|
531
536
|
function _extends$1() {
|
|
532
537
|
return _extends$1 = Object.assign || function(t) {
|
|
533
|
-
for (var
|
|
534
|
-
var n = arguments[
|
|
538
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
539
|
+
var n = arguments[o];
|
|
535
540
|
for (var s in n)
|
|
536
541
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
537
542
|
}
|
|
538
543
|
return t;
|
|
539
544
|
}, _extends$1.apply(this, arguments);
|
|
540
545
|
}
|
|
541
|
-
function _object_without_properties_loose(
|
|
542
|
-
if (
|
|
546
|
+
function _object_without_properties_loose(r, t) {
|
|
547
|
+
if (r == null)
|
|
543
548
|
return {};
|
|
544
|
-
var
|
|
549
|
+
var o = {}, n = Object.keys(r), s, l;
|
|
545
550
|
for (l = 0; l < n.length; l++)
|
|
546
|
-
s = n[l], !(t.indexOf(s) >= 0) && (
|
|
547
|
-
return
|
|
551
|
+
s = n[l], !(t.indexOf(s) >= 0) && (o[s] = r[s]);
|
|
552
|
+
return o;
|
|
548
553
|
}
|
|
549
554
|
function getBuilderId() {
|
|
550
555
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
551
556
|
}
|
|
552
557
|
const LOG_CATEGORY = "[ Federation Runtime ]", logger = createLogger(LOG_CATEGORY);
|
|
553
|
-
function assert(
|
|
554
|
-
|
|
558
|
+
function assert(r, t) {
|
|
559
|
+
r || error(t);
|
|
555
560
|
}
|
|
556
|
-
function error(
|
|
557
|
-
throw
|
|
561
|
+
function error(r) {
|
|
562
|
+
throw r instanceof Error ? (r.message = `${LOG_CATEGORY}: ${r.message}`, r) : new Error(`${LOG_CATEGORY}: ${r}`);
|
|
558
563
|
}
|
|
559
|
-
function warn(
|
|
560
|
-
|
|
564
|
+
function warn(r) {
|
|
565
|
+
r instanceof Error && (r.message = `${LOG_CATEGORY}: ${r.message}`), logger.warn(r);
|
|
561
566
|
}
|
|
562
|
-
function addUniqueItem(
|
|
563
|
-
return
|
|
567
|
+
function addUniqueItem(r, t) {
|
|
568
|
+
return r.findIndex((o) => o === t) === -1 && r.push(t), r;
|
|
564
569
|
}
|
|
565
|
-
function getFMId(
|
|
566
|
-
return "version" in
|
|
570
|
+
function getFMId(r) {
|
|
571
|
+
return "version" in r && r.version ? `${r.name}:${r.version}` : "entry" in r && r.entry ? `${r.name}:${r.entry}` : `${r.name}`;
|
|
567
572
|
}
|
|
568
|
-
function isRemoteInfoWithEntry(
|
|
569
|
-
return typeof
|
|
573
|
+
function isRemoteInfoWithEntry(r) {
|
|
574
|
+
return typeof r.entry < "u";
|
|
570
575
|
}
|
|
571
|
-
function isPureRemoteEntry(
|
|
572
|
-
return !
|
|
576
|
+
function isPureRemoteEntry(r) {
|
|
577
|
+
return !r.entry.includes(".json") && r.entry.includes(".js");
|
|
573
578
|
}
|
|
574
|
-
function isObject(
|
|
575
|
-
return
|
|
579
|
+
function isObject(r) {
|
|
580
|
+
return r && typeof r == "object";
|
|
576
581
|
}
|
|
577
582
|
const objectToString = Object.prototype.toString;
|
|
578
|
-
function isPlainObject(
|
|
579
|
-
return objectToString.call(
|
|
583
|
+
function isPlainObject(r) {
|
|
584
|
+
return objectToString.call(r) === "[object Object]";
|
|
580
585
|
}
|
|
581
|
-
function arrayOptions(
|
|
582
|
-
return Array.isArray(
|
|
583
|
-
|
|
586
|
+
function arrayOptions(r) {
|
|
587
|
+
return Array.isArray(r) ? r : [
|
|
588
|
+
r
|
|
584
589
|
];
|
|
585
590
|
}
|
|
586
|
-
function getRemoteEntryInfoFromSnapshot(
|
|
591
|
+
function getRemoteEntryInfoFromSnapshot(r) {
|
|
587
592
|
const t = {
|
|
588
593
|
url: "",
|
|
589
594
|
type: "global",
|
|
590
595
|
globalName: ""
|
|
591
596
|
};
|
|
592
|
-
return isBrowserEnv() ? "remoteEntry" in
|
|
593
|
-
url:
|
|
594
|
-
type:
|
|
595
|
-
globalName:
|
|
596
|
-
} : t : "ssrRemoteEntry" in
|
|
597
|
-
url:
|
|
598
|
-
type:
|
|
599
|
-
globalName:
|
|
597
|
+
return isBrowserEnv() ? "remoteEntry" in r ? {
|
|
598
|
+
url: r.remoteEntry,
|
|
599
|
+
type: r.remoteEntryType,
|
|
600
|
+
globalName: r.globalName
|
|
601
|
+
} : t : "ssrRemoteEntry" in r ? {
|
|
602
|
+
url: r.ssrRemoteEntry || t.url,
|
|
603
|
+
type: r.ssrRemoteEntryType || t.type,
|
|
604
|
+
globalName: r.globalName
|
|
600
605
|
} : t;
|
|
601
606
|
}
|
|
602
|
-
const processModuleAlias = (
|
|
603
|
-
let
|
|
604
|
-
return
|
|
607
|
+
const processModuleAlias = (r, t) => {
|
|
608
|
+
let o;
|
|
609
|
+
return r.endsWith("/") ? o = r.slice(0, -1) : o = r, t.startsWith(".") && (t = t.slice(1)), o = o + t, o;
|
|
605
610
|
}, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
|
|
606
611
|
try {
|
|
607
612
|
return document.defaultView;
|
|
@@ -609,57 +614,57 @@ const processModuleAlias = (o, t) => {
|
|
|
609
614
|
return CurrentGlobal;
|
|
610
615
|
}
|
|
611
616
|
})(), Global = nativeGlobal;
|
|
612
|
-
function definePropertyGlobalVal(
|
|
613
|
-
Object.defineProperty(
|
|
614
|
-
value:
|
|
617
|
+
function definePropertyGlobalVal(r, t, o) {
|
|
618
|
+
Object.defineProperty(r, t, {
|
|
619
|
+
value: o,
|
|
615
620
|
configurable: !1,
|
|
616
621
|
writable: !0
|
|
617
622
|
});
|
|
618
623
|
}
|
|
619
|
-
function includeOwnProperty(
|
|
620
|
-
return Object.hasOwnProperty.call(
|
|
624
|
+
function includeOwnProperty(r, t) {
|
|
625
|
+
return Object.hasOwnProperty.call(r, t);
|
|
621
626
|
}
|
|
622
627
|
includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
623
628
|
const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
624
|
-
function setGlobalDefaultVal(
|
|
625
|
-
var t,
|
|
626
|
-
includeOwnProperty(
|
|
629
|
+
function setGlobalDefaultVal(r) {
|
|
630
|
+
var t, o, n, s, l, a;
|
|
631
|
+
includeOwnProperty(r, "__VMOK__") && !includeOwnProperty(r, "__FEDERATION__") && definePropertyGlobalVal(r, "__FEDERATION__", r.__VMOK__), includeOwnProperty(r, "__FEDERATION__") || (definePropertyGlobalVal(r, "__FEDERATION__", {
|
|
627
632
|
__GLOBAL_PLUGIN__: [],
|
|
628
633
|
__INSTANCES__: [],
|
|
629
634
|
moduleInfo: {},
|
|
630
635
|
__SHARE__: {},
|
|
631
636
|
__MANIFEST_LOADING__: {},
|
|
632
637
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
633
|
-
}), definePropertyGlobalVal(
|
|
638
|
+
}), definePropertyGlobalVal(r, "__VMOK__", r.__FEDERATION__));
|
|
634
639
|
var i;
|
|
635
|
-
(i = (t =
|
|
640
|
+
(i = (t = r.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
|
|
636
641
|
var c;
|
|
637
|
-
(c = (
|
|
642
|
+
(c = (o = r.__FEDERATION__).__INSTANCES__) != null || (o.__INSTANCES__ = []);
|
|
638
643
|
var u;
|
|
639
|
-
(u = (n =
|
|
644
|
+
(u = (n = r.__FEDERATION__).moduleInfo) != null || (n.moduleInfo = {});
|
|
640
645
|
var d;
|
|
641
|
-
(d = (s =
|
|
646
|
+
(d = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
|
|
642
647
|
var p;
|
|
643
|
-
(p = (l =
|
|
648
|
+
(p = (l = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (l.__MANIFEST_LOADING__ = {});
|
|
644
649
|
var m;
|
|
645
|
-
(m = (a =
|
|
650
|
+
(m = (a = r.__FEDERATION__).__PRELOADED_MAP__) != null || (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
646
651
|
}
|
|
647
652
|
setGlobalDefaultVal(CurrentGlobal);
|
|
648
653
|
setGlobalDefaultVal(nativeGlobal);
|
|
649
|
-
function setGlobalFederationConstructor(
|
|
650
|
-
t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ =
|
|
654
|
+
function setGlobalFederationConstructor(r, t = isDebugMode()) {
|
|
655
|
+
t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.8.2");
|
|
651
656
|
}
|
|
652
|
-
function getInfoWithoutType(
|
|
657
|
+
function getInfoWithoutType(r, t) {
|
|
653
658
|
if (typeof t == "string") {
|
|
654
|
-
if (
|
|
659
|
+
if (r[t])
|
|
655
660
|
return {
|
|
656
|
-
value:
|
|
661
|
+
value: r[t],
|
|
657
662
|
key: t
|
|
658
663
|
};
|
|
659
664
|
{
|
|
660
|
-
const n = Object.keys(
|
|
665
|
+
const n = Object.keys(r);
|
|
661
666
|
for (const s of n) {
|
|
662
|
-
const [l, a] = s.split(":"), i = `${l}:${t}`, c =
|
|
667
|
+
const [l, a] = s.split(":"), i = `${l}:${t}`, c = r[i];
|
|
663
668
|
if (c)
|
|
664
669
|
return {
|
|
665
670
|
value: c,
|
|
@@ -674,121 +679,121 @@ function getInfoWithoutType(o, t) {
|
|
|
674
679
|
} else
|
|
675
680
|
throw new Error("key must be string");
|
|
676
681
|
}
|
|
677
|
-
const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (
|
|
678
|
-
const
|
|
679
|
-
if (n && !n.version && "version" in
|
|
682
|
+
const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (r, t) => {
|
|
683
|
+
const o = getFMId(r), n = getInfoWithoutType(t, o).value;
|
|
684
|
+
if (n && !n.version && "version" in r && r.version && (n.version = r.version), n)
|
|
680
685
|
return n;
|
|
681
|
-
if ("version" in
|
|
682
|
-
const { version: s } =
|
|
686
|
+
if ("version" in r && r.version) {
|
|
687
|
+
const { version: s } = r, l = _object_without_properties_loose(r, [
|
|
683
688
|
"version"
|
|
684
689
|
]), a = getFMId(l), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, a).value;
|
|
685
690
|
if ((i == null ? void 0 : i.version) === s)
|
|
686
691
|
return i;
|
|
687
692
|
}
|
|
688
|
-
}, getGlobalSnapshotInfoByModuleInfo = (
|
|
689
|
-
const
|
|
690
|
-
return nativeGlobal.__FEDERATION__.moduleInfo[
|
|
691
|
-
}, addGlobalSnapshot = (
|
|
692
|
-
const t = Object.keys(
|
|
693
|
-
for (const
|
|
694
|
-
delete nativeGlobal.__FEDERATION__.moduleInfo[
|
|
695
|
-
}), getRemoteEntryExports = (
|
|
696
|
-
const
|
|
693
|
+
}, getGlobalSnapshotInfoByModuleInfo = (r) => getTargetSnapshotInfoByModuleInfo(r, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (r, t) => {
|
|
694
|
+
const o = getFMId(r);
|
|
695
|
+
return nativeGlobal.__FEDERATION__.moduleInfo[o] = t, nativeGlobal.__FEDERATION__.moduleInfo;
|
|
696
|
+
}, addGlobalSnapshot = (r) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, r), () => {
|
|
697
|
+
const t = Object.keys(r);
|
|
698
|
+
for (const o of t)
|
|
699
|
+
delete nativeGlobal.__FEDERATION__.moduleInfo[o];
|
|
700
|
+
}), getRemoteEntryExports = (r, t) => {
|
|
701
|
+
const o = t || `__FEDERATION_${r}:custom__`, n = CurrentGlobal[o];
|
|
697
702
|
return {
|
|
698
|
-
remoteEntryKey:
|
|
703
|
+
remoteEntryKey: o,
|
|
699
704
|
entryExports: n
|
|
700
705
|
};
|
|
701
|
-
}, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (
|
|
702
|
-
function parseRegex(
|
|
703
|
-
return new RegExp(
|
|
706
|
+
}, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(r), setPreloaded = (r) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(r, !0), DEFAULT_SCOPE = "default", DEFAULT_REMOTE_TYPE = "global", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
|
|
707
|
+
function parseRegex(r) {
|
|
708
|
+
return new RegExp(r);
|
|
704
709
|
}
|
|
705
|
-
function isXVersion(
|
|
706
|
-
return !
|
|
710
|
+
function isXVersion(r) {
|
|
711
|
+
return !r || r.toLowerCase() === "x" || r === "*";
|
|
707
712
|
}
|
|
708
|
-
function pipe(...
|
|
709
|
-
return (t) =>
|
|
713
|
+
function pipe(...r) {
|
|
714
|
+
return (t) => r.reduce((o, n) => n(o), t);
|
|
710
715
|
}
|
|
711
|
-
function extractComparator(
|
|
712
|
-
return
|
|
716
|
+
function extractComparator(r) {
|
|
717
|
+
return r.match(parseRegex(comparator));
|
|
713
718
|
}
|
|
714
|
-
function combineVersion(
|
|
715
|
-
const s = `${
|
|
719
|
+
function combineVersion(r, t, o, n) {
|
|
720
|
+
const s = `${r}.${t}.${o}`;
|
|
716
721
|
return n ? `${s}-${n}` : s;
|
|
717
722
|
}
|
|
718
|
-
function parseHyphen(
|
|
719
|
-
return
|
|
723
|
+
function parseHyphen(r) {
|
|
724
|
+
return r.replace(parseRegex(hyphenRange), (t, o, n, s, l, a, i, c, u, d, p, m) => (isXVersion(n) ? o = "" : isXVersion(s) ? o = `>=${n}.0.0` : isXVersion(l) ? o = `>=${n}.${s}.0` : o = `>=${o}`, isXVersion(u) ? c = "" : isXVersion(d) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(d) + 1}.0-0` : m ? c = `<=${u}.${d}.${p}-${m}` : c = `<=${c}`, `${o} ${c}`.trim()));
|
|
720
725
|
}
|
|
721
|
-
function parseComparatorTrim(
|
|
722
|
-
return
|
|
726
|
+
function parseComparatorTrim(r) {
|
|
727
|
+
return r.replace(parseRegex(comparatorTrim), "$1$2$3");
|
|
723
728
|
}
|
|
724
|
-
function parseTildeTrim(
|
|
725
|
-
return
|
|
729
|
+
function parseTildeTrim(r) {
|
|
730
|
+
return r.replace(parseRegex(tildeTrim), "$1~");
|
|
726
731
|
}
|
|
727
|
-
function parseCaretTrim(
|
|
728
|
-
return
|
|
732
|
+
function parseCaretTrim(r) {
|
|
733
|
+
return r.replace(parseRegex(caretTrim), "$1^");
|
|
729
734
|
}
|
|
730
|
-
function parseCarets(
|
|
731
|
-
return
|
|
735
|
+
function parseCarets(r) {
|
|
736
|
+
return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (o, n, s, l, a) => isXVersion(n) ? "" : isXVersion(s) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(l) ? n === "0" ? `>=${n}.${s}.0 <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.0 <${Number(n) + 1}.0.0-0` : a ? n === "0" ? s === "0" ? `>=${n}.${s}.${l}-${a} <${n}.${s}.${Number(l) + 1}-0` : `>=${n}.${s}.${l}-${a} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l}-${a} <${Number(n) + 1}.0.0-0` : n === "0" ? s === "0" ? `>=${n}.${s}.${l} <${n}.${s}.${Number(l) + 1}-0` : `>=${n}.${s}.${l} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l} <${Number(n) + 1}.0.0-0`)).join(" ");
|
|
732
737
|
}
|
|
733
|
-
function parseTildes(
|
|
734
|
-
return
|
|
738
|
+
function parseTildes(r) {
|
|
739
|
+
return r.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (o, n, s, l, a) => isXVersion(n) ? "" : isXVersion(s) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : isXVersion(l) ? `>=${n}.${s}.0 <${n}.${Number(s) + 1}.0-0` : a ? `>=${n}.${s}.${l}-${a} <${n}.${Number(s) + 1}.0-0` : `>=${n}.${s}.${l} <${n}.${Number(s) + 1}.0-0`)).join(" ");
|
|
735
740
|
}
|
|
736
|
-
function parseXRanges(
|
|
737
|
-
return
|
|
741
|
+
function parseXRanges(r) {
|
|
742
|
+
return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (o, n, s, l, a, i) => {
|
|
738
743
|
const c = isXVersion(s), u = c || isXVersion(l), d = u || isXVersion(a);
|
|
739
|
-
return n === "=" && d && (n = ""), i = "", c ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && d ? (u && (l = 0), a = 0, n === ">" ? (n = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : n === "<=" && (n = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), n === "<" && (i = "-0"), `${n + s}.${l}.${a}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${l}.0${i} <${s}.${Number(l) + 1}.0-0` :
|
|
744
|
+
return n === "=" && d && (n = ""), i = "", c ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && d ? (u && (l = 0), a = 0, n === ">" ? (n = ">=", u ? (s = Number(s) + 1, l = 0, a = 0) : (l = Number(l) + 1, a = 0)) : n === "<=" && (n = "<", u ? s = Number(s) + 1 : l = Number(l) + 1), n === "<" && (i = "-0"), `${n + s}.${l}.${a}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${l}.0${i} <${s}.${Number(l) + 1}.0-0` : o;
|
|
740
745
|
})).join(" ");
|
|
741
746
|
}
|
|
742
|
-
function parseStar(
|
|
743
|
-
return
|
|
747
|
+
function parseStar(r) {
|
|
748
|
+
return r.trim().replace(parseRegex(star), "");
|
|
744
749
|
}
|
|
745
|
-
function parseGTE0(
|
|
746
|
-
return
|
|
750
|
+
function parseGTE0(r) {
|
|
751
|
+
return r.trim().replace(parseRegex(gte0), "");
|
|
747
752
|
}
|
|
748
|
-
function compareAtom(
|
|
749
|
-
return
|
|
753
|
+
function compareAtom(r, t) {
|
|
754
|
+
return r = Number(r) || r, t = Number(t) || t, r > t ? 1 : r === t ? 0 : -1;
|
|
750
755
|
}
|
|
751
|
-
function comparePreRelease(
|
|
752
|
-
const { preRelease:
|
|
753
|
-
if (
|
|
756
|
+
function comparePreRelease(r, t) {
|
|
757
|
+
const { preRelease: o } = r, { preRelease: n } = t;
|
|
758
|
+
if (o === void 0 && n)
|
|
754
759
|
return 1;
|
|
755
|
-
if (
|
|
760
|
+
if (o && n === void 0)
|
|
756
761
|
return -1;
|
|
757
|
-
if (
|
|
762
|
+
if (o === void 0 && n === void 0)
|
|
758
763
|
return 0;
|
|
759
|
-
for (let s = 0, l =
|
|
760
|
-
const a =
|
|
764
|
+
for (let s = 0, l = o.length; s <= l; s++) {
|
|
765
|
+
const a = o[s], i = n[s];
|
|
761
766
|
if (a !== i)
|
|
762
767
|
return a === void 0 && i === void 0 ? 0 : a ? i ? compareAtom(a, i) : -1 : 1;
|
|
763
768
|
}
|
|
764
769
|
return 0;
|
|
765
770
|
}
|
|
766
|
-
function compareVersion(
|
|
767
|
-
return compareAtom(
|
|
771
|
+
function compareVersion(r, t) {
|
|
772
|
+
return compareAtom(r.major, t.major) || compareAtom(r.minor, t.minor) || compareAtom(r.patch, t.patch) || comparePreRelease(r, t);
|
|
768
773
|
}
|
|
769
|
-
function eq(
|
|
770
|
-
return
|
|
774
|
+
function eq(r, t) {
|
|
775
|
+
return r.version === t.version;
|
|
771
776
|
}
|
|
772
|
-
function compare(
|
|
773
|
-
switch (
|
|
777
|
+
function compare(r, t) {
|
|
778
|
+
switch (r.operator) {
|
|
774
779
|
case "":
|
|
775
780
|
case "=":
|
|
776
|
-
return eq(
|
|
781
|
+
return eq(r, t);
|
|
777
782
|
case ">":
|
|
778
|
-
return compareVersion(
|
|
783
|
+
return compareVersion(r, t) < 0;
|
|
779
784
|
case ">=":
|
|
780
|
-
return eq(
|
|
785
|
+
return eq(r, t) || compareVersion(r, t) < 0;
|
|
781
786
|
case "<":
|
|
782
|
-
return compareVersion(
|
|
787
|
+
return compareVersion(r, t) > 0;
|
|
783
788
|
case "<=":
|
|
784
|
-
return eq(
|
|
789
|
+
return eq(r, t) || compareVersion(r, t) > 0;
|
|
785
790
|
case void 0:
|
|
786
791
|
return !0;
|
|
787
792
|
default:
|
|
788
793
|
return !1;
|
|
789
794
|
}
|
|
790
795
|
}
|
|
791
|
-
function parseComparatorString(
|
|
796
|
+
function parseComparatorString(r) {
|
|
792
797
|
return pipe(
|
|
793
798
|
// handle caret
|
|
794
799
|
// ^ --> * (any, kinda silly)
|
|
@@ -808,9 +813,9 @@ function parseComparatorString(o) {
|
|
|
808
813
|
parseTildes,
|
|
809
814
|
parseXRanges,
|
|
810
815
|
parseStar
|
|
811
|
-
)(
|
|
816
|
+
)(r);
|
|
812
817
|
}
|
|
813
|
-
function parseRange(
|
|
818
|
+
function parseRange(r) {
|
|
814
819
|
return pipe(
|
|
815
820
|
// handle hyphenRange
|
|
816
821
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
@@ -824,12 +829,12 @@ function parseRange(o) {
|
|
|
824
829
|
// handle trim caret
|
|
825
830
|
// `^ 1.2.3` => `^1.2.3`
|
|
826
831
|
parseCaretTrim
|
|
827
|
-
)(
|
|
832
|
+
)(r.trim()).split(/\s+/).join(" ");
|
|
828
833
|
}
|
|
829
|
-
function satisfy(
|
|
830
|
-
if (!
|
|
834
|
+
function satisfy(r, t) {
|
|
835
|
+
if (!r)
|
|
831
836
|
return !1;
|
|
832
|
-
const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), l = extractComparator(
|
|
837
|
+
const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), l = extractComparator(r);
|
|
833
838
|
if (!l)
|
|
834
839
|
return !1;
|
|
835
840
|
const [, a, , i, c, u, d] = l, p = {
|
|
@@ -841,56 +846,56 @@ function satisfy(o, t) {
|
|
|
841
846
|
preRelease: d == null ? void 0 : d.split(".")
|
|
842
847
|
};
|
|
843
848
|
for (const m of s) {
|
|
844
|
-
const
|
|
845
|
-
if (!
|
|
849
|
+
const g = extractComparator(m);
|
|
850
|
+
if (!g)
|
|
846
851
|
return !1;
|
|
847
|
-
const [, _, , R,
|
|
852
|
+
const [, _, , R, y, E, v] = g, I = {
|
|
848
853
|
operator: _,
|
|
849
|
-
version: combineVersion(R,
|
|
854
|
+
version: combineVersion(R, y, E, v),
|
|
850
855
|
major: R,
|
|
851
|
-
minor:
|
|
856
|
+
minor: y,
|
|
852
857
|
patch: E,
|
|
853
|
-
preRelease:
|
|
858
|
+
preRelease: v == null ? void 0 : v.split(".")
|
|
854
859
|
};
|
|
855
|
-
if (!compare(
|
|
860
|
+
if (!compare(I, p))
|
|
856
861
|
return !1;
|
|
857
862
|
}
|
|
858
863
|
return !0;
|
|
859
864
|
}
|
|
860
|
-
function formatShare(
|
|
865
|
+
function formatShare(r, t, o, n) {
|
|
861
866
|
let s;
|
|
862
|
-
"get" in
|
|
863
|
-
throw new Error(`Can not get shared '${
|
|
864
|
-
}),
|
|
867
|
+
"get" in r ? s = r.get : "lib" in r ? s = () => Promise.resolve(r.lib) : s = () => Promise.resolve(() => {
|
|
868
|
+
throw new Error(`Can not get shared '${o}'!`);
|
|
869
|
+
}), r.strategy && warn('"shared.strategy is deprecated, please set in initOptions.shareStrategy instead!"');
|
|
865
870
|
var l, a, i;
|
|
866
871
|
return _extends$1({
|
|
867
872
|
deps: [],
|
|
868
873
|
useIn: [],
|
|
869
874
|
from: t,
|
|
870
875
|
loading: null
|
|
871
|
-
},
|
|
876
|
+
}, r, {
|
|
872
877
|
shareConfig: _extends$1({
|
|
873
|
-
requiredVersion: `^${
|
|
878
|
+
requiredVersion: `^${r.version}`,
|
|
874
879
|
singleton: !1,
|
|
875
880
|
eager: !1,
|
|
876
881
|
strictVersion: !1
|
|
877
|
-
},
|
|
882
|
+
}, r.shareConfig),
|
|
878
883
|
get: s,
|
|
879
|
-
loaded:
|
|
880
|
-
version: (l =
|
|
881
|
-
scope: Array.isArray(
|
|
882
|
-
(a =
|
|
884
|
+
loaded: r != null && r.loaded || "lib" in r ? !0 : void 0,
|
|
885
|
+
version: (l = r.version) != null ? l : "0",
|
|
886
|
+
scope: Array.isArray(r.scope) ? r.scope : [
|
|
887
|
+
(a = r.scope) != null ? a : "default"
|
|
883
888
|
],
|
|
884
|
-
strategy: ((i =
|
|
889
|
+
strategy: ((i = r.strategy) != null ? i : n) || "version-first"
|
|
885
890
|
});
|
|
886
891
|
}
|
|
887
|
-
function formatShareConfigs(
|
|
888
|
-
const
|
|
889
|
-
const c = arrayOptions(
|
|
892
|
+
function formatShareConfigs(r, t) {
|
|
893
|
+
const o = t.shared || {}, n = t.name, s = Object.keys(o).reduce((a, i) => {
|
|
894
|
+
const c = arrayOptions(o[i]);
|
|
890
895
|
return a[i] = a[i] || [], c.forEach((u) => {
|
|
891
896
|
a[i].push(formatShare(u, n, i, t.shareStrategy));
|
|
892
897
|
}), a;
|
|
893
|
-
}, {}), l = _extends$1({},
|
|
898
|
+
}, {}), l = _extends$1({}, r.shared);
|
|
894
899
|
return Object.keys(s).forEach((a) => {
|
|
895
900
|
l[a] ? s[a].forEach((i) => {
|
|
896
901
|
l[a].find((u) => u.version === i.version) || l[a].push(i);
|
|
@@ -900,8 +905,8 @@ function formatShareConfigs(o, t) {
|
|
|
900
905
|
shareInfos: s
|
|
901
906
|
};
|
|
902
907
|
}
|
|
903
|
-
function versionLt(
|
|
904
|
-
const
|
|
908
|
+
function versionLt(r, t) {
|
|
909
|
+
const o = (n) => {
|
|
905
910
|
if (!Number.isNaN(Number(n))) {
|
|
906
911
|
const l = n.split(".");
|
|
907
912
|
let a = n;
|
|
@@ -911,68 +916,68 @@ function versionLt(o, t) {
|
|
|
911
916
|
}
|
|
912
917
|
return n;
|
|
913
918
|
};
|
|
914
|
-
return !!satisfy(r
|
|
919
|
+
return !!satisfy(o(r), `<=${o(t)}`);
|
|
915
920
|
}
|
|
916
|
-
const findVersion = (
|
|
917
|
-
const
|
|
921
|
+
const findVersion = (r, t) => {
|
|
922
|
+
const o = t || function(n, s) {
|
|
918
923
|
return versionLt(n, s);
|
|
919
924
|
};
|
|
920
|
-
return Object.keys(
|
|
921
|
-
}, isLoaded = (
|
|
922
|
-
function findSingletonVersionOrderByVersion(
|
|
923
|
-
const n =
|
|
925
|
+
return Object.keys(r).reduce((n, s) => !n || o(n, s) || n === "0" ? s : n, 0);
|
|
926
|
+
}, isLoaded = (r) => !!r.loaded || typeof r.lib == "function", isLoading = (r) => !!r.loading;
|
|
927
|
+
function findSingletonVersionOrderByVersion(r, t, o) {
|
|
928
|
+
const n = r[t][o], s = function(l, a) {
|
|
924
929
|
return !isLoaded(n[l]) && versionLt(l, a);
|
|
925
930
|
};
|
|
926
|
-
return findVersion(
|
|
931
|
+
return findVersion(r[t][o], s);
|
|
927
932
|
}
|
|
928
|
-
function findSingletonVersionOrderByLoaded(
|
|
929
|
-
const n =
|
|
933
|
+
function findSingletonVersionOrderByLoaded(r, t, o) {
|
|
934
|
+
const n = r[t][o], s = function(l, a) {
|
|
930
935
|
const i = (c) => isLoaded(c) || isLoading(c);
|
|
931
936
|
return i(n[a]) ? i(n[l]) ? !!versionLt(l, a) : !0 : i(n[l]) ? !1 : versionLt(l, a);
|
|
932
937
|
};
|
|
933
|
-
return findVersion(
|
|
938
|
+
return findVersion(r[t][o], s);
|
|
934
939
|
}
|
|
935
|
-
function getFindShareFunction(
|
|
936
|
-
return
|
|
940
|
+
function getFindShareFunction(r) {
|
|
941
|
+
return r === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
|
|
937
942
|
}
|
|
938
|
-
function getRegisteredShare(
|
|
939
|
-
if (!
|
|
943
|
+
function getRegisteredShare(r, t, o, n) {
|
|
944
|
+
if (!r)
|
|
940
945
|
return;
|
|
941
|
-
const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } =
|
|
946
|
+
const { shareConfig: s, scope: l = DEFAULT_SCOPE, strategy: a } = o, i = Array.isArray(l) ? l : [
|
|
942
947
|
l
|
|
943
948
|
];
|
|
944
949
|
for (const c of i)
|
|
945
|
-
if (s &&
|
|
946
|
-
const { requiredVersion: u } = s, p = getFindShareFunction(a)(
|
|
950
|
+
if (s && r[c] && r[c][t]) {
|
|
951
|
+
const { requiredVersion: u } = s, p = getFindShareFunction(a)(r, c, t), m = () => {
|
|
947
952
|
if (s.singleton) {
|
|
948
953
|
if (typeof u == "string" && !satisfy(p, u)) {
|
|
949
|
-
const R = `Version ${p} from ${p &&
|
|
954
|
+
const R = `Version ${p} from ${p && r[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;
|
|
950
955
|
s.strictVersion ? error(R) : warn(R);
|
|
951
956
|
}
|
|
952
|
-
return
|
|
957
|
+
return r[c][t][p];
|
|
953
958
|
} else {
|
|
954
959
|
if (u === !1 || u === "*" || satisfy(p, u))
|
|
955
|
-
return
|
|
956
|
-
for (const [R,
|
|
960
|
+
return r[c][t][p];
|
|
961
|
+
for (const [R, y] of Object.entries(r[c][t]))
|
|
957
962
|
if (satisfy(R, u))
|
|
958
|
-
return
|
|
963
|
+
return y;
|
|
959
964
|
}
|
|
960
|
-
},
|
|
961
|
-
shareScopeMap:
|
|
965
|
+
}, g = {
|
|
966
|
+
shareScopeMap: r,
|
|
962
967
|
scope: c,
|
|
963
968
|
pkgName: t,
|
|
964
969
|
version: p,
|
|
965
970
|
GlobalFederation: Global.__FEDERATION__,
|
|
966
971
|
resolver: m
|
|
967
972
|
};
|
|
968
|
-
return (n.emit(
|
|
973
|
+
return (n.emit(g) || g).resolver();
|
|
969
974
|
}
|
|
970
975
|
}
|
|
971
976
|
function getGlobalShareScope() {
|
|
972
977
|
return Global.__FEDERATION__.__SHARE__;
|
|
973
978
|
}
|
|
974
|
-
function getTargetSharedOptions(
|
|
975
|
-
const { pkgName: t, extraOptions:
|
|
979
|
+
function getTargetSharedOptions(r) {
|
|
980
|
+
const { pkgName: t, extraOptions: o, shareInfos: n } = r, s = (i) => {
|
|
976
981
|
if (!i)
|
|
977
982
|
return;
|
|
978
983
|
const c = {};
|
|
@@ -985,23 +990,23 @@ function getTargetSharedOptions(o) {
|
|
|
985
990
|
return c[d];
|
|
986
991
|
};
|
|
987
992
|
var l;
|
|
988
|
-
const a = (l =
|
|
989
|
-
return Object.assign({}, a(n[t]),
|
|
993
|
+
const a = (l = o == null ? void 0 : o.resolver) != null ? l : s;
|
|
994
|
+
return Object.assign({}, a(n[t]), o == null ? void 0 : o.customShareInfo);
|
|
990
995
|
}
|
|
991
|
-
const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", TYPE_001 = "TYPE-001", getDocsUrl = (
|
|
996
|
+
const RUNTIME_001 = "RUNTIME-001", RUNTIME_002 = "RUNTIME-002", RUNTIME_003 = "RUNTIME-003", RUNTIME_004 = "RUNTIME-004", RUNTIME_005 = "RUNTIME-005", RUNTIME_006 = "RUNTIME-006", RUNTIME_007 = "RUNTIME-007", RUNTIME_008 = "RUNTIME-008", TYPE_001 = "TYPE-001", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, o, n) => {
|
|
992
997
|
const s = [
|
|
993
998
|
`${[
|
|
994
|
-
t[
|
|
995
|
-
]} #${
|
|
999
|
+
t[r]
|
|
1000
|
+
]} #${r}`
|
|
996
1001
|
];
|
|
997
|
-
return
|
|
1002
|
+
return o && s.push(`args: ${JSON.stringify(o)}`), s.push(getDocsUrl(r)), n && s.push(`Original Error Message:
|
|
998
1003
|
${n}`), s.join(`
|
|
999
1004
|
`);
|
|
1000
1005
|
};
|
|
1001
1006
|
function _extends() {
|
|
1002
1007
|
return _extends = Object.assign || function(t) {
|
|
1003
|
-
for (var
|
|
1004
|
-
var n = arguments[
|
|
1008
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
1009
|
+
var n = arguments[o];
|
|
1005
1010
|
for (var s in n)
|
|
1006
1011
|
Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
1007
1012
|
}
|
|
@@ -1015,85 +1020,86 @@ const runtimeDescMap = {
|
|
|
1015
1020
|
[RUNTIME_004]: "Failed to locate remote.",
|
|
1016
1021
|
[RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
|
|
1017
1022
|
[RUNTIME_006]: "Invalid loadShareSync function call from runtime",
|
|
1018
|
-
[RUNTIME_007]: "Failed to get remote snapshot."
|
|
1023
|
+
[RUNTIME_007]: "Failed to get remote snapshot.",
|
|
1024
|
+
[RUNTIME_008]: "Failed to load script resources."
|
|
1019
1025
|
}, typeDescMap = {
|
|
1020
1026
|
[TYPE_001]: "Failed to generate type declaration."
|
|
1021
1027
|
};
|
|
1022
1028
|
_extends({}, runtimeDescMap, typeDescMap);
|
|
1023
|
-
function matchRemoteWithNameAndExpose(
|
|
1024
|
-
for (const
|
|
1025
|
-
const n = t.startsWith(
|
|
1026
|
-
let s = t.replace(
|
|
1029
|
+
function matchRemoteWithNameAndExpose(r, t) {
|
|
1030
|
+
for (const o of r) {
|
|
1031
|
+
const n = t.startsWith(o.name);
|
|
1032
|
+
let s = t.replace(o.name, "");
|
|
1027
1033
|
if (n) {
|
|
1028
1034
|
if (s.startsWith("/")) {
|
|
1029
|
-
const i =
|
|
1035
|
+
const i = o.name;
|
|
1030
1036
|
return s = `.${s}`, {
|
|
1031
1037
|
pkgNameOrAlias: i,
|
|
1032
1038
|
expose: s,
|
|
1033
|
-
remote:
|
|
1039
|
+
remote: o
|
|
1034
1040
|
};
|
|
1035
1041
|
} else if (s === "")
|
|
1036
1042
|
return {
|
|
1037
|
-
pkgNameOrAlias:
|
|
1043
|
+
pkgNameOrAlias: o.name,
|
|
1038
1044
|
expose: ".",
|
|
1039
|
-
remote:
|
|
1045
|
+
remote: o
|
|
1040
1046
|
};
|
|
1041
1047
|
}
|
|
1042
|
-
const l =
|
|
1043
|
-
let a =
|
|
1044
|
-
if (
|
|
1048
|
+
const l = o.alias && t.startsWith(o.alias);
|
|
1049
|
+
let a = o.alias && t.replace(o.alias, "");
|
|
1050
|
+
if (o.alias && l) {
|
|
1045
1051
|
if (a && a.startsWith("/")) {
|
|
1046
|
-
const i =
|
|
1052
|
+
const i = o.alias;
|
|
1047
1053
|
return a = `.${a}`, {
|
|
1048
1054
|
pkgNameOrAlias: i,
|
|
1049
1055
|
expose: a,
|
|
1050
|
-
remote:
|
|
1056
|
+
remote: o
|
|
1051
1057
|
};
|
|
1052
1058
|
} else if (a === "")
|
|
1053
1059
|
return {
|
|
1054
|
-
pkgNameOrAlias:
|
|
1060
|
+
pkgNameOrAlias: o.alias,
|
|
1055
1061
|
expose: ".",
|
|
1056
|
-
remote:
|
|
1062
|
+
remote: o
|
|
1057
1063
|
};
|
|
1058
1064
|
}
|
|
1059
1065
|
}
|
|
1060
1066
|
}
|
|
1061
|
-
function matchRemote(
|
|
1062
|
-
for (const
|
|
1063
|
-
if (t ===
|
|
1064
|
-
return
|
|
1067
|
+
function matchRemote(r, t) {
|
|
1068
|
+
for (const o of r)
|
|
1069
|
+
if (t === o.name || o.alias && t === o.alias)
|
|
1070
|
+
return o;
|
|
1065
1071
|
}
|
|
1066
|
-
function registerPlugins$1(
|
|
1067
|
-
const
|
|
1068
|
-
return
|
|
1069
|
-
|
|
1070
|
-
}),
|
|
1072
|
+
function registerPlugins$1(r, t) {
|
|
1073
|
+
const o = getGlobalHostPlugins();
|
|
1074
|
+
return o.length > 0 && o.forEach((n) => {
|
|
1075
|
+
r != null && r.find((s) => s.name !== n.name) && r.push(n);
|
|
1076
|
+
}), r && r.length > 0 && r.forEach((n) => {
|
|
1071
1077
|
t.forEach((s) => {
|
|
1072
1078
|
s.applyPlugin(n);
|
|
1073
1079
|
});
|
|
1074
|
-
}),
|
|
1080
|
+
}), r;
|
|
1075
1081
|
}
|
|
1076
|
-
async function loadEsmEntry({ entry:
|
|
1077
|
-
return new Promise((
|
|
1082
|
+
async function loadEsmEntry({ entry: r, remoteEntryExports: t }) {
|
|
1083
|
+
return new Promise((o, n) => {
|
|
1078
1084
|
try {
|
|
1079
|
-
t ?
|
|
1080
|
-
|
|
1085
|
+
t ? o(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
|
|
1086
|
+
o,
|
|
1081
1087
|
n
|
|
1082
1088
|
]) : import(
|
|
1083
1089
|
/* webpackIgnore: true */
|
|
1084
1090
|
/* @vite-ignore */
|
|
1085
|
-
|
|
1086
|
-
).then(
|
|
1091
|
+
r
|
|
1092
|
+
).then(o).catch(n);
|
|
1087
1093
|
} catch (s) {
|
|
1088
1094
|
n(s);
|
|
1089
1095
|
}
|
|
1090
1096
|
});
|
|
1091
1097
|
}
|
|
1092
|
-
async function loadSystemJsEntry({ entry:
|
|
1093
|
-
return new Promise((
|
|
1098
|
+
async function loadSystemJsEntry({ entry: r, remoteEntryExports: t }) {
|
|
1099
|
+
return new Promise((o, n) => {
|
|
1094
1100
|
try {
|
|
1095
|
-
t ?
|
|
1096
|
-
|
|
1101
|
+
t ? o(t) : typeof __system_context__ > "u" ? System.import(r).then(o).catch(n) : new Function("callbacks", `System.import("${r}").then(callbacks[0]).catch(callbacks[1])`)([
|
|
1102
|
+
o,
|
|
1097
1103
|
n
|
|
1098
1104
|
]);
|
|
1099
1105
|
} catch (s) {
|
|
@@ -1101,9 +1107,9 @@ async function loadSystemJsEntry({ entry: o, remoteEntryExports: t }) {
|
|
|
1101
1107
|
}
|
|
1102
1108
|
});
|
|
1103
1109
|
}
|
|
1104
|
-
async function loadEntryScript({ name:
|
|
1105
|
-
const { entryExports: s } = getRemoteEntryExports(
|
|
1106
|
-
return s || loadScript(
|
|
1110
|
+
async function loadEntryScript({ name: r, globalName: t, entry: o, loaderHook: n }) {
|
|
1111
|
+
const { entryExports: s } = getRemoteEntryExports(r, t);
|
|
1112
|
+
return s || loadScript(o, {
|
|
1107
1113
|
attrs: {},
|
|
1108
1114
|
createScriptHook: (l, a) => {
|
|
1109
1115
|
const i = n.lifecycle.createScript.emit({
|
|
@@ -1114,18 +1120,21 @@ async function loadEntryScript({ name: o, globalName: t, entry: r, loaderHook: n
|
|
|
1114
1120
|
return i;
|
|
1115
1121
|
}
|
|
1116
1122
|
}).then(() => {
|
|
1117
|
-
const { remoteEntryKey: l, entryExports: a } = getRemoteEntryExports(
|
|
1123
|
+
const { remoteEntryKey: l, entryExports: a } = getRemoteEntryExports(r, t);
|
|
1118
1124
|
return assert(a, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
|
|
1119
|
-
remoteName:
|
|
1120
|
-
remoteEntryUrl:
|
|
1125
|
+
remoteName: r,
|
|
1126
|
+
remoteEntryUrl: o,
|
|
1121
1127
|
remoteEntryKey: l
|
|
1122
1128
|
})), a;
|
|
1123
1129
|
}).catch((l) => {
|
|
1124
|
-
throw
|
|
1130
|
+
throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
|
|
1131
|
+
remoteName: r,
|
|
1132
|
+
resourceUrl: o
|
|
1133
|
+
})), l;
|
|
1125
1134
|
});
|
|
1126
1135
|
}
|
|
1127
|
-
async function loadEntryDom({ remoteInfo:
|
|
1128
|
-
const { entry: n, entryGlobalName: s, name: l, type: a } =
|
|
1136
|
+
async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: o }) {
|
|
1137
|
+
const { entry: n, entryGlobalName: s, name: l, type: a } = r;
|
|
1129
1138
|
switch (a) {
|
|
1130
1139
|
case "esm":
|
|
1131
1140
|
case "module":
|
|
@@ -1143,13 +1152,13 @@ async function loadEntryDom({ remoteInfo: o, remoteEntryExports: t, loaderHook:
|
|
|
1143
1152
|
entry: n,
|
|
1144
1153
|
globalName: s,
|
|
1145
1154
|
name: l,
|
|
1146
|
-
loaderHook:
|
|
1155
|
+
loaderHook: o
|
|
1147
1156
|
});
|
|
1148
1157
|
}
|
|
1149
1158
|
}
|
|
1150
|
-
async function loadEntryNode({ remoteInfo:
|
|
1151
|
-
const { entry:
|
|
1152
|
-
return a || loadScriptNode(
|
|
1159
|
+
async function loadEntryNode({ remoteInfo: r, loaderHook: t }) {
|
|
1160
|
+
const { entry: o, entryGlobalName: n, name: s, type: l } = r, { entryExports: a } = getRemoteEntryExports(s, n);
|
|
1161
|
+
return a || loadScriptNode(o, {
|
|
1153
1162
|
attrs: {
|
|
1154
1163
|
name: s,
|
|
1155
1164
|
globalName: n,
|
|
@@ -1169,44 +1178,44 @@ async function loadEntryNode({ remoteInfo: o, loaderHook: t }) {
|
|
|
1169
1178
|
const { remoteEntryKey: i, entryExports: c } = getRemoteEntryExports(s, n);
|
|
1170
1179
|
return assert(c, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
|
|
1171
1180
|
remoteName: s,
|
|
1172
|
-
remoteEntryUrl:
|
|
1181
|
+
remoteEntryUrl: o,
|
|
1173
1182
|
remoteEntryKey: i
|
|
1174
1183
|
})), c;
|
|
1175
1184
|
}).catch((i) => {
|
|
1176
1185
|
throw i;
|
|
1177
1186
|
});
|
|
1178
1187
|
}
|
|
1179
|
-
function getRemoteEntryUniqueKey(
|
|
1180
|
-
const { entry: t, name:
|
|
1181
|
-
return composeKeyWithSeparator(
|
|
1188
|
+
function getRemoteEntryUniqueKey(r) {
|
|
1189
|
+
const { entry: t, name: o } = r;
|
|
1190
|
+
return composeKeyWithSeparator(o, t);
|
|
1182
1191
|
}
|
|
1183
|
-
async function getRemoteEntry({ origin:
|
|
1184
|
-
const n = getRemoteEntryUniqueKey(
|
|
1192
|
+
async function getRemoteEntry({ origin: r, remoteEntryExports: t, remoteInfo: o }) {
|
|
1193
|
+
const n = getRemoteEntryUniqueKey(o);
|
|
1185
1194
|
if (t)
|
|
1186
1195
|
return t;
|
|
1187
1196
|
if (!globalLoading[n]) {
|
|
1188
|
-
const s =
|
|
1197
|
+
const s = r.remoteHandler.hooks.lifecycle.loadEntry, l = r.loaderHook;
|
|
1189
1198
|
globalLoading[n] = s.emit({
|
|
1190
1199
|
loaderHook: l,
|
|
1191
|
-
remoteInfo:
|
|
1200
|
+
remoteInfo: o,
|
|
1192
1201
|
remoteEntryExports: t
|
|
1193
1202
|
}).then((a) => a || (isBrowserEnv() ? loadEntryDom({
|
|
1194
|
-
remoteInfo:
|
|
1203
|
+
remoteInfo: o,
|
|
1195
1204
|
remoteEntryExports: t,
|
|
1196
1205
|
loaderHook: l
|
|
1197
1206
|
}) : loadEntryNode({
|
|
1198
|
-
remoteInfo:
|
|
1207
|
+
remoteInfo: o,
|
|
1199
1208
|
loaderHook: l
|
|
1200
1209
|
})));
|
|
1201
1210
|
}
|
|
1202
1211
|
return globalLoading[n];
|
|
1203
1212
|
}
|
|
1204
|
-
function getRemoteInfo(
|
|
1205
|
-
return _extends$1({},
|
|
1206
|
-
entry: "entry" in
|
|
1207
|
-
type:
|
|
1208
|
-
entryGlobalName:
|
|
1209
|
-
shareScope:
|
|
1213
|
+
function getRemoteInfo(r) {
|
|
1214
|
+
return _extends$1({}, r, {
|
|
1215
|
+
entry: "entry" in r ? r.entry : "",
|
|
1216
|
+
type: r.type || DEFAULT_REMOTE_TYPE,
|
|
1217
|
+
entryGlobalName: r.entryGlobalName || r.name,
|
|
1218
|
+
shareScope: r.shareScope || DEFAULT_SCOPE
|
|
1210
1219
|
});
|
|
1211
1220
|
}
|
|
1212
1221
|
let Module = class {
|
|
@@ -1235,14 +1244,14 @@ let Module = class {
|
|
|
1235
1244
|
${safeToString(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
|
|
1236
1245
|
}
|
|
1237
1246
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1238
|
-
async get(t,
|
|
1247
|
+
async get(t, o, n, s) {
|
|
1239
1248
|
const { loadFactory: l = !0 } = n || {
|
|
1240
1249
|
loadFactory: !0
|
|
1241
1250
|
}, a = await this.getEntry();
|
|
1242
1251
|
if (!this.inited) {
|
|
1243
1252
|
const p = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
|
|
1244
1253
|
p[m] || (p[m] = {});
|
|
1245
|
-
const
|
|
1254
|
+
const g = p[m], _ = [], R = {
|
|
1246
1255
|
version: this.remoteInfo.version || ""
|
|
1247
1256
|
};
|
|
1248
1257
|
Object.defineProperty(R, "shareScopeMap", {
|
|
@@ -1250,8 +1259,8 @@ let Module = class {
|
|
|
1250
1259
|
// remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
|
|
1251
1260
|
enumerable: !1
|
|
1252
1261
|
});
|
|
1253
|
-
const
|
|
1254
|
-
shareScope:
|
|
1262
|
+
const y = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1263
|
+
shareScope: g,
|
|
1255
1264
|
// @ts-ignore shareScopeMap will be set by Object.defineProperty
|
|
1256
1265
|
remoteEntryInitOptions: R,
|
|
1257
1266
|
initScope: _,
|
|
@@ -1262,7 +1271,7 @@ let Module = class {
|
|
|
1262
1271
|
remoteName: name,
|
|
1263
1272
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1264
1273
|
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1265
|
-
})), await a.init(
|
|
1274
|
+
})), await a.init(y.shareScope, y.initScope, y.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit(_extends$1({}, y, {
|
|
1266
1275
|
id: t,
|
|
1267
1276
|
remoteSnapshot: s,
|
|
1268
1277
|
remoteEntryExports: a
|
|
@@ -1272,13 +1281,13 @@ let Module = class {
|
|
|
1272
1281
|
let i;
|
|
1273
1282
|
i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1274
1283
|
remoteEntryExports: a,
|
|
1275
|
-
expose:
|
|
1284
|
+
expose: o,
|
|
1276
1285
|
moduleInfo: this.remoteInfo
|
|
1277
|
-
}), i || (i = await a.get(
|
|
1278
|
-
const c = processModuleAlias(this.remoteInfo.name,
|
|
1286
|
+
}), i || (i = await a.get(o)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${o}.`);
|
|
1287
|
+
const c = processModuleAlias(this.remoteInfo.name, o), u = this.wraperFactory(i, c);
|
|
1279
1288
|
return l ? await u() : u;
|
|
1280
1289
|
}
|
|
1281
|
-
wraperFactory(t,
|
|
1290
|
+
wraperFactory(t, o) {
|
|
1282
1291
|
function n(s, l) {
|
|
1283
1292
|
s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
|
|
1284
1293
|
value: l,
|
|
@@ -1287,14 +1296,14 @@ let Module = class {
|
|
|
1287
1296
|
}
|
|
1288
1297
|
return t instanceof Promise ? async () => {
|
|
1289
1298
|
const s = await t();
|
|
1290
|
-
return n(s,
|
|
1299
|
+
return n(s, o), s;
|
|
1291
1300
|
} : () => {
|
|
1292
1301
|
const s = t();
|
|
1293
|
-
return n(s,
|
|
1302
|
+
return n(s, o), s;
|
|
1294
1303
|
};
|
|
1295
1304
|
}
|
|
1296
|
-
constructor({ remoteInfo: t, host:
|
|
1297
|
-
this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host =
|
|
1305
|
+
constructor({ remoteInfo: t, host: o }) {
|
|
1306
|
+
this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = o;
|
|
1298
1307
|
}
|
|
1299
1308
|
};
|
|
1300
1309
|
class SyncHook {
|
|
@@ -1302,16 +1311,16 @@ class SyncHook {
|
|
|
1302
1311
|
typeof t == "function" && this.listeners.add(t);
|
|
1303
1312
|
}
|
|
1304
1313
|
once(t) {
|
|
1305
|
-
const
|
|
1314
|
+
const o = this;
|
|
1306
1315
|
this.on(function n(...s) {
|
|
1307
|
-
return
|
|
1316
|
+
return o.remove(n), t.apply(null, s);
|
|
1308
1317
|
});
|
|
1309
1318
|
}
|
|
1310
1319
|
emit(...t) {
|
|
1311
|
-
let
|
|
1320
|
+
let o;
|
|
1312
1321
|
return this.listeners.size > 0 && this.listeners.forEach((n) => {
|
|
1313
|
-
|
|
1314
|
-
}),
|
|
1322
|
+
o = n(...t);
|
|
1323
|
+
}), o;
|
|
1315
1324
|
}
|
|
1316
1325
|
remove(t) {
|
|
1317
1326
|
this.listeners.delete(t);
|
|
@@ -1325,22 +1334,22 @@ class SyncHook {
|
|
|
1325
1334
|
}
|
|
1326
1335
|
class AsyncHook extends SyncHook {
|
|
1327
1336
|
emit(...t) {
|
|
1328
|
-
let
|
|
1337
|
+
let o;
|
|
1329
1338
|
const n = Array.from(this.listeners);
|
|
1330
1339
|
if (n.length > 0) {
|
|
1331
1340
|
let s = 0;
|
|
1332
1341
|
const l = (a) => a === !1 ? !1 : s < n.length ? Promise.resolve(n[s++].apply(null, t)).then(l) : a;
|
|
1333
|
-
|
|
1342
|
+
o = l();
|
|
1334
1343
|
}
|
|
1335
|
-
return Promise.resolve(
|
|
1344
|
+
return Promise.resolve(o);
|
|
1336
1345
|
}
|
|
1337
1346
|
}
|
|
1338
|
-
function checkReturnData(
|
|
1347
|
+
function checkReturnData(r, t) {
|
|
1339
1348
|
if (!isObject(t))
|
|
1340
1349
|
return !1;
|
|
1341
|
-
if (
|
|
1342
|
-
for (const
|
|
1343
|
-
if (!(
|
|
1350
|
+
if (r !== t) {
|
|
1351
|
+
for (const o in r)
|
|
1352
|
+
if (!(o in t))
|
|
1344
1353
|
return !1;
|
|
1345
1354
|
}
|
|
1346
1355
|
return !0;
|
|
@@ -1348,9 +1357,9 @@ function checkReturnData(o, t) {
|
|
|
1348
1357
|
class SyncWaterfallHook extends SyncHook {
|
|
1349
1358
|
emit(t) {
|
|
1350
1359
|
isObject(t) || error(`The data for the "${this.type}" hook should be an object.`);
|
|
1351
|
-
for (const
|
|
1360
|
+
for (const o of this.listeners)
|
|
1352
1361
|
try {
|
|
1353
|
-
const n =
|
|
1362
|
+
const n = o(t);
|
|
1354
1363
|
if (checkReturnData(t, n))
|
|
1355
1364
|
t = n;
|
|
1356
1365
|
else {
|
|
@@ -1369,14 +1378,14 @@ class SyncWaterfallHook extends SyncHook {
|
|
|
1369
1378
|
class AsyncWaterfallHook extends SyncHook {
|
|
1370
1379
|
emit(t) {
|
|
1371
1380
|
isObject(t) || error(`The response data for the "${this.type}" hook must be an object.`);
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1381
|
+
const o = Array.from(this.listeners);
|
|
1382
|
+
if (o.length > 0) {
|
|
1374
1383
|
let n = 0;
|
|
1375
1384
|
const s = (a) => (warn(a), this.onerror(a), t), l = (a) => {
|
|
1376
1385
|
if (checkReturnData(t, a)) {
|
|
1377
|
-
if (t = a, n <
|
|
1386
|
+
if (t = a, n < o.length)
|
|
1378
1387
|
try {
|
|
1379
|
-
return Promise.resolve(
|
|
1388
|
+
return Promise.resolve(o[n++](t)).then(l, s);
|
|
1380
1389
|
} catch (i) {
|
|
1381
1390
|
return s(i);
|
|
1382
1391
|
}
|
|
@@ -1395,59 +1404,59 @@ class AsyncWaterfallHook extends SyncHook {
|
|
|
1395
1404
|
class PluginSystem {
|
|
1396
1405
|
applyPlugin(t) {
|
|
1397
1406
|
assert(isPlainObject(t), "Plugin configuration is invalid.");
|
|
1398
|
-
const
|
|
1399
|
-
assert(
|
|
1407
|
+
const o = t.name;
|
|
1408
|
+
assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = t, Object.keys(this.lifecycle).forEach((n) => {
|
|
1400
1409
|
const s = t[n];
|
|
1401
1410
|
s && this.lifecycle[n].on(s);
|
|
1402
1411
|
}));
|
|
1403
1412
|
}
|
|
1404
1413
|
removePlugin(t) {
|
|
1405
1414
|
assert(t, "A name is required.");
|
|
1406
|
-
const
|
|
1407
|
-
assert(
|
|
1408
|
-
n !== "name" && this.lifecycle[n].remove(
|
|
1415
|
+
const o = this.registerPlugins[t];
|
|
1416
|
+
assert(o, `The plugin "${t}" is not registered.`), Object.keys(o).forEach((n) => {
|
|
1417
|
+
n !== "name" && this.lifecycle[n].remove(o[n]);
|
|
1409
1418
|
});
|
|
1410
1419
|
}
|
|
1411
1420
|
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
1412
|
-
inherit({ lifecycle: t, registerPlugins:
|
|
1421
|
+
inherit({ lifecycle: t, registerPlugins: o }) {
|
|
1413
1422
|
Object.keys(t).forEach((n) => {
|
|
1414
1423
|
assert(!this.lifecycle[n], `The hook "${n}" has a conflict and cannot be inherited.`), this.lifecycle[n] = t[n];
|
|
1415
|
-
}), Object.keys(
|
|
1416
|
-
assert(!this.registerPlugins[n], `The plugin "${n}" has a conflict and cannot be inherited.`), this.applyPlugin(
|
|
1424
|
+
}), Object.keys(o).forEach((n) => {
|
|
1425
|
+
assert(!this.registerPlugins[n], `The plugin "${n}" has a conflict and cannot be inherited.`), this.applyPlugin(o[n]);
|
|
1417
1426
|
});
|
|
1418
1427
|
}
|
|
1419
1428
|
constructor(t) {
|
|
1420
1429
|
this.registerPlugins = {}, this.lifecycle = t, this.lifecycleKeys = Object.keys(t);
|
|
1421
1430
|
}
|
|
1422
1431
|
}
|
|
1423
|
-
function defaultPreloadArgs(
|
|
1432
|
+
function defaultPreloadArgs(r) {
|
|
1424
1433
|
return _extends$1({
|
|
1425
1434
|
resourceCategory: "sync",
|
|
1426
1435
|
share: !0,
|
|
1427
1436
|
depsRemote: !0,
|
|
1428
1437
|
prefetchInterface: !1
|
|
1429
|
-
},
|
|
1438
|
+
}, r);
|
|
1430
1439
|
}
|
|
1431
|
-
function formatPreloadArgs(
|
|
1432
|
-
return t.map((
|
|
1433
|
-
const n = matchRemote(
|
|
1434
|
-
return assert(n, `Unable to preload ${
|
|
1440
|
+
function formatPreloadArgs(r, t) {
|
|
1441
|
+
return t.map((o) => {
|
|
1442
|
+
const n = matchRemote(r, o.nameOrAlias);
|
|
1443
|
+
return assert(n, `Unable to preload ${o.nameOrAlias} as it is not included in ${!n && safeToString({
|
|
1435
1444
|
remoteInfo: n,
|
|
1436
|
-
remotes:
|
|
1445
|
+
remotes: r
|
|
1437
1446
|
})}`), {
|
|
1438
1447
|
remote: n,
|
|
1439
|
-
preloadConfig: defaultPreloadArgs(
|
|
1448
|
+
preloadConfig: defaultPreloadArgs(o)
|
|
1440
1449
|
};
|
|
1441
1450
|
});
|
|
1442
1451
|
}
|
|
1443
|
-
function normalizePreloadExposes(
|
|
1444
|
-
return
|
|
1452
|
+
function normalizePreloadExposes(r) {
|
|
1453
|
+
return r ? r.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1445
1454
|
}
|
|
1446
|
-
function preloadAssets(
|
|
1447
|
-
const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } =
|
|
1455
|
+
function preloadAssets(r, t, o, n = !0) {
|
|
1456
|
+
const { cssAssets: s, jsAssetsWithoutEntry: l, entryAssets: a } = o;
|
|
1448
1457
|
if (t.options.inBrowser) {
|
|
1449
1458
|
if (a.forEach((i) => {
|
|
1450
|
-
const { moduleInfo: c } = i, u = t.moduleCache.get(
|
|
1459
|
+
const { moduleInfo: c } = i, u = t.moduleCache.get(r.name);
|
|
1451
1460
|
getRemoteEntry(u ? {
|
|
1452
1461
|
origin: t,
|
|
1453
1462
|
remoteInfo: c,
|
|
@@ -1469,12 +1478,12 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1469
1478
|
},
|
|
1470
1479
|
attrs: i,
|
|
1471
1480
|
createLinkHook: (p, m) => {
|
|
1472
|
-
const
|
|
1481
|
+
const g = t.loaderHook.lifecycle.createLink.emit({
|
|
1473
1482
|
url: p,
|
|
1474
1483
|
attrs: m
|
|
1475
1484
|
});
|
|
1476
|
-
if (
|
|
1477
|
-
return
|
|
1485
|
+
if (g instanceof HTMLLinkElement)
|
|
1486
|
+
return g;
|
|
1478
1487
|
}
|
|
1479
1488
|
});
|
|
1480
1489
|
d && document.head.appendChild(u);
|
|
@@ -1491,12 +1500,12 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1491
1500
|
},
|
|
1492
1501
|
attrs: i,
|
|
1493
1502
|
createLinkHook: (p, m) => {
|
|
1494
|
-
const
|
|
1503
|
+
const g = t.loaderHook.lifecycle.createLink.emit({
|
|
1495
1504
|
url: p,
|
|
1496
1505
|
attrs: m
|
|
1497
1506
|
});
|
|
1498
|
-
if (
|
|
1499
|
-
return
|
|
1507
|
+
if (g instanceof HTMLLinkElement)
|
|
1508
|
+
return g;
|
|
1500
1509
|
},
|
|
1501
1510
|
needDeleteLink: !1
|
|
1502
1511
|
});
|
|
@@ -1515,12 +1524,12 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1515
1524
|
},
|
|
1516
1525
|
attrs: i,
|
|
1517
1526
|
createLinkHook: (p, m) => {
|
|
1518
|
-
const
|
|
1527
|
+
const g = t.loaderHook.lifecycle.createLink.emit({
|
|
1519
1528
|
url: p,
|
|
1520
1529
|
attrs: m
|
|
1521
1530
|
});
|
|
1522
|
-
if (
|
|
1523
|
-
return
|
|
1531
|
+
if (g instanceof HTMLLinkElement)
|
|
1532
|
+
return g;
|
|
1524
1533
|
}
|
|
1525
1534
|
});
|
|
1526
1535
|
d && document.head.appendChild(u);
|
|
@@ -1528,7 +1537,7 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1528
1537
|
} else {
|
|
1529
1538
|
const i = {
|
|
1530
1539
|
fetchpriority: "high",
|
|
1531
|
-
type: (
|
|
1540
|
+
type: (r == null ? void 0 : r.type) === "module" ? "module" : "text/javascript"
|
|
1532
1541
|
};
|
|
1533
1542
|
l.forEach((c) => {
|
|
1534
1543
|
const { script: u, needAttach: d } = createScript({
|
|
@@ -1537,12 +1546,12 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1537
1546
|
},
|
|
1538
1547
|
attrs: i,
|
|
1539
1548
|
createScriptHook: (p, m) => {
|
|
1540
|
-
const
|
|
1549
|
+
const g = t.loaderHook.lifecycle.createScript.emit({
|
|
1541
1550
|
url: p,
|
|
1542
1551
|
attrs: m
|
|
1543
1552
|
});
|
|
1544
|
-
if (
|
|
1545
|
-
return
|
|
1553
|
+
if (g instanceof HTMLScriptElement)
|
|
1554
|
+
return g;
|
|
1546
1555
|
},
|
|
1547
1556
|
needDeleteScript: !0
|
|
1548
1557
|
});
|
|
@@ -1551,24 +1560,24 @@ function preloadAssets(o, t, r, n = !0) {
|
|
|
1551
1560
|
}
|
|
1552
1561
|
}
|
|
1553
1562
|
}
|
|
1554
|
-
function assignRemoteInfo(
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1557
|
-
let n = getResourceUrl(t,
|
|
1558
|
-
!isBrowserEnv() && !n.startsWith("http") && (n = `https:${n}`),
|
|
1563
|
+
function assignRemoteInfo(r, t) {
|
|
1564
|
+
const o = getRemoteEntryInfoFromSnapshot(t);
|
|
1565
|
+
o.url || error(`The attribute remoteEntry of ${r.name} must not be undefined.`);
|
|
1566
|
+
let n = getResourceUrl(t, o.url);
|
|
1567
|
+
!isBrowserEnv() && !n.startsWith("http") && (n = `https:${n}`), r.type = o.type, r.entryGlobalName = o.globalName, r.entry = n, r.version = t.version, r.buildVersion = t.buildVersion;
|
|
1559
1568
|
}
|
|
1560
1569
|
function snapshotPlugin() {
|
|
1561
1570
|
return {
|
|
1562
1571
|
name: "snapshot-plugin",
|
|
1563
|
-
async afterResolve(
|
|
1564
|
-
const { remote: t, pkgNameOrAlias:
|
|
1572
|
+
async afterResolve(r) {
|
|
1573
|
+
const { remote: t, pkgNameOrAlias: o, expose: n, origin: s, remoteInfo: l } = r;
|
|
1565
1574
|
if (!isRemoteInfoWithEntry(t) || !isPureRemoteEntry(t)) {
|
|
1566
1575
|
const { remoteSnapshot: a, globalSnapshot: i } = await s.snapshotHandler.loadRemoteSnapshotInfo(t);
|
|
1567
1576
|
assignRemoteInfo(l, a);
|
|
1568
1577
|
const c = {
|
|
1569
1578
|
remote: t,
|
|
1570
1579
|
preloadConfig: {
|
|
1571
|
-
nameOrAlias:
|
|
1580
|
+
nameOrAlias: o,
|
|
1572
1581
|
exposes: [
|
|
1573
1582
|
n
|
|
1574
1583
|
],
|
|
@@ -1584,16 +1593,16 @@ function snapshotPlugin() {
|
|
|
1584
1593
|
remoteSnapshot: a,
|
|
1585
1594
|
globalSnapshot: i
|
|
1586
1595
|
});
|
|
1587
|
-
return u && preloadAssets(l, s, u, !1), _extends$1({},
|
|
1596
|
+
return u && preloadAssets(l, s, u, !1), _extends$1({}, r, {
|
|
1588
1597
|
remoteSnapshot: a
|
|
1589
1598
|
});
|
|
1590
1599
|
}
|
|
1591
|
-
return
|
|
1600
|
+
return r;
|
|
1592
1601
|
}
|
|
1593
1602
|
};
|
|
1594
1603
|
}
|
|
1595
|
-
function splitId(
|
|
1596
|
-
const t =
|
|
1604
|
+
function splitId(r) {
|
|
1605
|
+
const t = r.split(":");
|
|
1597
1606
|
return t.length === 1 ? {
|
|
1598
1607
|
name: t[0],
|
|
1599
1608
|
version: void 0
|
|
@@ -1605,99 +1614,99 @@ function splitId(o) {
|
|
|
1605
1614
|
version: t[2]
|
|
1606
1615
|
};
|
|
1607
1616
|
}
|
|
1608
|
-
function traverseModuleInfo(
|
|
1609
|
-
const a = getFMId(t), { value: i } = getInfoWithoutType(
|
|
1610
|
-
if (c && !isManifestProvider(c) && (
|
|
1617
|
+
function traverseModuleInfo(r, t, o, n, s = {}, l) {
|
|
1618
|
+
const a = getFMId(t), { value: i } = getInfoWithoutType(r, a), c = l || i;
|
|
1619
|
+
if (c && !isManifestProvider(c) && (o(c, t, n), c.remotesInfo)) {
|
|
1611
1620
|
const u = Object.keys(c.remotesInfo);
|
|
1612
1621
|
for (const d of u) {
|
|
1613
1622
|
if (s[d])
|
|
1614
1623
|
continue;
|
|
1615
1624
|
s[d] = !0;
|
|
1616
1625
|
const p = splitId(d), m = c.remotesInfo[d];
|
|
1617
|
-
traverseModuleInfo(
|
|
1626
|
+
traverseModuleInfo(r, {
|
|
1618
1627
|
name: p.name,
|
|
1619
1628
|
version: m.matchedVersion
|
|
1620
|
-
},
|
|
1629
|
+
}, o, !1, s, void 0);
|
|
1621
1630
|
}
|
|
1622
1631
|
}
|
|
1623
1632
|
}
|
|
1624
|
-
function generatePreloadAssets(
|
|
1625
|
-
const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } =
|
|
1626
|
-
if (traverseModuleInfo(n,
|
|
1627
|
-
let
|
|
1628
|
-
if (
|
|
1629
|
-
|
|
1633
|
+
function generatePreloadAssets(r, t, o, n, s) {
|
|
1634
|
+
const l = [], a = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = r, { preloadConfig: p } = t, { depsRemote: m } = p;
|
|
1635
|
+
if (traverseModuleInfo(n, o, (y, E, v) => {
|
|
1636
|
+
let I;
|
|
1637
|
+
if (v)
|
|
1638
|
+
I = p;
|
|
1630
1639
|
else if (Array.isArray(m)) {
|
|
1631
1640
|
const T = m.find((A) => A.nameOrAlias === E.name || A.nameOrAlias === E.alias);
|
|
1632
1641
|
if (!T)
|
|
1633
1642
|
return;
|
|
1634
|
-
|
|
1643
|
+
I = defaultPreloadArgs(T);
|
|
1635
1644
|
} else if (m === !0)
|
|
1636
|
-
|
|
1645
|
+
I = p;
|
|
1637
1646
|
else
|
|
1638
1647
|
return;
|
|
1639
|
-
const S = getResourceUrl(
|
|
1648
|
+
const S = getResourceUrl(y, getRemoteEntryInfoFromSnapshot(y).url);
|
|
1640
1649
|
S && i.push({
|
|
1641
1650
|
name: E.name,
|
|
1642
1651
|
moduleInfo: {
|
|
1643
1652
|
name: E.name,
|
|
1644
1653
|
entry: S,
|
|
1645
|
-
type: "remoteEntryType" in
|
|
1646
|
-
entryGlobalName: "globalName" in
|
|
1654
|
+
type: "remoteEntryType" in y ? y.remoteEntryType : "global",
|
|
1655
|
+
entryGlobalName: "globalName" in y ? y.globalName : E.name,
|
|
1647
1656
|
shareScope: "",
|
|
1648
|
-
version: "version" in
|
|
1657
|
+
version: "version" in y ? y.version : void 0
|
|
1649
1658
|
},
|
|
1650
1659
|
url: S
|
|
1651
1660
|
});
|
|
1652
|
-
let b = "modules" in
|
|
1653
|
-
const $ = normalizePreloadExposes(
|
|
1654
|
-
if ($.length && "modules" in
|
|
1661
|
+
let b = "modules" in y ? y.modules : [];
|
|
1662
|
+
const $ = normalizePreloadExposes(I.exposes);
|
|
1663
|
+
if ($.length && "modules" in y) {
|
|
1655
1664
|
var w;
|
|
1656
|
-
b =
|
|
1665
|
+
b = y == null || (w = y.modules) == null ? void 0 : w.reduce((T, A) => (($ == null ? void 0 : $.indexOf(A.moduleName)) !== -1 && T.push(A), T), []);
|
|
1657
1666
|
}
|
|
1658
1667
|
function O(T) {
|
|
1659
|
-
const A = T.map((P) => getResourceUrl(
|
|
1660
|
-
return
|
|
1668
|
+
const A = T.map((P) => getResourceUrl(y, P));
|
|
1669
|
+
return I.filter ? A.filter(I.filter) : A;
|
|
1661
1670
|
}
|
|
1662
1671
|
if (b) {
|
|
1663
1672
|
const T = b.length;
|
|
1664
1673
|
for (let A = 0; A < T; A++) {
|
|
1665
1674
|
const P = b[A], M = `${E.name}/${P.moduleName}`;
|
|
1666
|
-
|
|
1675
|
+
r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1667
1676
|
id: P.moduleName === "." ? E.name : M,
|
|
1668
1677
|
name: E.name,
|
|
1669
|
-
remoteSnapshot:
|
|
1670
|
-
preloadConfig:
|
|
1678
|
+
remoteSnapshot: y,
|
|
1679
|
+
preloadConfig: I,
|
|
1671
1680
|
remote: E,
|
|
1672
|
-
origin:
|
|
1673
|
-
}), !getPreloaded(M) && (
|
|
1681
|
+
origin: r
|
|
1682
|
+
}), !getPreloaded(M) && (I.resourceCategory === "all" ? (l.push(...O(P.assets.css.async)), l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.async)), a.push(...O(P.assets.js.sync))) : (I.resourceCategory = "sync") && (l.push(...O(P.assets.css.sync)), a.push(...O(P.assets.js.sync))), setPreloaded(M));
|
|
1674
1683
|
}
|
|
1675
1684
|
}
|
|
1676
1685
|
}, !0, {}, s), s.shared) {
|
|
1677
|
-
const
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1686
|
+
const y = (E, v) => {
|
|
1687
|
+
const I = getRegisteredShare(r.shareScopeMap, v.sharedName, E, r.sharedHandler.hooks.lifecycle.resolveShare);
|
|
1688
|
+
I && typeof I.lib == "function" && (v.assets.js.sync.forEach((S) => {
|
|
1680
1689
|
c.add(S);
|
|
1681
|
-
}),
|
|
1690
|
+
}), v.assets.css.sync.forEach((S) => {
|
|
1682
1691
|
u.add(S);
|
|
1683
1692
|
}));
|
|
1684
1693
|
};
|
|
1685
1694
|
s.shared.forEach((E) => {
|
|
1686
|
-
var
|
|
1687
|
-
const
|
|
1688
|
-
if (!
|
|
1695
|
+
var v;
|
|
1696
|
+
const I = (v = d.shared) == null ? void 0 : v[E.sharedName];
|
|
1697
|
+
if (!I)
|
|
1689
1698
|
return;
|
|
1690
|
-
const S = E.version ?
|
|
1699
|
+
const S = E.version ? I.find(($) => $.version === E.version) : I;
|
|
1691
1700
|
if (!S)
|
|
1692
1701
|
return;
|
|
1693
1702
|
arrayOptions(S).forEach(($) => {
|
|
1694
|
-
|
|
1703
|
+
y($, E);
|
|
1695
1704
|
});
|
|
1696
1705
|
});
|
|
1697
1706
|
}
|
|
1698
|
-
const _ = a.filter((
|
|
1707
|
+
const _ = a.filter((y) => !c.has(y));
|
|
1699
1708
|
return {
|
|
1700
|
-
cssAssets: l.filter((
|
|
1709
|
+
cssAssets: l.filter((y) => !u.has(y)),
|
|
1701
1710
|
jsAssetsWithoutEntry: _,
|
|
1702
1711
|
entryAssets: i
|
|
1703
1712
|
};
|
|
@@ -1705,8 +1714,8 @@ function generatePreloadAssets(o, t, r, n, s) {
|
|
|
1705
1714
|
const generatePreloadAssetsPlugin = function() {
|
|
1706
1715
|
return {
|
|
1707
1716
|
name: "generate-preload-assets-plugin",
|
|
1708
|
-
async generatePreloadAssets(
|
|
1709
|
-
const { origin: t, preloadOptions:
|
|
1717
|
+
async generatePreloadAssets(r) {
|
|
1718
|
+
const { origin: t, preloadOptions: o, remoteInfo: n, remote: s, globalSnapshot: l, remoteSnapshot: a } = r;
|
|
1710
1719
|
return isRemoteInfoWithEntry(s) && isPureRemoteEntry(s) ? {
|
|
1711
1720
|
cssAssets: [],
|
|
1712
1721
|
jsAssetsWithoutEntry: [],
|
|
@@ -1723,35 +1732,35 @@ const generatePreloadAssetsPlugin = function() {
|
|
|
1723
1732
|
}
|
|
1724
1733
|
}
|
|
1725
1734
|
]
|
|
1726
|
-
} : (assignRemoteInfo(n, a), generatePreloadAssets(t,
|
|
1735
|
+
} : (assignRemoteInfo(n, a), generatePreloadAssets(t, o, n, l, a));
|
|
1727
1736
|
}
|
|
1728
1737
|
};
|
|
1729
1738
|
};
|
|
1730
|
-
function getGlobalRemoteInfo(
|
|
1731
|
-
const
|
|
1739
|
+
function getGlobalRemoteInfo(r, t) {
|
|
1740
|
+
const o = getGlobalSnapshotInfoByModuleInfo({
|
|
1732
1741
|
name: t.options.name,
|
|
1733
1742
|
version: t.options.version
|
|
1734
|
-
}), n =
|
|
1743
|
+
}), n = o && "remotesInfo" in o && o.remotesInfo && getInfoWithoutType(o.remotesInfo, r.name).value;
|
|
1735
1744
|
return n && n.matchedVersion ? {
|
|
1736
|
-
hostGlobalSnapshot:
|
|
1745
|
+
hostGlobalSnapshot: o,
|
|
1737
1746
|
globalSnapshot: getGlobalSnapshot(),
|
|
1738
1747
|
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
1739
|
-
name:
|
|
1748
|
+
name: r.name,
|
|
1740
1749
|
version: n.matchedVersion
|
|
1741
1750
|
})
|
|
1742
1751
|
} : {
|
|
1743
1752
|
hostGlobalSnapshot: void 0,
|
|
1744
1753
|
globalSnapshot: getGlobalSnapshot(),
|
|
1745
1754
|
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
1746
|
-
name:
|
|
1747
|
-
version: "version" in
|
|
1755
|
+
name: r.name,
|
|
1756
|
+
version: "version" in r ? r.version : void 0
|
|
1748
1757
|
})
|
|
1749
1758
|
};
|
|
1750
1759
|
}
|
|
1751
1760
|
class SnapshotHandler {
|
|
1752
1761
|
async loadSnapshot(t) {
|
|
1753
|
-
const { options:
|
|
1754
|
-
options:
|
|
1762
|
+
const { options: o } = this.HostInstance, { hostGlobalSnapshot: n, remoteSnapshot: s, globalSnapshot: l } = this.getGlobalRemoteInfo(t), { remoteSnapshot: a, globalSnapshot: i } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1763
|
+
options: o,
|
|
1755
1764
|
moduleInfo: t,
|
|
1756
1765
|
hostGlobalSnapshot: n,
|
|
1757
1766
|
remoteSnapshot: s,
|
|
@@ -1764,9 +1773,9 @@ class SnapshotHandler {
|
|
|
1764
1773
|
}
|
|
1765
1774
|
// eslint-disable-next-line max-lines-per-function
|
|
1766
1775
|
async loadRemoteSnapshotInfo(t) {
|
|
1767
|
-
const { options:
|
|
1776
|
+
const { options: o } = this.HostInstance;
|
|
1768
1777
|
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
1769
|
-
options:
|
|
1778
|
+
options: o,
|
|
1770
1779
|
moduleInfo: t
|
|
1771
1780
|
});
|
|
1772
1781
|
let n = getGlobalSnapshotInfoByModuleInfo({
|
|
@@ -1785,7 +1794,7 @@ class SnapshotHandler {
|
|
|
1785
1794
|
}
|
|
1786
1795
|
}));
|
|
1787
1796
|
const { hostGlobalSnapshot: s, remoteSnapshot: l, globalSnapshot: a } = this.getGlobalRemoteInfo(t), { remoteSnapshot: i, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1788
|
-
options:
|
|
1797
|
+
options: o,
|
|
1789
1798
|
moduleInfo: t,
|
|
1790
1799
|
hostGlobalSnapshot: s,
|
|
1791
1800
|
remoteSnapshot: l,
|
|
@@ -1794,12 +1803,12 @@ class SnapshotHandler {
|
|
|
1794
1803
|
let u, d;
|
|
1795
1804
|
if (i)
|
|
1796
1805
|
if (isManifestProvider(i)) {
|
|
1797
|
-
const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}),
|
|
1806
|
+
const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}), g = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
|
|
1798
1807
|
// The global remote may be overridden
|
|
1799
1808
|
// Therefore, set the snapshot key to the global address of the actual request
|
|
1800
1809
|
entry: p
|
|
1801
1810
|
}), m);
|
|
1802
|
-
u = m, d =
|
|
1811
|
+
u = m, d = g;
|
|
1803
1812
|
} else {
|
|
1804
1813
|
const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1805
1814
|
options: this.HostInstance.options,
|
|
@@ -1810,13 +1819,13 @@ class SnapshotHandler {
|
|
|
1810
1819
|
u = p, d = c;
|
|
1811
1820
|
}
|
|
1812
1821
|
else if (isRemoteInfoWithEntry(t)) {
|
|
1813
|
-
const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot:
|
|
1822
|
+
const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: g } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1814
1823
|
options: this.HostInstance.options,
|
|
1815
1824
|
moduleInfo: t,
|
|
1816
1825
|
remoteSnapshot: p,
|
|
1817
1826
|
from: "global"
|
|
1818
1827
|
});
|
|
1819
|
-
u =
|
|
1828
|
+
u = g, d = m;
|
|
1820
1829
|
} else
|
|
1821
1830
|
error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
|
|
1822
1831
|
hostName: t.name,
|
|
@@ -1824,7 +1833,7 @@ class SnapshotHandler {
|
|
|
1824
1833
|
globalSnapshot: JSON.stringify(c)
|
|
1825
1834
|
}));
|
|
1826
1835
|
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1827
|
-
options:
|
|
1836
|
+
options: o,
|
|
1828
1837
|
moduleInfo: t,
|
|
1829
1838
|
remoteSnapshot: u
|
|
1830
1839
|
}), {
|
|
@@ -1835,7 +1844,7 @@ class SnapshotHandler {
|
|
|
1835
1844
|
getGlobalRemoteInfo(t) {
|
|
1836
1845
|
return getGlobalRemoteInfo(t, this.HostInstance);
|
|
1837
1846
|
}
|
|
1838
|
-
async getManifestJson(t,
|
|
1847
|
+
async getManifestJson(t, o, n) {
|
|
1839
1848
|
const s = async () => {
|
|
1840
1849
|
let a = this.manifestCache.get(t);
|
|
1841
1850
|
if (a)
|
|
@@ -1846,7 +1855,7 @@ class SnapshotHandler {
|
|
|
1846
1855
|
} catch (i) {
|
|
1847
1856
|
delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
|
|
1848
1857
|
manifestUrl: t,
|
|
1849
|
-
moduleName:
|
|
1858
|
+
moduleName: o.name
|
|
1850
1859
|
}, `${i}`));
|
|
1851
1860
|
}
|
|
1852
1861
|
}, l = async () => {
|
|
@@ -1854,7 +1863,7 @@ class SnapshotHandler {
|
|
|
1854
1863
|
version: t
|
|
1855
1864
|
}), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1856
1865
|
options: this.HostInstance.options,
|
|
1857
|
-
moduleInfo:
|
|
1866
|
+
moduleInfo: o,
|
|
1858
1867
|
manifestJson: a,
|
|
1859
1868
|
remoteSnapshot: i,
|
|
1860
1869
|
manifestUrl: t,
|
|
@@ -1875,8 +1884,8 @@ class SnapshotHandler {
|
|
|
1875
1884
|
}
|
|
1876
1885
|
class SharedHandler {
|
|
1877
1886
|
// register shared in shareScopeMap
|
|
1878
|
-
registerShared(t,
|
|
1879
|
-
const { shareInfos: n, shared: s } = formatShareConfigs(t,
|
|
1887
|
+
registerShared(t, o) {
|
|
1888
|
+
const { shareInfos: n, shared: s } = formatShareConfigs(t, o);
|
|
1880
1889
|
return Object.keys(n).forEach((a) => {
|
|
1881
1890
|
n[a].forEach((c) => {
|
|
1882
1891
|
!getRegisteredShare(this.shareScopeMap, a, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
|
|
@@ -1885,7 +1894,7 @@ class SharedHandler {
|
|
|
1885
1894
|
get: c.get,
|
|
1886
1895
|
loaded: !0,
|
|
1887
1896
|
shared: c,
|
|
1888
|
-
from:
|
|
1897
|
+
from: o.name
|
|
1889
1898
|
});
|
|
1890
1899
|
});
|
|
1891
1900
|
}), {
|
|
@@ -1893,10 +1902,10 @@ class SharedHandler {
|
|
|
1893
1902
|
shared: s
|
|
1894
1903
|
};
|
|
1895
1904
|
}
|
|
1896
|
-
async loadShare(t,
|
|
1905
|
+
async loadShare(t, o) {
|
|
1897
1906
|
const { host: n } = this, s = getTargetSharedOptions({
|
|
1898
1907
|
pkgName: t,
|
|
1899
|
-
extraOptions:
|
|
1908
|
+
extraOptions: o,
|
|
1900
1909
|
shareInfos: n.options.shared
|
|
1901
1910
|
});
|
|
1902
1911
|
s != null && s.scope && await Promise.all(s.scope.map(async (u) => {
|
|
@@ -1935,7 +1944,7 @@ class SharedHandler {
|
|
|
1935
1944
|
loading: d
|
|
1936
1945
|
}), d;
|
|
1937
1946
|
} else {
|
|
1938
|
-
if (
|
|
1947
|
+
if (o != null && o.customShareInfo)
|
|
1939
1948
|
return !1;
|
|
1940
1949
|
const d = (async () => {
|
|
1941
1950
|
const p = await a.get();
|
|
@@ -1959,9 +1968,9 @@ class SharedHandler {
|
|
|
1959
1968
|
* If the share scope does not exist, it creates one.
|
|
1960
1969
|
*/
|
|
1961
1970
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1962
|
-
initializeSharing(t = DEFAULT_SCOPE,
|
|
1963
|
-
const { host: n } = this, s =
|
|
1964
|
-
let a =
|
|
1971
|
+
initializeSharing(t = DEFAULT_SCOPE, o) {
|
|
1972
|
+
const { host: n } = this, s = o == null ? void 0 : o.from, l = o == null ? void 0 : o.strategy;
|
|
1973
|
+
let a = o == null ? void 0 : o.initScope;
|
|
1965
1974
|
const i = [];
|
|
1966
1975
|
if (s !== "build") {
|
|
1967
1976
|
const { initTokens: _ } = this;
|
|
@@ -1976,21 +1985,21 @@ class SharedHandler {
|
|
|
1976
1985
|
const c = this.shareScopeMap, u = n.options.name;
|
|
1977
1986
|
c[t] || (c[t] = {});
|
|
1978
1987
|
const d = c[t], p = (_, R) => {
|
|
1979
|
-
var
|
|
1980
|
-
const { version: E, eager:
|
|
1988
|
+
var y;
|
|
1989
|
+
const { version: E, eager: v } = R;
|
|
1981
1990
|
d[_] = d[_] || {};
|
|
1982
|
-
const
|
|
1983
|
-
(!S || S.strategy !== "loaded-first" && !S.loaded && (!
|
|
1984
|
-
}, m = (_) => _ && _.init && _.init(c[t], a),
|
|
1991
|
+
const I = d[_], S = I[E], b = !!(S && (S.eager || (y = S.shareConfig) != null && y.eager));
|
|
1992
|
+
(!S || S.strategy !== "loaded-first" && !S.loaded && (!v != !b ? v : u > S.from)) && (I[E] = R);
|
|
1993
|
+
}, m = (_) => _ && _.init && _.init(c[t], a), g = async (_) => {
|
|
1985
1994
|
const { module: R } = await n.remoteHandler.getRemoteModuleAndOptions({
|
|
1986
1995
|
id: _
|
|
1987
1996
|
});
|
|
1988
1997
|
if (R.getEntry) {
|
|
1989
|
-
let
|
|
1998
|
+
let y;
|
|
1990
1999
|
try {
|
|
1991
|
-
|
|
2000
|
+
y = await R.getEntry();
|
|
1992
2001
|
} catch (E) {
|
|
1993
|
-
|
|
2002
|
+
y = await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
1994
2003
|
id: _,
|
|
1995
2004
|
error: E,
|
|
1996
2005
|
from: "runtime",
|
|
@@ -1998,25 +2007,25 @@ class SharedHandler {
|
|
|
1998
2007
|
origin: n
|
|
1999
2008
|
});
|
|
2000
2009
|
}
|
|
2001
|
-
R.inited || (await m(
|
|
2010
|
+
R.inited || (await m(y), R.inited = !0);
|
|
2002
2011
|
}
|
|
2003
2012
|
};
|
|
2004
2013
|
return Object.keys(n.options.shared).forEach((_) => {
|
|
2005
|
-
n.options.shared[_].forEach((
|
|
2006
|
-
|
|
2014
|
+
n.options.shared[_].forEach((y) => {
|
|
2015
|
+
y.scope.includes(t) && p(_, y);
|
|
2007
2016
|
});
|
|
2008
2017
|
}), (n.options.shareStrategy === "version-first" || l === "version-first") && n.options.remotes.forEach((_) => {
|
|
2009
|
-
_.shareScope === t && i.push(
|
|
2018
|
+
_.shareScope === t && i.push(g(_.name));
|
|
2010
2019
|
}), i;
|
|
2011
2020
|
}
|
|
2012
2021
|
// The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
|
|
2013
2022
|
// 1. If the loaded shared already exists globally, then it will be reused
|
|
2014
2023
|
// 2. If lib exists in local shared, it will be used directly
|
|
2015
2024
|
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
2016
|
-
loadShareSync(t,
|
|
2025
|
+
loadShareSync(t, o) {
|
|
2017
2026
|
const { host: n } = this, s = getTargetSharedOptions({
|
|
2018
2027
|
pkgName: t,
|
|
2019
|
-
extraOptions:
|
|
2028
|
+
extraOptions: o,
|
|
2020
2029
|
shareInfos: n.options.shared
|
|
2021
2030
|
});
|
|
2022
2031
|
s != null && s.scope && s.scope.forEach((i) => {
|
|
@@ -2047,7 +2056,7 @@ class SharedHandler {
|
|
|
2047
2056
|
if (s.get) {
|
|
2048
2057
|
const i = s.get();
|
|
2049
2058
|
if (i instanceof Promise) {
|
|
2050
|
-
const c = (
|
|
2059
|
+
const c = (o == null ? void 0 : o.from) === "build" ? RUNTIME_005 : RUNTIME_006;
|
|
2051
2060
|
throw new Error(getShortErrorMsg(c, runtimeDescMap, {
|
|
2052
2061
|
hostName: n.options.name,
|
|
2053
2062
|
sharedPkgName: t
|
|
@@ -2066,18 +2075,18 @@ class SharedHandler {
|
|
|
2066
2075
|
sharedPkgName: t
|
|
2067
2076
|
}));
|
|
2068
2077
|
}
|
|
2069
|
-
initShareScopeMap(t,
|
|
2078
|
+
initShareScopeMap(t, o, n = {}) {
|
|
2070
2079
|
const { host: s } = this;
|
|
2071
|
-
this.shareScopeMap[t] =
|
|
2072
|
-
shareScope:
|
|
2080
|
+
this.shareScopeMap[t] = o, this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
2081
|
+
shareScope: o,
|
|
2073
2082
|
options: s.options,
|
|
2074
2083
|
origin: s,
|
|
2075
2084
|
scopeName: t,
|
|
2076
2085
|
hostShareScopeMap: n.hostShareScopeMap
|
|
2077
2086
|
});
|
|
2078
2087
|
}
|
|
2079
|
-
setShared({ pkgName: t, shared:
|
|
2080
|
-
const { version: c, scope: u = "default" } =
|
|
2088
|
+
setShared({ pkgName: t, shared: o, from: n, lib: s, loading: l, loaded: a, get: i }) {
|
|
2089
|
+
const { version: c, scope: u = "default" } = o, d = _object_without_properties_loose(o, [
|
|
2081
2090
|
"version",
|
|
2082
2091
|
"scope"
|
|
2083
2092
|
]);
|
|
@@ -2097,13 +2106,13 @@ class SharedHandler {
|
|
|
2097
2106
|
}), i && (this.shareScopeMap[m][t][c].get = i);
|
|
2098
2107
|
return;
|
|
2099
2108
|
}
|
|
2100
|
-
const
|
|
2101
|
-
l && !
|
|
2109
|
+
const g = this.shareScopeMap[m][t][c];
|
|
2110
|
+
l && !g.loading && (g.loading = l);
|
|
2102
2111
|
});
|
|
2103
2112
|
}
|
|
2104
2113
|
_setGlobalShareScopeMap(t) {
|
|
2105
|
-
const
|
|
2106
|
-
n && !
|
|
2114
|
+
const o = getGlobalShareScope(), n = t.id || t.name;
|
|
2115
|
+
n && !o[n] && (o[n] = this.shareScopeMap);
|
|
2107
2116
|
}
|
|
2108
2117
|
constructor(t) {
|
|
2109
2118
|
this.hooks = new PluginSystem({
|
|
@@ -2118,13 +2127,13 @@ class SharedHandler {
|
|
|
2118
2127
|
}
|
|
2119
2128
|
}
|
|
2120
2129
|
class RemoteHandler {
|
|
2121
|
-
formatAndRegisterRemote(t,
|
|
2122
|
-
return (
|
|
2130
|
+
formatAndRegisterRemote(t, o) {
|
|
2131
|
+
return (o.remotes || []).reduce((s, l) => (this.registerRemote(l, s, {
|
|
2123
2132
|
force: !1
|
|
2124
2133
|
}), s), t.remotes);
|
|
2125
2134
|
}
|
|
2126
|
-
setIdToRemoteMap(t,
|
|
2127
|
-
const { remote: n, expose: s } =
|
|
2135
|
+
setIdToRemoteMap(t, o) {
|
|
2136
|
+
const { remote: n, expose: s } = o, { name: l, alias: a } = n;
|
|
2128
2137
|
if (this.idToRemoteMap[t] = {
|
|
2129
2138
|
name: n.name,
|
|
2130
2139
|
expose: s
|
|
@@ -2146,27 +2155,27 @@ class RemoteHandler {
|
|
|
2146
2155
|
}
|
|
2147
2156
|
// eslint-disable-next-line max-lines-per-function
|
|
2148
2157
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2149
|
-
async loadRemote(t,
|
|
2158
|
+
async loadRemote(t, o) {
|
|
2150
2159
|
const { host: n } = this;
|
|
2151
2160
|
try {
|
|
2152
|
-
const { loadFactory: s = !0 } =
|
|
2161
|
+
const { loadFactory: s = !0 } = o || {
|
|
2153
2162
|
loadFactory: !0
|
|
2154
2163
|
}, { module: l, moduleOptions: a, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
|
|
2155
2164
|
id: t
|
|
2156
|
-
}), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i,
|
|
2165
|
+
}), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, g = await l.get(p, d, o, m), _ = await this.hooks.lifecycle.onLoad.emit({
|
|
2157
2166
|
id: p,
|
|
2158
2167
|
pkgNameOrAlias: c,
|
|
2159
2168
|
expose: d,
|
|
2160
|
-
exposeModule: s ?
|
|
2161
|
-
exposeModuleFactory: s ? void 0 :
|
|
2169
|
+
exposeModule: s ? g : void 0,
|
|
2170
|
+
exposeModuleFactory: s ? void 0 : g,
|
|
2162
2171
|
remote: u,
|
|
2163
2172
|
options: a,
|
|
2164
2173
|
moduleInstance: l,
|
|
2165
2174
|
origin: n
|
|
2166
2175
|
});
|
|
2167
|
-
return this.setIdToRemoteMap(t, i), typeof _ == "function" ? _ :
|
|
2176
|
+
return this.setIdToRemoteMap(t, i), typeof _ == "function" ? _ : g;
|
|
2168
2177
|
} catch (s) {
|
|
2169
|
-
const { from: l = "runtime" } =
|
|
2178
|
+
const { from: l = "runtime" } = o || {
|
|
2170
2179
|
from: "runtime"
|
|
2171
2180
|
}, a = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2172
2181
|
id: t,
|
|
@@ -2182,81 +2191,81 @@ class RemoteHandler {
|
|
|
2182
2191
|
}
|
|
2183
2192
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2184
2193
|
async preloadRemote(t) {
|
|
2185
|
-
const { host:
|
|
2194
|
+
const { host: o } = this;
|
|
2186
2195
|
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
2187
2196
|
preloadOps: t,
|
|
2188
|
-
options:
|
|
2189
|
-
origin:
|
|
2197
|
+
options: o.options,
|
|
2198
|
+
origin: o
|
|
2190
2199
|
});
|
|
2191
|
-
const n = formatPreloadArgs(
|
|
2200
|
+
const n = formatPreloadArgs(o.options.remotes, t);
|
|
2192
2201
|
await Promise.all(n.map(async (s) => {
|
|
2193
|
-
const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await
|
|
2194
|
-
origin:
|
|
2202
|
+
const { remote: l } = s, a = getRemoteInfo(l), { globalSnapshot: i, remoteSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo(l), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2203
|
+
origin: o,
|
|
2195
2204
|
preloadOptions: s,
|
|
2196
2205
|
remote: l,
|
|
2197
2206
|
remoteInfo: a,
|
|
2198
2207
|
globalSnapshot: i,
|
|
2199
2208
|
remoteSnapshot: c
|
|
2200
2209
|
});
|
|
2201
|
-
u && preloadAssets(a,
|
|
2210
|
+
u && preloadAssets(a, o, u);
|
|
2202
2211
|
}));
|
|
2203
2212
|
}
|
|
2204
|
-
registerRemotes(t,
|
|
2213
|
+
registerRemotes(t, o) {
|
|
2205
2214
|
const { host: n } = this;
|
|
2206
2215
|
t.forEach((s) => {
|
|
2207
2216
|
this.registerRemote(s, n.options.remotes, {
|
|
2208
|
-
force:
|
|
2217
|
+
force: o == null ? void 0 : o.force
|
|
2209
2218
|
});
|
|
2210
2219
|
});
|
|
2211
2220
|
}
|
|
2212
2221
|
async getRemoteModuleAndOptions(t) {
|
|
2213
|
-
const { host:
|
|
2222
|
+
const { host: o } = this, { id: n } = t;
|
|
2214
2223
|
let s;
|
|
2215
2224
|
try {
|
|
2216
2225
|
s = await this.hooks.lifecycle.beforeRequest.emit({
|
|
2217
2226
|
id: n,
|
|
2218
|
-
options:
|
|
2219
|
-
origin:
|
|
2227
|
+
options: o.options,
|
|
2228
|
+
origin: o
|
|
2220
2229
|
});
|
|
2221
2230
|
} catch (_) {
|
|
2222
2231
|
if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2223
2232
|
id: n,
|
|
2224
|
-
options:
|
|
2225
|
-
origin:
|
|
2233
|
+
options: o.options,
|
|
2234
|
+
origin: o,
|
|
2226
2235
|
from: "runtime",
|
|
2227
2236
|
error: _,
|
|
2228
2237
|
lifecycle: "beforeRequest"
|
|
2229
2238
|
}), !s)
|
|
2230
2239
|
throw _;
|
|
2231
2240
|
}
|
|
2232
|
-
const { id: l } = s, a = matchRemoteWithNameAndExpose(
|
|
2241
|
+
const { id: l } = s, a = matchRemoteWithNameAndExpose(o.options.remotes, l);
|
|
2233
2242
|
assert(a, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
|
|
2234
|
-
hostName:
|
|
2243
|
+
hostName: o.options.name,
|
|
2235
2244
|
requestId: l
|
|
2236
2245
|
}));
|
|
2237
|
-
const { remote: i } = a, c = getRemoteInfo(i), u = await
|
|
2246
|
+
const { remote: i } = a, c = getRemoteInfo(i), u = await o.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
|
|
2238
2247
|
id: l
|
|
2239
2248
|
}, a, {
|
|
2240
|
-
options:
|
|
2241
|
-
origin:
|
|
2249
|
+
options: o.options,
|
|
2250
|
+
origin: o,
|
|
2242
2251
|
remoteInfo: c
|
|
2243
2252
|
})), { remote: d, expose: p } = u;
|
|
2244
2253
|
assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);
|
|
2245
|
-
let m =
|
|
2246
|
-
const
|
|
2247
|
-
host:
|
|
2254
|
+
let m = o.moduleCache.get(d.name);
|
|
2255
|
+
const g = {
|
|
2256
|
+
host: o,
|
|
2248
2257
|
remoteInfo: c
|
|
2249
2258
|
};
|
|
2250
|
-
return m || (m = new Module(
|
|
2259
|
+
return m || (m = new Module(g), o.moduleCache.set(d.name, m)), {
|
|
2251
2260
|
module: m,
|
|
2252
|
-
moduleOptions:
|
|
2261
|
+
moduleOptions: g,
|
|
2253
2262
|
remoteMatchInfo: u
|
|
2254
2263
|
};
|
|
2255
2264
|
}
|
|
2256
|
-
registerRemote(t,
|
|
2265
|
+
registerRemote(t, o, n) {
|
|
2257
2266
|
const { host: s } = this, l = () => {
|
|
2258
2267
|
if (t.alias) {
|
|
2259
|
-
const i =
|
|
2268
|
+
const i = o.find((c) => {
|
|
2260
2269
|
var u;
|
|
2261
2270
|
return t.alias && (c.name.startsWith(t.alias) || ((u = c.alias) == null ? void 0 : u.startsWith(t.alias)));
|
|
2262
2271
|
});
|
|
@@ -2268,9 +2277,9 @@ class RemoteHandler {
|
|
|
2268
2277
|
remote: t,
|
|
2269
2278
|
origin: s
|
|
2270
2279
|
});
|
|
2271
|
-
const a =
|
|
2280
|
+
const a = o.find((i) => i.name === t.name);
|
|
2272
2281
|
if (!a)
|
|
2273
|
-
l(),
|
|
2282
|
+
l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
|
|
2274
2283
|
remote: t,
|
|
2275
2284
|
origin: s
|
|
2276
2285
|
});
|
|
@@ -2279,7 +2288,7 @@ class RemoteHandler {
|
|
|
2279
2288
|
`The remote "${t.name}" is already registered.`,
|
|
2280
2289
|
n != null && n.force ? "Hope you have known that OVERRIDE it may have some unexpected errors" : 'If you want to merge the remote, you can set "force: true".'
|
|
2281
2290
|
];
|
|
2282
|
-
n != null && n.force && (this.removeRemote(a), l(),
|
|
2291
|
+
n != null && n.force && (this.removeRemote(a), l(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
|
|
2283
2292
|
remote: t,
|
|
2284
2293
|
origin: s
|
|
2285
2294
|
})), warn$1(i.join(" "));
|
|
@@ -2293,50 +2302,50 @@ class RemoteHandler {
|
|
|
2293
2302
|
if (a) {
|
|
2294
2303
|
const i = a.remoteInfo, c = i.entryGlobalName;
|
|
2295
2304
|
if (CurrentGlobal[c]) {
|
|
2296
|
-
var
|
|
2297
|
-
(
|
|
2305
|
+
var o;
|
|
2306
|
+
(o = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && o.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
|
|
2298
2307
|
}
|
|
2299
2308
|
const u = getRemoteEntryUniqueKey(a.remoteInfo);
|
|
2300
2309
|
globalLoading[u] && delete globalLoading[u], n.snapshotHandler.manifestCache.delete(i.entry);
|
|
2301
2310
|
let d = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
|
|
2302
|
-
const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((
|
|
2311
|
+
const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((g) => i.buildVersion ? g.options.id === d : g.name === d);
|
|
2303
2312
|
if (p !== -1) {
|
|
2304
|
-
const
|
|
2305
|
-
d =
|
|
2313
|
+
const g = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
|
|
2314
|
+
d = g.options.id || d;
|
|
2306
2315
|
const _ = getGlobalShareScope();
|
|
2307
2316
|
let R = !0;
|
|
2308
|
-
const
|
|
2317
|
+
const y = [];
|
|
2309
2318
|
Object.keys(_).forEach((E) => {
|
|
2310
|
-
const
|
|
2311
|
-
|
|
2312
|
-
const S = I
|
|
2319
|
+
const v = _[E];
|
|
2320
|
+
v && Object.keys(v).forEach((I) => {
|
|
2321
|
+
const S = v[I];
|
|
2313
2322
|
S && Object.keys(S).forEach((b) => {
|
|
2314
2323
|
const $ = S[b];
|
|
2315
2324
|
$ && Object.keys($).forEach((w) => {
|
|
2316
2325
|
const O = $[w];
|
|
2317
|
-
O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? R = !1 :
|
|
2326
|
+
O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? R = !1 : y.push([
|
|
2318
2327
|
E,
|
|
2319
|
-
|
|
2328
|
+
I,
|
|
2320
2329
|
b,
|
|
2321
2330
|
w
|
|
2322
|
-
])) :
|
|
2331
|
+
])) : y.push([
|
|
2323
2332
|
E,
|
|
2324
|
-
|
|
2333
|
+
I,
|
|
2325
2334
|
b,
|
|
2326
2335
|
w
|
|
2327
2336
|
]));
|
|
2328
2337
|
});
|
|
2329
2338
|
});
|
|
2330
2339
|
});
|
|
2331
|
-
}), R && (
|
|
2340
|
+
}), R && (g.shareScopeMap = {}, delete _[d]), y.forEach(([E, v, I, S]) => {
|
|
2332
2341
|
var b, $, w;
|
|
2333
|
-
(w = _[E]) == null || ($ = w[
|
|
2342
|
+
(w = _[E]) == null || ($ = w[v]) == null || (b = $[I]) == null || delete b[S];
|
|
2334
2343
|
}), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
|
|
2335
2344
|
}
|
|
2336
2345
|
const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, n);
|
|
2337
2346
|
if (m) {
|
|
2338
|
-
const
|
|
2339
|
-
|
|
2347
|
+
const g = m && "remotesInfo" in m && m.remotesInfo && getInfoWithoutType(m.remotesInfo, t.name).key;
|
|
2348
|
+
g && (delete m.remotesInfo[g], Global.__FEDERATION__.__MANIFEST_LOADING__[g] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[g]);
|
|
2340
2349
|
}
|
|
2341
2350
|
n.moduleCache.delete(t.name);
|
|
2342
2351
|
}
|
|
@@ -2363,26 +2372,26 @@ class RemoteHandler {
|
|
|
2363
2372
|
class FederationHost {
|
|
2364
2373
|
initOptions(t) {
|
|
2365
2374
|
this.registerPlugins(t.plugins);
|
|
2366
|
-
const
|
|
2367
|
-
return this.options =
|
|
2375
|
+
const o = this.formatOptions(this.options, t);
|
|
2376
|
+
return this.options = o, o;
|
|
2368
2377
|
}
|
|
2369
|
-
async loadShare(t,
|
|
2370
|
-
return this.sharedHandler.loadShare(t,
|
|
2378
|
+
async loadShare(t, o) {
|
|
2379
|
+
return this.sharedHandler.loadShare(t, o);
|
|
2371
2380
|
}
|
|
2372
2381
|
// The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
|
|
2373
2382
|
// 1. If the loaded shared already exists globally, then it will be reused
|
|
2374
2383
|
// 2. If lib exists in local shared, it will be used directly
|
|
2375
2384
|
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
2376
|
-
loadShareSync(t,
|
|
2377
|
-
return this.sharedHandler.loadShareSync(t,
|
|
2385
|
+
loadShareSync(t, o) {
|
|
2386
|
+
return this.sharedHandler.loadShareSync(t, o);
|
|
2378
2387
|
}
|
|
2379
|
-
initializeSharing(t = DEFAULT_SCOPE,
|
|
2380
|
-
return this.sharedHandler.initializeSharing(t,
|
|
2388
|
+
initializeSharing(t = DEFAULT_SCOPE, o) {
|
|
2389
|
+
return this.sharedHandler.initializeSharing(t, o);
|
|
2381
2390
|
}
|
|
2382
|
-
initRawContainer(t,
|
|
2391
|
+
initRawContainer(t, o, n) {
|
|
2383
2392
|
const s = getRemoteInfo({
|
|
2384
2393
|
name: t,
|
|
2385
|
-
entry:
|
|
2394
|
+
entry: o
|
|
2386
2395
|
}), l = new Module({
|
|
2387
2396
|
host: this,
|
|
2388
2397
|
remoteInfo: s
|
|
@@ -2391,20 +2400,20 @@ class FederationHost {
|
|
|
2391
2400
|
}
|
|
2392
2401
|
// eslint-disable-next-line max-lines-per-function
|
|
2393
2402
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2394
|
-
async loadRemote(t,
|
|
2395
|
-
return this.remoteHandler.loadRemote(t,
|
|
2403
|
+
async loadRemote(t, o) {
|
|
2404
|
+
return this.remoteHandler.loadRemote(t, o);
|
|
2396
2405
|
}
|
|
2397
2406
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2398
2407
|
async preloadRemote(t) {
|
|
2399
2408
|
return this.remoteHandler.preloadRemote(t);
|
|
2400
2409
|
}
|
|
2401
|
-
initShareScopeMap(t,
|
|
2402
|
-
this.sharedHandler.initShareScopeMap(t,
|
|
2410
|
+
initShareScopeMap(t, o, n = {}) {
|
|
2411
|
+
this.sharedHandler.initShareScopeMap(t, o, n);
|
|
2403
2412
|
}
|
|
2404
|
-
formatOptions(t,
|
|
2405
|
-
const { shared: n } = formatShareConfigs(t,
|
|
2413
|
+
formatOptions(t, o) {
|
|
2414
|
+
const { shared: n } = formatShareConfigs(t, o), { userOptions: s, options: l } = this.hooks.lifecycle.beforeInit.emit({
|
|
2406
2415
|
origin: this,
|
|
2407
|
-
userOptions:
|
|
2416
|
+
userOptions: o,
|
|
2408
2417
|
options: t,
|
|
2409
2418
|
shareInfo: n
|
|
2410
2419
|
}), a = this.remoteHandler.formatAndRegisterRemote(l, s), { shared: i } = this.sharedHandler.registerShared(l, s), c = [
|
|
@@ -2413,7 +2422,7 @@ class FederationHost {
|
|
|
2413
2422
|
s.plugins && s.plugins.forEach((d) => {
|
|
2414
2423
|
c.includes(d) || c.push(d);
|
|
2415
2424
|
});
|
|
2416
|
-
const u = _extends$1({}, t,
|
|
2425
|
+
const u = _extends$1({}, t, o, {
|
|
2417
2426
|
plugins: c,
|
|
2418
2427
|
remotes: a,
|
|
2419
2428
|
shared: i
|
|
@@ -2424,7 +2433,7 @@ class FederationHost {
|
|
|
2424
2433
|
}), u;
|
|
2425
2434
|
}
|
|
2426
2435
|
registerPlugins(t) {
|
|
2427
|
-
const
|
|
2436
|
+
const o = registerPlugins$1(t, [
|
|
2428
2437
|
this.hooks,
|
|
2429
2438
|
this.remoteHandler.hooks,
|
|
2430
2439
|
this.sharedHandler.hooks,
|
|
@@ -2432,10 +2441,10 @@ class FederationHost {
|
|
|
2432
2441
|
this.loaderHook,
|
|
2433
2442
|
this.bridgeHook
|
|
2434
2443
|
]);
|
|
2435
|
-
this.options.plugins = this.options.plugins.reduce((n, s) => (s && n && !n.find((l) => l.name === s.name) && n.push(s), n),
|
|
2444
|
+
this.options.plugins = this.options.plugins.reduce((n, s) => (s && n && !n.find((l) => l.name === s.name) && n.push(s), n), o || []);
|
|
2436
2445
|
}
|
|
2437
|
-
registerRemotes(t,
|
|
2438
|
-
return this.remoteHandler.registerRemotes(t,
|
|
2446
|
+
registerRemotes(t, o) {
|
|
2447
|
+
return this.remoteHandler.registerRemotes(t, o);
|
|
2439
2448
|
}
|
|
2440
2449
|
constructor(t) {
|
|
2441
2450
|
this.hooks = new PluginSystem({
|
|
@@ -2459,7 +2468,7 @@ class FederationHost {
|
|
|
2459
2468
|
beforeBridgeDestroy: new SyncHook(),
|
|
2460
2469
|
afterBridgeDestroy: new SyncHook()
|
|
2461
2470
|
});
|
|
2462
|
-
const
|
|
2471
|
+
const o = {
|
|
2463
2472
|
id: getBuilderId(),
|
|
2464
2473
|
name: t.name,
|
|
2465
2474
|
plugins: [
|
|
@@ -2470,47 +2479,47 @@ class FederationHost {
|
|
|
2470
2479
|
shared: {},
|
|
2471
2480
|
inBrowser: isBrowserEnv()
|
|
2472
2481
|
};
|
|
2473
|
-
this.name = t.name, this.options =
|
|
2474
|
-
...
|
|
2482
|
+
this.name = t.name, this.options = o, this.snapshotHandler = new SnapshotHandler(this), this.sharedHandler = new SharedHandler(this), this.remoteHandler = new RemoteHandler(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([
|
|
2483
|
+
...o.plugins,
|
|
2475
2484
|
...t.plugins || []
|
|
2476
|
-
]), this.options = this.formatOptions(
|
|
2485
|
+
]), this.options = this.formatOptions(o, t);
|
|
2477
2486
|
}
|
|
2478
2487
|
}
|
|
2479
2488
|
setGlobalFederationConstructor(FederationHost);
|
|
2480
|
-
function createBridgeComponent(
|
|
2489
|
+
function createBridgeComponent(r) {
|
|
2481
2490
|
const t = /* @__PURE__ */ new Map();
|
|
2482
2491
|
return () => ({
|
|
2483
2492
|
__APP_VERSION__: "0.8.2",
|
|
2484
|
-
render(
|
|
2485
|
-
LoggerInstance.log("createBridgeComponent render Info",
|
|
2486
|
-
const n = Vue.createApp(
|
|
2487
|
-
t.set(
|
|
2488
|
-
const s = {}, l = s && typeof s == "object" && (s != null && s.extraProps) ? s == null ? void 0 : s.extraProps : {}, a =
|
|
2489
|
-
basename:
|
|
2490
|
-
memoryRoute:
|
|
2493
|
+
render(o) {
|
|
2494
|
+
LoggerInstance.log("createBridgeComponent render Info", o);
|
|
2495
|
+
const n = Vue.createApp(r.rootComponent);
|
|
2496
|
+
t.set(o.dom, n);
|
|
2497
|
+
const s = {}, l = s && typeof s == "object" && (s != null && s.extraProps) ? s == null ? void 0 : s.extraProps : {}, a = r.appOptions({
|
|
2498
|
+
basename: o.basename,
|
|
2499
|
+
memoryRoute: o.memoryRoute,
|
|
2491
2500
|
...l
|
|
2492
|
-
}), i =
|
|
2501
|
+
}), i = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), c = VueRouter.createRouter({
|
|
2493
2502
|
...a.router.options,
|
|
2494
2503
|
history: i,
|
|
2495
2504
|
routes: a.router.getRoutes()
|
|
2496
2505
|
});
|
|
2497
2506
|
LoggerInstance.log("createBridgeComponent render router info>>>", {
|
|
2498
|
-
name:
|
|
2507
|
+
name: o.moduleName,
|
|
2499
2508
|
router: c
|
|
2500
|
-
}),
|
|
2501
|
-
n.use(c), n.mount(
|
|
2502
|
-
}) : (n.use(c), n.mount(
|
|
2509
|
+
}), o.memoryRoute ? c.push(o.memoryRoute.entryPath).then(() => {
|
|
2510
|
+
n.use(c), n.mount(o.dom);
|
|
2511
|
+
}) : (n.use(c), n.mount(o.dom));
|
|
2503
2512
|
},
|
|
2504
|
-
destroy(
|
|
2505
|
-
LoggerInstance.log("createBridgeComponent destroy Info",
|
|
2506
|
-
const n = t.get(
|
|
2513
|
+
destroy(o) {
|
|
2514
|
+
LoggerInstance.log("createBridgeComponent destroy Info", o);
|
|
2515
|
+
const n = t.get(o == null ? void 0 : o.dom);
|
|
2507
2516
|
n == null || n.unmount();
|
|
2508
2517
|
}
|
|
2509
2518
|
});
|
|
2510
2519
|
}
|
|
2511
2520
|
function e() {
|
|
2512
|
-
const
|
|
2513
|
-
window.dispatchEvent(
|
|
2521
|
+
const r = new PopStateEvent("popstate", { state: window.history.state });
|
|
2522
|
+
window.dispatchEvent(r);
|
|
2514
2523
|
}
|
|
2515
2524
|
const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
2516
2525
|
name: "RemoteApp",
|
|
@@ -2520,16 +2529,16 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
|
2520
2529
|
memoryRoute: Object,
|
|
2521
2530
|
providerInfo: Function
|
|
2522
2531
|
},
|
|
2523
|
-
setup(
|
|
2524
|
-
const t = ref(null),
|
|
2532
|
+
setup(r) {
|
|
2533
|
+
const t = ref(null), o = ref(null), n = ref(""), s = useRoute(), l = () => {
|
|
2525
2534
|
var d;
|
|
2526
|
-
const i = (d =
|
|
2527
|
-
|
|
2535
|
+
const i = (d = r.providerInfo) == null ? void 0 : d.call(r);
|
|
2536
|
+
o.value = i;
|
|
2528
2537
|
let c = {
|
|
2529
|
-
name:
|
|
2538
|
+
name: r.moduleName,
|
|
2530
2539
|
dom: t.value,
|
|
2531
|
-
basename:
|
|
2532
|
-
memoryRoute:
|
|
2540
|
+
basename: r.basename,
|
|
2541
|
+
memoryRoute: r.memoryRoute
|
|
2533
2542
|
};
|
|
2534
2543
|
LoggerInstance.log("createRemoteComponent LazyComponent render >>>", c), c = {
|
|
2535
2544
|
...c,
|
|
@@ -2537,7 +2546,7 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
|
2537
2546
|
}, i.render(c);
|
|
2538
2547
|
}, a = watch(() => s.path, (i) => {
|
|
2539
2548
|
i !== s.path && l(), n.value !== "" && n.value !== i && (LoggerInstance.log("createRemoteComponent dispatchPopstateEnv >>>", {
|
|
2540
|
-
...
|
|
2549
|
+
...r,
|
|
2541
2550
|
pathname: s.path
|
|
2542
2551
|
}), e()), n.value = i;
|
|
2543
2552
|
});
|
|
@@ -2546,8 +2555,8 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
|
2546
2555
|
}), onBeforeUnmount(() => {
|
|
2547
2556
|
var i;
|
|
2548
2557
|
LoggerInstance.log("createRemoteComponent LazyComponent destroy >>>", {
|
|
2549
|
-
...
|
|
2550
|
-
}), a(), (i =
|
|
2558
|
+
...r
|
|
2559
|
+
}), a(), (i = o.value) == null || i.destroy({
|
|
2551
2560
|
dom: t.value
|
|
2552
2561
|
});
|
|
2553
2562
|
}), () => createVNode("div", {
|
|
@@ -2555,33 +2564,33 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
|
2555
2564
|
}, null);
|
|
2556
2565
|
}
|
|
2557
2566
|
});
|
|
2558
|
-
function createRemoteComponent(
|
|
2567
|
+
function createRemoteComponent(r) {
|
|
2559
2568
|
return defineAsyncComponent({
|
|
2560
2569
|
__APP_VERSION__: "0.8.2",
|
|
2561
|
-
...
|
|
2570
|
+
...r.asyncComponentOptions,
|
|
2562
2571
|
//@ts-ignore
|
|
2563
2572
|
loader: async () => {
|
|
2564
2573
|
var c;
|
|
2565
2574
|
const t = useRoute();
|
|
2566
|
-
let
|
|
2575
|
+
let o = "/";
|
|
2567
2576
|
const n = (c = t.matched[0]) == null ? void 0 : c.path;
|
|
2568
|
-
n && (n.endsWith("/:pathMatch(.*)*") ?
|
|
2569
|
-
const s = (
|
|
2577
|
+
n && (n.endsWith("/:pathMatch(.*)*") ? o = n.replace("/:pathMatch(.*)*", "") : o = t.matched[0].path);
|
|
2578
|
+
const s = (r == null ? void 0 : r.export) || "default";
|
|
2570
2579
|
LoggerInstance.log("createRemoteComponent LazyComponent create >>>", {
|
|
2571
|
-
basename:
|
|
2572
|
-
info:
|
|
2580
|
+
basename: o,
|
|
2581
|
+
info: r
|
|
2573
2582
|
});
|
|
2574
|
-
const l = await
|
|
2583
|
+
const l = await r.loader(), a = l && l[Symbol.for("mf_module_id")], i = l[s];
|
|
2575
2584
|
if (LoggerInstance.log(
|
|
2576
2585
|
"createRemoteComponent LazyComponent loadRemote info >>>",
|
|
2577
|
-
{ name: a, module: l, exportName: s, basename:
|
|
2586
|
+
{ name: a, module: l, exportName: s, basename: o, route: t }
|
|
2578
2587
|
), s in l && typeof i == "function")
|
|
2579
2588
|
return {
|
|
2580
2589
|
render() {
|
|
2581
2590
|
return h(RemoteApp, {
|
|
2582
2591
|
moduleName: a,
|
|
2583
2592
|
providerInfo: i,
|
|
2584
|
-
basename:
|
|
2593
|
+
basename: o
|
|
2585
2594
|
});
|
|
2586
2595
|
}
|
|
2587
2596
|
};
|