@module-federation/bridge-vue3 2.8.1 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +533 -509
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defineComponent as Yt, ref as V, useAttrs as Qt, watch as er, onMounted
|
|
|
3
3
|
import * as de from "vue-router";
|
|
4
4
|
import { useRoute as rt } from "vue-router";
|
|
5
5
|
const ur = ".json", fr = "FEDERATION_DEBUG", hr = ":";
|
|
6
|
-
let
|
|
6
|
+
let Ae = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e[e.UNKNOWN = 1] = "UNKNOWN", e[e.CALCULATED = 2] = "CALCULATED", e[e.NO_USE = 0] = "NO_USE", e;
|
|
8
8
|
}({});
|
|
9
9
|
const G = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
@@ -21,13 +21,13 @@ function dr() {
|
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Me() {
|
|
25
25
|
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : dr();
|
|
26
26
|
}
|
|
27
27
|
const mr = "[ Federation Runtime ]", st = function(...e) {
|
|
28
28
|
return e.length ? e.reduce((t, r) => r ? t ? `${t}${hr}${r}` : r : t, "") : "";
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function Pe(e, t) {
|
|
31
31
|
if ("getPublicPath" in e) {
|
|
32
32
|
let r;
|
|
33
33
|
return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
|
|
@@ -43,7 +43,7 @@ function at(e) {
|
|
|
43
43
|
return "";
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const Ie = (e, t) => {
|
|
47
47
|
if (!e) return t;
|
|
48
48
|
const o = ((n) => {
|
|
49
49
|
if (n === ".") return "";
|
|
@@ -63,13 +63,13 @@ function yr(e, t = {}) {
|
|
|
63
63
|
var R;
|
|
64
64
|
const { remotes: r = {}, overrides: o = {}, version: n } = t;
|
|
65
65
|
let s;
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
Object.keys(r).length || (
|
|
69
|
-
let
|
|
66
|
+
const a = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ? pr(n) : e.metaData.publicPath : e.metaData.getPublicPath, c = Object.keys(o);
|
|
67
|
+
let i = {};
|
|
68
|
+
Object.keys(r).length || (i = ((R = e.remotes) == null ? void 0 : R.reduce((g, _) => {
|
|
69
|
+
let S;
|
|
70
70
|
const I = _.federationContainerName;
|
|
71
|
-
return c.includes(I) ?
|
|
72
|
-
}, {})) || {}), Object.keys(r).forEach((g) =>
|
|
71
|
+
return c.includes(I) ? S = o[I] : "version" in _ ? S = _.version : S = _.entry, g[I] = { matchedVersion: S }, g;
|
|
72
|
+
}, {})) || {}), Object.keys(r).forEach((g) => i[g] = { matchedVersion: c.includes(g) ? o[g] : r[g] });
|
|
73
73
|
const { remoteEntry: { path: l, name: u, type: f }, types: m = {
|
|
74
74
|
path: "",
|
|
75
75
|
name: "",
|
|
@@ -80,12 +80,12 @@ function yr(e, t = {}) {
|
|
|
80
80
|
version: n || "",
|
|
81
81
|
buildVersion: h,
|
|
82
82
|
globalName: d,
|
|
83
|
-
remoteEntry:
|
|
83
|
+
remoteEntry: Ie(l, u),
|
|
84
84
|
remoteEntryType: f,
|
|
85
|
-
remoteTypes:
|
|
85
|
+
remoteTypes: Ie(m.path, m.name),
|
|
86
86
|
remoteTypesZip: m.zip || "",
|
|
87
87
|
remoteTypesAPI: m.api || "",
|
|
88
|
-
remotesInfo:
|
|
88
|
+
remotesInfo: i,
|
|
89
89
|
shared: e == null ? void 0 : e.shared.map((g) => ({
|
|
90
90
|
assets: g.assets,
|
|
91
91
|
sharedName: g.name,
|
|
@@ -100,12 +100,12 @@ function yr(e, t = {}) {
|
|
|
100
100
|
};
|
|
101
101
|
if ("publicPath" in e.metaData ? (s = {
|
|
102
102
|
...y,
|
|
103
|
-
publicPath:
|
|
103
|
+
publicPath: a()
|
|
104
104
|
}, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
|
|
105
105
|
...y,
|
|
106
|
-
getPublicPath:
|
|
106
|
+
getPublicPath: a()
|
|
107
107
|
}, p) {
|
|
108
|
-
const g =
|
|
108
|
+
const g = Ie(p.path, p.name);
|
|
109
109
|
s.ssrRemoteEntry = g, s.ssrRemoteEntryType = p.type || "commonjs-module";
|
|
110
110
|
}
|
|
111
111
|
return s;
|
|
@@ -148,7 +148,7 @@ var lt = class {
|
|
|
148
148
|
this.delegate = e ?? Q;
|
|
149
149
|
}
|
|
150
150
|
emit(e, t) {
|
|
151
|
-
const r = this.delegate, o =
|
|
151
|
+
const r = this.delegate, o = Me() ? Rr() : void 0, n = o ? [...t, o] : t, s = (() => {
|
|
152
152
|
switch (e) {
|
|
153
153
|
case "log":
|
|
154
154
|
return ["log", "info"];
|
|
@@ -170,15 +170,15 @@ var lt = class {
|
|
|
170
170
|
return ["debug", "log"];
|
|
171
171
|
}
|
|
172
172
|
})();
|
|
173
|
-
for (const
|
|
174
|
-
const c = r[
|
|
173
|
+
for (const a of s) {
|
|
174
|
+
const c = r[a];
|
|
175
175
|
if (typeof c == "function") {
|
|
176
176
|
c.call(r, this.prefix, ...n);
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
for (const
|
|
181
|
-
const c = Q[
|
|
180
|
+
for (const a of s) {
|
|
181
|
+
const c = Q[a];
|
|
182
182
|
if (typeof c == "function") {
|
|
183
183
|
c.call(Q, this.prefix, ...n);
|
|
184
184
|
return;
|
|
@@ -204,7 +204,7 @@ var lt = class {
|
|
|
204
204
|
this.emit("info", e);
|
|
205
205
|
}
|
|
206
206
|
debug(...e) {
|
|
207
|
-
|
|
207
|
+
Me() && this.emit("debug", e);
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
210
|
function ut(e) {
|
|
@@ -227,7 +227,7 @@ async function ft(e, t) {
|
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function ke(e, t) {
|
|
231
231
|
const r = /^(https?:)?\/\//i;
|
|
232
232
|
return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
|
|
233
233
|
}
|
|
@@ -236,7 +236,7 @@ function ht(e) {
|
|
|
236
236
|
const s = document.getElementsByTagName("script");
|
|
237
237
|
for (let l = 0; l < s.length; l++) {
|
|
238
238
|
const u = s[l], f = u.getAttribute("src");
|
|
239
|
-
if (f &&
|
|
239
|
+
if (f && ke(f, e.url)) {
|
|
240
240
|
t = u, r = !1;
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
@@ -249,21 +249,21 @@ function ht(e) {
|
|
|
249
249
|
t && (f === "async" || f === "defer" ? t[f] = l[f] : t.getAttribute(f) || t.setAttribute(f, l[f]));
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
let
|
|
252
|
+
let a = null;
|
|
253
253
|
const c = typeof window < "u" ? (l) => {
|
|
254
|
-
if (l.filename &&
|
|
254
|
+
if (l.filename && ke(l.filename, e.url)) {
|
|
255
255
|
const u = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${l.message} (${l.filename}:${l.lineno}:${l.colno})`);
|
|
256
|
-
u.name = "ScriptExecutionError",
|
|
256
|
+
u.name = "ScriptExecutionError", a = u;
|
|
257
257
|
}
|
|
258
258
|
} : null;
|
|
259
259
|
c && window.addEventListener("error", c);
|
|
260
|
-
const
|
|
260
|
+
const i = async (l, u) => {
|
|
261
261
|
clearTimeout(n), c && window.removeEventListener("error", c);
|
|
262
262
|
const f = () => {
|
|
263
263
|
if ((u == null ? void 0 : u.type) === "error") {
|
|
264
264
|
const m = /* @__PURE__ */ new Error(u != null && u.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
|
|
265
265
|
m.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(m));
|
|
266
|
-
} else
|
|
266
|
+
} else a ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(a)) : e != null && e.cb && (e == null || e.cb());
|
|
267
267
|
};
|
|
268
268
|
if (t && (t.onerror = null, t.onload = null, ft(() => {
|
|
269
269
|
const { needDeleteScript: m = !0 } = e;
|
|
@@ -278,8 +278,8 @@ function ht(e) {
|
|
|
278
278
|
}
|
|
279
279
|
f();
|
|
280
280
|
};
|
|
281
|
-
return t.onerror =
|
|
282
|
-
|
|
281
|
+
return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), n = setTimeout(() => {
|
|
282
|
+
i(null, {
|
|
283
283
|
type: "error",
|
|
284
284
|
isTimeout: !0
|
|
285
285
|
});
|
|
@@ -288,21 +288,21 @@ function ht(e) {
|
|
|
288
288
|
needAttach: r
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function Sr(e) {
|
|
292
292
|
let t = null, r = !0, o = 2e4, n;
|
|
293
293
|
const s = document.getElementsByTagName("link");
|
|
294
294
|
for (let c = 0; c < s.length; c++) {
|
|
295
|
-
const
|
|
296
|
-
if (l &&
|
|
297
|
-
t =
|
|
295
|
+
const i = s[c], l = i.getAttribute("href"), u = i.getAttribute("rel");
|
|
296
|
+
if (l && ke(l, e.url) && u === e.attrs.rel) {
|
|
297
|
+
t = i, r = !1;
|
|
298
298
|
break;
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
if (!t) {
|
|
302
302
|
t = document.createElement("link"), t.setAttribute("href", e.url);
|
|
303
|
-
let c,
|
|
303
|
+
let c, i = !0;
|
|
304
304
|
const l = e.attrs;
|
|
305
|
-
e.createLinkHook && (c = e.createLinkHook(e.url, l), c instanceof HTMLLinkElement ? (t = c,
|
|
305
|
+
e.createLinkHook && (c = e.createLinkHook(e.url, l), c instanceof HTMLLinkElement ? (t = c, i = !1) : typeof c == "object" && ("link" in c && c.link && (t = c.link, i = !1), "timeout" in c && c.timeout && (o = c.timeout))), l && i && Object.keys(l).forEach((u) => {
|
|
306
306
|
t && !t.getAttribute(u) && t.setAttribute(u, l[u]);
|
|
307
307
|
});
|
|
308
308
|
}
|
|
@@ -313,11 +313,11 @@ function br(e) {
|
|
|
313
313
|
link: t,
|
|
314
314
|
needAttach: r
|
|
315
315
|
};
|
|
316
|
-
const
|
|
316
|
+
const a = (c, i) => {
|
|
317
317
|
n && clearTimeout(n);
|
|
318
318
|
const l = () => {
|
|
319
|
-
if ((
|
|
320
|
-
const u = /* @__PURE__ */ new Error(
|
|
319
|
+
if ((i == null ? void 0 : i.type) === "error") {
|
|
320
|
+
const u = /* @__PURE__ */ new Error(i != null && i.isTimeout ? `LinkNetworkError: Link "${e.url}" timed out.` : `LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);
|
|
321
321
|
u.name = "LinkNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
|
|
322
322
|
} else e != null && e.cb && (e == null || e.cb());
|
|
323
323
|
};
|
|
@@ -325,13 +325,13 @@ function br(e) {
|
|
|
325
325
|
const { needDeleteLink: u = !0 } = e;
|
|
326
326
|
u && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
327
327
|
}), c)) {
|
|
328
|
-
const u = c(
|
|
328
|
+
const u = c(i);
|
|
329
329
|
return l(), u;
|
|
330
330
|
}
|
|
331
331
|
l();
|
|
332
332
|
};
|
|
333
|
-
return t.onerror =
|
|
334
|
-
|
|
333
|
+
return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), n = setTimeout(() => {
|
|
334
|
+
a(null, {
|
|
335
335
|
type: "error",
|
|
336
336
|
isTimeout: !0
|
|
337
337
|
});
|
|
@@ -340,10 +340,10 @@ function br(e) {
|
|
|
340
340
|
needAttach: r
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function br(e, t) {
|
|
344
344
|
const { attrs: r = {}, createScriptHook: o } = t;
|
|
345
345
|
return new Promise((n, s) => {
|
|
346
|
-
const { script:
|
|
346
|
+
const { script: a, needAttach: c } = ht({
|
|
347
347
|
url: e,
|
|
348
348
|
cb: n,
|
|
349
349
|
onErrorCallback: s,
|
|
@@ -354,7 +354,7 @@ function Sr(e, t) {
|
|
|
354
354
|
createScriptHook: o,
|
|
355
355
|
needDeleteScript: !0
|
|
356
356
|
});
|
|
357
|
-
c && document.head.appendChild(
|
|
357
|
+
c && document.head.appendChild(a);
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
const ce = /* @__PURE__ */ new Map();
|
|
@@ -367,7 +367,7 @@ function x(e) {
|
|
|
367
367
|
return ce.set(e, t), t;
|
|
368
368
|
}
|
|
369
369
|
const wr = async (e, t, r) => {
|
|
370
|
-
const n = await ((s,
|
|
370
|
+
const n = await ((s, a) => r.lifecycle.fetch.emit(s, a))(e, t || {});
|
|
371
371
|
return !n || !(n instanceof Response) ? fetch(e, t || {}) : n;
|
|
372
372
|
}, Ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, o) => {
|
|
373
373
|
if (o != null && o.createScriptHook) {
|
|
@@ -381,19 +381,19 @@ const wr = async (e, t, r) => {
|
|
|
381
381
|
console.error("Error constructing URL:", c), t(/* @__PURE__ */ new Error(`Invalid URL: ${c}`));
|
|
382
382
|
return;
|
|
383
383
|
}
|
|
384
|
-
const s = async () => o != null && o.fetch ? (c,
|
|
384
|
+
const s = async () => o != null && o.fetch ? (c, i) => wr(c, i, o) : fetch, a = async (c, i) => {
|
|
385
385
|
var l;
|
|
386
386
|
try {
|
|
387
|
-
const f = await (await c(
|
|
387
|
+
const f = await (await c(i.href)).text(), [m, h] = await Promise.all([x("path"), x("vm")]), d = {
|
|
388
388
|
exports: {},
|
|
389
389
|
module: { exports: {} }
|
|
390
|
-
}, p =
|
|
390
|
+
}, p = i.pathname.split("/").slice(0, -1).join("/"), E = m.basename(i.pathname), y = new h.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
391
391
|
})`, {
|
|
392
392
|
filename: E,
|
|
393
393
|
importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? x
|
|
394
394
|
});
|
|
395
395
|
let R;
|
|
396
|
-
R = (await x("node:module")).createRequire(
|
|
396
|
+
R = (await x("node:module")).createRequire(i.protocol === "file:" || i.protocol === "node:" ? i.href : m.join(process.cwd(), "__mf_require_base__.js")), y.runInThisContext()(d.exports, d.module, R, p, E);
|
|
397
397
|
const g = d.module.exports || d.exports;
|
|
398
398
|
if (r && g && r.globalName) {
|
|
399
399
|
t(void 0, g[r.globalName] || g);
|
|
@@ -408,12 +408,12 @@ const wr = async (e, t, r) => {
|
|
|
408
408
|
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return pt(n.href, {
|
|
409
409
|
fetch: c,
|
|
410
410
|
vm: await x("vm")
|
|
411
|
-
}).then(async (
|
|
412
|
-
await
|
|
413
|
-
}).catch((
|
|
414
|
-
t(
|
|
411
|
+
}).then(async (i) => {
|
|
412
|
+
await i.evaluate(), t(void 0, i.namespace);
|
|
413
|
+
}).catch((i) => {
|
|
414
|
+
t(i instanceof Error ? i : /* @__PURE__ */ new Error(`Script execution error: ${i}`));
|
|
415
415
|
});
|
|
416
|
-
|
|
416
|
+
a(c, n);
|
|
417
417
|
}).catch((c) => {
|
|
418
418
|
t(c);
|
|
419
419
|
});
|
|
@@ -421,18 +421,18 @@ const wr = async (e, t, r) => {
|
|
|
421
421
|
t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
422
422
|
}, $r = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, o) => {
|
|
423
423
|
Ir(e, (n, s) => {
|
|
424
|
-
var
|
|
424
|
+
var a, c;
|
|
425
425
|
if (n) o(n);
|
|
426
426
|
else {
|
|
427
|
-
const
|
|
428
|
-
r(globalThis[
|
|
427
|
+
const i = ((a = t == null ? void 0 : t.attrs) == null ? void 0 : a.globalName) || `__FEDERATION_${(c = t == null ? void 0 : t.attrs) == null ? void 0 : c.name}:custom__`;
|
|
428
|
+
r(globalThis[i] = s);
|
|
429
429
|
}
|
|
430
430
|
}, t.attrs, t.loaderHook);
|
|
431
431
|
}) : (e, t) => {
|
|
432
432
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
433
433
|
}, Z = /* @__PURE__ */ new Map(), dt = (e) => e.startsWith("http:") || e.startsWith("https:"), mt = (e) => !e.startsWith("./") && !e.startsWith("../") && !e.startsWith("/") && !e.includes(":");
|
|
434
434
|
function Tr(e) {
|
|
435
|
-
const t = new URL(e), r = encodeURIComponent(t.protocol.slice(0, -1)), o = encodeURIComponent(t.host), n = t.pathname.split("/").map((
|
|
435
|
+
const t = new URL(e), r = encodeURIComponent(t.protocol.slice(0, -1)), o = encodeURIComponent(t.host), n = t.pathname.split("/").map((a) => encodeURIComponent(a)).join("/"), s = encodeURIComponent(`${t.search}${t.hash}`);
|
|
436
436
|
return `/${r}/${o}${n}${s ? `/${s}` : ""}`;
|
|
437
437
|
}
|
|
438
438
|
function vr(e, t) {
|
|
@@ -474,14 +474,14 @@ async function pt(e, t) {
|
|
|
474
474
|
if (Z.has(e)) return Z.get(e);
|
|
475
475
|
const { fetch: r, vm: o } = t;
|
|
476
476
|
if (!dt(e)) throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);
|
|
477
|
-
const n = await (await r(e)).text(), s = (await x("node:url")).pathToFileURL(process.cwd()).href,
|
|
477
|
+
const n = await (await r(e)).text(), s = (await x("node:url")).pathToFileURL(process.cwd()).href, a = new o.SourceTextModule(n, {
|
|
478
478
|
identifier: e,
|
|
479
479
|
initializeImportMeta: (c) => {
|
|
480
480
|
c.url = vr(e, s);
|
|
481
481
|
},
|
|
482
482
|
importModuleDynamically: async (c) => kr(await We(c, e, t))
|
|
483
483
|
});
|
|
484
|
-
return Z.set(e,
|
|
484
|
+
return Z.set(e, a), await a.link(async (c) => We(c, e, t)), a;
|
|
485
485
|
}
|
|
486
486
|
const C = ut("[ Module Federation Bridge Vue3 ]"), Or = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, yt = (e, t, r, o) => {
|
|
487
487
|
const n = [`${[t[e]]} #${e}`];
|
|
@@ -492,19 +492,19 @@ const C = ut("[ Module Federation Bridge Vue3 ]"), Or = (e) => `View the docs to
|
|
|
492
492
|
function Lr(e, t, r, o, n, s) {
|
|
493
493
|
return o(yt(e, t, r, n));
|
|
494
494
|
}
|
|
495
|
-
const U = "[ Federation Runtime ]",
|
|
495
|
+
const U = "[ Federation Runtime ]", Oe = ut(U);
|
|
496
496
|
function L(e, t, r, o, n) {
|
|
497
|
-
e ||
|
|
497
|
+
e || b(t);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
if (t !== void 0) return Lr(e, t, r ?? {}, (
|
|
501
|
-
throw new Error(`${U}: ${
|
|
499
|
+
function b(e, t, r, o, n) {
|
|
500
|
+
if (t !== void 0) return Lr(e, t, r ?? {}, (a) => {
|
|
501
|
+
throw new Error(`${U}: ${a}`);
|
|
502
502
|
}, o);
|
|
503
503
|
const s = e;
|
|
504
504
|
throw s instanceof Error ? (s.message.startsWith(U) || (s.message = `${U}: ${s.message}`), s) : new Error(`${U}: ${s}`);
|
|
505
505
|
}
|
|
506
506
|
function oe(e) {
|
|
507
|
-
e instanceof Error && (e.message.startsWith(U) || (e.message = `${U}: ${e.message}`)),
|
|
507
|
+
e instanceof Error && (e.message.startsWith(U) || (e.message = `${U}: ${e.message}`)), Oe.warn(e);
|
|
508
508
|
}
|
|
509
509
|
function Cr(e, t) {
|
|
510
510
|
return e.findIndex((r) => r === t) === -1 && e.push(t), e;
|
|
@@ -512,13 +512,13 @@ function Cr(e, t) {
|
|
|
512
512
|
function ne(e) {
|
|
513
513
|
return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Fe(e) {
|
|
516
516
|
return typeof e.entry < "u";
|
|
517
517
|
}
|
|
518
518
|
function Et(e) {
|
|
519
519
|
return !e.entry.includes(".json");
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function He(e) {
|
|
522
522
|
return e && typeof e == "object";
|
|
523
523
|
}
|
|
524
524
|
const Fr = Object.prototype.toString;
|
|
@@ -553,7 +553,7 @@ const Dr = (e, t) => {
|
|
|
553
553
|
} catch {
|
|
554
554
|
return v;
|
|
555
555
|
}
|
|
556
|
-
})(),
|
|
556
|
+
})(), Se = k;
|
|
557
557
|
function me(e, t, r) {
|
|
558
558
|
Object.defineProperty(e, t, {
|
|
559
559
|
value: r,
|
|
@@ -567,7 +567,7 @@ function pe(e, t) {
|
|
|
567
567
|
pe(v, "__GLOBAL_LOADING_REMOTE_ENTRY__") || me(v, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
568
568
|
const J = v.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
569
569
|
function _t(e) {
|
|
570
|
-
var t, r, o, n, s,
|
|
570
|
+
var t, r, o, n, s, a;
|
|
571
571
|
pe(e, "__VMOK__") && !pe(e, "__FEDERATION__") && me(e, "__FEDERATION__", e.__VMOK__), pe(e, "__FEDERATION__") || (me(e, "__FEDERATION__", {
|
|
572
572
|
__GLOBAL_PLUGIN__: [],
|
|
573
573
|
__INSTANCES__: [],
|
|
@@ -575,12 +575,12 @@ function _t(e) {
|
|
|
575
575
|
__SHARE__: {},
|
|
576
576
|
__MANIFEST_LOADING__: {},
|
|
577
577
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
578
|
-
}), me(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (o = e.__FEDERATION__).moduleInfo ?? (o.moduleInfo = {}), (n = e.__FEDERATION__).__SHARE__ ?? (n.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (
|
|
578
|
+
}), me(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (o = e.__FEDERATION__).moduleInfo ?? (o.moduleInfo = {}), (n = e.__FEDERATION__).__SHARE__ ?? (n.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (a = e.__FEDERATION__).__PRELOADED_MAP__ ?? (a.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
579
579
|
}
|
|
580
580
|
_t(v);
|
|
581
581
|
_t(k);
|
|
582
|
-
function xr(e, t =
|
|
583
|
-
t && (v.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, v.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.
|
|
582
|
+
function xr(e, t = Me()) {
|
|
583
|
+
t && (v.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, v.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.2");
|
|
584
584
|
}
|
|
585
585
|
function W(e, t) {
|
|
586
586
|
if (typeof t == "string") {
|
|
@@ -591,10 +591,10 @@ function W(e, t) {
|
|
|
591
591
|
{
|
|
592
592
|
const r = Object.keys(e);
|
|
593
593
|
for (const o of r) {
|
|
594
|
-
const [n, s] = o.split(":"),
|
|
594
|
+
const [n, s] = o.split(":"), a = `${n}:${t}`, c = e[a];
|
|
595
595
|
if (c) return {
|
|
596
596
|
value: c,
|
|
597
|
-
key:
|
|
597
|
+
key: a
|
|
598
598
|
};
|
|
599
599
|
}
|
|
600
600
|
return {
|
|
@@ -602,14 +602,14 @@ function W(e, t) {
|
|
|
602
602
|
key: t
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
} else
|
|
605
|
+
} else b(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
606
606
|
}
|
|
607
607
|
const Ve = () => k.__FEDERATION__.moduleInfo, Gr = (e, t) => {
|
|
608
608
|
const r = W(t, ne(e)).value;
|
|
609
609
|
if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
|
|
610
610
|
if ("version" in e && e.version) {
|
|
611
|
-
const { version: o, ...n } = e, s = ne(n),
|
|
612
|
-
if ((
|
|
611
|
+
const { version: o, ...n } = e, s = ne(n), a = W(k.__FEDERATION__.moduleInfo, s).value;
|
|
612
|
+
if ((a == null ? void 0 : a.version) === o) return a;
|
|
613
613
|
}
|
|
614
614
|
}, ye = (e) => Gr(e, k.__FEDERATION__.moduleInfo), qe = (e, t) => {
|
|
615
615
|
const r = ne(e);
|
|
@@ -620,13 +620,13 @@ const Ve = () => k.__FEDERATION__.moduleInfo, Gr = (e, t) => {
|
|
|
620
620
|
}, () => {
|
|
621
621
|
const t = Object.keys(e);
|
|
622
622
|
for (const r of t) delete k.__FEDERATION__.moduleInfo[r];
|
|
623
|
-
}),
|
|
623
|
+
}), De = (e, t) => {
|
|
624
624
|
const r = t || `__FEDERATION_${e}:custom__`;
|
|
625
625
|
return {
|
|
626
626
|
remoteEntryKey: r,
|
|
627
627
|
entryExports: v[r]
|
|
628
628
|
};
|
|
629
|
-
}, Br = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, jr = (e) => v.__FEDERATION__.__PRELOADED_MAP__.get(e), Wr = (e) => v.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), ze = "[0-9A-Za-z-]+",
|
|
629
|
+
}, Br = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, jr = (e) => v.__FEDERATION__.__PRELOADED_MAP__.get(e), Wr = (e) => v.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), ze = "[0-9A-Za-z-]+", xe = `(?:\\+(${ze}(?:\\.${ze})*))`, re = "0|[1-9]\\d*", Ee = "[0-9]+", St = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ke = `(?:${Ee}|${St})`, Vr = `(?:-?(${Ke}(?:\\.${Ke})*))`, Je = `(?:${re}|${St})`, bt = `(?:-(${Je}(?:\\.${Je})*))`, $e = `${re}|x|X|\\*`, Y = `[v=\\s]*(${$e})(?:\\.(${$e})(?:\\.(${$e})(?:${bt})?${xe}?)?)?`, qr = `^\\s*(${Y})\\s+-\\s+(${Y})\\s*$`, zr = `[v=\\s]*${`(${Ee})\\.(${Ee})\\.(${Ee})`}${Vr}?${xe}?`, Ge = "((?:<|>)?=?)", Kr = `(\\s*)${Ge}\\s*(${zr}|${Y})`, wt = "(?:~>?)", Jr = `(\\s*)${wt}\\s+`, It = "(?:\\^)", Zr = `(\\s*)${It}\\s+`, Xr = "(<|>)?=?\\s*\\*", Yr = `^${It}${Y}$`, Qr = `v?${`(${re})\\.(${re})\\.(${re})`}${bt}?${xe}?`, eo = `^${wt}${Y}$`, to = `^${Ge}\\s*${Y}$`, ro = `^${Ge}\\s*(${Qr})$|^$`, oo = "^\\s*>=\\s*0.0.0\\s*$";
|
|
630
630
|
function O(e) {
|
|
631
631
|
return new RegExp(e);
|
|
632
632
|
}
|
|
@@ -644,7 +644,7 @@ function Xe(e, t, r, o) {
|
|
|
644
644
|
return o ? `${n}-${o}` : n;
|
|
645
645
|
}
|
|
646
646
|
function no(e) {
|
|
647
|
-
return e.replace(O(qr), (t, r, o, n, s,
|
|
647
|
+
return e.replace(O(qr), (t, r, o, n, s, a, c, i, l, u, f, m) => (N(o) ? r = "" : N(n) ? r = `>=${o}.0.0` : N(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, N(l) ? i = "" : N(u) ? i = `<${Number(l) + 1}.0.0-0` : N(f) ? i = `<${l}.${Number(u) + 1}.0-0` : m ? i = `<=${l}.${u}.${f}-${m}` : i = `<=${i}`, `${r} ${i}`.trim()));
|
|
648
648
|
}
|
|
649
649
|
function so(e) {
|
|
650
650
|
return e.replace(O(Kr), "$1$2$3");
|
|
@@ -656,15 +656,15 @@ function ao(e) {
|
|
|
656
656
|
return e.replace(O(Zr), "$1^");
|
|
657
657
|
}
|
|
658
658
|
function co(e) {
|
|
659
|
-
return e.trim().split(/\s+/).map((t) => t.replace(O(Yr), (r, o, n, s,
|
|
659
|
+
return e.trim().split(/\s+/).map((t) => t.replace(O(Yr), (r, o, n, s, a) => N(o) ? "" : N(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : N(s) ? o === "0" ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.0 <${Number(o) + 1}.0.0-0` : a ? o === "0" ? n === "0" ? `>=${o}.${n}.${s}-${a} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s}-${a} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s}-${a} <${Number(o) + 1}.0.0-0` : o === "0" ? n === "0" ? `>=${o}.${n}.${s} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${Number(o) + 1}.0.0-0`)).join(" ");
|
|
660
660
|
}
|
|
661
661
|
function lo(e) {
|
|
662
|
-
return e.trim().split(/\s+/).map((t) => t.replace(O(eo), (r, o, n, s,
|
|
662
|
+
return e.trim().split(/\s+/).map((t) => t.replace(O(eo), (r, o, n, s, a) => N(o) ? "" : N(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : N(s) ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : a ? `>=${o}.${n}.${s}-${a} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0`)).join(" ");
|
|
663
663
|
}
|
|
664
664
|
function uo(e) {
|
|
665
|
-
return e.split(/\s+/).map((t) => t.trim().replace(O(to), (r, o, n, s,
|
|
666
|
-
const
|
|
667
|
-
return o === "=" && u && (o = ""), c = "",
|
|
665
|
+
return e.split(/\s+/).map((t) => t.trim().replace(O(to), (r, o, n, s, a, c) => {
|
|
666
|
+
const i = N(n), l = i || N(s), u = l || N(a);
|
|
667
|
+
return o === "=" && u && (o = ""), c = "", i ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && u ? (l && (s = 0), a = 0, o === ">" ? (o = ">=", l ? (n = Number(n) + 1, s = 0, a = 0) : (s = Number(s) + 1, a = 0)) : o === "<=" && (o = "<", l ? n = Number(n) + 1 : s = Number(s) + 1), o === "<" && (c = "-0"), `${o + n}.${s}.${a}${c}`) : l ? `>=${n}.0.0${c} <${Number(n) + 1}.0.0-0` : u ? `>=${n}.${s}.0${c} <${n}.${Number(s) + 1}.0-0` : r;
|
|
668
668
|
})).join(" ");
|
|
669
669
|
}
|
|
670
670
|
function fo(e) {
|
|
@@ -682,31 +682,31 @@ function mo(e, t) {
|
|
|
682
682
|
if (r && o === void 0) return -1;
|
|
683
683
|
if (r === void 0 && o === void 0) return 0;
|
|
684
684
|
for (let n = 0, s = r.length; n <= s; n++) {
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
685
|
+
const a = r[n], c = o[n];
|
|
686
|
+
if (a !== c)
|
|
687
|
+
return a === void 0 && c === void 0 ? 0 : a ? c ? ge(a, c) : -1 : 1;
|
|
688
688
|
}
|
|
689
689
|
return 0;
|
|
690
690
|
}
|
|
691
691
|
function le(e, t) {
|
|
692
692
|
return ge(e.major, t.major) || ge(e.minor, t.minor) || ge(e.patch, t.patch) || mo(e, t);
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Te(e, t) {
|
|
695
695
|
return e.version === t.version;
|
|
696
696
|
}
|
|
697
697
|
function po(e, t) {
|
|
698
698
|
switch (e.operator) {
|
|
699
699
|
case "":
|
|
700
700
|
case "=":
|
|
701
|
-
return
|
|
701
|
+
return Te(e, t);
|
|
702
702
|
case ">":
|
|
703
703
|
return le(e, t) < 0;
|
|
704
704
|
case ">=":
|
|
705
|
-
return
|
|
705
|
+
return Te(e, t) || le(e, t) < 0;
|
|
706
706
|
case "<":
|
|
707
707
|
return le(e, t) > 0;
|
|
708
708
|
case "<=":
|
|
709
|
-
return
|
|
709
|
+
return Te(e, t) || le(e, t) > 0;
|
|
710
710
|
case void 0:
|
|
711
711
|
return !0;
|
|
712
712
|
default:
|
|
@@ -723,12 +723,12 @@ function te(e, t) {
|
|
|
723
723
|
if (!e) return !1;
|
|
724
724
|
const r = Ze(e);
|
|
725
725
|
if (!r) return !1;
|
|
726
|
-
const [, o, , n, s,
|
|
726
|
+
const [, o, , n, s, a, c] = r, i = {
|
|
727
727
|
operator: o,
|
|
728
|
-
version: Xe(n, s,
|
|
728
|
+
version: Xe(n, s, a, c),
|
|
729
729
|
major: n,
|
|
730
730
|
minor: s,
|
|
731
|
-
patch:
|
|
731
|
+
patch: a,
|
|
732
732
|
preRelease: c == null ? void 0 : c.split(".")
|
|
733
733
|
}, l = t.split("||");
|
|
734
734
|
for (const u of l) {
|
|
@@ -748,15 +748,15 @@ function te(e, t) {
|
|
|
748
748
|
p = !1;
|
|
749
749
|
break;
|
|
750
750
|
}
|
|
751
|
-
const [, R, , g, _,
|
|
751
|
+
const [, R, , g, _, S, I] = y;
|
|
752
752
|
if (!po({
|
|
753
753
|
operator: R,
|
|
754
|
-
version: Xe(g, _,
|
|
754
|
+
version: Xe(g, _, S, I),
|
|
755
755
|
major: g,
|
|
756
756
|
minor: _,
|
|
757
|
-
patch:
|
|
757
|
+
patch: S,
|
|
758
758
|
preRelease: I == null ? void 0 : I.split(".")
|
|
759
|
-
},
|
|
759
|
+
}, i)) {
|
|
760
760
|
p = !1;
|
|
761
761
|
break;
|
|
762
762
|
}
|
|
@@ -771,11 +771,11 @@ function te(e, t) {
|
|
|
771
771
|
}
|
|
772
772
|
const ae = "default", Tt = "global";
|
|
773
773
|
function go(e, t, r, o) {
|
|
774
|
-
var s,
|
|
774
|
+
var s, a;
|
|
775
775
|
let n;
|
|
776
776
|
return "get" in e ? n = e.get : "lib" in e ? n = () => Promise.resolve(e.lib) : n = () => Promise.resolve(() => {
|
|
777
|
-
|
|
778
|
-
}), (s = e.shareConfig) != null && s.eager && ((
|
|
777
|
+
b(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
|
|
778
|
+
}), (s = e.shareConfig) != null && s.eager && ((a = e.treeShaking) != null && a.mode) && b(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
|
|
779
779
|
deps: [],
|
|
780
780
|
useIn: [],
|
|
781
781
|
from: t,
|
|
@@ -796,22 +796,22 @@ function go(e, t, r, o) {
|
|
|
796
796
|
treeShaking: e.treeShaking ? {
|
|
797
797
|
...e.treeShaking,
|
|
798
798
|
mode: e.treeShaking.mode ?? "server-calc",
|
|
799
|
-
status: e.treeShaking.status ??
|
|
799
|
+
status: e.treeShaking.status ?? Ae.UNKNOWN,
|
|
800
800
|
useIn: []
|
|
801
801
|
} : void 0
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
804
|
function vt(e, t) {
|
|
805
|
-
const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((
|
|
806
|
-
const
|
|
807
|
-
return
|
|
808
|
-
|
|
809
|
-
}),
|
|
805
|
+
const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((a, c) => {
|
|
806
|
+
const i = gt(r[c]);
|
|
807
|
+
return a[c] = a[c] || [], i.forEach((l) => {
|
|
808
|
+
a[c].push(go(l, o, c, t.shareStrategy));
|
|
809
|
+
}), a;
|
|
810
810
|
}, {}), s = { ...e.shared };
|
|
811
|
-
return Object.keys(n).forEach((
|
|
812
|
-
s[
|
|
813
|
-
s[
|
|
814
|
-
}) : s[
|
|
811
|
+
return Object.keys(n).forEach((a) => {
|
|
812
|
+
s[a] ? n[a].forEach((c) => {
|
|
813
|
+
s[a].find((i) => i.version === c.version) || s[a].push(c);
|
|
814
|
+
}) : s[a] = n[a];
|
|
815
815
|
}), {
|
|
816
816
|
allShareInfos: s,
|
|
817
817
|
newShareInfos: n
|
|
@@ -820,14 +820,14 @@ function vt(e, t) {
|
|
|
820
820
|
function se(e, t) {
|
|
821
821
|
if (!e) return !1;
|
|
822
822
|
const { status: r, mode: o } = e;
|
|
823
|
-
return r ===
|
|
823
|
+
return r === Ae.NO_USE ? !1 : r === Ae.CALCULATED ? !0 : o === "runtime-infer" ? t ? _o(e, t) : !0 : !1;
|
|
824
824
|
}
|
|
825
825
|
function B(e, t) {
|
|
826
826
|
const r = (o) => {
|
|
827
827
|
if (!Number.isNaN(Number(o))) {
|
|
828
828
|
const n = o.split(".");
|
|
829
829
|
let s = o;
|
|
830
|
-
for (let
|
|
830
|
+
for (let a = 0; a < 3 - n.length; a++) s += ".0";
|
|
831
831
|
return s;
|
|
832
832
|
}
|
|
833
833
|
return o;
|
|
@@ -844,62 +844,62 @@ const ie = (e, t) => {
|
|
|
844
844
|
const { usedExports: r } = e;
|
|
845
845
|
return r ? !!t.every((o) => r.includes(o)) : !1;
|
|
846
846
|
};
|
|
847
|
-
function
|
|
847
|
+
function So(e, t, r, o) {
|
|
848
848
|
const n = e[t][r];
|
|
849
|
-
let s = "",
|
|
850
|
-
const c = function(
|
|
851
|
-
return
|
|
849
|
+
let s = "", a = se(o);
|
|
850
|
+
const c = function(i, l) {
|
|
851
|
+
return a ? n[i].treeShaking ? n[l].treeShaking ? !_e(n[i].treeShaking) && B(i, l) : !1 : !0 : !_e(n[i]) && B(i, l);
|
|
852
852
|
};
|
|
853
|
-
if (
|
|
853
|
+
if (a) {
|
|
854
854
|
if (s = ie(e[t][r], c), s) return {
|
|
855
855
|
version: s,
|
|
856
|
-
useTreesShaking:
|
|
856
|
+
useTreesShaking: a
|
|
857
857
|
};
|
|
858
|
-
|
|
858
|
+
a = !1;
|
|
859
859
|
}
|
|
860
860
|
return {
|
|
861
861
|
version: ie(e[t][r], c),
|
|
862
|
-
useTreesShaking:
|
|
862
|
+
useTreesShaking: a
|
|
863
863
|
};
|
|
864
864
|
}
|
|
865
865
|
const q = (e) => _e(e) || Ro(e);
|
|
866
|
-
function
|
|
866
|
+
function bo(e, t, r, o) {
|
|
867
867
|
const n = e[t][r];
|
|
868
|
-
let s = "",
|
|
869
|
-
const c = function(
|
|
870
|
-
if (
|
|
871
|
-
if (!n[
|
|
868
|
+
let s = "", a = se(o);
|
|
869
|
+
const c = function(i, l) {
|
|
870
|
+
if (a) {
|
|
871
|
+
if (!n[i].treeShaking) return !0;
|
|
872
872
|
if (!n[l].treeShaking) return !1;
|
|
873
|
-
if (q(n[l].treeShaking)) return q(n[
|
|
874
|
-
if (q(n[
|
|
873
|
+
if (q(n[l].treeShaking)) return q(n[i].treeShaking) ? !!B(i, l) : !0;
|
|
874
|
+
if (q(n[i].treeShaking)) return !1;
|
|
875
875
|
}
|
|
876
|
-
return q(n[l]) ? q(n[
|
|
876
|
+
return q(n[l]) ? q(n[i]) ? !!B(i, l) : !0 : q(n[i]) ? !1 : B(i, l);
|
|
877
877
|
};
|
|
878
|
-
if (
|
|
878
|
+
if (a) {
|
|
879
879
|
if (s = ie(e[t][r], c), s) return {
|
|
880
880
|
version: s,
|
|
881
|
-
useTreesShaking:
|
|
881
|
+
useTreesShaking: a
|
|
882
882
|
};
|
|
883
|
-
|
|
883
|
+
a = !1;
|
|
884
884
|
}
|
|
885
885
|
return {
|
|
886
886
|
version: ie(e[t][r], c),
|
|
887
|
-
useTreesShaking:
|
|
887
|
+
useTreesShaking: a
|
|
888
888
|
};
|
|
889
889
|
}
|
|
890
890
|
function wo(e) {
|
|
891
|
-
return e === "loaded-first" ?
|
|
891
|
+
return e === "loaded-first" ? bo : So;
|
|
892
892
|
}
|
|
893
893
|
function Re(e, t, r, o) {
|
|
894
894
|
if (!e) return;
|
|
895
|
-
const { shareConfig: n, scope: s = ae, strategy:
|
|
896
|
-
for (const l of
|
|
897
|
-
const { requiredVersion: u } = n, { version: f, useTreesShaking: m } = wo(
|
|
895
|
+
const { shareConfig: n, scope: s = ae, strategy: a, treeShaking: c } = r, i = Array.isArray(s) ? s : [s];
|
|
896
|
+
for (const l of i) if (n && e[l] && e[l][t]) {
|
|
897
|
+
const { requiredVersion: u } = n, { version: f, useTreesShaking: m } = wo(a)(e, l, t, c), h = () => {
|
|
898
898
|
const p = e[l][t][f];
|
|
899
899
|
if (n.singleton) {
|
|
900
900
|
if (typeof u == "string" && !te(f, u)) {
|
|
901
901
|
const E = `Version ${f} from ${f && p.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
|
|
902
|
-
n.strictVersion ?
|
|
902
|
+
n.strictVersion ? b(E) : oe(E);
|
|
903
903
|
}
|
|
904
904
|
return {
|
|
905
905
|
shared: p,
|
|
@@ -933,7 +933,7 @@ function Re(e, t, r, o) {
|
|
|
933
933
|
scope: l,
|
|
934
934
|
pkgName: t,
|
|
935
935
|
version: f,
|
|
936
|
-
GlobalFederation:
|
|
936
|
+
GlobalFederation: Se.__FEDERATION__,
|
|
937
937
|
shareInfo: r,
|
|
938
938
|
resolver: h
|
|
939
939
|
};
|
|
@@ -941,24 +941,24 @@ function Re(e, t, r, o) {
|
|
|
941
941
|
}
|
|
942
942
|
}
|
|
943
943
|
function Nt() {
|
|
944
|
-
return
|
|
944
|
+
return Se.__FEDERATION__.__SHARE__;
|
|
945
945
|
}
|
|
946
946
|
function Ye(e) {
|
|
947
|
-
const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (
|
|
948
|
-
if (!
|
|
947
|
+
const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (i) => {
|
|
948
|
+
if (!i) return;
|
|
949
949
|
const l = {};
|
|
950
|
-
return
|
|
950
|
+
return i.forEach((f) => {
|
|
951
951
|
l[f.version] = f;
|
|
952
952
|
}), l[ie(l, function(f, m) {
|
|
953
953
|
return !_e(l[f]) && B(f, m);
|
|
954
954
|
})];
|
|
955
|
-
}, s = (r == null ? void 0 : r.resolver) ?? n,
|
|
955
|
+
}, s = (r == null ? void 0 : r.resolver) ?? n, a = (i) => i !== null && typeof i == "object" && !Array.isArray(i), c = (...i) => {
|
|
956
956
|
const l = {};
|
|
957
|
-
for (const u of
|
|
957
|
+
for (const u of i)
|
|
958
958
|
if (u)
|
|
959
959
|
for (const [f, m] of Object.entries(u)) {
|
|
960
960
|
const h = l[f];
|
|
961
|
-
|
|
961
|
+
a(h) && a(m) ? l[f] = c(h, m) : m !== void 0 && (l[f] = m);
|
|
962
962
|
}
|
|
963
963
|
return l;
|
|
964
964
|
};
|
|
@@ -970,7 +970,7 @@ const z = (e, t) => {
|
|
|
970
970
|
function ue(e, t) {
|
|
971
971
|
return t && e.treeShaking ? e.treeShaking : e;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Ue(e, t) {
|
|
974
974
|
return !t || t === "." ? e : `${e}/${t.replace(/^\.\//, "")}`;
|
|
975
975
|
}
|
|
976
976
|
function Qe(e, t) {
|
|
@@ -992,16 +992,16 @@ function Qe(e, t) {
|
|
|
992
992
|
};
|
|
993
993
|
}
|
|
994
994
|
const s = r.alias && t.startsWith(r.alias);
|
|
995
|
-
let
|
|
995
|
+
let a = r.alias && t.replace(r.alias, "");
|
|
996
996
|
if (r.alias && s) {
|
|
997
|
-
if (
|
|
997
|
+
if (a && a.startsWith("/")) {
|
|
998
998
|
const c = r.alias;
|
|
999
|
-
return
|
|
999
|
+
return a = `.${a}`, {
|
|
1000
1000
|
pkgNameOrAlias: c,
|
|
1001
|
-
expose:
|
|
1001
|
+
expose: a,
|
|
1002
1002
|
remote: r
|
|
1003
1003
|
};
|
|
1004
|
-
} else if (
|
|
1004
|
+
} else if (a === "") return {
|
|
1005
1005
|
pkgNameOrAlias: r.alias,
|
|
1006
1006
|
expose: ".",
|
|
1007
1007
|
remote: r
|
|
@@ -1013,15 +1013,15 @@ function Io(e, t) {
|
|
|
1013
1013
|
for (const r of e)
|
|
1014
1014
|
if (t === r.name || r.alias && t === r.alias) return r;
|
|
1015
1015
|
}
|
|
1016
|
-
const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-004", Ot = "RUNTIME-005",
|
|
1016
|
+
const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-004", Ot = "RUNTIME-005", Le = "RUNTIME-006", Lt = "RUNTIME-007", be = "RUNTIME-008", $o = "RUNTIME-009", Ct = "RUNTIME-010", Ft = "RUNTIME-011", To = "RUNTIME-012", Ht = "RUNTIME-013", Dt = "RUNTIME-014", xt = "RUNTIME-015", A = {
|
|
1017
1017
|
[At]: "Failed to get remoteEntry exports.",
|
|
1018
1018
|
[Mt]: 'The remote entry interface does not contain "init"',
|
|
1019
1019
|
[Pt]: "Failed to get manifest.",
|
|
1020
1020
|
[kt]: "Failed to locate remote.",
|
|
1021
1021
|
[Ot]: "Invalid loadShareSync function call from bundler runtime",
|
|
1022
|
-
[
|
|
1022
|
+
[Le]: "Invalid loadShareSync function call from runtime",
|
|
1023
1023
|
[Lt]: "Failed to get remote snapshot.",
|
|
1024
|
-
[
|
|
1024
|
+
[be]: "Failed to load script resources.",
|
|
1025
1025
|
[$o]: "Please call createInstance first.",
|
|
1026
1026
|
[Ct]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
|
|
1027
1027
|
[Ft]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
@@ -1031,55 +1031,77 @@ const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-
|
|
|
1031
1031
|
[xt]: "Remote container initialization failed."
|
|
1032
1032
|
};
|
|
1033
1033
|
({
|
|
1034
|
-
...
|
|
1034
|
+
...A
|
|
1035
1035
|
});
|
|
1036
|
-
const Gt = ".then(callbacks[0]).catch(callbacks[1])"
|
|
1036
|
+
const Gt = ".then(callbacks[0]).catch(callbacks[1])", vo = [
|
|
1037
|
+
"Failed to fetch dynamically imported module",
|
|
1038
|
+
"Importing a module script failed",
|
|
1039
|
+
"error loading dynamically imported module"
|
|
1040
|
+
];
|
|
1041
|
+
function No(e) {
|
|
1042
|
+
return e instanceof TypeError ? vo.some((t) => e.message.includes(t)) : !1;
|
|
1043
|
+
}
|
|
1037
1044
|
function Ut(e) {
|
|
1038
1045
|
return e === "esm" || e === "module";
|
|
1039
1046
|
}
|
|
1040
|
-
async function
|
|
1041
|
-
return new Promise((
|
|
1047
|
+
async function Ao({ entry: e, remoteEntryExports: t, name: r, getEntryUrl: o }) {
|
|
1048
|
+
return new Promise((n, s) => {
|
|
1049
|
+
const a = (i) => {
|
|
1050
|
+
if (No(i)) {
|
|
1051
|
+
const l = i instanceof Error ? i.message : String(i);
|
|
1052
|
+
try {
|
|
1053
|
+
b(be, A, {
|
|
1054
|
+
remoteName: r,
|
|
1055
|
+
resourceUrl: c
|
|
1056
|
+
}, l);
|
|
1057
|
+
} catch (u) {
|
|
1058
|
+
s(u);
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
s(i);
|
|
1063
|
+
}, c = o ? o(e) : e;
|
|
1042
1064
|
try {
|
|
1043
|
-
t ?
|
|
1065
|
+
t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${c}")${Gt}`)([n, a]) : import(
|
|
1044
1066
|
/* webpackIgnore: true */
|
|
1045
1067
|
/* @vite-ignore */
|
|
1046
|
-
|
|
1047
|
-
).then(
|
|
1048
|
-
} catch (
|
|
1049
|
-
|
|
1068
|
+
c
|
|
1069
|
+
).then(n).catch(a);
|
|
1070
|
+
} catch (i) {
|
|
1071
|
+
b(`Failed to load ESM entry from "${c}". ${i instanceof Error ? i.message : String(i)}`);
|
|
1050
1072
|
}
|
|
1051
1073
|
});
|
|
1052
1074
|
}
|
|
1053
|
-
async function
|
|
1075
|
+
async function Mo({ entry: e, remoteEntryExports: t }) {
|
|
1054
1076
|
return new Promise((r, o) => {
|
|
1055
1077
|
try {
|
|
1056
1078
|
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${Gt}`)([r, o]);
|
|
1057
1079
|
} catch (n) {
|
|
1058
|
-
|
|
1080
|
+
b(`Failed to load SystemJS entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
|
|
1059
1081
|
}
|
|
1060
1082
|
});
|
|
1061
1083
|
}
|
|
1062
1084
|
function Bt(e, t, r) {
|
|
1063
|
-
const { remoteEntryKey: o, entryExports: n } =
|
|
1064
|
-
return n ||
|
|
1085
|
+
const { remoteEntryKey: o, entryExports: n } = De(e, t);
|
|
1086
|
+
return n || b(At, A, {
|
|
1065
1087
|
remoteName: e,
|
|
1066
1088
|
remoteEntryUrl: r,
|
|
1067
1089
|
remoteEntryKey: o
|
|
1068
1090
|
}), n;
|
|
1069
1091
|
}
|
|
1070
|
-
async function
|
|
1071
|
-
const { entryExports: c } =
|
|
1092
|
+
async function Po({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook: n, getEntryUrl: s, resourceContext: a }) {
|
|
1093
|
+
const { entryExports: c } = De(e, t);
|
|
1072
1094
|
if (c) return c;
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1095
|
+
const i = s ? s(r) : r;
|
|
1096
|
+
return br(i, {
|
|
1075
1097
|
attrs: {},
|
|
1076
1098
|
createScriptHook: (l, u) => {
|
|
1077
1099
|
const f = n.lifecycle.createScript.emit({
|
|
1078
1100
|
url: l,
|
|
1079
1101
|
attrs: u,
|
|
1080
1102
|
remoteInfo: o,
|
|
1081
|
-
resourceContext:
|
|
1082
|
-
...
|
|
1103
|
+
resourceContext: a ? {
|
|
1104
|
+
...a,
|
|
1083
1105
|
url: l
|
|
1084
1106
|
} : void 0
|
|
1085
1107
|
});
|
|
@@ -1088,23 +1110,25 @@ async function Ao({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook:
|
|
|
1088
1110
|
}
|
|
1089
1111
|
}).then(() => Bt(e, t, r), (l) => {
|
|
1090
1112
|
const u = l instanceof Error ? l.message : String(l);
|
|
1091
|
-
|
|
1113
|
+
b(be, A, {
|
|
1092
1114
|
remoteName: e,
|
|
1093
|
-
resourceUrl:
|
|
1115
|
+
resourceUrl: i
|
|
1094
1116
|
}, u);
|
|
1095
1117
|
});
|
|
1096
1118
|
}
|
|
1097
|
-
async function
|
|
1098
|
-
const { entry: s, entryGlobalName:
|
|
1099
|
-
return Ut(
|
|
1119
|
+
async function ko({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: o, resourceContext: n }) {
|
|
1120
|
+
const { entry: s, entryGlobalName: a, name: c, type: i } = e;
|
|
1121
|
+
return Ut(i) ? Ao({
|
|
1100
1122
|
entry: s,
|
|
1101
|
-
remoteEntryExports: t
|
|
1102
|
-
|
|
1123
|
+
remoteEntryExports: t,
|
|
1124
|
+
name: c,
|
|
1125
|
+
getEntryUrl: o
|
|
1126
|
+
}) : i === "system" ? Mo({
|
|
1103
1127
|
entry: s,
|
|
1104
1128
|
remoteEntryExports: t
|
|
1105
|
-
}) :
|
|
1129
|
+
}) : Po({
|
|
1106
1130
|
entry: s,
|
|
1107
|
-
globalName:
|
|
1131
|
+
globalName: a,
|
|
1108
1132
|
name: c,
|
|
1109
1133
|
remoteInfo: e,
|
|
1110
1134
|
loaderHook: r,
|
|
@@ -1112,52 +1136,52 @@ async function Mo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
|
|
|
1112
1136
|
resourceContext: n
|
|
1113
1137
|
});
|
|
1114
1138
|
}
|
|
1115
|
-
async function
|
|
1116
|
-
const { entry: o, entryGlobalName: n, name: s, type:
|
|
1139
|
+
async function Oo({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
|
|
1140
|
+
const { entry: o, entryGlobalName: n, name: s, type: a } = e, { entryExports: c } = De(s, n);
|
|
1117
1141
|
return c || $r(o, {
|
|
1118
1142
|
attrs: {
|
|
1119
1143
|
name: s,
|
|
1120
1144
|
globalName: n,
|
|
1121
|
-
type:
|
|
1145
|
+
type: a
|
|
1122
1146
|
},
|
|
1123
|
-
loaderHook: { createScriptHook: (
|
|
1147
|
+
loaderHook: { createScriptHook: (i, l = {}) => {
|
|
1124
1148
|
const u = t.lifecycle.createScript.emit({
|
|
1125
|
-
url:
|
|
1149
|
+
url: i,
|
|
1126
1150
|
attrs: l,
|
|
1127
1151
|
remoteInfo: e,
|
|
1128
1152
|
resourceContext: r ? {
|
|
1129
1153
|
...r,
|
|
1130
|
-
url:
|
|
1154
|
+
url: i
|
|
1131
1155
|
} : void 0
|
|
1132
1156
|
});
|
|
1133
1157
|
if (u && "url" in u)
|
|
1134
1158
|
return u;
|
|
1135
1159
|
} }
|
|
1136
|
-
}).then(() => Bt(s, n, o)).catch((
|
|
1137
|
-
|
|
1160
|
+
}).then(() => Bt(s, n, o)).catch((i) => {
|
|
1161
|
+
b(`Failed to load Node.js entry for remote "${s}" from "${o}". ${i instanceof Error ? i.message : String(i)}`);
|
|
1138
1162
|
});
|
|
1139
1163
|
}
|
|
1140
|
-
function
|
|
1164
|
+
function Ce(e) {
|
|
1141
1165
|
const { entry: t, name: r } = e;
|
|
1142
1166
|
return st(r, t);
|
|
1143
1167
|
}
|
|
1144
1168
|
async function Be(e) {
|
|
1145
|
-
const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling:
|
|
1169
|
+
const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling: a = !1 } = e, c = Ce(o);
|
|
1146
1170
|
if (r) return r;
|
|
1147
1171
|
if (!J[c]) {
|
|
1148
|
-
const
|
|
1149
|
-
J[c] =
|
|
1172
|
+
const i = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
|
|
1173
|
+
J[c] = i.emit({
|
|
1150
1174
|
origin: t,
|
|
1151
1175
|
loaderHook: l,
|
|
1152
1176
|
remoteInfo: o,
|
|
1153
1177
|
remoteEntryExports: r
|
|
1154
|
-
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : G) ?
|
|
1178
|
+
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : G) ? ko({
|
|
1155
1179
|
remoteInfo: o,
|
|
1156
1180
|
remoteEntryExports: r,
|
|
1157
1181
|
loaderHook: l,
|
|
1158
1182
|
getEntryUrl: n,
|
|
1159
1183
|
resourceContext: s
|
|
1160
|
-
}) :
|
|
1184
|
+
}) : Oo({
|
|
1161
1185
|
remoteInfo: o,
|
|
1162
1186
|
loaderHook: l,
|
|
1163
1187
|
resourceContext: s
|
|
@@ -1166,8 +1190,8 @@ async function Be(e) {
|
|
|
1166
1190
|
remoteInfo: o,
|
|
1167
1191
|
remoteEntryExports: u
|
|
1168
1192
|
}), u)).catch(async (u) => {
|
|
1169
|
-
const f =
|
|
1170
|
-
if (u instanceof Error && u.message.includes(
|
|
1193
|
+
const f = Ce(o), m = u instanceof Error && u.message.includes("ScriptExecutionError");
|
|
1194
|
+
if (u instanceof Error && u.message.includes(be) && !m && !a) {
|
|
1171
1195
|
const h = (p) => Be({
|
|
1172
1196
|
...p,
|
|
1173
1197
|
_inErrorHandling: !0
|
|
@@ -1205,10 +1229,10 @@ function K(e) {
|
|
|
1205
1229
|
shareScope: e.shareScope || ae
|
|
1206
1230
|
};
|
|
1207
1231
|
}
|
|
1208
|
-
function
|
|
1232
|
+
function Lo() {
|
|
1209
1233
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1210
1234
|
}
|
|
1211
|
-
function
|
|
1235
|
+
function Co(e, t) {
|
|
1212
1236
|
const r = Br(), o = [
|
|
1213
1237
|
t.hooks,
|
|
1214
1238
|
t.remoteHandler.hooks,
|
|
@@ -1225,7 +1249,7 @@ function Oo(e, t) {
|
|
|
1225
1249
|
});
|
|
1226
1250
|
}), e;
|
|
1227
1251
|
}
|
|
1228
|
-
function
|
|
1252
|
+
function Fo(e) {
|
|
1229
1253
|
return {
|
|
1230
1254
|
name: e.name,
|
|
1231
1255
|
alias: e.alias,
|
|
@@ -1237,11 +1261,11 @@ function Lo(e) {
|
|
|
1237
1261
|
};
|
|
1238
1262
|
}
|
|
1239
1263
|
function F(e) {
|
|
1240
|
-
var r, o, n, s,
|
|
1264
|
+
var r, o, n, s, a, c;
|
|
1241
1265
|
const t = {};
|
|
1242
|
-
for (const [
|
|
1266
|
+
for (const [i, l] of Object.entries(e.shared)) {
|
|
1243
1267
|
const u = l[0];
|
|
1244
|
-
u && (t[
|
|
1268
|
+
u && (t[i] = {
|
|
1245
1269
|
version: u.version,
|
|
1246
1270
|
singleton: (r = u.shareConfig) == null ? void 0 : r.singleton,
|
|
1247
1271
|
requiredVersion: ((o = u.shareConfig) == null ? void 0 : o.requiredVersion) === !1 ? !1 : (n = u.shareConfig) == null ? void 0 : n.requiredVersion,
|
|
@@ -1252,11 +1276,11 @@ function F(e) {
|
|
|
1252
1276
|
return {
|
|
1253
1277
|
project: {
|
|
1254
1278
|
name: e.name,
|
|
1255
|
-
mfRole: ((
|
|
1279
|
+
mfRole: ((a = e.remotes) == null ? void 0 : a.length) > 0 ? "host" : "unknown"
|
|
1256
1280
|
},
|
|
1257
1281
|
mfConfig: {
|
|
1258
1282
|
name: e.name,
|
|
1259
|
-
remotes: ((c = e.remotes) == null ? void 0 : c.map(
|
|
1283
|
+
remotes: ((c = e.remotes) == null ? void 0 : c.map(Fo)) ?? [],
|
|
1260
1284
|
shared: t
|
|
1261
1285
|
}
|
|
1262
1286
|
};
|
|
@@ -1269,7 +1293,7 @@ function jt(e) {
|
|
|
1269
1293
|
...e
|
|
1270
1294
|
};
|
|
1271
1295
|
}
|
|
1272
|
-
function
|
|
1296
|
+
function Ho(e, t) {
|
|
1273
1297
|
return t.map((r) => {
|
|
1274
1298
|
const o = Io(e, r.nameOrAlias);
|
|
1275
1299
|
return L(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && at({
|
|
@@ -1281,7 +1305,7 @@ function Co(e, t) {
|
|
|
1281
1305
|
};
|
|
1282
1306
|
});
|
|
1283
1307
|
}
|
|
1284
|
-
function
|
|
1308
|
+
function Do(e) {
|
|
1285
1309
|
return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1286
1310
|
}
|
|
1287
1311
|
function je(e) {
|
|
@@ -1297,7 +1321,7 @@ function j(e, t, r, o) {
|
|
|
1297
1321
|
error: o
|
|
1298
1322
|
};
|
|
1299
1323
|
}
|
|
1300
|
-
async function
|
|
1324
|
+
async function xo(e, t, r, o) {
|
|
1301
1325
|
const n = e.moduleCache.get(r.name), s = r.entry;
|
|
1302
1326
|
if (n != null && n.remoteEntryExports) return j(o, s, "cached");
|
|
1303
1327
|
try {
|
|
@@ -1311,19 +1335,19 @@ async function Ho(e, t, r, o) {
|
|
|
1311
1335
|
}
|
|
1312
1336
|
})) throw new Error(`Failed to load remoteEntry "${s}".`);
|
|
1313
1337
|
return j(o, s, "success");
|
|
1314
|
-
} catch (
|
|
1315
|
-
return j(o, s, je(
|
|
1338
|
+
} catch (a) {
|
|
1339
|
+
return j(o, s, je(a) ? "timeout" : "error", a);
|
|
1316
1340
|
}
|
|
1317
1341
|
}
|
|
1318
1342
|
function fe({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
|
|
1319
|
-
return new Promise((
|
|
1320
|
-
const { link: c, needAttach:
|
|
1343
|
+
return new Promise((a) => {
|
|
1344
|
+
const { link: c, needAttach: i } = Sr({
|
|
1321
1345
|
url: r,
|
|
1322
1346
|
cb: () => {
|
|
1323
|
-
|
|
1347
|
+
a(j(n, r, i ? "success" : "cached"));
|
|
1324
1348
|
},
|
|
1325
1349
|
onErrorCallback: (l) => {
|
|
1326
|
-
|
|
1350
|
+
a(j(n, r, je(l) ? "timeout" : "error", l));
|
|
1327
1351
|
},
|
|
1328
1352
|
attrs: o,
|
|
1329
1353
|
createLinkHook: (l, u) => {
|
|
@@ -1340,35 +1364,35 @@ function fe({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1340
1364
|
},
|
|
1341
1365
|
needDeleteLink: s
|
|
1342
1366
|
});
|
|
1343
|
-
|
|
1367
|
+
i && document.head.appendChild(c);
|
|
1344
1368
|
});
|
|
1345
1369
|
}
|
|
1346
|
-
function
|
|
1370
|
+
function Go({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
1347
1371
|
return new Promise((s) => {
|
|
1348
|
-
const { script:
|
|
1372
|
+
const { script: a, needAttach: c } = ht({
|
|
1349
1373
|
url: r,
|
|
1350
1374
|
cb: () => {
|
|
1351
1375
|
s(j(n, r, c ? "success" : "cached"));
|
|
1352
1376
|
},
|
|
1353
|
-
onErrorCallback: (
|
|
1354
|
-
s(j(n, r, je(
|
|
1377
|
+
onErrorCallback: (i) => {
|
|
1378
|
+
s(j(n, r, je(i) ? "timeout" : "error", i));
|
|
1355
1379
|
},
|
|
1356
1380
|
attrs: o,
|
|
1357
|
-
createScriptHook: (
|
|
1381
|
+
createScriptHook: (i, l) => {
|
|
1358
1382
|
const u = e.loaderHook.lifecycle.createScript.emit({
|
|
1359
|
-
url:
|
|
1383
|
+
url: i,
|
|
1360
1384
|
attrs: l,
|
|
1361
1385
|
remoteInfo: t,
|
|
1362
1386
|
resourceContext: {
|
|
1363
1387
|
...n,
|
|
1364
|
-
url:
|
|
1388
|
+
url: i
|
|
1365
1389
|
}
|
|
1366
1390
|
});
|
|
1367
1391
|
return u instanceof HTMLScriptElement, u;
|
|
1368
1392
|
},
|
|
1369
1393
|
needDeleteScript: !0
|
|
1370
1394
|
});
|
|
1371
|
-
c && document.head.appendChild(
|
|
1395
|
+
c && document.head.appendChild(a);
|
|
1372
1396
|
});
|
|
1373
1397
|
}
|
|
1374
1398
|
function he(e, t) {
|
|
@@ -1381,18 +1405,18 @@ function Wt(e, t, r, o = !0, n = {
|
|
|
1381
1405
|
initiator: "preloadRemote",
|
|
1382
1406
|
id: e.name
|
|
1383
1407
|
}) {
|
|
1384
|
-
const { cssAssets: s, jsAssetsWithoutEntry:
|
|
1408
|
+
const { cssAssets: s, jsAssetsWithoutEntry: a, entryAssets: c } = r, i = [];
|
|
1385
1409
|
if (t.options.inBrowser) {
|
|
1386
1410
|
if (c.forEach((f) => {
|
|
1387
1411
|
const { moduleInfo: m } = f;
|
|
1388
|
-
|
|
1412
|
+
i.push(xo(t, e, m, he(n, "remoteEntry")));
|
|
1389
1413
|
}), o) {
|
|
1390
1414
|
const f = {
|
|
1391
1415
|
rel: "preload",
|
|
1392
1416
|
as: "style"
|
|
1393
1417
|
};
|
|
1394
1418
|
s.forEach((m) => {
|
|
1395
|
-
|
|
1419
|
+
i.push(fe({
|
|
1396
1420
|
host: t,
|
|
1397
1421
|
remoteInfo: e,
|
|
1398
1422
|
url: m,
|
|
@@ -1406,7 +1430,7 @@ function Wt(e, t, r, o = !0, n = {
|
|
|
1406
1430
|
type: "text/css"
|
|
1407
1431
|
};
|
|
1408
1432
|
s.forEach((m) => {
|
|
1409
|
-
|
|
1433
|
+
i.push(fe({
|
|
1410
1434
|
host: t,
|
|
1411
1435
|
remoteInfo: e,
|
|
1412
1436
|
url: m,
|
|
@@ -1416,7 +1440,7 @@ function Wt(e, t, r, o = !0, n = {
|
|
|
1416
1440
|
}));
|
|
1417
1441
|
});
|
|
1418
1442
|
}
|
|
1419
|
-
let l =
|
|
1443
|
+
let l = Go, u = {
|
|
1420
1444
|
fetchpriority: "high",
|
|
1421
1445
|
type: "text/javascript"
|
|
1422
1446
|
};
|
|
@@ -1426,8 +1450,8 @@ function Wt(e, t, r, o = !0, n = {
|
|
|
1426
1450
|
}) : Ut(e.type) && (l = fe, u = {
|
|
1427
1451
|
rel: "modulepreload",
|
|
1428
1452
|
fetchpriority: "high"
|
|
1429
|
-
}),
|
|
1430
|
-
|
|
1453
|
+
}), a.forEach((f) => {
|
|
1454
|
+
i.push(l({
|
|
1431
1455
|
host: t,
|
|
1432
1456
|
remoteInfo: e,
|
|
1433
1457
|
url: f,
|
|
@@ -1436,17 +1460,17 @@ function Wt(e, t, r, o = !0, n = {
|
|
|
1436
1460
|
}));
|
|
1437
1461
|
});
|
|
1438
1462
|
}
|
|
1439
|
-
return Promise.all(
|
|
1463
|
+
return Promise.all(i);
|
|
1440
1464
|
}
|
|
1441
|
-
function
|
|
1465
|
+
function Uo(e) {
|
|
1442
1466
|
if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
|
|
1443
1467
|
const t = e.modules.map((r) => r.moduleName).filter(Boolean);
|
|
1444
1468
|
return t.length ? t.join(",") : void 0;
|
|
1445
1469
|
}
|
|
1446
|
-
function
|
|
1470
|
+
function Bo(e, t, r) {
|
|
1447
1471
|
const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1448
|
-
n.length || n.push("default"), n.forEach((
|
|
1449
|
-
o[
|
|
1472
|
+
n.length || n.push("default"), n.forEach((a) => {
|
|
1473
|
+
o[a] || (o[a] = {});
|
|
1450
1474
|
});
|
|
1451
1475
|
const s = {
|
|
1452
1476
|
version: e.version || "",
|
|
@@ -1473,7 +1497,7 @@ var et = class {
|
|
|
1473
1497
|
remoteEntryExports: this.remoteEntryExports,
|
|
1474
1498
|
resourceContext: {
|
|
1475
1499
|
initiator: "loadRemote",
|
|
1476
|
-
id:
|
|
1500
|
+
id: Ue(this.remoteInfo.name, e),
|
|
1477
1501
|
resourceType: "remoteEntry"
|
|
1478
1502
|
}
|
|
1479
1503
|
});
|
|
@@ -1521,23 +1545,23 @@ var et = class {
|
|
|
1521
1545
|
remoteSnapshot: t,
|
|
1522
1546
|
origin: this.host
|
|
1523
1547
|
});
|
|
1524
|
-
const { remoteEntryInitOptions: s, shareScope:
|
|
1525
|
-
shareScope:
|
|
1548
|
+
const { remoteEntryInitOptions: s, shareScope: a, initScope: c } = Bo(this.remoteInfo, this.host.shareScopeMap, r), i = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1549
|
+
shareScope: a,
|
|
1526
1550
|
remoteEntryInitOptions: s,
|
|
1527
1551
|
initScope: c,
|
|
1528
1552
|
remoteInfo: this.remoteInfo,
|
|
1529
1553
|
origin: this.host
|
|
1530
1554
|
});
|
|
1531
|
-
typeof (n == null ? void 0 : n.init) > "u" &&
|
|
1555
|
+
typeof (n == null ? void 0 : n.init) > "u" && b(Mt, A, {
|
|
1532
1556
|
hostName: this.host.name,
|
|
1533
1557
|
remoteName: this.remoteInfo.name,
|
|
1534
1558
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1535
1559
|
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1536
1560
|
}, void 0, F(this.host.options));
|
|
1537
1561
|
try {
|
|
1538
|
-
await n.init(
|
|
1562
|
+
await n.init(i.shareScope, i.initScope, i.remoteEntryInitOptions);
|
|
1539
1563
|
} catch (l) {
|
|
1540
|
-
|
|
1564
|
+
b(xt, A, {
|
|
1541
1565
|
hostName: this.host.name,
|
|
1542
1566
|
remoteName: this.remoteInfo.name,
|
|
1543
1567
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
@@ -1546,7 +1570,7 @@ var et = class {
|
|
|
1546
1570
|
}, `${l}`, F(this.host.options));
|
|
1547
1571
|
}
|
|
1548
1572
|
await this.host.hooks.lifecycle.initContainer.emit({
|
|
1549
|
-
...
|
|
1573
|
+
...i,
|
|
1550
1574
|
id: e,
|
|
1551
1575
|
remoteSnapshot: t,
|
|
1552
1576
|
remoteEntryExports: n
|
|
@@ -1583,26 +1607,26 @@ var et = class {
|
|
|
1583
1607
|
remoteEntryExports: s,
|
|
1584
1608
|
origin: this.host
|
|
1585
1609
|
});
|
|
1586
|
-
let
|
|
1610
|
+
let a;
|
|
1587
1611
|
try {
|
|
1588
1612
|
const l = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1589
1613
|
remoteEntryExports: s,
|
|
1590
1614
|
expose: t,
|
|
1591
1615
|
moduleInfo: this.remoteInfo
|
|
1592
1616
|
});
|
|
1593
|
-
|
|
1617
|
+
a = typeof l == "function" ? l : void 0, a || (a = await s.get(t)), a || b(Dt, A, {
|
|
1594
1618
|
hostName: this.host.name,
|
|
1595
1619
|
remoteName: this.remoteInfo.name,
|
|
1596
1620
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1597
1621
|
expose: t,
|
|
1598
1622
|
requestId: e,
|
|
1599
|
-
availableExposes:
|
|
1623
|
+
availableExposes: Uo(o)
|
|
1600
1624
|
}, void 0, F(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1601
1625
|
id: e,
|
|
1602
1626
|
expose: t,
|
|
1603
1627
|
moduleInfo: this.remoteInfo,
|
|
1604
1628
|
remoteEntryExports: s,
|
|
1605
|
-
moduleFactory:
|
|
1629
|
+
moduleFactory: a,
|
|
1606
1630
|
origin: this.host
|
|
1607
1631
|
});
|
|
1608
1632
|
} catch (l) {
|
|
@@ -1615,8 +1639,8 @@ var et = class {
|
|
|
1615
1639
|
origin: this.host
|
|
1616
1640
|
}), l;
|
|
1617
1641
|
}
|
|
1618
|
-
const c = Dr(this.remoteInfo.name, t),
|
|
1619
|
-
if (!n) return
|
|
1642
|
+
const c = Dr(this.remoteInfo.name, t), i = this.wraperFactory(a, c);
|
|
1643
|
+
if (!n) return i;
|
|
1620
1644
|
await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
|
|
1621
1645
|
id: e,
|
|
1622
1646
|
expose: t,
|
|
@@ -1625,7 +1649,7 @@ var et = class {
|
|
|
1625
1649
|
origin: this.host
|
|
1626
1650
|
});
|
|
1627
1651
|
try {
|
|
1628
|
-
const l = await
|
|
1652
|
+
const l = await i();
|
|
1629
1653
|
return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
|
|
1630
1654
|
id: e,
|
|
1631
1655
|
expose: t,
|
|
@@ -1677,7 +1701,7 @@ var et = class {
|
|
|
1677
1701
|
r !== "name" && this.lifecycle[r].remove(t[r]);
|
|
1678
1702
|
});
|
|
1679
1703
|
}
|
|
1680
|
-
},
|
|
1704
|
+
}, M = class {
|
|
1681
1705
|
constructor(e) {
|
|
1682
1706
|
this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
|
|
1683
1707
|
}
|
|
@@ -1703,31 +1727,31 @@ var et = class {
|
|
|
1703
1727
|
removeAll() {
|
|
1704
1728
|
this.listeners.clear();
|
|
1705
1729
|
}
|
|
1706
|
-
}, T = class extends
|
|
1730
|
+
}, T = class extends M {
|
|
1707
1731
|
emit(...e) {
|
|
1708
1732
|
let t;
|
|
1709
1733
|
const r = Array.from(this.listeners);
|
|
1710
1734
|
if (r.length > 0) {
|
|
1711
1735
|
let o = 0;
|
|
1712
|
-
const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((
|
|
1736
|
+
const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((a) => a === void 0 || e.length === 1 && a === e[0] ? n(s) : n(a)) : s;
|
|
1713
1737
|
t = n();
|
|
1714
1738
|
}
|
|
1715
1739
|
return Promise.resolve(t);
|
|
1716
1740
|
}
|
|
1717
1741
|
};
|
|
1718
1742
|
function Vt(e, t) {
|
|
1719
|
-
if (!
|
|
1743
|
+
if (!He(t)) return !1;
|
|
1720
1744
|
if (e !== t) {
|
|
1721
1745
|
for (const r in e) if (!(r in t)) return !1;
|
|
1722
1746
|
}
|
|
1723
1747
|
return !0;
|
|
1724
1748
|
}
|
|
1725
|
-
var X = class extends
|
|
1749
|
+
var X = class extends M {
|
|
1726
1750
|
constructor(e) {
|
|
1727
|
-
super(), this.onerror =
|
|
1751
|
+
super(), this.onerror = b, this.type = e;
|
|
1728
1752
|
}
|
|
1729
1753
|
emit(e) {
|
|
1730
|
-
|
|
1754
|
+
He(e) || b(`The data for the "${this.type}" hook should be an object.`);
|
|
1731
1755
|
for (const t of this.listeners) try {
|
|
1732
1756
|
const r = t(e);
|
|
1733
1757
|
if (r === void 0) continue;
|
|
@@ -1741,12 +1765,12 @@ var X = class extends A {
|
|
|
1741
1765
|
}
|
|
1742
1766
|
return e;
|
|
1743
1767
|
}
|
|
1744
|
-
}, D = class extends
|
|
1768
|
+
}, D = class extends M {
|
|
1745
1769
|
constructor(e) {
|
|
1746
|
-
super(), this.onerror =
|
|
1770
|
+
super(), this.onerror = b, this.type = e;
|
|
1747
1771
|
}
|
|
1748
1772
|
emit(e) {
|
|
1749
|
-
|
|
1773
|
+
He(e) || b(`The response data for the "${this.type}" hook must be an object.`);
|
|
1750
1774
|
const t = Array.from(this.listeners);
|
|
1751
1775
|
if (t.length > 0) {
|
|
1752
1776
|
let r = 0;
|
|
@@ -1756,8 +1780,8 @@ var X = class extends A {
|
|
|
1756
1780
|
return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
|
|
1757
1781
|
if (r < t.length) try {
|
|
1758
1782
|
return Promise.resolve(t[r++](e)).then(n, o);
|
|
1759
|
-
} catch (
|
|
1760
|
-
return o(
|
|
1783
|
+
} catch (a) {
|
|
1784
|
+
return o(a);
|
|
1761
1785
|
}
|
|
1762
1786
|
return e;
|
|
1763
1787
|
};
|
|
@@ -1767,7 +1791,7 @@ var X = class extends A {
|
|
|
1767
1791
|
}
|
|
1768
1792
|
};
|
|
1769
1793
|
const ee = "Remote loading is disabled by experiments.optimization.disableRemote.";
|
|
1770
|
-
var
|
|
1794
|
+
var jo = class {
|
|
1771
1795
|
constructor() {
|
|
1772
1796
|
this.hooks = new H({});
|
|
1773
1797
|
}
|
|
@@ -1792,19 +1816,19 @@ var Uo = class {
|
|
|
1792
1816
|
};
|
|
1793
1817
|
function qt(e, t) {
|
|
1794
1818
|
const r = Rt(t);
|
|
1795
|
-
r.url ||
|
|
1796
|
-
let o =
|
|
1819
|
+
r.url || b(Ft, A, { remoteName: e.name });
|
|
1820
|
+
let o = Pe(t, r.url);
|
|
1797
1821
|
!G && !o.startsWith("http") && (o = `https:${o}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = o, e.version = t.version, e.buildVersion = t.buildVersion;
|
|
1798
1822
|
}
|
|
1799
|
-
function
|
|
1823
|
+
function Wo() {
|
|
1800
1824
|
return {
|
|
1801
1825
|
name: "snapshot-plugin",
|
|
1802
1826
|
async afterResolve(e) {
|
|
1803
|
-
const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id:
|
|
1804
|
-
if (!
|
|
1805
|
-
const { remoteSnapshot: c, globalSnapshot:
|
|
1827
|
+
const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id: a } = e;
|
|
1828
|
+
if (!Fe(t) || !Et(t)) {
|
|
1829
|
+
const { remoteSnapshot: c, globalSnapshot: i } = await n.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1806
1830
|
moduleInfo: t,
|
|
1807
|
-
id:
|
|
1831
|
+
id: Ue(t.name, o)
|
|
1808
1832
|
});
|
|
1809
1833
|
qt(s, c);
|
|
1810
1834
|
const l = {
|
|
@@ -1822,11 +1846,11 @@ function Bo() {
|
|
|
1822
1846
|
remoteInfo: s,
|
|
1823
1847
|
remote: t,
|
|
1824
1848
|
remoteSnapshot: c,
|
|
1825
|
-
globalSnapshot:
|
|
1849
|
+
globalSnapshot: i
|
|
1826
1850
|
});
|
|
1827
1851
|
return u && Wt(s, n, u, !1, {
|
|
1828
1852
|
initiator: "loadRemote",
|
|
1829
|
-
id:
|
|
1853
|
+
id: a
|
|
1830
1854
|
}).catch(() => {
|
|
1831
1855
|
}), {
|
|
1832
1856
|
...e,
|
|
@@ -1837,7 +1861,7 @@ function Bo() {
|
|
|
1837
1861
|
}
|
|
1838
1862
|
};
|
|
1839
1863
|
}
|
|
1840
|
-
function
|
|
1864
|
+
function Vo(e) {
|
|
1841
1865
|
const t = e.split(":");
|
|
1842
1866
|
return t.length === 1 ? {
|
|
1843
1867
|
name: t[0],
|
|
@@ -1851,13 +1875,13 @@ function jo(e) {
|
|
|
1851
1875
|
};
|
|
1852
1876
|
}
|
|
1853
1877
|
function zt(e, t, r, o, n = {}, s) {
|
|
1854
|
-
const { value:
|
|
1878
|
+
const { value: a } = W(e, ne(t)), c = s || a;
|
|
1855
1879
|
if (c && !ct(c) && (r(c, t, o), c.remotesInfo)) {
|
|
1856
|
-
const
|
|
1857
|
-
for (const l of
|
|
1880
|
+
const i = Object.keys(c.remotesInfo);
|
|
1881
|
+
for (const l of i) {
|
|
1858
1882
|
if (n[l]) continue;
|
|
1859
1883
|
n[l] = !0;
|
|
1860
|
-
const u =
|
|
1884
|
+
const u = Vo(l), f = c.remotesInfo[l];
|
|
1861
1885
|
zt(e, {
|
|
1862
1886
|
name: u.name,
|
|
1863
1887
|
version: f.matchedVersion
|
|
@@ -1865,20 +1889,20 @@ function zt(e, t, r, o, n = {}, s) {
|
|
|
1865
1889
|
}
|
|
1866
1890
|
}
|
|
1867
1891
|
}
|
|
1868
|
-
const
|
|
1869
|
-
function
|
|
1870
|
-
const s = [],
|
|
1892
|
+
const ve = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1893
|
+
function qo(e, t, r, o, n) {
|
|
1894
|
+
const s = [], a = [], c = [], i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: m } = f;
|
|
1871
1895
|
if (zt(o, r, (d, p, E) => {
|
|
1872
1896
|
var I;
|
|
1873
1897
|
let y;
|
|
1874
1898
|
if (E) y = f;
|
|
1875
1899
|
else if (Array.isArray(m)) {
|
|
1876
|
-
const
|
|
1877
|
-
if (!
|
|
1878
|
-
y = jt(
|
|
1900
|
+
const w = m.find(($) => $.nameOrAlias === p.name || $.nameOrAlias === p.alias);
|
|
1901
|
+
if (!w) return;
|
|
1902
|
+
y = jt(w);
|
|
1879
1903
|
} else if (m === !0) y = f;
|
|
1880
1904
|
else return;
|
|
1881
|
-
const R =
|
|
1905
|
+
const R = Pe(d, Rt(d).url);
|
|
1882
1906
|
R && c.push({
|
|
1883
1907
|
name: p.name,
|
|
1884
1908
|
moduleInfo: {
|
|
@@ -1892,31 +1916,31 @@ function Wo(e, t, r, o, n) {
|
|
|
1892
1916
|
url: R
|
|
1893
1917
|
});
|
|
1894
1918
|
let g = "modules" in d ? d.modules : [];
|
|
1895
|
-
const _ =
|
|
1896
|
-
_.length && "modules" in d && (g = (I = d == null ? void 0 : d.modules) == null ? void 0 : I.reduce((
|
|
1897
|
-
function
|
|
1898
|
-
const $ =
|
|
1919
|
+
const _ = Do(y.exposes);
|
|
1920
|
+
_.length && "modules" in d && (g = (I = d == null ? void 0 : d.modules) == null ? void 0 : I.reduce((w, $) => ((_ == null ? void 0 : _.indexOf($.moduleName)) !== -1 && w.push($), w), []));
|
|
1921
|
+
function S(w) {
|
|
1922
|
+
const $ = w.map((P) => Pe(d, P));
|
|
1899
1923
|
return y.filter ? $.filter(y.filter) : $;
|
|
1900
1924
|
}
|
|
1901
1925
|
if (g) {
|
|
1902
|
-
const
|
|
1903
|
-
for (let $ = 0; $ <
|
|
1904
|
-
const P = g[$],
|
|
1926
|
+
const w = g.length;
|
|
1927
|
+
for (let $ = 0; $ < w; $++) {
|
|
1928
|
+
const P = g[$], we = `${p.name}/${P.moduleName}`;
|
|
1905
1929
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1906
|
-
id: P.moduleName === "." ? p.name :
|
|
1930
|
+
id: P.moduleName === "." ? p.name : we,
|
|
1907
1931
|
name: p.name,
|
|
1908
1932
|
remoteSnapshot: d,
|
|
1909
1933
|
preloadConfig: y,
|
|
1910
1934
|
remote: p,
|
|
1911
1935
|
origin: e
|
|
1912
|
-
}), !jr(
|
|
1936
|
+
}), !jr(we) && (y.resourceCategory === "all" ? (s.push(...S(P.assets.css.async)), s.push(...S(P.assets.css.sync)), a.push(...S(P.assets.js.async)), a.push(...S(P.assets.js.sync))) : y.resourceCategory === "sync" && (s.push(...S(P.assets.css.sync)), a.push(...S(P.assets.js.sync))), Wr(we));
|
|
1913
1937
|
}
|
|
1914
1938
|
}
|
|
1915
1939
|
}, !0, {}, n), n.shared && n.shared.length > 0) {
|
|
1916
1940
|
const d = (p, E) => {
|
|
1917
1941
|
const { shared: y } = Re(e.shareScopeMap, E.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1918
1942
|
y && typeof y.lib == "function" && (E.assets.js.sync.forEach((R) => {
|
|
1919
|
-
|
|
1943
|
+
i.add(R);
|
|
1920
1944
|
}), E.assets.css.sync.forEach((R) => {
|
|
1921
1945
|
l.add(R);
|
|
1922
1946
|
}));
|
|
@@ -1931,19 +1955,19 @@ function Wo(e, t, r, o, n) {
|
|
|
1931
1955
|
});
|
|
1932
1956
|
});
|
|
1933
1957
|
}
|
|
1934
|
-
const h =
|
|
1958
|
+
const h = a.filter((d) => !i.has(d) && !ve("script", d));
|
|
1935
1959
|
return {
|
|
1936
|
-
cssAssets: s.filter((d) => !l.has(d) && !
|
|
1960
|
+
cssAssets: s.filter((d) => !l.has(d) && !ve("link", d)),
|
|
1937
1961
|
jsAssetsWithoutEntry: h,
|
|
1938
|
-
entryAssets: c.filter((d) => !
|
|
1962
|
+
entryAssets: c.filter((d) => !ve("script", d.url))
|
|
1939
1963
|
};
|
|
1940
1964
|
}
|
|
1941
|
-
const
|
|
1965
|
+
const zo = function() {
|
|
1942
1966
|
return {
|
|
1943
1967
|
name: "generate-preload-assets-plugin",
|
|
1944
1968
|
async generatePreloadAssets(e) {
|
|
1945
|
-
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot:
|
|
1946
|
-
return G ?
|
|
1969
|
+
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: a } = e;
|
|
1970
|
+
return G ? Fe(n) && Et(n) ? {
|
|
1947
1971
|
cssAssets: [],
|
|
1948
1972
|
jsAssetsWithoutEntry: [],
|
|
1949
1973
|
entryAssets: [{
|
|
@@ -1957,7 +1981,7 @@ const Vo = function() {
|
|
|
1957
1981
|
shareScope: ""
|
|
1958
1982
|
}
|
|
1959
1983
|
}]
|
|
1960
|
-
} : (qt(o,
|
|
1984
|
+
} : (qt(o, a), qo(t, r, o, s, a)) : {
|
|
1961
1985
|
cssAssets: [],
|
|
1962
1986
|
jsAssetsWithoutEntry: [],
|
|
1963
1987
|
entryAssets: []
|
|
@@ -1986,14 +2010,14 @@ function Kt(e, t) {
|
|
|
1986
2010
|
})
|
|
1987
2011
|
};
|
|
1988
2012
|
}
|
|
1989
|
-
var
|
|
2013
|
+
var Ko = class {
|
|
1990
2014
|
constructor(e) {
|
|
1991
2015
|
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new H({
|
|
1992
2016
|
beforeLoadRemoteSnapshot: new T("beforeLoadRemoteSnapshot"),
|
|
1993
2017
|
loadSnapshot: new D("loadGlobalSnapshot"),
|
|
1994
2018
|
loadRemoteSnapshot: new D("loadRemoteSnapshot"),
|
|
1995
2019
|
afterLoadSnapshot: new D("afterLoadSnapshot")
|
|
1996
|
-
}), this.manifestLoading =
|
|
2020
|
+
}), this.manifestLoading = Se.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
1997
2021
|
}
|
|
1998
2022
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
|
|
1999
2023
|
const { options: o } = this.HostInstance;
|
|
@@ -2014,16 +2038,16 @@ var qo = class {
|
|
|
2014
2038
|
...n == null ? void 0 : n.remotesInfo,
|
|
2015
2039
|
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
2016
2040
|
});
|
|
2017
|
-
const { hostGlobalSnapshot: s, remoteSnapshot:
|
|
2041
|
+
const { hostGlobalSnapshot: s, remoteSnapshot: a, globalSnapshot: c } = this.getGlobalRemoteInfo(e), { remoteSnapshot: i, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
2018
2042
|
options: o,
|
|
2019
2043
|
moduleInfo: e,
|
|
2020
2044
|
hostGlobalSnapshot: s,
|
|
2021
|
-
remoteSnapshot:
|
|
2045
|
+
remoteSnapshot: a,
|
|
2022
2046
|
globalSnapshot: c
|
|
2023
2047
|
});
|
|
2024
2048
|
let u, f;
|
|
2025
|
-
if (
|
|
2026
|
-
const m = G ?
|
|
2049
|
+
if (i) if (ct(i)) {
|
|
2050
|
+
const m = G ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", h = await this.loadManifestSnapshot(m, e, {}, {
|
|
2027
2051
|
initiator: r,
|
|
2028
2052
|
id: t || e.name
|
|
2029
2053
|
}), d = qe({
|
|
@@ -2035,18 +2059,18 @@ var qo = class {
|
|
|
2035
2059
|
const { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2036
2060
|
options: this.HostInstance.options,
|
|
2037
2061
|
moduleInfo: e,
|
|
2038
|
-
remoteSnapshot:
|
|
2062
|
+
remoteSnapshot: i,
|
|
2039
2063
|
from: "global"
|
|
2040
2064
|
});
|
|
2041
2065
|
u = m, f = l;
|
|
2042
2066
|
}
|
|
2043
|
-
else if (
|
|
2067
|
+
else if (Fe(e)) {
|
|
2044
2068
|
const m = await this.loadManifestSnapshot(e.entry, e, {}, {
|
|
2045
2069
|
initiator: r,
|
|
2046
2070
|
id: t || e.name
|
|
2047
2071
|
}), h = qe(e, m);
|
|
2048
2072
|
u = m, f = h;
|
|
2049
|
-
} else
|
|
2073
|
+
} else b(Lt, A, {
|
|
2050
2074
|
remoteName: e.name,
|
|
2051
2075
|
remoteVersion: e.version,
|
|
2052
2076
|
hostName: this.HostInstance.options.name,
|
|
@@ -2069,33 +2093,33 @@ var qo = class {
|
|
|
2069
2093
|
async getManifestJson(e, t, r, o) {
|
|
2070
2094
|
return (async () => {
|
|
2071
2095
|
const s = K(t);
|
|
2072
|
-
let
|
|
2073
|
-
if (
|
|
2096
|
+
let a = this.manifestCache.get(e);
|
|
2097
|
+
if (a) return a;
|
|
2074
2098
|
try {
|
|
2075
|
-
let
|
|
2099
|
+
let i = await this.loaderHook.lifecycle.fetch.emit(e, {}, s, o ? {
|
|
2076
2100
|
...o,
|
|
2077
2101
|
url: e,
|
|
2078
2102
|
resourceType: "manifest"
|
|
2079
2103
|
} : void 0);
|
|
2080
|
-
(!
|
|
2081
|
-
} catch (
|
|
2082
|
-
|
|
2104
|
+
(!i || !(i instanceof Response)) && (i = await fetch(e, {})), a = await i.json();
|
|
2105
|
+
} catch (i) {
|
|
2106
|
+
a = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2083
2107
|
id: e,
|
|
2084
|
-
error:
|
|
2108
|
+
error: i,
|
|
2085
2109
|
from: "runtime",
|
|
2086
2110
|
lifecycle: "afterResolve",
|
|
2087
2111
|
remote: s,
|
|
2088
2112
|
origin: this.HostInstance
|
|
2089
|
-
}),
|
|
2113
|
+
}), a || (delete this.manifestLoading[e], b(Pt, A, {
|
|
2090
2114
|
manifestUrl: e,
|
|
2091
2115
|
moduleName: t.name,
|
|
2092
2116
|
hostName: this.HostInstance.options.name
|
|
2093
|
-
}, `${
|
|
2117
|
+
}, `${i}`, F(this.HostInstance.options)));
|
|
2094
2118
|
}
|
|
2095
2119
|
const c = [
|
|
2096
|
-
!
|
|
2097
|
-
!
|
|
2098
|
-
!
|
|
2120
|
+
!a.metaData && "metaData",
|
|
2121
|
+
!a.exposes && "exposes",
|
|
2122
|
+
!a.shared && "shared"
|
|
2099
2123
|
].filter(Boolean);
|
|
2100
2124
|
return c.length > 0 && await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2101
2125
|
id: e,
|
|
@@ -2104,21 +2128,21 @@ var qo = class {
|
|
|
2104
2128
|
lifecycle: "afterResolve",
|
|
2105
2129
|
remote: s,
|
|
2106
2130
|
origin: this.HostInstance
|
|
2107
|
-
}), c.length > 0 &&
|
|
2131
|
+
}), c.length > 0 && b(Ht, A, {
|
|
2108
2132
|
manifestUrl: e,
|
|
2109
2133
|
moduleName: t.name,
|
|
2110
2134
|
hostName: this.HostInstance.options.name,
|
|
2111
2135
|
missingFields: c.join(",")
|
|
2112
|
-
}, void 0, F(this.HostInstance.options)), this.manifestCache.set(e,
|
|
2136
|
+
}, void 0, F(this.HostInstance.options)), this.manifestCache.set(e, a), a;
|
|
2113
2137
|
})();
|
|
2114
2138
|
}
|
|
2115
2139
|
async loadManifestSnapshot(e, t, r, o) {
|
|
2116
2140
|
const n = async () => {
|
|
2117
|
-
const s = await this.getManifestJson(e, t, r, o),
|
|
2141
|
+
const s = await this.getManifestJson(e, t, r, o), a = yr(s, { version: e }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2118
2142
|
options: this.HostInstance.options,
|
|
2119
2143
|
moduleInfo: t,
|
|
2120
2144
|
manifestJson: s,
|
|
2121
|
-
remoteSnapshot:
|
|
2145
|
+
remoteSnapshot: a,
|
|
2122
2146
|
manifestUrl: e,
|
|
2123
2147
|
from: "manifest"
|
|
2124
2148
|
});
|
|
@@ -2126,19 +2150,19 @@ var qo = class {
|
|
|
2126
2150
|
};
|
|
2127
2151
|
return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
|
|
2128
2152
|
}
|
|
2129
|
-
},
|
|
2153
|
+
}, Jo = class {
|
|
2130
2154
|
constructor() {
|
|
2131
2155
|
this.hooks = new H({});
|
|
2132
2156
|
}
|
|
2133
|
-
},
|
|
2157
|
+
}, Zo = class {
|
|
2134
2158
|
constructor(e) {
|
|
2135
2159
|
this.hooks = new H({
|
|
2136
2160
|
beforeRegisterShare: new X("beforeRegisterShare"),
|
|
2137
2161
|
afterResolve: new D("afterResolve"),
|
|
2138
2162
|
beforeLoadShare: new D("beforeLoadShare"),
|
|
2139
2163
|
loadShare: new T(),
|
|
2140
|
-
afterLoadShare: new
|
|
2141
|
-
errorLoadShare: new
|
|
2164
|
+
afterLoadShare: new M("afterLoadShare"),
|
|
2165
|
+
errorLoadShare: new M("errorLoadShare"),
|
|
2142
2166
|
resolveShare: new X("resolveShare"),
|
|
2143
2167
|
initContainerShareScopeMap: new X("initContainerShareScopeMap")
|
|
2144
2168
|
}), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
|
|
@@ -2178,13 +2202,13 @@ var qo = class {
|
|
|
2178
2202
|
const { newShareInfos: r, allShareInfos: o } = vt(e, t);
|
|
2179
2203
|
return Object.keys(r).forEach((n) => {
|
|
2180
2204
|
r[n].forEach((s) => {
|
|
2181
|
-
s.scope.forEach((
|
|
2205
|
+
s.scope.forEach((a) => {
|
|
2182
2206
|
var c;
|
|
2183
2207
|
this.hooks.lifecycle.beforeRegisterShare.emit({
|
|
2184
2208
|
origin: this.host,
|
|
2185
2209
|
pkgName: n,
|
|
2186
2210
|
shared: s
|
|
2187
|
-
}), (c = this.shareScopeMap[
|
|
2211
|
+
}), (c = this.shareScopeMap[a]) != null && c[n] || this.setShared({
|
|
2188
2212
|
pkgName: n,
|
|
2189
2213
|
lib: s.lib,
|
|
2190
2214
|
get: s.get,
|
|
@@ -2207,52 +2231,52 @@ var qo = class {
|
|
|
2207
2231
|
});
|
|
2208
2232
|
let n = o;
|
|
2209
2233
|
try {
|
|
2210
|
-
o != null && o.scope && await Promise.all(o.scope.map(async (
|
|
2211
|
-
await Promise.all(this.initializeSharing(
|
|
2234
|
+
o != null && o.scope && await Promise.all(o.scope.map(async (i) => {
|
|
2235
|
+
await Promise.all(this.initializeSharing(i, { strategy: o.strategy }));
|
|
2212
2236
|
})), n = (await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
2213
2237
|
pkgName: e,
|
|
2214
2238
|
shareInfo: o,
|
|
2215
2239
|
shared: r.options.shared,
|
|
2216
2240
|
origin: r
|
|
2217
2241
|
})).shareInfo, L(n, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
|
|
2218
|
-
const s = n, { shared:
|
|
2219
|
-
if (
|
|
2220
|
-
const
|
|
2221
|
-
if (
|
|
2222
|
-
return z(
|
|
2242
|
+
const s = n, { shared: a, useTreesShaking: c } = Re(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
|
|
2243
|
+
if (a) {
|
|
2244
|
+
const i = ue(a, c);
|
|
2245
|
+
if (i.lib)
|
|
2246
|
+
return z(i, r.options.name), this.emitAfterLoadShare({
|
|
2223
2247
|
lifecycle: "loadShare",
|
|
2224
2248
|
pkgName: e,
|
|
2225
2249
|
shareInfo: s,
|
|
2226
|
-
selectedShared:
|
|
2227
|
-
}),
|
|
2228
|
-
if (
|
|
2229
|
-
const l = await
|
|
2230
|
-
return
|
|
2250
|
+
selectedShared: a
|
|
2251
|
+
}), i.lib;
|
|
2252
|
+
if (i.loading && !i.loaded) {
|
|
2253
|
+
const l = await i.loading;
|
|
2254
|
+
return i.loaded = !0, i.lib || (i.lib = l), z(i, r.options.name), this.emitAfterLoadShare({
|
|
2231
2255
|
lifecycle: "loadShare",
|
|
2232
2256
|
pkgName: e,
|
|
2233
2257
|
shareInfo: s,
|
|
2234
|
-
selectedShared:
|
|
2258
|
+
selectedShared: a
|
|
2235
2259
|
}), l;
|
|
2236
2260
|
} else {
|
|
2237
2261
|
const u = (async () => {
|
|
2238
|
-
const m = await
|
|
2239
|
-
return z(
|
|
2262
|
+
const m = await i.get();
|
|
2263
|
+
return z(i, r.options.name), i.loaded = !0, i.lib = m, m;
|
|
2240
2264
|
})();
|
|
2241
2265
|
this.setShared({
|
|
2242
2266
|
pkgName: e,
|
|
2243
2267
|
loaded: !1,
|
|
2244
|
-
shared:
|
|
2268
|
+
shared: a,
|
|
2245
2269
|
from: r.options.name,
|
|
2246
2270
|
lib: null,
|
|
2247
2271
|
loading: u,
|
|
2248
|
-
treeShaking: c ?
|
|
2272
|
+
treeShaking: c ? i : void 0
|
|
2249
2273
|
});
|
|
2250
2274
|
const f = await u;
|
|
2251
2275
|
return this.emitAfterLoadShare({
|
|
2252
2276
|
lifecycle: "loadShare",
|
|
2253
2277
|
pkgName: e,
|
|
2254
2278
|
shareInfo: s,
|
|
2255
|
-
selectedShared:
|
|
2279
|
+
selectedShared: a
|
|
2256
2280
|
}), f;
|
|
2257
2281
|
}
|
|
2258
2282
|
} else {
|
|
@@ -2263,7 +2287,7 @@ var qo = class {
|
|
|
2263
2287
|
shareInfo: s,
|
|
2264
2288
|
recovered: !0
|
|
2265
2289
|
}), !1;
|
|
2266
|
-
const
|
|
2290
|
+
const i = se(s.treeShaking), l = ue(s, i), f = (async () => {
|
|
2267
2291
|
const h = await l.get();
|
|
2268
2292
|
l.lib = h, l.loaded = !0, z(l, r.options.name);
|
|
2269
2293
|
const { shared: d, useTreesShaking: p } = Re(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare) || {};
|
|
@@ -2280,7 +2304,7 @@ var qo = class {
|
|
|
2280
2304
|
from: r.options.name,
|
|
2281
2305
|
lib: null,
|
|
2282
2306
|
loading: f,
|
|
2283
|
-
treeShaking:
|
|
2307
|
+
treeShaking: i ? l : void 0
|
|
2284
2308
|
});
|
|
2285
2309
|
const m = await f;
|
|
2286
2310
|
return this.emitAfterLoadShare({
|
|
@@ -2307,22 +2331,22 @@ var qo = class {
|
|
|
2307
2331
|
initializeSharing(e = ae, t) {
|
|
2308
2332
|
const { host: r } = this, o = t == null ? void 0 : t.from, n = t == null ? void 0 : t.strategy;
|
|
2309
2333
|
let s = t == null ? void 0 : t.initScope;
|
|
2310
|
-
const
|
|
2334
|
+
const a = [];
|
|
2311
2335
|
if (o !== "build") {
|
|
2312
2336
|
const { initTokens: m } = this;
|
|
2313
2337
|
s || (s = []);
|
|
2314
2338
|
let h = m[e];
|
|
2315
|
-
if (h || (h = m[e] = { from: this.host.name }), s.indexOf(h) >= 0) return
|
|
2339
|
+
if (h || (h = m[e] = { from: this.host.name }), s.indexOf(h) >= 0) return a;
|
|
2316
2340
|
s.push(h);
|
|
2317
2341
|
}
|
|
2318
|
-
const c = this.shareScopeMap,
|
|
2342
|
+
const c = this.shareScopeMap, i = r.options.name;
|
|
2319
2343
|
c[e] || (c[e] = {});
|
|
2320
2344
|
const l = c[e], u = (m, h) => {
|
|
2321
2345
|
var g;
|
|
2322
2346
|
const { version: d, eager: p } = h;
|
|
2323
2347
|
l[m] = l[m] || {};
|
|
2324
2348
|
const E = l[m], y = E[d] && ue(E[d]), R = !!(y && ("eager" in y && y.eager || "shareConfig" in y && ((g = y.shareConfig) != null && g.eager)));
|
|
2325
|
-
(!y || y.strategy !== "loaded-first" && !y.loaded && (!p != !R ? p :
|
|
2349
|
+
(!y || y.strategy !== "loaded-first" && !y.loaded && (!p != !R ? p : i > E[d].from)) && (E[d] = h);
|
|
2326
2350
|
}, f = async (m) => {
|
|
2327
2351
|
const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: m });
|
|
2328
2352
|
let d;
|
|
@@ -2346,8 +2370,8 @@ var qo = class {
|
|
|
2346
2370
|
h.scope.includes(e) && u(m, h);
|
|
2347
2371
|
});
|
|
2348
2372
|
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((m) => {
|
|
2349
|
-
m.shareScope === e &&
|
|
2350
|
-
}),
|
|
2373
|
+
m.shareScope === e && a.push(f(m.name));
|
|
2374
|
+
}), a;
|
|
2351
2375
|
}
|
|
2352
2376
|
loadShareSync(e, t) {
|
|
2353
2377
|
const { host: r } = this, o = Ye({
|
|
@@ -2394,7 +2418,7 @@ var qo = class {
|
|
|
2394
2418
|
}), o.lib;
|
|
2395
2419
|
if (o.get) {
|
|
2396
2420
|
const s = o.get();
|
|
2397
|
-
return s instanceof Promise &&
|
|
2421
|
+
return s instanceof Promise && b((t == null ? void 0 : t.from) === "build" ? Ot : Le, A, {
|
|
2398
2422
|
hostName: r.options.name,
|
|
2399
2423
|
sharedPkgName: e
|
|
2400
2424
|
}, void 0, F(r.options)), o.lib = s, this.setShared({
|
|
@@ -2410,7 +2434,7 @@ var qo = class {
|
|
|
2410
2434
|
selectedShared: o
|
|
2411
2435
|
}), o.lib;
|
|
2412
2436
|
}
|
|
2413
|
-
|
|
2437
|
+
b(Le, A, {
|
|
2414
2438
|
hostName: r.options.name,
|
|
2415
2439
|
sharedPkgName: e
|
|
2416
2440
|
}, void 0, F(r.options));
|
|
@@ -2433,21 +2457,21 @@ var qo = class {
|
|
|
2433
2457
|
hostShareScopeMap: r.hostShareScopeMap
|
|
2434
2458
|
});
|
|
2435
2459
|
}
|
|
2436
|
-
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get:
|
|
2437
|
-
const { version:
|
|
2460
|
+
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: a, treeShaking: c }) {
|
|
2461
|
+
const { version: i, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], m = (h) => {
|
|
2438
2462
|
const d = (E, y, R) => {
|
|
2439
2463
|
R && !E[y] && (E[y] = R);
|
|
2440
2464
|
}, p = c ? h.treeShaking : h;
|
|
2441
|
-
d(p, "loaded", s), d(p, "loading", n), d(p, "get",
|
|
2465
|
+
d(p, "loaded", s), d(p, "loading", n), d(p, "get", a);
|
|
2442
2466
|
};
|
|
2443
2467
|
f.forEach((h) => {
|
|
2444
|
-
this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][
|
|
2445
|
-
version:
|
|
2468
|
+
this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][i] || (this.shareScopeMap[h][e][i] = {
|
|
2469
|
+
version: i,
|
|
2446
2470
|
scope: [h],
|
|
2447
2471
|
...u,
|
|
2448
2472
|
lib: o
|
|
2449
2473
|
});
|
|
2450
|
-
const d = this.shareScopeMap[h][e][
|
|
2474
|
+
const d = this.shareScopeMap[h][e][i];
|
|
2451
2475
|
m(d), r && d.from !== r && (d.from = r);
|
|
2452
2476
|
});
|
|
2453
2477
|
}
|
|
@@ -2455,7 +2479,7 @@ var qo = class {
|
|
|
2455
2479
|
const t = Nt(), r = e.id || e.name;
|
|
2456
2480
|
r && !t[r] && (t[r] = this.shareScopeMap);
|
|
2457
2481
|
}
|
|
2458
|
-
},
|
|
2482
|
+
}, Xo = class {
|
|
2459
2483
|
constructor() {
|
|
2460
2484
|
this.shareScopeMap = {}, this.hooks = new H({ afterResolve: new D("afterResolve") });
|
|
2461
2485
|
}
|
|
@@ -2477,7 +2501,7 @@ var qo = class {
|
|
|
2477
2501
|
initShareScopeMap(e, t) {
|
|
2478
2502
|
this.shareScopeMap[e] = t;
|
|
2479
2503
|
}
|
|
2480
|
-
},
|
|
2504
|
+
}, Yo = class {
|
|
2481
2505
|
constructor(e) {
|
|
2482
2506
|
this.hooks = new H({
|
|
2483
2507
|
beforeRegisterRemote: new X("beforeRegisterRemote"),
|
|
@@ -2486,7 +2510,7 @@ var qo = class {
|
|
|
2486
2510
|
afterMatchRemote: new T("afterMatchRemote"),
|
|
2487
2511
|
onLoad: new T("onLoad"),
|
|
2488
2512
|
afterLoadRemote: new T("afterLoadRemote"),
|
|
2489
|
-
handlePreloadModule: new
|
|
2513
|
+
handlePreloadModule: new M("handlePreloadModule"),
|
|
2490
2514
|
errorLoadRemote: new T("errorLoadRemote"),
|
|
2491
2515
|
beforePreloadRemote: new T("beforePreloadRemote"),
|
|
2492
2516
|
generatePreloadAssets: new T("generatePreloadAssets"),
|
|
@@ -2503,16 +2527,16 @@ var qo = class {
|
|
|
2503
2527
|
name: r.name,
|
|
2504
2528
|
expose: o
|
|
2505
2529
|
}, s && e.startsWith(n)) {
|
|
2506
|
-
const
|
|
2507
|
-
this.idToRemoteMap[
|
|
2530
|
+
const a = e.replace(n, s);
|
|
2531
|
+
this.idToRemoteMap[a] = {
|
|
2508
2532
|
name: r.name,
|
|
2509
2533
|
expose: o
|
|
2510
2534
|
};
|
|
2511
2535
|
return;
|
|
2512
2536
|
}
|
|
2513
2537
|
if (s && e.startsWith(s)) {
|
|
2514
|
-
const
|
|
2515
|
-
this.idToRemoteMap[
|
|
2538
|
+
const a = e.replace(s, n);
|
|
2539
|
+
this.idToRemoteMap[a] = {
|
|
2516
2540
|
name: r.name,
|
|
2517
2541
|
expose: o
|
|
2518
2542
|
};
|
|
@@ -2520,16 +2544,16 @@ var qo = class {
|
|
|
2520
2544
|
}
|
|
2521
2545
|
async loadRemote(e, t) {
|
|
2522
2546
|
const { host: r } = this, o = Qe(r.options.remotes, e);
|
|
2523
|
-
let n = e, s = o == null ? void 0 : o.expose,
|
|
2547
|
+
let n = e, s = o == null ? void 0 : o.expose, a = o ? K(o.remote) : void 0, c;
|
|
2524
2548
|
try {
|
|
2525
|
-
const { loadFactory:
|
|
2526
|
-
n = p, s = d,
|
|
2549
|
+
const { loadFactory: i = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: m, remote: h, expose: d, id: p, remoteSnapshot: E } = f;
|
|
2550
|
+
n = p, s = d, a = K(h);
|
|
2527
2551
|
const y = await l.get(p, d, t, E), R = await this.hooks.lifecycle.onLoad.emit({
|
|
2528
2552
|
id: p,
|
|
2529
2553
|
pkgNameOrAlias: m,
|
|
2530
2554
|
expose: d,
|
|
2531
|
-
exposeModule:
|
|
2532
|
-
exposeModuleFactory:
|
|
2555
|
+
exposeModule: i ? y : void 0,
|
|
2556
|
+
exposeModuleFactory: i ? void 0 : y,
|
|
2533
2557
|
remote: h,
|
|
2534
2558
|
options: u,
|
|
2535
2559
|
moduleInstance: l,
|
|
@@ -2538,28 +2562,28 @@ var qo = class {
|
|
|
2538
2562
|
return this.setIdToRemoteMap(e, f), c = {
|
|
2539
2563
|
id: n,
|
|
2540
2564
|
expose: s,
|
|
2541
|
-
remote:
|
|
2565
|
+
remote: a,
|
|
2542
2566
|
options: t,
|
|
2543
2567
|
origin: r
|
|
2544
2568
|
}, typeof R == "function" ? R : y;
|
|
2545
|
-
} catch (
|
|
2569
|
+
} catch (i) {
|
|
2546
2570
|
const { from: l = "runtime" } = t || { from: "runtime" };
|
|
2547
2571
|
let u;
|
|
2548
2572
|
try {
|
|
2549
2573
|
u = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2550
2574
|
id: e,
|
|
2551
|
-
error:
|
|
2575
|
+
error: i,
|
|
2552
2576
|
from: l,
|
|
2553
2577
|
lifecycle: "onLoad",
|
|
2554
2578
|
expose: s,
|
|
2555
|
-
remote:
|
|
2579
|
+
remote: a,
|
|
2556
2580
|
origin: r
|
|
2557
2581
|
});
|
|
2558
2582
|
} catch (f) {
|
|
2559
2583
|
throw c = {
|
|
2560
2584
|
id: n,
|
|
2561
2585
|
expose: s,
|
|
2562
|
-
remote:
|
|
2586
|
+
remote: a,
|
|
2563
2587
|
options: t,
|
|
2564
2588
|
error: f,
|
|
2565
2589
|
origin: r
|
|
@@ -2569,17 +2593,17 @@ var qo = class {
|
|
|
2569
2593
|
throw c = {
|
|
2570
2594
|
id: n,
|
|
2571
2595
|
expose: s,
|
|
2572
|
-
remote:
|
|
2596
|
+
remote: a,
|
|
2573
2597
|
options: t,
|
|
2574
|
-
error:
|
|
2598
|
+
error: i,
|
|
2575
2599
|
origin: r
|
|
2576
|
-
},
|
|
2600
|
+
}, i;
|
|
2577
2601
|
return c = {
|
|
2578
2602
|
id: n,
|
|
2579
2603
|
expose: s,
|
|
2580
|
-
remote:
|
|
2604
|
+
remote: a,
|
|
2581
2605
|
options: t,
|
|
2582
|
-
error:
|
|
2606
|
+
error: i,
|
|
2583
2607
|
origin: r,
|
|
2584
2608
|
recovered: !0
|
|
2585
2609
|
}, u;
|
|
@@ -2594,17 +2618,17 @@ var qo = class {
|
|
|
2594
2618
|
options: t.options,
|
|
2595
2619
|
origin: t
|
|
2596
2620
|
});
|
|
2597
|
-
const o =
|
|
2598
|
-
const { preloadConfig:
|
|
2621
|
+
const o = Ho(t.options.remotes, e), n = (c) => {
|
|
2622
|
+
const { preloadConfig: i, remote: l } = c, u = i.exposes || [];
|
|
2599
2623
|
return u.length ? u.map((f) => ({
|
|
2600
2624
|
ops: {
|
|
2601
2625
|
...c,
|
|
2602
2626
|
preloadConfig: {
|
|
2603
|
-
...
|
|
2627
|
+
...i,
|
|
2604
2628
|
exposes: [f]
|
|
2605
2629
|
}
|
|
2606
2630
|
},
|
|
2607
|
-
id:
|
|
2631
|
+
id: Ue(l.name, f)
|
|
2608
2632
|
})) : [{
|
|
2609
2633
|
ops: c,
|
|
2610
2634
|
id: `${l.name}/*`
|
|
@@ -2612,7 +2636,7 @@ var qo = class {
|
|
|
2612
2636
|
};
|
|
2613
2637
|
let s;
|
|
2614
2638
|
await Promise.all(o.flatMap(n).map(async (c) => {
|
|
2615
|
-
const { ops:
|
|
2639
|
+
const { ops: i, id: l } = c, { remote: u, preloadConfig: f } = i, m = K(u);
|
|
2616
2640
|
try {
|
|
2617
2641
|
const { globalSnapshot: h, remoteSnapshot: d } = await t.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2618
2642
|
moduleInfo: u,
|
|
@@ -2620,7 +2644,7 @@ var qo = class {
|
|
|
2620
2644
|
initiator: "preloadRemote"
|
|
2621
2645
|
}), p = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2622
2646
|
origin: t,
|
|
2623
|
-
preloadOptions:
|
|
2647
|
+
preloadOptions: i,
|
|
2624
2648
|
remote: u,
|
|
2625
2649
|
remoteInfo: m,
|
|
2626
2650
|
globalSnapshot: h,
|
|
@@ -2655,10 +2679,10 @@ var qo = class {
|
|
|
2655
2679
|
});
|
|
2656
2680
|
}
|
|
2657
2681
|
}));
|
|
2658
|
-
const
|
|
2659
|
-
if (
|
|
2682
|
+
const a = r.flatMap((c) => c.results.filter((i) => i.status === "error" || i.status === "timeout"));
|
|
2683
|
+
if (a.length > 0 && (s = /* @__PURE__ */ new Error(`preloadRemote failed to load ${a.length} resource(s).`), Object.assign(s, {
|
|
2660
2684
|
results: r,
|
|
2661
|
-
failedResults:
|
|
2685
|
+
failedResults: a
|
|
2662
2686
|
})), await this.hooks.lifecycle.afterPreloadRemote.emit({
|
|
2663
2687
|
preloadOps: e,
|
|
2664
2688
|
options: t.options,
|
|
@@ -2704,7 +2728,7 @@ var qo = class {
|
|
|
2704
2728
|
}
|
|
2705
2729
|
const { id: n } = o, s = Qe(t.options.remotes, n);
|
|
2706
2730
|
if (!s) try {
|
|
2707
|
-
|
|
2731
|
+
b(kt, A, {
|
|
2708
2732
|
hostName: t.options.name,
|
|
2709
2733
|
requestId: n
|
|
2710
2734
|
}, void 0, F(t.options));
|
|
@@ -2716,7 +2740,7 @@ var qo = class {
|
|
|
2716
2740
|
origin: t
|
|
2717
2741
|
}), h;
|
|
2718
2742
|
}
|
|
2719
|
-
const { remote:
|
|
2743
|
+
const { remote: a } = s, c = K(a);
|
|
2720
2744
|
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
2721
2745
|
id: n,
|
|
2722
2746
|
...s,
|
|
@@ -2724,13 +2748,13 @@ var qo = class {
|
|
|
2724
2748
|
remoteInfo: c,
|
|
2725
2749
|
origin: t
|
|
2726
2750
|
});
|
|
2727
|
-
const
|
|
2751
|
+
const i = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2728
2752
|
id: n,
|
|
2729
2753
|
...s,
|
|
2730
2754
|
options: t.options,
|
|
2731
2755
|
origin: t,
|
|
2732
2756
|
remoteInfo: c
|
|
2733
|
-
}), { remote: l, expose: u } =
|
|
2757
|
+
}), { remote: l, expose: u } = i;
|
|
2734
2758
|
L(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
|
|
2735
2759
|
let f = t.moduleCache.get(l.name);
|
|
2736
2760
|
const m = {
|
|
@@ -2740,17 +2764,17 @@ var qo = class {
|
|
|
2740
2764
|
return f || (f = new et(m), t.moduleCache.set(l.name, f)), {
|
|
2741
2765
|
module: f,
|
|
2742
2766
|
moduleOptions: m,
|
|
2743
|
-
remoteMatchInfo:
|
|
2767
|
+
remoteMatchInfo: i
|
|
2744
2768
|
};
|
|
2745
2769
|
}
|
|
2746
2770
|
registerRemote(e, t, r) {
|
|
2747
2771
|
const { host: o } = this, n = () => {
|
|
2748
2772
|
if (e.alias) {
|
|
2749
|
-
const
|
|
2750
|
-
var
|
|
2751
|
-
return e.alias && (c.name.startsWith(e.alias) || ((
|
|
2773
|
+
const a = t.find((c) => {
|
|
2774
|
+
var i;
|
|
2775
|
+
return e.alias && (c.name.startsWith(e.alias) || ((i = c.alias) == null ? void 0 : i.startsWith(e.alias)));
|
|
2752
2776
|
});
|
|
2753
|
-
L(!
|
|
2777
|
+
L(!a, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${a && a.name} name or alias`);
|
|
2754
2778
|
}
|
|
2755
2779
|
"entry" in e && G && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = ae), e.type || (e.type = Tt);
|
|
2756
2780
|
};
|
|
@@ -2758,40 +2782,40 @@ var qo = class {
|
|
|
2758
2782
|
remote: e,
|
|
2759
2783
|
origin: o
|
|
2760
2784
|
});
|
|
2761
|
-
const s = t.find((
|
|
2785
|
+
const s = t.find((a) => a.name === e.name);
|
|
2762
2786
|
if (!s)
|
|
2763
2787
|
n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2764
2788
|
remote: e,
|
|
2765
2789
|
origin: o
|
|
2766
2790
|
});
|
|
2767
2791
|
else {
|
|
2768
|
-
const
|
|
2792
|
+
const a = [`The remote "${e.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
|
|
2769
2793
|
r != null && r.force && (this.removeRemote(s), n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2770
2794
|
remote: e,
|
|
2771
2795
|
origin: o
|
|
2772
|
-
}), it(
|
|
2796
|
+
}), it(a.join(" ")));
|
|
2773
2797
|
}
|
|
2774
2798
|
}
|
|
2775
2799
|
removeRemote(e) {
|
|
2776
2800
|
var t;
|
|
2777
2801
|
try {
|
|
2778
|
-
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((
|
|
2802
|
+
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((i) => i.name === o);
|
|
2779
2803
|
n !== -1 && r.options.remotes.splice(n, 1);
|
|
2780
2804
|
const s = W(v.__FEDERATION__.moduleInfo, ne(e)).key;
|
|
2781
|
-
delete v.__FEDERATION__.moduleInfo[s], "entry" in e && (r.snapshotHandler.manifestCache.delete(e.entry), delete
|
|
2782
|
-
const { hostGlobalSnapshot:
|
|
2783
|
-
if (
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2805
|
+
delete v.__FEDERATION__.moduleInfo[s], "entry" in e && (r.snapshotHandler.manifestCache.delete(e.entry), delete Se.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);
|
|
2806
|
+
const { hostGlobalSnapshot: a } = Kt(e, r);
|
|
2807
|
+
if (a) {
|
|
2808
|
+
const i = a && "remotesInfo" in a && a.remotesInfo && W(a.remotesInfo, e.name).key;
|
|
2809
|
+
i && delete a.remotesInfo[i];
|
|
2786
2810
|
}
|
|
2787
2811
|
const c = r.moduleCache.get(e.name);
|
|
2788
2812
|
if (c) {
|
|
2789
|
-
const
|
|
2813
|
+
const i = c.remoteInfo, l = i.entryGlobalName;
|
|
2790
2814
|
v[l] && ((t = Object.getOwnPropertyDescriptor(v, l)) != null && t.configurable ? delete v[l] : v[l] = void 0);
|
|
2791
|
-
const u =
|
|
2815
|
+
const u = Ce(c.remoteInfo);
|
|
2792
2816
|
J[u] && delete J[u];
|
|
2793
|
-
let f =
|
|
2794
|
-
const m = v.__FEDERATION__.__INSTANCES__.findIndex((h) =>
|
|
2817
|
+
let f = i.buildVersion ? st(i.name, i.buildVersion) : i.name;
|
|
2818
|
+
const m = v.__FEDERATION__.__INSTANCES__.findIndex((h) => i.buildVersion ? h.options.id === f : h.name === f);
|
|
2795
2819
|
if (m !== -1) {
|
|
2796
2820
|
const h = v.__FEDERATION__.__INSTANCES__[m];
|
|
2797
2821
|
f = h.options.id || f;
|
|
@@ -2802,48 +2826,48 @@ var qo = class {
|
|
|
2802
2826
|
const R = d[y];
|
|
2803
2827
|
R && Object.keys(R).forEach((g) => {
|
|
2804
2828
|
const _ = R[g];
|
|
2805
|
-
_ && Object.keys(_).forEach((
|
|
2806
|
-
const I = _[
|
|
2807
|
-
I && Object.keys(I).forEach((
|
|
2808
|
-
const $ = I[
|
|
2809
|
-
$ && typeof $ == "object" && $.from ===
|
|
2829
|
+
_ && Object.keys(_).forEach((S) => {
|
|
2830
|
+
const I = _[S];
|
|
2831
|
+
I && Object.keys(I).forEach((w) => {
|
|
2832
|
+
const $ = I[w];
|
|
2833
|
+
$ && typeof $ == "object" && $.from === i.name && ($.loaded || $.loading ? ($.useIn = $.useIn.filter((P) => P !== i.name), $.useIn.length ? p = !1 : E.push([
|
|
2810
2834
|
y,
|
|
2811
2835
|
g,
|
|
2812
|
-
|
|
2813
|
-
|
|
2836
|
+
S,
|
|
2837
|
+
w
|
|
2814
2838
|
])) : E.push([
|
|
2815
2839
|
y,
|
|
2816
2840
|
g,
|
|
2817
|
-
|
|
2818
|
-
|
|
2841
|
+
S,
|
|
2842
|
+
w
|
|
2819
2843
|
]));
|
|
2820
2844
|
});
|
|
2821
2845
|
});
|
|
2822
2846
|
});
|
|
2823
2847
|
}), p && (h.shareScopeMap = {}, delete d[f]), E.forEach(([y, R, g, _]) => {
|
|
2824
|
-
var
|
|
2825
|
-
(
|
|
2848
|
+
var S, I, w;
|
|
2849
|
+
(w = (I = (S = d[y]) == null ? void 0 : S[R]) == null ? void 0 : I[g]) == null || delete w[_];
|
|
2826
2850
|
}), v.__FEDERATION__.__INSTANCES__.splice(m, 1);
|
|
2827
2851
|
}
|
|
2828
2852
|
r.moduleCache.delete(e.name);
|
|
2829
2853
|
}
|
|
2830
2854
|
} catch (r) {
|
|
2831
|
-
|
|
2855
|
+
Oe.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
|
|
2832
2856
|
}
|
|
2833
2857
|
}
|
|
2834
2858
|
};
|
|
2835
|
-
const
|
|
2836
|
-
var
|
|
2859
|
+
const Qo = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0, Ne = typeof FEDERATION_OPTIMIZE_NO_REMOTE == "boolean" ? !FEDERATION_OPTIMIZE_NO_REMOTE : !0, tt = typeof FEDERATION_OPTIMIZE_NO_SHARED == "boolean" ? !FEDERATION_OPTIMIZE_NO_SHARED : !0;
|
|
2860
|
+
var en = class {
|
|
2837
2861
|
constructor(e) {
|
|
2838
2862
|
this.hooks = new H({
|
|
2839
2863
|
beforeInit: new X("beforeInit"),
|
|
2840
|
-
init: new
|
|
2864
|
+
init: new M(),
|
|
2841
2865
|
beforeInitContainer: new D("beforeInitContainer"),
|
|
2842
2866
|
initContainer: new D("initContainer")
|
|
2843
|
-
}), this.version = "2.8.
|
|
2844
|
-
getModuleInfo: new
|
|
2845
|
-
createScript: new
|
|
2846
|
-
createLink: new
|
|
2867
|
+
}), this.version = "2.8.2", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new H({
|
|
2868
|
+
getModuleInfo: new M(),
|
|
2869
|
+
createScript: new M(),
|
|
2870
|
+
createLink: new M(),
|
|
2847
2871
|
fetch: new T(),
|
|
2848
2872
|
loadEntryError: new T(),
|
|
2849
2873
|
afterLoadEntry: new T("afterLoadEntry"),
|
|
@@ -2855,23 +2879,23 @@ var Yo = class {
|
|
|
2855
2879
|
afterExecuteFactory: new T("afterExecuteFactory"),
|
|
2856
2880
|
getModuleFactory: new T()
|
|
2857
2881
|
}), this.bridgeHook = new H({
|
|
2858
|
-
beforeBridgeRender: new
|
|
2859
|
-
afterBridgeRender: new
|
|
2860
|
-
beforeBridgeDestroy: new
|
|
2861
|
-
afterBridgeDestroy: new
|
|
2882
|
+
beforeBridgeRender: new M(),
|
|
2883
|
+
afterBridgeRender: new M(),
|
|
2884
|
+
beforeBridgeDestroy: new M(),
|
|
2885
|
+
afterBridgeDestroy: new M()
|
|
2862
2886
|
});
|
|
2863
|
-
const t =
|
|
2864
|
-
id:
|
|
2887
|
+
const t = Ne && Qo ? [Wo(), zo()] : [], r = {
|
|
2888
|
+
id: Lo(),
|
|
2865
2889
|
name: e.name,
|
|
2866
2890
|
plugins: t,
|
|
2867
2891
|
remotes: [],
|
|
2868
2892
|
shared: {},
|
|
2869
2893
|
inBrowser: G
|
|
2870
2894
|
};
|
|
2871
|
-
this.name = e.name, this.options = r, this.snapshotHandler =
|
|
2895
|
+
this.name = e.name, this.options = r, this.snapshotHandler = Ne ? new Ko(this) : new Jo(), this.sharedHandler = tt ? new Zo(this) : new Xo(), this.remoteHandler = Ne ? new Yo(this) : new jo(), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2872
2896
|
}
|
|
2873
2897
|
initOptions(e) {
|
|
2874
|
-
e.name && e.name !== this.options.name &&
|
|
2898
|
+
e.name && e.name !== this.options.name && b(yt(Ct, A)), this.registerPlugins(e.plugins);
|
|
2875
2899
|
const t = this.formatOptions(this.options, e);
|
|
2876
2900
|
return this.options = t, t;
|
|
2877
2901
|
}
|
|
@@ -2902,25 +2926,25 @@ var Yo = class {
|
|
|
2902
2926
|
userOptions: t,
|
|
2903
2927
|
options: e,
|
|
2904
2928
|
shareInfo: r
|
|
2905
|
-
}), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos:
|
|
2929
|
+
}), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos: a } = this.sharedHandler.registerShared(n, o), c = [...n.plugins];
|
|
2906
2930
|
o.plugins && o.plugins.forEach((l) => {
|
|
2907
2931
|
c.includes(l) || c.push(l);
|
|
2908
2932
|
});
|
|
2909
|
-
const
|
|
2933
|
+
const i = {
|
|
2910
2934
|
...e,
|
|
2911
2935
|
...t,
|
|
2912
2936
|
plugins: c,
|
|
2913
2937
|
remotes: s,
|
|
2914
|
-
shared:
|
|
2938
|
+
shared: a,
|
|
2915
2939
|
id: o.id || e.id
|
|
2916
2940
|
};
|
|
2917
2941
|
return this.hooks.lifecycle.init.emit({
|
|
2918
2942
|
origin: this,
|
|
2919
|
-
options:
|
|
2920
|
-
}),
|
|
2943
|
+
options: i
|
|
2944
|
+
}), i;
|
|
2921
2945
|
}
|
|
2922
2946
|
registerPlugins(e) {
|
|
2923
|
-
const t =
|
|
2947
|
+
const t = Co(e, this);
|
|
2924
2948
|
this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
|
|
2925
2949
|
}
|
|
2926
2950
|
registerRemotes(e, t) {
|
|
@@ -2933,11 +2957,11 @@ var Yo = class {
|
|
|
2933
2957
|
});
|
|
2934
2958
|
}
|
|
2935
2959
|
};
|
|
2936
|
-
let
|
|
2960
|
+
let tn = null;
|
|
2937
2961
|
function Jt(e) {
|
|
2938
|
-
return
|
|
2962
|
+
return tn;
|
|
2939
2963
|
}
|
|
2940
|
-
xr(
|
|
2964
|
+
xr(en);
|
|
2941
2965
|
function Zt(e, t) {
|
|
2942
2966
|
const r = (o) => {
|
|
2943
2967
|
if (!o.startsWith("/")) return o;
|
|
@@ -2958,26 +2982,26 @@ function Zt(e, t) {
|
|
|
2958
2982
|
)), n;
|
|
2959
2983
|
});
|
|
2960
2984
|
}
|
|
2961
|
-
function
|
|
2985
|
+
function rn(e) {
|
|
2962
2986
|
const t = e.replace(/\/+$/, ""), r = (s) => s.startsWith("/") && s !== t && !s.startsWith(t + "/"), o = (s) => `${t}${s}`.replace(/\/+/g, "/"), n = (s) => typeof s == "string" ? r(s) ? o(s) : s : "path" in s && typeof s.path == "string" && r(s.path) ? { ...s, path: o(s.path) } : s;
|
|
2963
2987
|
return (s) => {
|
|
2964
|
-
const
|
|
2965
|
-
s.push = (l) =>
|
|
2988
|
+
const a = s.push.bind(s), c = s.replace.bind(s), i = s.resolve.bind(s);
|
|
2989
|
+
s.push = (l) => a(n(l)), s.replace = (l) => c(n(l)), s.resolve = (l, ...u) => i(n(l), ...u);
|
|
2966
2990
|
};
|
|
2967
2991
|
}
|
|
2968
|
-
function
|
|
2992
|
+
function on(e) {
|
|
2969
2993
|
const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
|
|
2970
2994
|
(h, d) => h.path.split("/").filter((p) => p).length - d.path.split("/").filter((p) => p).length
|
|
2971
|
-
),
|
|
2995
|
+
), a = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
2972
2996
|
s.forEach((h) => {
|
|
2973
|
-
const d =
|
|
2974
|
-
d.push(h),
|
|
2997
|
+
const d = a.get(h.path) || [];
|
|
2998
|
+
d.push(h), a.set(h.path, d);
|
|
2975
2999
|
});
|
|
2976
|
-
const
|
|
3000
|
+
const i = (h, d) => `${h}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (h, d = "") => {
|
|
2977
3001
|
if (!h.children || h.children.length === 0)
|
|
2978
3002
|
return h;
|
|
2979
3003
|
for (let p = 0; p < h.children.length; p++) {
|
|
2980
|
-
const E = h.children[p], y =
|
|
3004
|
+
const E = h.children[p], y = i(d, E.path), g = (a.get(y) || []).find(
|
|
2981
3005
|
(_) => !c.has(_) && _ !== h && (E.name == null || _.name === E.name)
|
|
2982
3006
|
);
|
|
2983
3007
|
if (g) {
|
|
@@ -2998,63 +3022,63 @@ function tn(e) {
|
|
|
2998
3022
|
c.add(h), u.push(d);
|
|
2999
3023
|
}
|
|
3000
3024
|
let f, m;
|
|
3001
|
-
return o ? f = de.createMemoryHistory(r) : n ? (f = de.createWebHashHistory(), r && (u = Zt(u, r), m =
|
|
3025
|
+
return o ? f = de.createMemoryHistory(r) : n ? (f = de.createWebHashHistory(), r && (u = Zt(u, r), m = rn(r))) : f = de.createWebHistory(r), { history: f, routes: u, patchRouter: m };
|
|
3002
3026
|
}
|
|
3003
|
-
function
|
|
3027
|
+
function un(e) {
|
|
3004
3028
|
const t = /* @__PURE__ */ new Map(), r = Jt();
|
|
3005
3029
|
return () => ({
|
|
3006
|
-
__APP_VERSION__: "2.8.
|
|
3030
|
+
__APP_VERSION__: "2.8.2",
|
|
3007
3031
|
async render(o) {
|
|
3008
3032
|
var d, p, E, y, R, g;
|
|
3009
3033
|
C.debug("createBridgeComponent render Info", o);
|
|
3010
3034
|
const {
|
|
3011
3035
|
moduleName: n,
|
|
3012
3036
|
dom: s,
|
|
3013
|
-
basename:
|
|
3037
|
+
basename: a,
|
|
3014
3038
|
memoryRoute: c,
|
|
3015
|
-
hashRoute:
|
|
3039
|
+
hashRoute: i,
|
|
3016
3040
|
...l
|
|
3017
3041
|
} = o, u = Xt.createApp(e.rootComponent, l);
|
|
3018
3042
|
t.set(s, u);
|
|
3019
3043
|
const f = await ((E = (p = (d = r == null ? void 0 : r.bridgeHook) == null ? void 0 : d.lifecycle) == null ? void 0 : p.beforeBridgeRender) == null ? void 0 : E.emit(o)), m = f && typeof f == "object" && (f != null && f.extraProps) ? f == null ? void 0 : f.extraProps : {}, h = e.appOptions({
|
|
3020
3044
|
app: u,
|
|
3021
|
-
basename:
|
|
3045
|
+
basename: a,
|
|
3022
3046
|
memoryRoute: c,
|
|
3023
|
-
hashRoute:
|
|
3047
|
+
hashRoute: i,
|
|
3024
3048
|
...l,
|
|
3025
3049
|
...m
|
|
3026
3050
|
});
|
|
3027
3051
|
if (h != null && h.router) {
|
|
3028
|
-
const { history: _, routes:
|
|
3052
|
+
const { history: _, routes: S, patchRouter: I } = on({
|
|
3029
3053
|
router: h.router,
|
|
3030
3054
|
basename: o.basename,
|
|
3031
3055
|
memoryRoute: o.memoryRoute,
|
|
3032
3056
|
hashRoute: o.hashRoute
|
|
3033
|
-
}),
|
|
3057
|
+
}), w = de.createRouter({
|
|
3034
3058
|
...h.router.options,
|
|
3035
3059
|
history: _,
|
|
3036
|
-
routes:
|
|
3060
|
+
routes: S
|
|
3037
3061
|
});
|
|
3038
|
-
I && I(
|
|
3062
|
+
I && I(w), h.afterRouterCreate && h.afterRouterCreate(w), C.debug("createBridgeComponent render router info>>>", {
|
|
3039
3063
|
moduleName: n,
|
|
3040
|
-
router:
|
|
3041
|
-
}), c && await
|
|
3064
|
+
router: w
|
|
3065
|
+
}), c && await w.push(c.entryPath), u.use(w);
|
|
3042
3066
|
}
|
|
3043
3067
|
u.mount(s), (g = (R = (y = r == null ? void 0 : r.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : R.afterBridgeRender) == null || g.emit(o);
|
|
3044
3068
|
},
|
|
3045
3069
|
destroy(o) {
|
|
3046
|
-
var s,
|
|
3070
|
+
var s, a, c, i, l, u;
|
|
3047
3071
|
C.debug("createBridgeComponent destroy Info", o);
|
|
3048
3072
|
const n = t.get(o == null ? void 0 : o.dom);
|
|
3049
|
-
(c = (
|
|
3073
|
+
(c = (a = (s = r == null ? void 0 : r.bridgeHook) == null ? void 0 : s.lifecycle) == null ? void 0 : a.beforeBridgeDestroy) == null || c.emit(o), n == null || n.unmount(), (u = (l = (i = r == null ? void 0 : r.bridgeHook) == null ? void 0 : i.lifecycle) == null ? void 0 : l.afterBridgeDestroy) == null || u.emit(o);
|
|
3050
3074
|
}
|
|
3051
3075
|
});
|
|
3052
3076
|
}
|
|
3053
|
-
function
|
|
3077
|
+
function nn() {
|
|
3054
3078
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
3055
3079
|
window.dispatchEvent(e);
|
|
3056
3080
|
}
|
|
3057
|
-
const
|
|
3081
|
+
const sn = /* @__PURE__ */ Yt({
|
|
3058
3082
|
name: "RemoteApp",
|
|
3059
3083
|
props: {
|
|
3060
3084
|
moduleName: String,
|
|
@@ -3066,14 +3090,14 @@ const on = /* @__PURE__ */ Yt({
|
|
|
3066
3090
|
},
|
|
3067
3091
|
inheritAttrs: !1,
|
|
3068
3092
|
setup(e) {
|
|
3069
|
-
const t = V(null), r = V(null), o = V(""), n = V(!1), s = V(!1),
|
|
3093
|
+
const t = V(null), r = V(null), o = V(""), n = V(!1), s = V(!1), a = V(!1), c = rt(), i = Jt(), l = Qt(), u = () => ({
|
|
3070
3094
|
name: e.moduleName,
|
|
3071
3095
|
dom: t.value,
|
|
3072
3096
|
basename: e.basename,
|
|
3073
3097
|
memoryRoute: e.memoryRoute,
|
|
3074
3098
|
hashRoute: e.hashRoute
|
|
3075
3099
|
}), f = async () => {
|
|
3076
|
-
var y, R, g, _,
|
|
3100
|
+
var y, R, g, _, S, I, w;
|
|
3077
3101
|
if (!t.value || n.value)
|
|
3078
3102
|
return;
|
|
3079
3103
|
const d = (y = e.providerInfo) == null ? void 0 : y.call(e);
|
|
@@ -3087,13 +3111,13 @@ const on = /* @__PURE__ */ Yt({
|
|
|
3087
3111
|
hashRoute: e.hashRoute
|
|
3088
3112
|
};
|
|
3089
3113
|
C.debug("createRemoteAppComponent LazyComponent render >>>", p);
|
|
3090
|
-
const E = await ((_ = (g = (R =
|
|
3114
|
+
const E = await ((_ = (g = (R = i == null ? void 0 : i.bridgeHook) == null ? void 0 : R.lifecycle) == null ? void 0 : g.beforeBridgeRender) == null ? void 0 : _.emit(p)) || {};
|
|
3091
3115
|
p = {
|
|
3092
3116
|
...p,
|
|
3093
3117
|
...E.extraProps
|
|
3094
|
-
}, d.render(p), n.value = !0, (
|
|
3118
|
+
}, d.render(p), n.value = !0, (w = (I = (S = i == null ? void 0 : i.bridgeHook) == null ? void 0 : S.lifecycle) == null ? void 0 : I.afterBridgeRender) == null || w.emit(p);
|
|
3095
3119
|
}, m = () => {
|
|
3096
|
-
var E, y, R, g, _,
|
|
3120
|
+
var E, y, R, g, _, S;
|
|
3097
3121
|
const d = r.value;
|
|
3098
3122
|
if (!d || !n.value)
|
|
3099
3123
|
return;
|
|
@@ -3101,21 +3125,21 @@ const on = /* @__PURE__ */ Yt({
|
|
|
3101
3125
|
...e
|
|
3102
3126
|
});
|
|
3103
3127
|
const p = u();
|
|
3104
|
-
(R = (y = (E =
|
|
3128
|
+
(R = (y = (E = i == null ? void 0 : i.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : y.beforeBridgeDestroy) == null || R.emit(p), d.destroy({
|
|
3105
3129
|
dom: t.value
|
|
3106
|
-
}), r.value = null, n.value = !1, (
|
|
3130
|
+
}), r.value = null, n.value = !1, (S = (_ = (g = i == null ? void 0 : i.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : _.afterBridgeDestroy) == null || S.emit(p);
|
|
3107
3131
|
}, h = er(() => c == null ? void 0 : c.path, (d) => {
|
|
3108
3132
|
s.value && o.value !== "" && o.value !== d && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
3109
3133
|
...e,
|
|
3110
3134
|
pathname: c.path
|
|
3111
|
-
}),
|
|
3135
|
+
}), nn()), o.value = d;
|
|
3112
3136
|
});
|
|
3113
3137
|
return tr(() => {
|
|
3114
3138
|
s.value = !0, f();
|
|
3115
3139
|
}), rr(async () => {
|
|
3116
|
-
s.value = !0,
|
|
3140
|
+
s.value = !0, a.value && (a.value = !1, await or(), f());
|
|
3117
3141
|
}), nr(() => {
|
|
3118
|
-
s.value = !1,
|
|
3142
|
+
s.value = !1, a.value = !0, m();
|
|
3119
3143
|
}), sr(() => {
|
|
3120
3144
|
h(), m();
|
|
3121
3145
|
}), () => ir("div", ar(e.rootAttrs || {}, {
|
|
@@ -3123,17 +3147,17 @@ const on = /* @__PURE__ */ Yt({
|
|
|
3123
3147
|
}), null);
|
|
3124
3148
|
}
|
|
3125
3149
|
});
|
|
3126
|
-
function
|
|
3150
|
+
function an(e) {
|
|
3127
3151
|
return cr({
|
|
3128
3152
|
// @ts-ignore
|
|
3129
|
-
__APP_VERSION__: "2.8.
|
|
3153
|
+
__APP_VERSION__: "2.8.2",
|
|
3130
3154
|
...e.asyncComponentOptions,
|
|
3131
3155
|
//@ts-ignore
|
|
3132
3156
|
loader: async () => {
|
|
3133
|
-
var
|
|
3157
|
+
var i, l;
|
|
3134
3158
|
const t = rt();
|
|
3135
3159
|
let r = "/";
|
|
3136
|
-
const o = (l = (
|
|
3160
|
+
const o = (l = (i = t == null ? void 0 : t.matched) == null ? void 0 : i[0]) == null ? void 0 : l.path;
|
|
3137
3161
|
o && (o.endsWith("/:pathMatch(.*)*") ? r = o.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
|
|
3138
3162
|
const n = (e == null ? void 0 : e.export) || "default";
|
|
3139
3163
|
C.debug(
|
|
@@ -3143,15 +3167,15 @@ function nn(e) {
|
|
|
3143
3167
|
info: e
|
|
3144
3168
|
}
|
|
3145
3169
|
);
|
|
3146
|
-
const s = await e.loader(),
|
|
3170
|
+
const s = await e.loader(), a = s && s[Symbol.for("mf_module_id")], c = s[n];
|
|
3147
3171
|
if (C.debug(
|
|
3148
3172
|
"createRemoteAppComponent LazyComponent loadRemote info >>>",
|
|
3149
|
-
{ moduleName:
|
|
3173
|
+
{ moduleName: a, module: s, exportName: n, basename: r, route: t }
|
|
3150
3174
|
), n in s && typeof c == "function")
|
|
3151
3175
|
return {
|
|
3152
3176
|
render() {
|
|
3153
|
-
return lr(
|
|
3154
|
-
moduleName:
|
|
3177
|
+
return lr(sn, {
|
|
3178
|
+
moduleName: a,
|
|
3155
3179
|
providerInfo: c,
|
|
3156
3180
|
basename: r,
|
|
3157
3181
|
rootAttrs: e.rootAttrs,
|
|
@@ -3164,13 +3188,13 @@ function nn(e) {
|
|
|
3164
3188
|
}
|
|
3165
3189
|
});
|
|
3166
3190
|
}
|
|
3167
|
-
function
|
|
3191
|
+
function fn(e) {
|
|
3168
3192
|
return C.warn(
|
|
3169
3193
|
"createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
3170
|
-
),
|
|
3194
|
+
), an(e);
|
|
3171
3195
|
}
|
|
3172
3196
|
export {
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3197
|
+
un as createBridgeComponent,
|
|
3198
|
+
an as createRemoteAppComponent,
|
|
3199
|
+
fn as createRemoteComponent
|
|
3176
3200
|
};
|