@module-federation/bridge-vue3 2.8.0 → 2.8.1
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 +6 -6
- package/dist/index.js +507 -520
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import * as
|
|
1
|
+
import * as Xt from "vue";
|
|
2
|
+
import { defineComponent as Yt, ref as V, useAttrs as Qt, watch as er, onMounted as tr, onActivated as rr, nextTick as or, onDeactivated as nr, onBeforeUnmount as sr, createVNode as ir, mergeProps as ar, defineAsyncComponent as cr, h as lr } from "vue";
|
|
3
|
+
import * as de from "vue-router";
|
|
4
4
|
import { useRoute as rt } from "vue-router";
|
|
5
|
-
const
|
|
5
|
+
const ur = ".json", fr = "FEDERATION_DEBUG", hr = ":";
|
|
6
6
|
let Ne = /* @__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
|
}({});
|
|
@@ -13,26 +13,28 @@ function ot() {
|
|
|
13
13
|
function nt() {
|
|
14
14
|
return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function dr() {
|
|
17
17
|
try {
|
|
18
|
-
if (ot() && window.localStorage) return !!localStorage.getItem(
|
|
18
|
+
if (ot() && window.localStorage) return !!localStorage.getItem(fr);
|
|
19
19
|
} catch {
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
24
|
function Ae() {
|
|
25
|
-
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 :
|
|
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
|
-
const
|
|
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 Me(e, t) {
|
|
30
31
|
if ("getPublicPath" in e) {
|
|
31
32
|
let r;
|
|
32
33
|
return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
|
|
33
34
|
} else return "publicPath" in e ? !ot() && !nt() && "ssrPublicPath" in e && typeof e.ssrPublicPath == "string" ? `${e.ssrPublicPath}${t}` : `${e.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", e, t), "");
|
|
34
|
-
}
|
|
35
|
-
|
|
35
|
+
}
|
|
36
|
+
const it = (e) => {
|
|
37
|
+
console.warn(`${mr}: ${e}`);
|
|
36
38
|
};
|
|
37
39
|
function at(e) {
|
|
38
40
|
try {
|
|
@@ -41,7 +43,7 @@ function at(e) {
|
|
|
41
43
|
return "";
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
|
-
const
|
|
46
|
+
const we = (e, t) => {
|
|
45
47
|
if (!e) return t;
|
|
46
48
|
const o = ((n) => {
|
|
47
49
|
if (n === ".") return "";
|
|
@@ -54,33 +56,33 @@ const be = (e, t) => {
|
|
|
54
56
|
})(e);
|
|
55
57
|
return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
|
|
56
58
|
};
|
|
57
|
-
function
|
|
59
|
+
function pr(e) {
|
|
58
60
|
return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function yr(e, t = {}) {
|
|
61
63
|
var R;
|
|
62
64
|
const { remotes: r = {}, overrides: o = {}, version: n } = t;
|
|
63
65
|
let s;
|
|
64
|
-
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ?
|
|
66
|
+
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ? pr(n) : e.metaData.publicPath : e.metaData.getPublicPath, c = Object.keys(o);
|
|
65
67
|
let a = {};
|
|
66
68
|
Object.keys(r).length || (a = ((R = e.remotes) == null ? void 0 : R.reduce((g, _) => {
|
|
67
|
-
let
|
|
69
|
+
let b;
|
|
68
70
|
const I = _.federationContainerName;
|
|
69
|
-
return c.includes(I) ?
|
|
71
|
+
return c.includes(I) ? b = o[I] : "version" in _ ? b = _.version : b = _.entry, g[I] = { matchedVersion: b }, g;
|
|
70
72
|
}, {})) || {}), Object.keys(r).forEach((g) => a[g] = { matchedVersion: c.includes(g) ? o[g] : r[g] });
|
|
71
|
-
const { remoteEntry: { path: l, name: u, type:
|
|
73
|
+
const { remoteEntry: { path: l, name: u, type: f }, types: m = {
|
|
72
74
|
path: "",
|
|
73
75
|
name: "",
|
|
74
76
|
zip: "",
|
|
75
77
|
api: ""
|
|
76
|
-
}, buildInfo: { buildVersion:
|
|
78
|
+
}, buildInfo: { buildVersion: h }, globalName: d, ssrRemoteEntry: p } = e.metaData, { exposes: E } = e;
|
|
77
79
|
let y = {
|
|
78
80
|
version: n || "",
|
|
79
|
-
buildVersion:
|
|
81
|
+
buildVersion: h,
|
|
80
82
|
globalName: d,
|
|
81
|
-
remoteEntry:
|
|
82
|
-
remoteEntryType:
|
|
83
|
-
remoteTypes:
|
|
83
|
+
remoteEntry: we(l, u),
|
|
84
|
+
remoteEntryType: f,
|
|
85
|
+
remoteTypes: we(m.path, m.name),
|
|
84
86
|
remoteTypesZip: m.zip || "",
|
|
85
87
|
remoteTypesAPI: m.api || "",
|
|
86
88
|
remotesInfo: a,
|
|
@@ -103,15 +105,15 @@ function pr(e, t = {}) {
|
|
|
103
105
|
...y,
|
|
104
106
|
getPublicPath: i()
|
|
105
107
|
}, p) {
|
|
106
|
-
const g =
|
|
108
|
+
const g = we(p.path, p.name);
|
|
107
109
|
s.ssrRemoteEntry = g, s.ssrRemoteEntryType = p.type || "commonjs-module";
|
|
108
110
|
}
|
|
109
111
|
return s;
|
|
110
112
|
}
|
|
111
113
|
function ct(e) {
|
|
112
|
-
return !!("remoteEntry" in e && e.remoteEntry.includes(
|
|
114
|
+
return !!("remoteEntry" in e && e.remoteEntry.includes(ur));
|
|
113
115
|
}
|
|
114
|
-
const
|
|
116
|
+
const Er = "[ Module Federation ]", Q = console, gr = [
|
|
115
117
|
"logger.ts",
|
|
116
118
|
"logger.js",
|
|
117
119
|
"captureStackTrace",
|
|
@@ -122,12 +124,12 @@ const yr = "[ Module Federation ]", Q = console, Er = [
|
|
|
122
124
|
"Logger.error",
|
|
123
125
|
"Logger.debug"
|
|
124
126
|
];
|
|
125
|
-
function
|
|
127
|
+
function Rr() {
|
|
126
128
|
try {
|
|
127
129
|
const e = (/* @__PURE__ */ new Error()).stack;
|
|
128
130
|
if (!e) return;
|
|
129
131
|
const [, ...t] = e.split(`
|
|
130
|
-
`), r = t.filter((o) => !
|
|
132
|
+
`), r = t.filter((o) => !gr.some((n) => o.includes(n)));
|
|
131
133
|
return r.length ? `Stack trace:
|
|
132
134
|
${r.slice(0, 5).join(`
|
|
133
135
|
`)}` : void 0;
|
|
@@ -146,7 +148,7 @@ var lt = class {
|
|
|
146
148
|
this.delegate = e ?? Q;
|
|
147
149
|
}
|
|
148
150
|
emit(e, t) {
|
|
149
|
-
const r = this.delegate, o = Ae() ?
|
|
151
|
+
const r = this.delegate, o = Ae() ? Rr() : void 0, n = o ? [...t, o] : t, s = (() => {
|
|
150
152
|
switch (e) {
|
|
151
153
|
case "log":
|
|
152
154
|
return ["log", "info"];
|
|
@@ -208,7 +210,7 @@ var lt = class {
|
|
|
208
210
|
function ut(e) {
|
|
209
211
|
return new lt(e);
|
|
210
212
|
}
|
|
211
|
-
function
|
|
213
|
+
function _r(e) {
|
|
212
214
|
const t = new lt(e);
|
|
213
215
|
return Object.defineProperty(t, "__mf_infrastructure_logger__", {
|
|
214
216
|
value: !0,
|
|
@@ -216,8 +218,8 @@ function Rr(e) {
|
|
|
216
218
|
configurable: !1
|
|
217
219
|
}), t;
|
|
218
220
|
}
|
|
219
|
-
|
|
220
|
-
async function
|
|
221
|
+
_r(Er);
|
|
222
|
+
async function ft(e, t) {
|
|
221
223
|
try {
|
|
222
224
|
return await e();
|
|
223
225
|
} catch (r) {
|
|
@@ -229,12 +231,12 @@ function Pe(e, t) {
|
|
|
229
231
|
const r = /^(https?:)?\/\//i;
|
|
230
232
|
return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
|
|
231
233
|
}
|
|
232
|
-
function
|
|
234
|
+
function ht(e) {
|
|
233
235
|
let t = null, r = !0, o = 2e4, n;
|
|
234
236
|
const s = document.getElementsByTagName("script");
|
|
235
237
|
for (let l = 0; l < s.length; l++) {
|
|
236
|
-
const u = s[l],
|
|
237
|
-
if (
|
|
238
|
+
const u = s[l], f = u.getAttribute("src");
|
|
239
|
+
if (f && Pe(f, e.url)) {
|
|
238
240
|
t = u, r = !1;
|
|
239
241
|
break;
|
|
240
242
|
}
|
|
@@ -243,8 +245,8 @@ function ft(e) {
|
|
|
243
245
|
const l = e.attrs;
|
|
244
246
|
t = document.createElement("script"), t.type = (l == null ? void 0 : l.type) === "module" ? "module" : "text/javascript";
|
|
245
247
|
let u;
|
|
246
|
-
e.createScriptHook && (u = e.createScriptHook(e.url, e.attrs), u instanceof HTMLScriptElement ? t = u : typeof u == "object" && ("script" in u && u.script && (t = u.script), "timeout" in u && u.timeout && (o = u.timeout))), t.src || (t.src = e.url), l && !u && Object.keys(l).forEach((
|
|
247
|
-
t && (
|
|
248
|
+
e.createScriptHook && (u = e.createScriptHook(e.url, e.attrs), u instanceof HTMLScriptElement ? t = u : typeof u == "object" && ("script" in u && u.script && (t = u.script), "timeout" in u && u.timeout && (o = u.timeout))), t.src || (t.src = e.url), l && !u && Object.keys(l).forEach((f) => {
|
|
249
|
+
t && (f === "async" || f === "defer" ? t[f] = l[f] : t.getAttribute(f) || t.setAttribute(f, l[f]));
|
|
248
250
|
});
|
|
249
251
|
}
|
|
250
252
|
let i = null;
|
|
@@ -257,24 +259,24 @@ function ft(e) {
|
|
|
257
259
|
c && window.addEventListener("error", c);
|
|
258
260
|
const a = async (l, u) => {
|
|
259
261
|
clearTimeout(n), c && window.removeEventListener("error", c);
|
|
260
|
-
const
|
|
262
|
+
const f = () => {
|
|
261
263
|
if ((u == null ? void 0 : u.type) === "error") {
|
|
262
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.)`);
|
|
263
265
|
m.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(m));
|
|
264
266
|
} else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
|
|
265
267
|
};
|
|
266
|
-
if (t && (t.onerror = null, t.onload = null,
|
|
268
|
+
if (t && (t.onerror = null, t.onload = null, ft(() => {
|
|
267
269
|
const { needDeleteScript: m = !0 } = e;
|
|
268
270
|
m && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
269
271
|
}), l && typeof l == "function")) {
|
|
270
272
|
const m = l(u);
|
|
271
273
|
if (m instanceof Promise) {
|
|
272
|
-
const
|
|
273
|
-
return
|
|
274
|
+
const h = await m;
|
|
275
|
+
return f(), h;
|
|
274
276
|
}
|
|
275
|
-
return
|
|
277
|
+
return f(), m;
|
|
276
278
|
}
|
|
277
|
-
|
|
279
|
+
f();
|
|
278
280
|
};
|
|
279
281
|
return t.onerror = a.bind(null, t.onerror), t.onload = a.bind(null, t.onload), n = setTimeout(() => {
|
|
280
282
|
a(null, {
|
|
@@ -286,7 +288,7 @@ function ft(e) {
|
|
|
286
288
|
needAttach: r
|
|
287
289
|
};
|
|
288
290
|
}
|
|
289
|
-
function
|
|
291
|
+
function br(e) {
|
|
290
292
|
let t = null, r = !0, o = 2e4, n;
|
|
291
293
|
const s = document.getElementsByTagName("link");
|
|
292
294
|
for (let c = 0; c < s.length; c++) {
|
|
@@ -319,7 +321,7 @@ function _r(e) {
|
|
|
319
321
|
u.name = "LinkNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
|
|
320
322
|
} else e != null && e.cb && (e == null || e.cb());
|
|
321
323
|
};
|
|
322
|
-
if (t && (t.onerror = null, t.onload = null,
|
|
324
|
+
if (t && (t.onerror = null, t.onload = null, ft(() => {
|
|
323
325
|
const { needDeleteLink: u = !0 } = e;
|
|
324
326
|
u && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
325
327
|
}), c)) {
|
|
@@ -341,7 +343,7 @@ function _r(e) {
|
|
|
341
343
|
function Sr(e, t) {
|
|
342
344
|
const { attrs: r = {}, createScriptHook: o } = t;
|
|
343
345
|
return new Promise((n, s) => {
|
|
344
|
-
const { script: i, needAttach: c } =
|
|
346
|
+
const { script: i, needAttach: c } = ht({
|
|
345
347
|
url: e,
|
|
346
348
|
cb: n,
|
|
347
349
|
onErrorCallback: s,
|
|
@@ -355,19 +357,19 @@ function Sr(e, t) {
|
|
|
355
357
|
c && document.head.appendChild(i);
|
|
356
358
|
});
|
|
357
359
|
}
|
|
358
|
-
const
|
|
360
|
+
const ce = /* @__PURE__ */ new Map();
|
|
359
361
|
function x(e) {
|
|
360
362
|
if (!e) throw new Error("import specifier is required");
|
|
361
|
-
if (
|
|
363
|
+
if (ce.has(e)) return ce.get(e);
|
|
362
364
|
const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
|
|
363
|
-
throw console.error(`Error importing module ${e}:`, r),
|
|
365
|
+
throw console.error(`Error importing module ${e}:`, r), ce.delete(e), r;
|
|
364
366
|
});
|
|
365
|
-
return
|
|
367
|
+
return ce.set(e, t), t;
|
|
366
368
|
}
|
|
367
|
-
const
|
|
369
|
+
const wr = async (e, t, r) => {
|
|
368
370
|
const n = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
|
|
369
371
|
return !n || !(n instanceof Response) ? fetch(e, t || {}) : n;
|
|
370
|
-
},
|
|
372
|
+
}, Ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, o) => {
|
|
371
373
|
if (o != null && o.createScriptHook) {
|
|
372
374
|
const c = o.createScriptHook(e);
|
|
373
375
|
c && typeof c == "object" && "url" in c && (e = c.url);
|
|
@@ -379,16 +381,16 @@ const br = async (e, t, r) => {
|
|
|
379
381
|
console.error("Error constructing URL:", c), t(/* @__PURE__ */ new Error(`Invalid URL: ${c}`));
|
|
380
382
|
return;
|
|
381
383
|
}
|
|
382
|
-
const s = async () => o != null && o.fetch ? (c, a) =>
|
|
384
|
+
const s = async () => o != null && o.fetch ? (c, a) => wr(c, a, o) : fetch, i = async (c, a) => {
|
|
383
385
|
var l;
|
|
384
386
|
try {
|
|
385
|
-
const
|
|
387
|
+
const f = await (await c(a.href)).text(), [m, h] = await Promise.all([x("path"), x("vm")]), d = {
|
|
386
388
|
exports: {},
|
|
387
389
|
module: { exports: {} }
|
|
388
|
-
}, p = a.pathname.split("/").slice(0, -1).join("/"), E = m.basename(a.pathname), y = new
|
|
390
|
+
}, p = a.pathname.split("/").slice(0, -1).join("/"), E = m.basename(a.pathname), y = new h.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
389
391
|
})`, {
|
|
390
392
|
filename: E,
|
|
391
|
-
importModuleDynamically: ((l =
|
|
393
|
+
importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? x
|
|
392
394
|
});
|
|
393
395
|
let R;
|
|
394
396
|
R = (await x("node:module")).createRequire(a.protocol === "file:" || a.protocol === "node:" ? a.href : m.join(process.cwd(), "__mf_require_base__.js")), y.runInThisContext()(d.exports, d.module, R, p, E);
|
|
@@ -417,8 +419,8 @@ const br = async (e, t, r) => {
|
|
|
417
419
|
});
|
|
418
420
|
} : (e, t, r, o) => {
|
|
419
421
|
t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
420
|
-
},
|
|
421
|
-
|
|
422
|
+
}, $r = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, o) => {
|
|
423
|
+
Ir(e, (n, s) => {
|
|
422
424
|
var i, c;
|
|
423
425
|
if (n) o(n);
|
|
424
426
|
else {
|
|
@@ -429,42 +431,42 @@ const br = async (e, t, r) => {
|
|
|
429
431
|
}) : (e, t) => {
|
|
430
432
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
431
433
|
}, Z = /* @__PURE__ */ new Map(), dt = (e) => e.startsWith("http:") || e.startsWith("https:"), mt = (e) => !e.startsWith("./") && !e.startsWith("../") && !e.startsWith("/") && !e.includes(":");
|
|
432
|
-
function
|
|
434
|
+
function Tr(e) {
|
|
433
435
|
const t = new URL(e), r = encodeURIComponent(t.protocol.slice(0, -1)), o = encodeURIComponent(t.host), n = t.pathname.split("/").map((i) => encodeURIComponent(i)).join("/"), s = encodeURIComponent(`${t.search}${t.hash}`);
|
|
434
436
|
return `/${r}/${o}${n}${s ? `/${s}` : ""}`;
|
|
435
437
|
}
|
|
436
|
-
function
|
|
438
|
+
function vr(e, t) {
|
|
437
439
|
const r = t.endsWith("/") ? t : `${t}/`;
|
|
438
|
-
return new URL(`__module_federation_remote__${
|
|
440
|
+
return new URL(`__module_federation_remote__${Tr(e)}`, r).href;
|
|
439
441
|
}
|
|
440
|
-
async function
|
|
442
|
+
async function Nr(e) {
|
|
441
443
|
return e.startsWith("node:") ? !0 : mt(e) ? (await x("node:module")).builtinModules.includes(e) : !1;
|
|
442
444
|
}
|
|
443
|
-
function
|
|
445
|
+
function Ar(e) {
|
|
444
446
|
const t = e && (typeof e == "object" || typeof e == "function") ? e : { default: e }, r = { ...t };
|
|
445
447
|
return Object.prototype.hasOwnProperty.call(r, "default") || (r.default = t), r;
|
|
446
448
|
}
|
|
447
|
-
async function
|
|
449
|
+
async function Mr(e, t, r) {
|
|
448
450
|
if (typeof r.SyntheticModule != "function") throw new Error("vm.SyntheticModule is required to load Node.js built-in modules in ESM remote entries.");
|
|
449
|
-
const o =
|
|
451
|
+
const o = Ar(t), n = Object.keys(o), s = new r.SyntheticModule(n, function() {
|
|
450
452
|
for (const c of n) this.setExport(c, o[c]);
|
|
451
453
|
}, { identifier: e });
|
|
452
454
|
return Z.set(e, s), await s.link(async () => {
|
|
453
455
|
throw new Error(`Node.js built-in module "${e}" should not request child modules.`);
|
|
454
456
|
}), await s.evaluate(), s;
|
|
455
457
|
}
|
|
456
|
-
async function
|
|
458
|
+
async function Pr(e, t) {
|
|
457
459
|
const r = `node-builtin:${e}`;
|
|
458
|
-
return Z.has(r) ? Z.get(r) :
|
|
460
|
+
return Z.has(r) ? Z.get(r) : Mr(r, await x(e), t);
|
|
459
461
|
}
|
|
460
462
|
async function We(e, t, r) {
|
|
461
|
-
if (await
|
|
463
|
+
if (await Nr(e)) return Pr(e, r.vm);
|
|
462
464
|
if (mt(e)) throw new Error(`Unsupported ESM module specifier "${e}". Only relative or absolute http(s) remote modules and Node.js built-in modules are supported.`);
|
|
463
465
|
const o = new URL(e, t).href;
|
|
464
466
|
if (!dt(o)) throw new Error(`Unsupported ESM module specifier "${e}" resolved to "${o}". Only http(s) remote modules and Node.js built-in modules are supported.`);
|
|
465
467
|
return pt(o, r);
|
|
466
468
|
}
|
|
467
|
-
async function
|
|
469
|
+
async function kr(e) {
|
|
468
470
|
if (e.status === "linked" && await e.evaluate(), e.status === "errored") throw e.error;
|
|
469
471
|
return e;
|
|
470
472
|
}
|
|
@@ -475,19 +477,19 @@ async function pt(e, t) {
|
|
|
475
477
|
const n = await (await r(e)).text(), s = (await x("node:url")).pathToFileURL(process.cwd()).href, i = new o.SourceTextModule(n, {
|
|
476
478
|
identifier: e,
|
|
477
479
|
initializeImportMeta: (c) => {
|
|
478
|
-
c.url =
|
|
480
|
+
c.url = vr(e, s);
|
|
479
481
|
},
|
|
480
|
-
importModuleDynamically: async (c) =>
|
|
482
|
+
importModuleDynamically: async (c) => kr(await We(c, e, t))
|
|
481
483
|
});
|
|
482
484
|
return Z.set(e, i), await i.link(async (c) => We(c, e, t)), i;
|
|
483
485
|
}
|
|
484
|
-
const C = ut("[ Module Federation Bridge Vue3 ]"),
|
|
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) => {
|
|
485
487
|
const n = [`${[t[e]]} #${e}`];
|
|
486
|
-
return r && n.push(`args: ${JSON.stringify(r)}`), n.push(
|
|
488
|
+
return r && n.push(`args: ${JSON.stringify(r)}`), n.push(Or(e)), o && n.push(`Original Error Message:
|
|
487
489
|
${o}`), n.join(`
|
|
488
490
|
`);
|
|
489
491
|
};
|
|
490
|
-
function
|
|
492
|
+
function Lr(e, t, r, o, n, s) {
|
|
491
493
|
return o(yt(e, t, r, n));
|
|
492
494
|
}
|
|
493
495
|
const U = "[ Federation Runtime ]", ke = ut(U);
|
|
@@ -495,19 +497,19 @@ function L(e, t, r, o, n) {
|
|
|
495
497
|
e || w(t);
|
|
496
498
|
}
|
|
497
499
|
function w(e, t, r, o, n) {
|
|
498
|
-
if (t !== void 0) return
|
|
500
|
+
if (t !== void 0) return Lr(e, t, r ?? {}, (i) => {
|
|
499
501
|
throw new Error(`${U}: ${i}`);
|
|
500
502
|
}, o);
|
|
501
503
|
const s = e;
|
|
502
504
|
throw s instanceof Error ? (s.message.startsWith(U) || (s.message = `${U}: ${s.message}`), s) : new Error(`${U}: ${s}`);
|
|
503
505
|
}
|
|
504
|
-
function
|
|
506
|
+
function oe(e) {
|
|
505
507
|
e instanceof Error && (e.message.startsWith(U) || (e.message = `${U}: ${e.message}`)), ke.warn(e);
|
|
506
508
|
}
|
|
507
|
-
function
|
|
509
|
+
function Cr(e, t) {
|
|
508
510
|
return e.findIndex((r) => r === t) === -1 && e.push(t), e;
|
|
509
511
|
}
|
|
510
|
-
function
|
|
512
|
+
function ne(e) {
|
|
511
513
|
return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
|
|
512
514
|
}
|
|
513
515
|
function Ce(e) {
|
|
@@ -519,9 +521,9 @@ function Et(e) {
|
|
|
519
521
|
function Fe(e) {
|
|
520
522
|
return e && typeof e == "object";
|
|
521
523
|
}
|
|
522
|
-
const
|
|
523
|
-
function
|
|
524
|
-
return
|
|
524
|
+
const Fr = Object.prototype.toString;
|
|
525
|
+
function Hr(e) {
|
|
526
|
+
return Fr.call(e) === "[object Object]";
|
|
525
527
|
}
|
|
526
528
|
function gt(e) {
|
|
527
529
|
return Array.isArray(e) ? e : [e];
|
|
@@ -542,7 +544,7 @@ function Rt(e) {
|
|
|
542
544
|
globalName: e.globalName
|
|
543
545
|
} : t;
|
|
544
546
|
}
|
|
545
|
-
const
|
|
547
|
+
const Dr = (e, t) => {
|
|
546
548
|
let r;
|
|
547
549
|
return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
|
|
548
550
|
}, v = typeof globalThis == "object" ? globalThis : window, k = (() => {
|
|
@@ -551,34 +553,34 @@ const Hr = (e, t) => {
|
|
|
551
553
|
} catch {
|
|
552
554
|
return v;
|
|
553
555
|
}
|
|
554
|
-
})(),
|
|
555
|
-
function
|
|
556
|
+
})(), be = k;
|
|
557
|
+
function me(e, t, r) {
|
|
556
558
|
Object.defineProperty(e, t, {
|
|
557
559
|
value: r,
|
|
558
560
|
configurable: !1,
|
|
559
561
|
writable: !0
|
|
560
562
|
});
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function pe(e, t) {
|
|
563
565
|
return Object.hasOwnProperty.call(e, t);
|
|
564
566
|
}
|
|
565
|
-
|
|
567
|
+
pe(v, "__GLOBAL_LOADING_REMOTE_ENTRY__") || me(v, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
566
568
|
const J = v.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
567
569
|
function _t(e) {
|
|
568
570
|
var t, r, o, n, s, i;
|
|
569
|
-
|
|
571
|
+
pe(e, "__VMOK__") && !pe(e, "__FEDERATION__") && me(e, "__FEDERATION__", e.__VMOK__), pe(e, "__FEDERATION__") || (me(e, "__FEDERATION__", {
|
|
570
572
|
__GLOBAL_PLUGIN__: [],
|
|
571
573
|
__INSTANCES__: [],
|
|
572
574
|
moduleInfo: {},
|
|
573
575
|
__SHARE__: {},
|
|
574
576
|
__MANIFEST_LOADING__: {},
|
|
575
577
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
576
|
-
}),
|
|
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__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
577
579
|
}
|
|
578
580
|
_t(v);
|
|
579
581
|
_t(k);
|
|
580
|
-
function
|
|
581
|
-
t && (v.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, v.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.
|
|
582
|
+
function xr(e, t = Ae()) {
|
|
583
|
+
t && (v.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, v.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.1");
|
|
582
584
|
}
|
|
583
585
|
function W(e, t) {
|
|
584
586
|
if (typeof t == "string") {
|
|
@@ -602,17 +604,17 @@ function W(e, t) {
|
|
|
602
604
|
}
|
|
603
605
|
} else w(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
604
606
|
}
|
|
605
|
-
const Ve = () => k.__FEDERATION__.moduleInfo,
|
|
606
|
-
const r = W(t,
|
|
607
|
+
const Ve = () => k.__FEDERATION__.moduleInfo, Gr = (e, t) => {
|
|
608
|
+
const r = W(t, ne(e)).value;
|
|
607
609
|
if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
|
|
608
610
|
if ("version" in e && e.version) {
|
|
609
|
-
const { version: o, ...n } = e, s =
|
|
611
|
+
const { version: o, ...n } = e, s = ne(n), i = W(k.__FEDERATION__.moduleInfo, s).value;
|
|
610
612
|
if ((i == null ? void 0 : i.version) === o) return i;
|
|
611
613
|
}
|
|
612
|
-
},
|
|
613
|
-
const r =
|
|
614
|
+
}, ye = (e) => Gr(e, k.__FEDERATION__.moduleInfo), qe = (e, t) => {
|
|
615
|
+
const r = ne(e);
|
|
614
616
|
return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
|
|
615
|
-
},
|
|
617
|
+
}, Ur = (e) => (k.__FEDERATION__.moduleInfo = {
|
|
616
618
|
...k.__FEDERATION__.moduleInfo,
|
|
617
619
|
...e
|
|
618
620
|
}, () => {
|
|
@@ -624,7 +626,7 @@ const Ve = () => k.__FEDERATION__.moduleInfo, xr = (e, t) => {
|
|
|
624
626
|
remoteEntryKey: r,
|
|
625
627
|
entryExports: v[r]
|
|
626
628
|
};
|
|
627
|
-
},
|
|
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-]+", De = `(?:\\+(${ze}(?:\\.${ze})*))`, re = "0|[1-9]\\d*", Ee = "[0-9]+", bt = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ke = `(?:${Ee}|${bt})`, Vr = `(?:-?(${Ke}(?:\\.${Ke})*))`, Je = `(?:${re}|${bt})`, St = `(?:-(${Je}(?:\\.${Je})*))`, Ie = `${re}|x|X|\\*`, Y = `[v=\\s]*(${Ie})(?:\\.(${Ie})(?:\\.(${Ie})(?:${St})?${De}?)?)?`, qr = `^\\s*(${Y})\\s+-\\s+(${Y})\\s*$`, zr = `[v=\\s]*${`(${Ee})\\.(${Ee})\\.(${Ee})`}${Vr}?${De}?`, xe = "((?:<|>)?=?)", Kr = `(\\s*)${xe}\\s*(${zr}|${Y})`, wt = "(?:~>?)", Jr = `(\\s*)${wt}\\s+`, It = "(?:\\^)", Zr = `(\\s*)${It}\\s+`, Xr = "(<|>)?=?\\s*\\*", Yr = `^${It}${Y}$`, Qr = `v?${`(${re})\\.(${re})\\.(${re})`}${St}?${De}?`, eo = `^${wt}${Y}$`, to = `^${xe}\\s*${Y}$`, ro = `^${xe}\\s*(${Qr})$|^$`, oo = "^\\s*>=\\s*0.0.0\\s*$";
|
|
628
630
|
function O(e) {
|
|
629
631
|
return new RegExp(e);
|
|
630
632
|
}
|
|
@@ -635,46 +637,46 @@ function $t(...e) {
|
|
|
635
637
|
return (t) => e.reduce((r, o) => o(r), t);
|
|
636
638
|
}
|
|
637
639
|
function Ze(e) {
|
|
638
|
-
return e.match(O(
|
|
640
|
+
return e.match(O(ro));
|
|
639
641
|
}
|
|
640
642
|
function Xe(e, t, r, o) {
|
|
641
643
|
const n = `${e}.${t}.${r}`;
|
|
642
644
|
return o ? `${n}-${o}` : n;
|
|
643
645
|
}
|
|
644
|
-
function oo(e) {
|
|
645
|
-
return e.replace(O(Vr), (t, r, o, n, s, i, c, a, l, u, h, m) => (N(o) ? r = "" : N(n) ? r = `>=${o}.0.0` : N(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, N(l) ? a = "" : N(u) ? a = `<${Number(l) + 1}.0.0-0` : N(h) ? a = `<${l}.${Number(u) + 1}.0-0` : m ? a = `<=${l}.${u}.${h}-${m}` : a = `<=${a}`, `${r} ${a}`.trim()));
|
|
646
|
-
}
|
|
647
646
|
function no(e) {
|
|
648
|
-
return e.replace(O(
|
|
647
|
+
return e.replace(O(qr), (t, r, o, n, s, i, c, a, l, u, f, m) => (N(o) ? r = "" : N(n) ? r = `>=${o}.0.0` : N(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, N(l) ? a = "" : N(u) ? a = `<${Number(l) + 1}.0.0-0` : N(f) ? a = `<${l}.${Number(u) + 1}.0-0` : m ? a = `<=${l}.${u}.${f}-${m}` : a = `<=${a}`, `${r} ${a}`.trim()));
|
|
649
648
|
}
|
|
650
649
|
function so(e) {
|
|
651
|
-
return e.replace(O(Kr), "$1
|
|
650
|
+
return e.replace(O(Kr), "$1$2$3");
|
|
652
651
|
}
|
|
653
652
|
function io(e) {
|
|
654
|
-
return e.replace(O(Jr), "$1
|
|
653
|
+
return e.replace(O(Jr), "$1~");
|
|
655
654
|
}
|
|
656
655
|
function ao(e) {
|
|
657
|
-
return e.
|
|
656
|
+
return e.replace(O(Zr), "$1^");
|
|
658
657
|
}
|
|
659
658
|
function co(e) {
|
|
660
|
-
return e.trim().split(/\s+/).map((t) => t.replace(O(
|
|
659
|
+
return e.trim().split(/\s+/).map((t) => t.replace(O(Yr), (r, o, n, s, i) => 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` : i ? o === "0" ? n === "0" ? `>=${o}.${n}.${s}-${i} <${o}.${n}.${Number(s) + 1}-0` : `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s}-${i} <${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(" ");
|
|
661
660
|
}
|
|
662
661
|
function lo(e) {
|
|
663
|
-
return e.split(/\s+/).map((t) => t.
|
|
662
|
+
return e.trim().split(/\s+/).map((t) => t.replace(O(eo), (r, o, n, s, i) => N(o) ? "" : N(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : N(s) ? `>=${o}.${n}.0 <${o}.${Number(n) + 1}.0-0` : i ? `>=${o}.${n}.${s}-${i} <${o}.${Number(n) + 1}.0-0` : `>=${o}.${n}.${s} <${o}.${Number(n) + 1}.0-0`)).join(" ");
|
|
663
|
+
}
|
|
664
|
+
function uo(e) {
|
|
665
|
+
return e.split(/\s+/).map((t) => t.trim().replace(O(to), (r, o, n, s, i, c) => {
|
|
664
666
|
const a = N(n), l = a || N(s), u = l || N(i);
|
|
665
667
|
return o === "=" && u && (o = ""), c = "", a ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && u ? (l && (s = 0), i = 0, o === ">" ? (o = ">=", l ? (n = Number(n) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : o === "<=" && (o = "<", l ? n = Number(n) + 1 : s = Number(s) + 1), o === "<" && (c = "-0"), `${o + n}.${s}.${i}${c}`) : l ? `>=${n}.0.0${c} <${Number(n) + 1}.0.0-0` : u ? `>=${n}.${s}.0${c} <${n}.${Number(s) + 1}.0-0` : r;
|
|
666
668
|
})).join(" ");
|
|
667
669
|
}
|
|
668
|
-
function
|
|
669
|
-
return e.trim().replace(O(
|
|
670
|
+
function fo(e) {
|
|
671
|
+
return e.trim().replace(O(Xr), "");
|
|
670
672
|
}
|
|
671
673
|
function ho(e) {
|
|
672
|
-
return e.trim().replace(O(
|
|
674
|
+
return e.trim().replace(O(oo), "");
|
|
673
675
|
}
|
|
674
|
-
function
|
|
676
|
+
function ge(e, t) {
|
|
675
677
|
return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
|
|
676
678
|
}
|
|
677
|
-
function
|
|
679
|
+
function mo(e, t) {
|
|
678
680
|
const { preRelease: r } = e, { preRelease: o } = t;
|
|
679
681
|
if (r === void 0 && o) return 1;
|
|
680
682
|
if (r && o === void 0) return -1;
|
|
@@ -682,42 +684,42 @@ function fo(e, t) {
|
|
|
682
684
|
for (let n = 0, s = r.length; n <= s; n++) {
|
|
683
685
|
const i = r[n], c = o[n];
|
|
684
686
|
if (i !== c)
|
|
685
|
-
return i === void 0 && c === void 0 ? 0 : i ? c ?
|
|
687
|
+
return i === void 0 && c === void 0 ? 0 : i ? c ? ge(i, c) : -1 : 1;
|
|
686
688
|
}
|
|
687
689
|
return 0;
|
|
688
690
|
}
|
|
689
|
-
function
|
|
690
|
-
return
|
|
691
|
+
function le(e, t) {
|
|
692
|
+
return ge(e.major, t.major) || ge(e.minor, t.minor) || ge(e.patch, t.patch) || mo(e, t);
|
|
691
693
|
}
|
|
692
|
-
function
|
|
694
|
+
function $e(e, t) {
|
|
693
695
|
return e.version === t.version;
|
|
694
696
|
}
|
|
695
|
-
function
|
|
697
|
+
function po(e, t) {
|
|
696
698
|
switch (e.operator) {
|
|
697
699
|
case "":
|
|
698
700
|
case "=":
|
|
699
|
-
return
|
|
701
|
+
return $e(e, t);
|
|
700
702
|
case ">":
|
|
701
|
-
return
|
|
703
|
+
return le(e, t) < 0;
|
|
702
704
|
case ">=":
|
|
703
|
-
return
|
|
705
|
+
return $e(e, t) || le(e, t) < 0;
|
|
704
706
|
case "<":
|
|
705
|
-
return
|
|
707
|
+
return le(e, t) > 0;
|
|
706
708
|
case "<=":
|
|
707
|
-
return
|
|
709
|
+
return $e(e, t) || le(e, t) > 0;
|
|
708
710
|
case void 0:
|
|
709
711
|
return !0;
|
|
710
712
|
default:
|
|
711
713
|
return !1;
|
|
712
714
|
}
|
|
713
715
|
}
|
|
714
|
-
function po(e) {
|
|
715
|
-
return $t(ao, co, lo, uo)(e);
|
|
716
|
-
}
|
|
717
716
|
function yo(e) {
|
|
718
|
-
return $t(
|
|
717
|
+
return $t(co, lo, uo, fo)(e);
|
|
719
718
|
}
|
|
720
|
-
function
|
|
719
|
+
function Eo(e) {
|
|
720
|
+
return $t(no, so, io, ao)(e.trim()).split(/\s+/).join(" ");
|
|
721
|
+
}
|
|
722
|
+
function te(e, t) {
|
|
721
723
|
if (!e) return !1;
|
|
722
724
|
const r = Ze(e);
|
|
723
725
|
if (!r) return !1;
|
|
@@ -730,14 +732,14 @@ function re(e, t) {
|
|
|
730
732
|
preRelease: c == null ? void 0 : c.split(".")
|
|
731
733
|
}, l = t.split("||");
|
|
732
734
|
for (const u of l) {
|
|
733
|
-
const
|
|
734
|
-
if (!
|
|
735
|
+
const f = u.trim();
|
|
736
|
+
if (!f || f === "*" || f === "x") return !0;
|
|
735
737
|
try {
|
|
736
|
-
const m =
|
|
738
|
+
const m = Eo(f);
|
|
737
739
|
if (!m.trim()) return !0;
|
|
738
|
-
const
|
|
739
|
-
if (!
|
|
740
|
-
const d =
|
|
740
|
+
const h = m.split(" ").map((E) => yo(E)).join(" ");
|
|
741
|
+
if (!h.trim()) return !0;
|
|
742
|
+
const d = h.split(/\s+/).map((E) => ho(E)).filter(Boolean);
|
|
741
743
|
if (d.length === 0) continue;
|
|
742
744
|
let p = !0;
|
|
743
745
|
for (const E of d) {
|
|
@@ -746,13 +748,13 @@ function re(e, t) {
|
|
|
746
748
|
p = !1;
|
|
747
749
|
break;
|
|
748
750
|
}
|
|
749
|
-
const [, R, , g, _,
|
|
750
|
-
if (!
|
|
751
|
+
const [, R, , g, _, b, I] = y;
|
|
752
|
+
if (!po({
|
|
751
753
|
operator: R,
|
|
752
|
-
version: Xe(g, _,
|
|
754
|
+
version: Xe(g, _, b, I),
|
|
753
755
|
major: g,
|
|
754
756
|
minor: _,
|
|
755
|
-
patch:
|
|
757
|
+
patch: b,
|
|
756
758
|
preRelease: I == null ? void 0 : I.split(".")
|
|
757
759
|
}, a)) {
|
|
758
760
|
p = !1;
|
|
@@ -761,14 +763,14 @@ function re(e, t) {
|
|
|
761
763
|
}
|
|
762
764
|
if (p) return !0;
|
|
763
765
|
} catch (m) {
|
|
764
|
-
console.error(`[semver] Error processing range part "${
|
|
766
|
+
console.error(`[semver] Error processing range part "${f}":`, m);
|
|
765
767
|
continue;
|
|
766
768
|
}
|
|
767
769
|
}
|
|
768
770
|
return !1;
|
|
769
771
|
}
|
|
770
|
-
const
|
|
771
|
-
function
|
|
772
|
+
const ae = "default", Tt = "global";
|
|
773
|
+
function go(e, t, r, o) {
|
|
772
774
|
var s, i;
|
|
773
775
|
let n;
|
|
774
776
|
return "get" in e ? n = e.get : "lib" in e ? n = () => Promise.resolve(e.lib) : n = () => Promise.resolve(() => {
|
|
@@ -803,7 +805,7 @@ function vt(e, t) {
|
|
|
803
805
|
const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((i, c) => {
|
|
804
806
|
const a = gt(r[c]);
|
|
805
807
|
return i[c] = i[c] || [], a.forEach((l) => {
|
|
806
|
-
i[c].push(
|
|
808
|
+
i[c].push(go(l, o, c, t.shareStrategy));
|
|
807
809
|
}), i;
|
|
808
810
|
}, {}), s = { ...e.shared };
|
|
809
811
|
return Object.keys(n).forEach((i) => {
|
|
@@ -815,10 +817,10 @@ function vt(e, t) {
|
|
|
815
817
|
newShareInfos: n
|
|
816
818
|
};
|
|
817
819
|
}
|
|
818
|
-
function
|
|
820
|
+
function se(e, t) {
|
|
819
821
|
if (!e) return !1;
|
|
820
822
|
const { status: r, mode: o } = e;
|
|
821
|
-
return r === Ne.NO_USE ? !1 : r === Ne.CALCULATED ? !0 : o === "runtime-infer" ? t ?
|
|
823
|
+
return r === Ne.NO_USE ? !1 : r === Ne.CALCULATED ? !0 : o === "runtime-infer" ? t ? _o(e, t) : !0 : !1;
|
|
822
824
|
}
|
|
823
825
|
function B(e, t) {
|
|
824
826
|
const r = (o) => {
|
|
@@ -830,40 +832,40 @@ function B(e, t) {
|
|
|
830
832
|
}
|
|
831
833
|
return o;
|
|
832
834
|
};
|
|
833
|
-
return !!
|
|
835
|
+
return !!te(r(e), `<=${r(t)}`);
|
|
834
836
|
}
|
|
835
|
-
const
|
|
837
|
+
const ie = (e, t) => {
|
|
836
838
|
const r = t || function(o, n) {
|
|
837
839
|
return B(o, n);
|
|
838
840
|
};
|
|
839
841
|
return Object.keys(e).reduce((o, n) => !o || r(o, n) || o === "0" ? n : o, 0);
|
|
840
|
-
},
|
|
842
|
+
}, _e = (e) => !!e.loaded || typeof e.lib == "function", Ro = (e) => !!e.loading, _o = (e, t) => {
|
|
841
843
|
if (!e || !t) return !1;
|
|
842
844
|
const { usedExports: r } = e;
|
|
843
845
|
return r ? !!t.every((o) => r.includes(o)) : !1;
|
|
844
846
|
};
|
|
845
|
-
function
|
|
847
|
+
function bo(e, t, r, o) {
|
|
846
848
|
const n = e[t][r];
|
|
847
|
-
let s = "", i =
|
|
849
|
+
let s = "", i = se(o);
|
|
848
850
|
const c = function(a, l) {
|
|
849
|
-
return i ? n[a].treeShaking ? n[l].treeShaking ? !
|
|
851
|
+
return i ? n[a].treeShaking ? n[l].treeShaking ? !_e(n[a].treeShaking) && B(a, l) : !1 : !0 : !_e(n[a]) && B(a, l);
|
|
850
852
|
};
|
|
851
853
|
if (i) {
|
|
852
|
-
if (s =
|
|
854
|
+
if (s = ie(e[t][r], c), s) return {
|
|
853
855
|
version: s,
|
|
854
856
|
useTreesShaking: i
|
|
855
857
|
};
|
|
856
858
|
i = !1;
|
|
857
859
|
}
|
|
858
860
|
return {
|
|
859
|
-
version:
|
|
861
|
+
version: ie(e[t][r], c),
|
|
860
862
|
useTreesShaking: i
|
|
861
863
|
};
|
|
862
864
|
}
|
|
863
|
-
const q = (e) =>
|
|
865
|
+
const q = (e) => _e(e) || Ro(e);
|
|
864
866
|
function So(e, t, r, o) {
|
|
865
867
|
const n = e[t][r];
|
|
866
|
-
let s = "", i =
|
|
868
|
+
let s = "", i = se(o);
|
|
867
869
|
const c = function(a, l) {
|
|
868
870
|
if (i) {
|
|
869
871
|
if (!n[a].treeShaking) return !0;
|
|
@@ -874,30 +876,30 @@ function So(e, t, r, o) {
|
|
|
874
876
|
return q(n[l]) ? q(n[a]) ? !!B(a, l) : !0 : q(n[a]) ? !1 : B(a, l);
|
|
875
877
|
};
|
|
876
878
|
if (i) {
|
|
877
|
-
if (s =
|
|
879
|
+
if (s = ie(e[t][r], c), s) return {
|
|
878
880
|
version: s,
|
|
879
881
|
useTreesShaking: i
|
|
880
882
|
};
|
|
881
883
|
i = !1;
|
|
882
884
|
}
|
|
883
885
|
return {
|
|
884
|
-
version:
|
|
886
|
+
version: ie(e[t][r], c),
|
|
885
887
|
useTreesShaking: i
|
|
886
888
|
};
|
|
887
889
|
}
|
|
888
|
-
function
|
|
889
|
-
return e === "loaded-first" ? So :
|
|
890
|
+
function wo(e) {
|
|
891
|
+
return e === "loaded-first" ? So : bo;
|
|
890
892
|
}
|
|
891
|
-
function
|
|
893
|
+
function Re(e, t, r, o) {
|
|
892
894
|
if (!e) return;
|
|
893
|
-
const { shareConfig: n, scope: s =
|
|
895
|
+
const { shareConfig: n, scope: s = ae, strategy: i, treeShaking: c } = r, a = Array.isArray(s) ? s : [s];
|
|
894
896
|
for (const l of a) if (n && e[l] && e[l][t]) {
|
|
895
|
-
const { requiredVersion: u } = n, { version:
|
|
896
|
-
const p = e[l][t][
|
|
897
|
+
const { requiredVersion: u } = n, { version: f, useTreesShaking: m } = wo(i)(e, l, t, c), h = () => {
|
|
898
|
+
const p = e[l][t][f];
|
|
897
899
|
if (n.singleton) {
|
|
898
|
-
if (typeof u == "string" && !
|
|
899
|
-
const E = `Version ${
|
|
900
|
-
n.strictVersion ? w(E) :
|
|
900
|
+
if (typeof u == "string" && !te(f, u)) {
|
|
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 ? w(E) : oe(E);
|
|
901
903
|
}
|
|
902
904
|
return {
|
|
903
905
|
shared: p,
|
|
@@ -908,20 +910,20 @@ function ge(e, t, r, o) {
|
|
|
908
910
|
shared: p,
|
|
909
911
|
useTreesShaking: m
|
|
910
912
|
};
|
|
911
|
-
if (
|
|
913
|
+
if (te(f, u)) return {
|
|
912
914
|
shared: p,
|
|
913
915
|
useTreesShaking: m
|
|
914
916
|
};
|
|
915
|
-
const E =
|
|
917
|
+
const E = se(c);
|
|
916
918
|
if (E) {
|
|
917
919
|
for (const [y, R] of Object.entries(e[l][t]))
|
|
918
|
-
if (
|
|
920
|
+
if (se(R.treeShaking, c == null ? void 0 : c.usedExports) && te(y, u))
|
|
919
921
|
return {
|
|
920
922
|
shared: R,
|
|
921
923
|
useTreesShaking: E
|
|
922
924
|
};
|
|
923
925
|
}
|
|
924
|
-
for (const [y, R] of Object.entries(e[l][t])) if (
|
|
926
|
+
for (const [y, R] of Object.entries(e[l][t])) if (te(y, u)) return {
|
|
925
927
|
shared: R,
|
|
926
928
|
useTreesShaking: !1
|
|
927
929
|
};
|
|
@@ -930,42 +932,42 @@ function ge(e, t, r, o) {
|
|
|
930
932
|
shareScopeMap: e,
|
|
931
933
|
scope: l,
|
|
932
934
|
pkgName: t,
|
|
933
|
-
version:
|
|
934
|
-
GlobalFederation:
|
|
935
|
+
version: f,
|
|
936
|
+
GlobalFederation: be.__FEDERATION__,
|
|
935
937
|
shareInfo: r,
|
|
936
|
-
resolver:
|
|
938
|
+
resolver: h
|
|
937
939
|
};
|
|
938
940
|
return (o.emit(d) || d).resolver();
|
|
939
941
|
}
|
|
940
942
|
}
|
|
941
943
|
function Nt() {
|
|
942
|
-
return
|
|
944
|
+
return be.__FEDERATION__.__SHARE__;
|
|
943
945
|
}
|
|
944
946
|
function Ye(e) {
|
|
945
947
|
const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (a) => {
|
|
946
948
|
if (!a) return;
|
|
947
949
|
const l = {};
|
|
948
|
-
return a.forEach((
|
|
949
|
-
l[
|
|
950
|
-
}), l[
|
|
951
|
-
return !
|
|
950
|
+
return a.forEach((f) => {
|
|
951
|
+
l[f.version] = f;
|
|
952
|
+
}), l[ie(l, function(f, m) {
|
|
953
|
+
return !_e(l[f]) && B(f, m);
|
|
952
954
|
})];
|
|
953
955
|
}, s = (r == null ? void 0 : r.resolver) ?? n, i = (a) => a !== null && typeof a == "object" && !Array.isArray(a), c = (...a) => {
|
|
954
956
|
const l = {};
|
|
955
957
|
for (const u of a)
|
|
956
958
|
if (u)
|
|
957
|
-
for (const [
|
|
958
|
-
const
|
|
959
|
-
i(
|
|
959
|
+
for (const [f, m] of Object.entries(u)) {
|
|
960
|
+
const h = l[f];
|
|
961
|
+
i(h) && i(m) ? l[f] = c(h, m) : m !== void 0 && (l[f] = m);
|
|
960
962
|
}
|
|
961
963
|
return l;
|
|
962
964
|
};
|
|
963
965
|
return c(s(o[t]), r == null ? void 0 : r.customShareInfo);
|
|
964
966
|
}
|
|
965
967
|
const z = (e, t) => {
|
|
966
|
-
e.useIn || (e.useIn = []),
|
|
968
|
+
e.useIn || (e.useIn = []), Cr(e.useIn, t);
|
|
967
969
|
};
|
|
968
|
-
function
|
|
970
|
+
function ue(e, t) {
|
|
969
971
|
return t && e.treeShaking ? e.treeShaking : e;
|
|
970
972
|
}
|
|
971
973
|
function Ge(e, t) {
|
|
@@ -1007,11 +1009,11 @@ function Qe(e, t) {
|
|
|
1007
1009
|
}
|
|
1008
1010
|
}
|
|
1009
1011
|
}
|
|
1010
|
-
function
|
|
1012
|
+
function Io(e, t) {
|
|
1011
1013
|
for (const r of e)
|
|
1012
1014
|
if (t === r.name || r.alias && t === r.alias) return r;
|
|
1013
1015
|
}
|
|
1014
|
-
const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-004", Ot = "RUNTIME-005", Oe = "RUNTIME-006", Lt = "RUNTIME-007", Ue = "RUNTIME-008",
|
|
1016
|
+
const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-004", Ot = "RUNTIME-005", Oe = "RUNTIME-006", Lt = "RUNTIME-007", Ue = "RUNTIME-008", $o = "RUNTIME-009", Ct = "RUNTIME-010", Ft = "RUNTIME-011", To = "RUNTIME-012", Ht = "RUNTIME-013", Dt = "RUNTIME-014", xt = "RUNTIME-015", M = {
|
|
1015
1017
|
[At]: "Failed to get remoteEntry exports.",
|
|
1016
1018
|
[Mt]: 'The remote entry interface does not contain "init"',
|
|
1017
1019
|
[Pt]: "Failed to get manifest.",
|
|
@@ -1020,10 +1022,10 @@ const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-
|
|
|
1020
1022
|
[Oe]: "Invalid loadShareSync function call from runtime",
|
|
1021
1023
|
[Lt]: "Failed to get remote snapshot.",
|
|
1022
1024
|
[Ue]: "Failed to load script resources.",
|
|
1023
|
-
[
|
|
1025
|
+
[$o]: "Please call createInstance first.",
|
|
1024
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.',
|
|
1025
1027
|
[Ft]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
1026
|
-
[
|
|
1028
|
+
[To]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.',
|
|
1027
1029
|
[Ht]: "The manifest is not a valid Module Federation manifest.",
|
|
1028
1030
|
[Dt]: "The remote does not expose the requested module.",
|
|
1029
1031
|
[xt]: "Remote container initialization failed."
|
|
@@ -1032,7 +1034,10 @@ const At = "RUNTIME-001", Mt = "RUNTIME-002", Pt = "RUNTIME-003", kt = "RUNTIME-
|
|
|
1032
1034
|
...M
|
|
1033
1035
|
});
|
|
1034
1036
|
const Gt = ".then(callbacks[0]).catch(callbacks[1])";
|
|
1035
|
-
|
|
1037
|
+
function Ut(e) {
|
|
1038
|
+
return e === "esm" || e === "module";
|
|
1039
|
+
}
|
|
1040
|
+
async function vo({ entry: e, remoteEntryExports: t }) {
|
|
1036
1041
|
return new Promise((r, o) => {
|
|
1037
1042
|
try {
|
|
1038
1043
|
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Gt}`)([r, o]) : import(
|
|
@@ -1045,7 +1050,7 @@ async function To({ entry: e, remoteEntryExports: t }) {
|
|
|
1045
1050
|
}
|
|
1046
1051
|
});
|
|
1047
1052
|
}
|
|
1048
|
-
async function
|
|
1053
|
+
async function No({ entry: e, remoteEntryExports: t }) {
|
|
1049
1054
|
return new Promise((r, o) => {
|
|
1050
1055
|
try {
|
|
1051
1056
|
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${Gt}`)([r, o]);
|
|
@@ -1054,7 +1059,7 @@ async function vo({ entry: e, remoteEntryExports: t }) {
|
|
|
1054
1059
|
}
|
|
1055
1060
|
});
|
|
1056
1061
|
}
|
|
1057
|
-
function
|
|
1062
|
+
function Bt(e, t, r) {
|
|
1058
1063
|
const { remoteEntryKey: o, entryExports: n } = He(e, t);
|
|
1059
1064
|
return n || w(At, M, {
|
|
1060
1065
|
remoteName: e,
|
|
@@ -1062,14 +1067,14 @@ function Ut(e, t, r) {
|
|
|
1062
1067
|
remoteEntryKey: o
|
|
1063
1068
|
}), n;
|
|
1064
1069
|
}
|
|
1065
|
-
async function
|
|
1070
|
+
async function Ao({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook: n, getEntryUrl: s, resourceContext: i }) {
|
|
1066
1071
|
const { entryExports: c } = He(e, t);
|
|
1067
1072
|
if (c) return c;
|
|
1068
1073
|
const a = s ? s(r) : r;
|
|
1069
1074
|
return Sr(a, {
|
|
1070
1075
|
attrs: {},
|
|
1071
1076
|
createScriptHook: (l, u) => {
|
|
1072
|
-
const
|
|
1077
|
+
const f = n.lifecycle.createScript.emit({
|
|
1073
1078
|
url: l,
|
|
1074
1079
|
attrs: u,
|
|
1075
1080
|
remoteInfo: o,
|
|
@@ -1078,10 +1083,10 @@ async function No({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook:
|
|
|
1078
1083
|
url: l
|
|
1079
1084
|
} : void 0
|
|
1080
1085
|
});
|
|
1081
|
-
if (
|
|
1082
|
-
return
|
|
1086
|
+
if (f && (f instanceof HTMLScriptElement || "script" in f || "timeout" in f))
|
|
1087
|
+
return f;
|
|
1083
1088
|
}
|
|
1084
|
-
}).then(() =>
|
|
1089
|
+
}).then(() => Bt(e, t, r), (l) => {
|
|
1085
1090
|
const u = l instanceof Error ? l.message : String(l);
|
|
1086
1091
|
w(Ue, M, {
|
|
1087
1092
|
remoteName: e,
|
|
@@ -1089,35 +1094,27 @@ async function No({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook:
|
|
|
1089
1094
|
}, u);
|
|
1090
1095
|
});
|
|
1091
1096
|
}
|
|
1092
|
-
async function
|
|
1097
|
+
async function Mo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: o, resourceContext: n }) {
|
|
1093
1098
|
const { entry: s, entryGlobalName: i, name: c, type: a } = e;
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
globalName: i,
|
|
1110
|
-
name: c,
|
|
1111
|
-
remoteInfo: e,
|
|
1112
|
-
loaderHook: r,
|
|
1113
|
-
getEntryUrl: o,
|
|
1114
|
-
resourceContext: n
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1099
|
+
return Ut(a) ? vo({
|
|
1100
|
+
entry: s,
|
|
1101
|
+
remoteEntryExports: t
|
|
1102
|
+
}) : a === "system" ? No({
|
|
1103
|
+
entry: s,
|
|
1104
|
+
remoteEntryExports: t
|
|
1105
|
+
}) : Ao({
|
|
1106
|
+
entry: s,
|
|
1107
|
+
globalName: i,
|
|
1108
|
+
name: c,
|
|
1109
|
+
remoteInfo: e,
|
|
1110
|
+
loaderHook: r,
|
|
1111
|
+
getEntryUrl: o,
|
|
1112
|
+
resourceContext: n
|
|
1113
|
+
});
|
|
1117
1114
|
}
|
|
1118
|
-
async function
|
|
1115
|
+
async function Po({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
|
|
1119
1116
|
const { entry: o, entryGlobalName: n, name: s, type: i } = e, { entryExports: c } = He(s, n);
|
|
1120
|
-
return c ||
|
|
1117
|
+
return c || $r(o, {
|
|
1121
1118
|
attrs: {
|
|
1122
1119
|
name: s,
|
|
1123
1120
|
globalName: n,
|
|
@@ -1136,7 +1133,7 @@ async function Mo({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
|
|
|
1136
1133
|
if (u && "url" in u)
|
|
1137
1134
|
return u;
|
|
1138
1135
|
} }
|
|
1139
|
-
}).then(() =>
|
|
1136
|
+
}).then(() => Bt(s, n, o)).catch((a) => {
|
|
1140
1137
|
w(`Failed to load Node.js entry for remote "${s}" from "${o}". ${a instanceof Error ? a.message : String(a)}`);
|
|
1141
1138
|
});
|
|
1142
1139
|
}
|
|
@@ -1154,13 +1151,13 @@ async function Be(e) {
|
|
|
1154
1151
|
loaderHook: l,
|
|
1155
1152
|
remoteInfo: o,
|
|
1156
1153
|
remoteEntryExports: r
|
|
1157
|
-
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : G) ?
|
|
1154
|
+
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : G) ? Mo({
|
|
1158
1155
|
remoteInfo: o,
|
|
1159
1156
|
remoteEntryExports: r,
|
|
1160
1157
|
loaderHook: l,
|
|
1161
1158
|
getEntryUrl: n,
|
|
1162
1159
|
resourceContext: s
|
|
1163
|
-
}) :
|
|
1160
|
+
}) : Po({
|
|
1164
1161
|
remoteInfo: o,
|
|
1165
1162
|
loaderHook: l,
|
|
1166
1163
|
resourceContext: s
|
|
@@ -1169,18 +1166,18 @@ async function Be(e) {
|
|
|
1169
1166
|
remoteInfo: o,
|
|
1170
1167
|
remoteEntryExports: u
|
|
1171
1168
|
}), u)).catch(async (u) => {
|
|
1172
|
-
const
|
|
1169
|
+
const f = Le(o), m = u instanceof Error && u.message.includes("ScriptExecutionError");
|
|
1173
1170
|
if (u instanceof Error && u.message.includes(Ue) && !m && !i) {
|
|
1174
|
-
const
|
|
1171
|
+
const h = (p) => Be({
|
|
1175
1172
|
...p,
|
|
1176
1173
|
_inErrorHandling: !0
|
|
1177
1174
|
}), d = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
1178
|
-
getRemoteEntry:
|
|
1175
|
+
getRemoteEntry: h,
|
|
1179
1176
|
origin: t,
|
|
1180
1177
|
remoteInfo: o,
|
|
1181
1178
|
remoteEntryExports: r,
|
|
1182
1179
|
globalLoading: J,
|
|
1183
|
-
uniqueKey:
|
|
1180
|
+
uniqueKey: f
|
|
1184
1181
|
});
|
|
1185
1182
|
if (d)
|
|
1186
1183
|
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
@@ -1205,14 +1202,14 @@ function K(e) {
|
|
|
1205
1202
|
entry: "entry" in e ? e.entry : "",
|
|
1206
1203
|
type: e.type || Tt,
|
|
1207
1204
|
entryGlobalName: e.entryGlobalName || e.name,
|
|
1208
|
-
shareScope: e.shareScope ||
|
|
1205
|
+
shareScope: e.shareScope || ae
|
|
1209
1206
|
};
|
|
1210
1207
|
}
|
|
1211
|
-
function
|
|
1208
|
+
function ko() {
|
|
1212
1209
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1213
1210
|
}
|
|
1214
|
-
function
|
|
1215
|
-
const r =
|
|
1211
|
+
function Oo(e, t) {
|
|
1212
|
+
const r = Br(), o = [
|
|
1216
1213
|
t.hooks,
|
|
1217
1214
|
t.remoteHandler.hooks,
|
|
1218
1215
|
t.sharedHandler.hooks,
|
|
@@ -1228,7 +1225,7 @@ function ko(e, t) {
|
|
|
1228
1225
|
});
|
|
1229
1226
|
}), e;
|
|
1230
1227
|
}
|
|
1231
|
-
function
|
|
1228
|
+
function Lo(e) {
|
|
1232
1229
|
return {
|
|
1233
1230
|
name: e.name,
|
|
1234
1231
|
alias: e.alias,
|
|
@@ -1259,12 +1256,12 @@ function F(e) {
|
|
|
1259
1256
|
},
|
|
1260
1257
|
mfConfig: {
|
|
1261
1258
|
name: e.name,
|
|
1262
|
-
remotes: ((c = e.remotes) == null ? void 0 : c.map(
|
|
1259
|
+
remotes: ((c = e.remotes) == null ? void 0 : c.map(Lo)) ?? [],
|
|
1263
1260
|
shared: t
|
|
1264
1261
|
}
|
|
1265
1262
|
};
|
|
1266
1263
|
}
|
|
1267
|
-
function
|
|
1264
|
+
function jt(e) {
|
|
1268
1265
|
return {
|
|
1269
1266
|
resourceCategory: "sync",
|
|
1270
1267
|
share: !0,
|
|
@@ -1272,19 +1269,19 @@ function Bt(e) {
|
|
|
1272
1269
|
...e
|
|
1273
1270
|
};
|
|
1274
1271
|
}
|
|
1275
|
-
function
|
|
1272
|
+
function Co(e, t) {
|
|
1276
1273
|
return t.map((r) => {
|
|
1277
|
-
const o =
|
|
1274
|
+
const o = Io(e, r.nameOrAlias);
|
|
1278
1275
|
return L(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && at({
|
|
1279
1276
|
remoteInfo: o,
|
|
1280
1277
|
remotes: e
|
|
1281
1278
|
})}`), {
|
|
1282
1279
|
remote: o,
|
|
1283
|
-
preloadConfig:
|
|
1280
|
+
preloadConfig: jt(r)
|
|
1284
1281
|
};
|
|
1285
1282
|
});
|
|
1286
1283
|
}
|
|
1287
|
-
function
|
|
1284
|
+
function Fo(e) {
|
|
1288
1285
|
return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1289
1286
|
}
|
|
1290
1287
|
function je(e) {
|
|
@@ -1300,7 +1297,7 @@ function j(e, t, r, o) {
|
|
|
1300
1297
|
error: o
|
|
1301
1298
|
};
|
|
1302
1299
|
}
|
|
1303
|
-
async function
|
|
1300
|
+
async function Ho(e, t, r, o) {
|
|
1304
1301
|
const n = e.moduleCache.get(r.name), s = r.entry;
|
|
1305
1302
|
if (n != null && n.remoteEntryExports) return j(o, s, "cached");
|
|
1306
1303
|
try {
|
|
@@ -1318,9 +1315,9 @@ async function Fo(e, t, r, o) {
|
|
|
1318
1315
|
return j(o, s, je(i) ? "timeout" : "error", i);
|
|
1319
1316
|
}
|
|
1320
1317
|
}
|
|
1321
|
-
function
|
|
1318
|
+
function fe({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
|
|
1322
1319
|
return new Promise((i) => {
|
|
1323
|
-
const { link: c, needAttach: a } =
|
|
1320
|
+
const { link: c, needAttach: a } = br({
|
|
1324
1321
|
url: r,
|
|
1325
1322
|
cb: () => {
|
|
1326
1323
|
i(j(n, r, a ? "success" : "cached"));
|
|
@@ -1330,7 +1327,7 @@ function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1330
1327
|
},
|
|
1331
1328
|
attrs: o,
|
|
1332
1329
|
createLinkHook: (l, u) => {
|
|
1333
|
-
const
|
|
1330
|
+
const f = e.loaderHook.lifecycle.createLink.emit({
|
|
1334
1331
|
url: l,
|
|
1335
1332
|
attrs: u,
|
|
1336
1333
|
remoteInfo: t,
|
|
@@ -1339,16 +1336,16 @@ function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1339
1336
|
url: l
|
|
1340
1337
|
}
|
|
1341
1338
|
});
|
|
1342
|
-
return
|
|
1339
|
+
return f instanceof HTMLLinkElement, f;
|
|
1343
1340
|
},
|
|
1344
1341
|
needDeleteLink: s
|
|
1345
1342
|
});
|
|
1346
1343
|
a && document.head.appendChild(c);
|
|
1347
1344
|
});
|
|
1348
1345
|
}
|
|
1349
|
-
function
|
|
1346
|
+
function Do({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
1350
1347
|
return new Promise((s) => {
|
|
1351
|
-
const { script: i, needAttach: c } =
|
|
1348
|
+
const { script: i, needAttach: c } = ht({
|
|
1352
1349
|
url: r,
|
|
1353
1350
|
cb: () => {
|
|
1354
1351
|
s(j(n, r, c ? "success" : "cached"));
|
|
@@ -1374,89 +1371,79 @@ function Ho({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
|
1374
1371
|
c && document.head.appendChild(i);
|
|
1375
1372
|
});
|
|
1376
1373
|
}
|
|
1377
|
-
function
|
|
1374
|
+
function he(e, t) {
|
|
1378
1375
|
return {
|
|
1379
1376
|
...e,
|
|
1380
1377
|
resourceType: t
|
|
1381
1378
|
};
|
|
1382
1379
|
}
|
|
1383
|
-
function
|
|
1380
|
+
function Wt(e, t, r, o = !0, n = {
|
|
1384
1381
|
initiator: "preloadRemote",
|
|
1385
1382
|
id: e.name
|
|
1386
1383
|
}) {
|
|
1387
1384
|
const { cssAssets: s, jsAssetsWithoutEntry: i, entryAssets: c } = r, a = [];
|
|
1388
1385
|
if (t.options.inBrowser) {
|
|
1389
|
-
if (c.forEach((
|
|
1390
|
-
const { moduleInfo:
|
|
1391
|
-
a.push(
|
|
1386
|
+
if (c.forEach((f) => {
|
|
1387
|
+
const { moduleInfo: m } = f;
|
|
1388
|
+
a.push(Ho(t, e, m, he(n, "remoteEntry")));
|
|
1392
1389
|
}), o) {
|
|
1393
|
-
const
|
|
1390
|
+
const f = {
|
|
1394
1391
|
rel: "preload",
|
|
1395
1392
|
as: "style"
|
|
1396
1393
|
};
|
|
1397
|
-
s.forEach((
|
|
1398
|
-
a.push(
|
|
1394
|
+
s.forEach((m) => {
|
|
1395
|
+
a.push(fe({
|
|
1399
1396
|
host: t,
|
|
1400
1397
|
remoteInfo: e,
|
|
1401
|
-
url:
|
|
1402
|
-
attrs:
|
|
1403
|
-
context:
|
|
1398
|
+
url: m,
|
|
1399
|
+
attrs: f,
|
|
1400
|
+
context: he(n, "css")
|
|
1404
1401
|
}));
|
|
1405
1402
|
});
|
|
1406
1403
|
} else {
|
|
1407
|
-
const
|
|
1404
|
+
const f = {
|
|
1408
1405
|
rel: "stylesheet",
|
|
1409
1406
|
type: "text/css"
|
|
1410
1407
|
};
|
|
1411
|
-
s.forEach((
|
|
1412
|
-
a.push(
|
|
1408
|
+
s.forEach((m) => {
|
|
1409
|
+
a.push(fe({
|
|
1413
1410
|
host: t,
|
|
1414
1411
|
remoteInfo: e,
|
|
1415
|
-
url:
|
|
1416
|
-
attrs:
|
|
1412
|
+
url: m,
|
|
1413
|
+
attrs: f,
|
|
1417
1414
|
needDeleteLink: !1,
|
|
1418
|
-
context:
|
|
1419
|
-
}));
|
|
1420
|
-
});
|
|
1421
|
-
}
|
|
1422
|
-
if (o) {
|
|
1423
|
-
const l = {
|
|
1424
|
-
rel: "preload",
|
|
1425
|
-
as: "script"
|
|
1426
|
-
};
|
|
1427
|
-
i.forEach((u) => {
|
|
1428
|
-
a.push($e({
|
|
1429
|
-
host: t,
|
|
1430
|
-
remoteInfo: e,
|
|
1431
|
-
url: u,
|
|
1432
|
-
attrs: l,
|
|
1433
|
-
context: ee(n, "js")
|
|
1434
|
-
}));
|
|
1435
|
-
});
|
|
1436
|
-
} else {
|
|
1437
|
-
const l = {
|
|
1438
|
-
fetchpriority: "high",
|
|
1439
|
-
type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
|
|
1440
|
-
};
|
|
1441
|
-
i.forEach((u) => {
|
|
1442
|
-
a.push(Ho({
|
|
1443
|
-
host: t,
|
|
1444
|
-
remoteInfo: e,
|
|
1445
|
-
url: u,
|
|
1446
|
-
attrs: l,
|
|
1447
|
-
context: ee(n, "js")
|
|
1415
|
+
context: he(n, "css")
|
|
1448
1416
|
}));
|
|
1449
1417
|
});
|
|
1450
1418
|
}
|
|
1419
|
+
let l = Do, u = {
|
|
1420
|
+
fetchpriority: "high",
|
|
1421
|
+
type: "text/javascript"
|
|
1422
|
+
};
|
|
1423
|
+
o ? (l = fe, u = {
|
|
1424
|
+
rel: "preload",
|
|
1425
|
+
as: "script"
|
|
1426
|
+
}) : Ut(e.type) && (l = fe, u = {
|
|
1427
|
+
rel: "modulepreload",
|
|
1428
|
+
fetchpriority: "high"
|
|
1429
|
+
}), i.forEach((f) => {
|
|
1430
|
+
a.push(l({
|
|
1431
|
+
host: t,
|
|
1432
|
+
remoteInfo: e,
|
|
1433
|
+
url: f,
|
|
1434
|
+
attrs: u,
|
|
1435
|
+
context: he(n, "js")
|
|
1436
|
+
}));
|
|
1437
|
+
});
|
|
1451
1438
|
}
|
|
1452
1439
|
return Promise.all(a);
|
|
1453
1440
|
}
|
|
1454
|
-
function
|
|
1441
|
+
function xo(e) {
|
|
1455
1442
|
if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
|
|
1456
1443
|
const t = e.modules.map((r) => r.moduleName).filter(Boolean);
|
|
1457
1444
|
return t.length ? t.join(",") : void 0;
|
|
1458
1445
|
}
|
|
1459
|
-
function
|
|
1446
|
+
function Go(e, t, r) {
|
|
1460
1447
|
const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1461
1448
|
n.length || n.push("default"), n.forEach((i) => {
|
|
1462
1449
|
o[i] || (o[i] = {});
|
|
@@ -1534,7 +1521,7 @@ var et = class {
|
|
|
1534
1521
|
remoteSnapshot: t,
|
|
1535
1522
|
origin: this.host
|
|
1536
1523
|
});
|
|
1537
|
-
const { remoteEntryInitOptions: s, shareScope: i, initScope: c } =
|
|
1524
|
+
const { remoteEntryInitOptions: s, shareScope: i, initScope: c } = Go(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1538
1525
|
shareScope: i,
|
|
1539
1526
|
remoteEntryInitOptions: s,
|
|
1540
1527
|
initScope: c,
|
|
@@ -1609,7 +1596,7 @@ var et = class {
|
|
|
1609
1596
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1610
1597
|
expose: t,
|
|
1611
1598
|
requestId: e,
|
|
1612
|
-
availableExposes:
|
|
1599
|
+
availableExposes: xo(o)
|
|
1613
1600
|
}, void 0, F(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1614
1601
|
id: e,
|
|
1615
1602
|
expose: t,
|
|
@@ -1628,7 +1615,7 @@ var et = class {
|
|
|
1628
1615
|
origin: this.host
|
|
1629
1616
|
}), l;
|
|
1630
1617
|
}
|
|
1631
|
-
const c =
|
|
1618
|
+
const c = Dr(this.remoteInfo.name, t), a = this.wraperFactory(i, c);
|
|
1632
1619
|
if (!n) return a;
|
|
1633
1620
|
await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
|
|
1634
1621
|
id: e,
|
|
@@ -1676,7 +1663,7 @@ var et = class {
|
|
|
1676
1663
|
}
|
|
1677
1664
|
applyPlugin(e, t) {
|
|
1678
1665
|
var o;
|
|
1679
|
-
L(
|
|
1666
|
+
L(Hr(e), "Plugin configuration is invalid.");
|
|
1680
1667
|
const r = e.name;
|
|
1681
1668
|
L(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (o = e.apply) == null || o.call(e, t), Object.keys(this.lifecycle).forEach((n) => {
|
|
1682
1669
|
const s = e[n];
|
|
@@ -1728,7 +1715,7 @@ var et = class {
|
|
|
1728
1715
|
return Promise.resolve(t);
|
|
1729
1716
|
}
|
|
1730
1717
|
};
|
|
1731
|
-
function
|
|
1718
|
+
function Vt(e, t) {
|
|
1732
1719
|
if (!Fe(t)) return !1;
|
|
1733
1720
|
if (e !== t) {
|
|
1734
1721
|
for (const r in e) if (!(r in t)) return !1;
|
|
@@ -1744,13 +1731,13 @@ var X = class extends A {
|
|
|
1744
1731
|
for (const t of this.listeners) try {
|
|
1745
1732
|
const r = t(e);
|
|
1746
1733
|
if (r === void 0) continue;
|
|
1747
|
-
if (
|
|
1734
|
+
if (Vt(e, r)) e = r;
|
|
1748
1735
|
else {
|
|
1749
1736
|
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1750
1737
|
break;
|
|
1751
1738
|
}
|
|
1752
1739
|
} catch (r) {
|
|
1753
|
-
|
|
1740
|
+
oe(r), this.onerror(r);
|
|
1754
1741
|
}
|
|
1755
1742
|
return e;
|
|
1756
1743
|
}
|
|
@@ -1763,8 +1750,8 @@ var X = class extends A {
|
|
|
1763
1750
|
const t = Array.from(this.listeners);
|
|
1764
1751
|
if (t.length > 0) {
|
|
1765
1752
|
let r = 0;
|
|
1766
|
-
const o = (s) => (
|
|
1767
|
-
if (s !== void 0 &&
|
|
1753
|
+
const o = (s) => (oe(s), this.onerror(s), e), n = (s) => {
|
|
1754
|
+
if (s !== void 0 && Vt(e, s)) e = s;
|
|
1768
1755
|
else if (s !== void 0)
|
|
1769
1756
|
return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
|
|
1770
1757
|
if (r < t.length) try {
|
|
@@ -1779,8 +1766,8 @@ var X = class extends A {
|
|
|
1779
1766
|
return Promise.resolve(e);
|
|
1780
1767
|
}
|
|
1781
1768
|
};
|
|
1782
|
-
const
|
|
1783
|
-
var
|
|
1769
|
+
const ee = "Remote loading is disabled by experiments.optimization.disableRemote.";
|
|
1770
|
+
var Uo = class {
|
|
1784
1771
|
constructor() {
|
|
1785
1772
|
this.hooks = new H({});
|
|
1786
1773
|
}
|
|
@@ -1788,28 +1775,28 @@ var Go = class {
|
|
|
1788
1775
|
return [];
|
|
1789
1776
|
}
|
|
1790
1777
|
loadRemote() {
|
|
1791
|
-
throw new Error(
|
|
1778
|
+
throw new Error(ee);
|
|
1792
1779
|
}
|
|
1793
1780
|
preloadRemote() {
|
|
1794
|
-
throw new Error(
|
|
1781
|
+
throw new Error(ee);
|
|
1795
1782
|
}
|
|
1796
1783
|
registerRemotes() {
|
|
1797
|
-
throw new Error(
|
|
1784
|
+
throw new Error(ee);
|
|
1798
1785
|
}
|
|
1799
1786
|
getRemoteModuleAndOptions() {
|
|
1800
|
-
throw new Error(
|
|
1787
|
+
throw new Error(ee);
|
|
1801
1788
|
}
|
|
1802
1789
|
initRawContainer() {
|
|
1803
|
-
throw new Error(
|
|
1790
|
+
throw new Error(ee);
|
|
1804
1791
|
}
|
|
1805
1792
|
};
|
|
1806
|
-
function
|
|
1793
|
+
function qt(e, t) {
|
|
1807
1794
|
const r = Rt(t);
|
|
1808
1795
|
r.url || w(Ft, M, { remoteName: e.name });
|
|
1809
1796
|
let o = Me(t, r.url);
|
|
1810
1797
|
!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;
|
|
1811
1798
|
}
|
|
1812
|
-
function
|
|
1799
|
+
function Bo() {
|
|
1813
1800
|
return {
|
|
1814
1801
|
name: "snapshot-plugin",
|
|
1815
1802
|
async afterResolve(e) {
|
|
@@ -1819,7 +1806,7 @@ function Uo() {
|
|
|
1819
1806
|
moduleInfo: t,
|
|
1820
1807
|
id: Ge(t.name, o)
|
|
1821
1808
|
});
|
|
1822
|
-
|
|
1809
|
+
qt(s, c);
|
|
1823
1810
|
const l = {
|
|
1824
1811
|
remote: t,
|
|
1825
1812
|
preloadConfig: {
|
|
@@ -1837,7 +1824,7 @@ function Uo() {
|
|
|
1837
1824
|
remoteSnapshot: c,
|
|
1838
1825
|
globalSnapshot: a
|
|
1839
1826
|
});
|
|
1840
|
-
return u &&
|
|
1827
|
+
return u && Wt(s, n, u, !1, {
|
|
1841
1828
|
initiator: "loadRemote",
|
|
1842
1829
|
id: i
|
|
1843
1830
|
}).catch(() => {
|
|
@@ -1850,7 +1837,7 @@ function Uo() {
|
|
|
1850
1837
|
}
|
|
1851
1838
|
};
|
|
1852
1839
|
}
|
|
1853
|
-
function
|
|
1840
|
+
function jo(e) {
|
|
1854
1841
|
const t = e.split(":");
|
|
1855
1842
|
return t.length === 1 ? {
|
|
1856
1843
|
name: t[0],
|
|
@@ -1863,33 +1850,33 @@ function Bo(e) {
|
|
|
1863
1850
|
version: t[2]
|
|
1864
1851
|
};
|
|
1865
1852
|
}
|
|
1866
|
-
function
|
|
1867
|
-
const { value: i } = W(e,
|
|
1853
|
+
function zt(e, t, r, o, n = {}, s) {
|
|
1854
|
+
const { value: i } = W(e, ne(t)), c = s || i;
|
|
1868
1855
|
if (c && !ct(c) && (r(c, t, o), c.remotesInfo)) {
|
|
1869
1856
|
const a = Object.keys(c.remotesInfo);
|
|
1870
1857
|
for (const l of a) {
|
|
1871
1858
|
if (n[l]) continue;
|
|
1872
1859
|
n[l] = !0;
|
|
1873
|
-
const u =
|
|
1874
|
-
|
|
1860
|
+
const u = jo(l), f = c.remotesInfo[l];
|
|
1861
|
+
zt(e, {
|
|
1875
1862
|
name: u.name,
|
|
1876
|
-
version:
|
|
1863
|
+
version: f.matchedVersion
|
|
1877
1864
|
}, r, !1, n, void 0);
|
|
1878
1865
|
}
|
|
1879
1866
|
}
|
|
1880
1867
|
}
|
|
1881
1868
|
const Te = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1882
|
-
function
|
|
1883
|
-
const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig:
|
|
1884
|
-
if (
|
|
1869
|
+
function Wo(e, t, r, o, n) {
|
|
1870
|
+
const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: m } = f;
|
|
1871
|
+
if (zt(o, r, (d, p, E) => {
|
|
1885
1872
|
var I;
|
|
1886
1873
|
let y;
|
|
1887
|
-
if (E) y =
|
|
1874
|
+
if (E) y = f;
|
|
1888
1875
|
else if (Array.isArray(m)) {
|
|
1889
|
-
const
|
|
1890
|
-
if (!
|
|
1891
|
-
y =
|
|
1892
|
-
} else if (m === !0) y =
|
|
1876
|
+
const S = m.find(($) => $.nameOrAlias === p.name || $.nameOrAlias === p.alias);
|
|
1877
|
+
if (!S) return;
|
|
1878
|
+
y = jt(S);
|
|
1879
|
+
} else if (m === !0) y = f;
|
|
1893
1880
|
else return;
|
|
1894
1881
|
const R = Me(d, Rt(d).url);
|
|
1895
1882
|
R && c.push({
|
|
@@ -1905,15 +1892,15 @@ function jo(e, t, r, o, n) {
|
|
|
1905
1892
|
url: R
|
|
1906
1893
|
});
|
|
1907
1894
|
let g = "modules" in d ? d.modules : [];
|
|
1908
|
-
const _ =
|
|
1909
|
-
_.length && "modules" in d && (g = (I = d == null ? void 0 : d.modules) == null ? void 0 : I.reduce((
|
|
1910
|
-
function S
|
|
1911
|
-
const $ =
|
|
1895
|
+
const _ = Fo(y.exposes);
|
|
1896
|
+
_.length && "modules" in d && (g = (I = d == null ? void 0 : d.modules) == null ? void 0 : I.reduce((S, $) => ((_ == null ? void 0 : _.indexOf($.moduleName)) !== -1 && S.push($), S), []));
|
|
1897
|
+
function b(S) {
|
|
1898
|
+
const $ = S.map((P) => Me(d, P));
|
|
1912
1899
|
return y.filter ? $.filter(y.filter) : $;
|
|
1913
1900
|
}
|
|
1914
1901
|
if (g) {
|
|
1915
|
-
const
|
|
1916
|
-
for (let $ = 0; $ <
|
|
1902
|
+
const S = g.length;
|
|
1903
|
+
for (let $ = 0; $ < S; $++) {
|
|
1917
1904
|
const P = g[$], Se = `${p.name}/${P.moduleName}`;
|
|
1918
1905
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1919
1906
|
id: P.moduleName === "." ? p.name : Se,
|
|
@@ -1922,12 +1909,12 @@ function jo(e, t, r, o, n) {
|
|
|
1922
1909
|
preloadConfig: y,
|
|
1923
1910
|
remote: p,
|
|
1924
1911
|
origin: e
|
|
1925
|
-
}), !
|
|
1912
|
+
}), !jr(Se) && (y.resourceCategory === "all" ? (s.push(...b(P.assets.css.async)), s.push(...b(P.assets.css.sync)), i.push(...b(P.assets.js.async)), i.push(...b(P.assets.js.sync))) : y.resourceCategory === "sync" && (s.push(...b(P.assets.css.sync)), i.push(...b(P.assets.js.sync))), Wr(Se));
|
|
1926
1913
|
}
|
|
1927
1914
|
}
|
|
1928
1915
|
}, !0, {}, n), n.shared && n.shared.length > 0) {
|
|
1929
1916
|
const d = (p, E) => {
|
|
1930
|
-
const { shared: y } =
|
|
1917
|
+
const { shared: y } = Re(e.shareScopeMap, E.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1931
1918
|
y && typeof y.lib == "function" && (E.assets.js.sync.forEach((R) => {
|
|
1932
1919
|
a.add(R);
|
|
1933
1920
|
}), E.assets.css.sync.forEach((R) => {
|
|
@@ -1944,14 +1931,14 @@ function jo(e, t, r, o, n) {
|
|
|
1944
1931
|
});
|
|
1945
1932
|
});
|
|
1946
1933
|
}
|
|
1947
|
-
const
|
|
1934
|
+
const h = i.filter((d) => !a.has(d) && !Te("script", d));
|
|
1948
1935
|
return {
|
|
1949
1936
|
cssAssets: s.filter((d) => !l.has(d) && !Te("link", d)),
|
|
1950
|
-
jsAssetsWithoutEntry:
|
|
1937
|
+
jsAssetsWithoutEntry: h,
|
|
1951
1938
|
entryAssets: c.filter((d) => !Te("script", d.url))
|
|
1952
1939
|
};
|
|
1953
1940
|
}
|
|
1954
|
-
const
|
|
1941
|
+
const Vo = function() {
|
|
1955
1942
|
return {
|
|
1956
1943
|
name: "generate-preload-assets-plugin",
|
|
1957
1944
|
async generatePreloadAssets(e) {
|
|
@@ -1970,7 +1957,7 @@ const Wo = function() {
|
|
|
1970
1957
|
shareScope: ""
|
|
1971
1958
|
}
|
|
1972
1959
|
}]
|
|
1973
|
-
} : (
|
|
1960
|
+
} : (qt(o, i), Wo(t, r, o, s, i)) : {
|
|
1974
1961
|
cssAssets: [],
|
|
1975
1962
|
jsAssetsWithoutEntry: [],
|
|
1976
1963
|
entryAssets: []
|
|
@@ -1978,35 +1965,35 @@ const Wo = function() {
|
|
|
1978
1965
|
}
|
|
1979
1966
|
};
|
|
1980
1967
|
};
|
|
1981
|
-
function
|
|
1982
|
-
const r =
|
|
1968
|
+
function Kt(e, t) {
|
|
1969
|
+
const r = ye({
|
|
1983
1970
|
name: t.name,
|
|
1984
1971
|
version: t.options.version
|
|
1985
1972
|
}), o = r && "remotesInfo" in r && r.remotesInfo && W(r.remotesInfo, e.name).value;
|
|
1986
1973
|
return o && o.matchedVersion ? {
|
|
1987
1974
|
hostGlobalSnapshot: r,
|
|
1988
1975
|
globalSnapshot: Ve(),
|
|
1989
|
-
remoteSnapshot:
|
|
1976
|
+
remoteSnapshot: ye({
|
|
1990
1977
|
name: e.name,
|
|
1991
1978
|
version: o.matchedVersion
|
|
1992
1979
|
})
|
|
1993
1980
|
} : {
|
|
1994
1981
|
hostGlobalSnapshot: void 0,
|
|
1995
1982
|
globalSnapshot: Ve(),
|
|
1996
|
-
remoteSnapshot:
|
|
1983
|
+
remoteSnapshot: ye({
|
|
1997
1984
|
name: e.name,
|
|
1998
1985
|
version: "version" in e ? e.version : void 0
|
|
1999
1986
|
})
|
|
2000
1987
|
};
|
|
2001
1988
|
}
|
|
2002
|
-
var
|
|
1989
|
+
var qo = class {
|
|
2003
1990
|
constructor(e) {
|
|
2004
1991
|
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new H({
|
|
2005
1992
|
beforeLoadRemoteSnapshot: new T("beforeLoadRemoteSnapshot"),
|
|
2006
1993
|
loadSnapshot: new D("loadGlobalSnapshot"),
|
|
2007
1994
|
loadRemoteSnapshot: new D("loadRemoteSnapshot"),
|
|
2008
1995
|
afterLoadSnapshot: new D("afterLoadSnapshot")
|
|
2009
|
-
}), this.manifestLoading =
|
|
1996
|
+
}), this.manifestLoading = be.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
2010
1997
|
}
|
|
2011
1998
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
|
|
2012
1999
|
const { options: o } = this.HostInstance;
|
|
@@ -2015,7 +2002,7 @@ var Vo = class {
|
|
|
2015
2002
|
moduleInfo: e,
|
|
2016
2003
|
origin: this.HostInstance
|
|
2017
2004
|
});
|
|
2018
|
-
let n =
|
|
2005
|
+
let n = ye({
|
|
2019
2006
|
name: this.HostInstance.options.name,
|
|
2020
2007
|
version: this.HostInstance.options.version
|
|
2021
2008
|
});
|
|
@@ -2023,7 +2010,7 @@ var Vo = class {
|
|
|
2023
2010
|
version: this.HostInstance.options.version || "",
|
|
2024
2011
|
remoteEntry: "",
|
|
2025
2012
|
remotesInfo: {}
|
|
2026
|
-
},
|
|
2013
|
+
}, Ur({ [this.HostInstance.options.name]: n })), n && "remotesInfo" in n && !W(n.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (n.remotesInfo = {
|
|
2027
2014
|
...n == null ? void 0 : n.remotesInfo,
|
|
2028
2015
|
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
2029
2016
|
});
|
|
@@ -2034,16 +2021,16 @@ var Vo = class {
|
|
|
2034
2021
|
remoteSnapshot: i,
|
|
2035
2022
|
globalSnapshot: c
|
|
2036
2023
|
});
|
|
2037
|
-
let u,
|
|
2024
|
+
let u, f;
|
|
2038
2025
|
if (a) if (ct(a)) {
|
|
2039
|
-
const m = G ? a.remoteEntry : a.ssrRemoteEntry || a.remoteEntry || "",
|
|
2026
|
+
const m = G ? a.remoteEntry : a.ssrRemoteEntry || a.remoteEntry || "", h = await this.loadManifestSnapshot(m, e, {}, {
|
|
2040
2027
|
initiator: r,
|
|
2041
2028
|
id: t || e.name
|
|
2042
2029
|
}), d = qe({
|
|
2043
2030
|
...e,
|
|
2044
2031
|
entry: m
|
|
2045
|
-
},
|
|
2046
|
-
u =
|
|
2032
|
+
}, h);
|
|
2033
|
+
u = h, f = d;
|
|
2047
2034
|
} else {
|
|
2048
2035
|
const { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2049
2036
|
options: this.HostInstance.options,
|
|
@@ -2051,14 +2038,14 @@ var Vo = class {
|
|
|
2051
2038
|
remoteSnapshot: a,
|
|
2052
2039
|
from: "global"
|
|
2053
2040
|
});
|
|
2054
|
-
u = m,
|
|
2041
|
+
u = m, f = l;
|
|
2055
2042
|
}
|
|
2056
2043
|
else if (Ce(e)) {
|
|
2057
2044
|
const m = await this.loadManifestSnapshot(e.entry, e, {}, {
|
|
2058
2045
|
initiator: r,
|
|
2059
2046
|
id: t || e.name
|
|
2060
|
-
}),
|
|
2061
|
-
u = m,
|
|
2047
|
+
}), h = qe(e, m);
|
|
2048
|
+
u = m, f = h;
|
|
2062
2049
|
} else w(Lt, M, {
|
|
2063
2050
|
remoteName: e.name,
|
|
2064
2051
|
remoteVersion: e.version,
|
|
@@ -2073,11 +2060,11 @@ var Vo = class {
|
|
|
2073
2060
|
remoteSnapshot: u
|
|
2074
2061
|
}), {
|
|
2075
2062
|
remoteSnapshot: u,
|
|
2076
|
-
globalSnapshot:
|
|
2063
|
+
globalSnapshot: f
|
|
2077
2064
|
};
|
|
2078
2065
|
}
|
|
2079
2066
|
getGlobalRemoteInfo(e) {
|
|
2080
|
-
return
|
|
2067
|
+
return Kt(e, this.HostInstance);
|
|
2081
2068
|
}
|
|
2082
2069
|
async getManifestJson(e, t, r, o) {
|
|
2083
2070
|
return (async () => {
|
|
@@ -2127,7 +2114,7 @@ var Vo = class {
|
|
|
2127
2114
|
}
|
|
2128
2115
|
async loadManifestSnapshot(e, t, r, o) {
|
|
2129
2116
|
const n = async () => {
|
|
2130
|
-
const s = await this.getManifestJson(e, t, r, o), i =
|
|
2117
|
+
const s = await this.getManifestJson(e, t, r, o), i = yr(s, { version: e }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2131
2118
|
options: this.HostInstance.options,
|
|
2132
2119
|
moduleInfo: t,
|
|
2133
2120
|
manifestJson: s,
|
|
@@ -2139,11 +2126,11 @@ var Vo = class {
|
|
|
2139
2126
|
};
|
|
2140
2127
|
return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
|
|
2141
2128
|
}
|
|
2142
|
-
},
|
|
2129
|
+
}, zo = class {
|
|
2143
2130
|
constructor() {
|
|
2144
2131
|
this.hooks = new H({});
|
|
2145
2132
|
}
|
|
2146
|
-
},
|
|
2133
|
+
}, Ko = class {
|
|
2147
2134
|
constructor(e) {
|
|
2148
2135
|
this.hooks = new H({
|
|
2149
2136
|
beforeRegisterShare: new X("beforeRegisterShare"),
|
|
@@ -2168,7 +2155,7 @@ var Vo = class {
|
|
|
2168
2155
|
origin: this.host
|
|
2169
2156
|
});
|
|
2170
2157
|
} catch (n) {
|
|
2171
|
-
|
|
2158
|
+
oe(n);
|
|
2172
2159
|
}
|
|
2173
2160
|
}
|
|
2174
2161
|
emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n }) {
|
|
@@ -2184,7 +2171,7 @@ var Vo = class {
|
|
|
2184
2171
|
recovered: n
|
|
2185
2172
|
});
|
|
2186
2173
|
} catch (s) {
|
|
2187
|
-
|
|
2174
|
+
oe(s);
|
|
2188
2175
|
}
|
|
2189
2176
|
}
|
|
2190
2177
|
registerShared(e, t) {
|
|
@@ -2228,9 +2215,9 @@ var Vo = class {
|
|
|
2228
2215
|
shared: r.options.shared,
|
|
2229
2216
|
origin: r
|
|
2230
2217
|
})).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.`);
|
|
2231
|
-
const s = n, { shared: i, useTreesShaking: c } =
|
|
2218
|
+
const s = n, { shared: i, useTreesShaking: c } = Re(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
|
|
2232
2219
|
if (i) {
|
|
2233
|
-
const a =
|
|
2220
|
+
const a = ue(i, c);
|
|
2234
2221
|
if (a.lib)
|
|
2235
2222
|
return z(a, r.options.name), this.emitAfterLoadShare({
|
|
2236
2223
|
lifecycle: "loadShare",
|
|
@@ -2260,13 +2247,13 @@ var Vo = class {
|
|
|
2260
2247
|
loading: u,
|
|
2261
2248
|
treeShaking: c ? a : void 0
|
|
2262
2249
|
});
|
|
2263
|
-
const
|
|
2250
|
+
const f = await u;
|
|
2264
2251
|
return this.emitAfterLoadShare({
|
|
2265
2252
|
lifecycle: "loadShare",
|
|
2266
2253
|
pkgName: e,
|
|
2267
2254
|
shareInfo: s,
|
|
2268
2255
|
selectedShared: i
|
|
2269
|
-
}),
|
|
2256
|
+
}), f;
|
|
2270
2257
|
}
|
|
2271
2258
|
} else {
|
|
2272
2259
|
if (t != null && t.customShareInfo)
|
|
@@ -2276,15 +2263,15 @@ var Vo = class {
|
|
|
2276
2263
|
shareInfo: s,
|
|
2277
2264
|
recovered: !0
|
|
2278
2265
|
}), !1;
|
|
2279
|
-
const a =
|
|
2280
|
-
const
|
|
2281
|
-
l.lib =
|
|
2282
|
-
const { shared: d, useTreesShaking: p } =
|
|
2266
|
+
const a = se(s.treeShaking), l = ue(s, a), f = (async () => {
|
|
2267
|
+
const h = await l.get();
|
|
2268
|
+
l.lib = h, l.loaded = !0, z(l, r.options.name);
|
|
2269
|
+
const { shared: d, useTreesShaking: p } = Re(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare) || {};
|
|
2283
2270
|
if (d) {
|
|
2284
|
-
const E =
|
|
2285
|
-
E.lib =
|
|
2271
|
+
const E = ue(d, p);
|
|
2272
|
+
E.lib = h, E.loaded = !0, d.from = s.from;
|
|
2286
2273
|
}
|
|
2287
|
-
return
|
|
2274
|
+
return h;
|
|
2288
2275
|
})();
|
|
2289
2276
|
this.setShared({
|
|
2290
2277
|
pkgName: e,
|
|
@@ -2292,10 +2279,10 @@ var Vo = class {
|
|
|
2292
2279
|
shared: s,
|
|
2293
2280
|
from: r.options.name,
|
|
2294
2281
|
lib: null,
|
|
2295
|
-
loading:
|
|
2282
|
+
loading: f,
|
|
2296
2283
|
treeShaking: a ? l : void 0
|
|
2297
2284
|
});
|
|
2298
|
-
const m = await
|
|
2285
|
+
const m = await f;
|
|
2299
2286
|
return this.emitAfterLoadShare({
|
|
2300
2287
|
lifecycle: "loadShare",
|
|
2301
2288
|
pkgName: e,
|
|
@@ -2317,49 +2304,49 @@ var Vo = class {
|
|
|
2317
2304
|
* It accepts one argument, the name of the share scope.
|
|
2318
2305
|
* If the share scope does not exist, it creates one.
|
|
2319
2306
|
*/
|
|
2320
|
-
initializeSharing(e =
|
|
2307
|
+
initializeSharing(e = ae, t) {
|
|
2321
2308
|
const { host: r } = this, o = t == null ? void 0 : t.from, n = t == null ? void 0 : t.strategy;
|
|
2322
2309
|
let s = t == null ? void 0 : t.initScope;
|
|
2323
2310
|
const i = [];
|
|
2324
2311
|
if (o !== "build") {
|
|
2325
2312
|
const { initTokens: m } = this;
|
|
2326
2313
|
s || (s = []);
|
|
2327
|
-
let
|
|
2328
|
-
if (
|
|
2329
|
-
s.push(
|
|
2314
|
+
let h = m[e];
|
|
2315
|
+
if (h || (h = m[e] = { from: this.host.name }), s.indexOf(h) >= 0) return i;
|
|
2316
|
+
s.push(h);
|
|
2330
2317
|
}
|
|
2331
2318
|
const c = this.shareScopeMap, a = r.options.name;
|
|
2332
2319
|
c[e] || (c[e] = {});
|
|
2333
|
-
const l = c[e], u = (m,
|
|
2320
|
+
const l = c[e], u = (m, h) => {
|
|
2334
2321
|
var g;
|
|
2335
|
-
const { version: d, eager: p } =
|
|
2322
|
+
const { version: d, eager: p } = h;
|
|
2336
2323
|
l[m] = l[m] || {};
|
|
2337
|
-
const E = l[m], y = E[d] &&
|
|
2338
|
-
(!y || y.strategy !== "loaded-first" && !y.loaded && (!p != !R ? p : a > E[d].from)) && (E[d] =
|
|
2339
|
-
},
|
|
2340
|
-
const { module:
|
|
2324
|
+
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 : a > E[d].from)) && (E[d] = h);
|
|
2326
|
+
}, f = async (m) => {
|
|
2327
|
+
const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: m });
|
|
2341
2328
|
let d;
|
|
2342
2329
|
try {
|
|
2343
|
-
d = await
|
|
2330
|
+
d = await h.getEntry();
|
|
2344
2331
|
} catch (p) {
|
|
2345
2332
|
if (d = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2346
2333
|
id: m,
|
|
2347
2334
|
error: p,
|
|
2348
2335
|
from: "runtime",
|
|
2349
2336
|
lifecycle: "beforeLoadShare",
|
|
2350
|
-
remote:
|
|
2337
|
+
remote: h.remoteInfo,
|
|
2351
2338
|
origin: r
|
|
2352
2339
|
}), !d) return;
|
|
2353
2340
|
} finally {
|
|
2354
|
-
d != null && d.init && !
|
|
2341
|
+
d != null && d.init && !h.initing && (h.remoteEntryExports = d, await h.init(void 0, void 0, s));
|
|
2355
2342
|
}
|
|
2356
2343
|
};
|
|
2357
2344
|
return Object.keys(r.options.shared).forEach((m) => {
|
|
2358
|
-
r.options.shared[m].forEach((
|
|
2359
|
-
|
|
2345
|
+
r.options.shared[m].forEach((h) => {
|
|
2346
|
+
h.scope.includes(e) && u(m, h);
|
|
2360
2347
|
});
|
|
2361
2348
|
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((m) => {
|
|
2362
|
-
m.shareScope === e && i.push(
|
|
2349
|
+
m.shareScope === e && i.push(f(m.name));
|
|
2363
2350
|
}), i;
|
|
2364
2351
|
}
|
|
2365
2352
|
loadShareSync(e, t) {
|
|
@@ -2372,7 +2359,7 @@ var Vo = class {
|
|
|
2372
2359
|
o != null && o.scope && o.scope.forEach((s) => {
|
|
2373
2360
|
this.initializeSharing(s, { strategy: o.strategy });
|
|
2374
2361
|
});
|
|
2375
|
-
const { shared: n } =
|
|
2362
|
+
const { shared: n } = Re(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
2376
2363
|
if (n) {
|
|
2377
2364
|
if (typeof n.lib == "function")
|
|
2378
2365
|
return z(n, r.options.name), n.loaded || (n.loaded = !0, n.from === r.options.name && (o.loaded = !0)), this.emitAfterLoadShare({
|
|
@@ -2447,20 +2434,20 @@ var Vo = class {
|
|
|
2447
2434
|
});
|
|
2448
2435
|
}
|
|
2449
2436
|
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: c }) {
|
|
2450
|
-
const { version: a, scope: l = "default", ...u } = t,
|
|
2437
|
+
const { version: a, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], m = (h) => {
|
|
2451
2438
|
const d = (E, y, R) => {
|
|
2452
2439
|
R && !E[y] && (E[y] = R);
|
|
2453
|
-
}, p = c ?
|
|
2440
|
+
}, p = c ? h.treeShaking : h;
|
|
2454
2441
|
d(p, "loaded", s), d(p, "loading", n), d(p, "get", i);
|
|
2455
2442
|
};
|
|
2456
|
-
|
|
2457
|
-
this.shareScopeMap[
|
|
2443
|
+
f.forEach((h) => {
|
|
2444
|
+
this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][a] || (this.shareScopeMap[h][e][a] = {
|
|
2458
2445
|
version: a,
|
|
2459
|
-
scope: [
|
|
2446
|
+
scope: [h],
|
|
2460
2447
|
...u,
|
|
2461
2448
|
lib: o
|
|
2462
2449
|
});
|
|
2463
|
-
const d = this.shareScopeMap[
|
|
2450
|
+
const d = this.shareScopeMap[h][e][a];
|
|
2464
2451
|
m(d), r && d.from !== r && (d.from = r);
|
|
2465
2452
|
});
|
|
2466
2453
|
}
|
|
@@ -2468,7 +2455,7 @@ var Vo = class {
|
|
|
2468
2455
|
const t = Nt(), r = e.id || e.name;
|
|
2469
2456
|
r && !t[r] && (t[r] = this.shareScopeMap);
|
|
2470
2457
|
}
|
|
2471
|
-
},
|
|
2458
|
+
}, Jo = class {
|
|
2472
2459
|
constructor() {
|
|
2473
2460
|
this.shareScopeMap = {}, this.hooks = new H({ afterResolve: new D("afterResolve") });
|
|
2474
2461
|
}
|
|
@@ -2490,7 +2477,7 @@ var Vo = class {
|
|
|
2490
2477
|
initShareScopeMap(e, t) {
|
|
2491
2478
|
this.shareScopeMap[e] = t;
|
|
2492
2479
|
}
|
|
2493
|
-
},
|
|
2480
|
+
}, Zo = class {
|
|
2494
2481
|
constructor(e) {
|
|
2495
2482
|
this.hooks = new H({
|
|
2496
2483
|
beforeRegisterRemote: new X("beforeRegisterRemote"),
|
|
@@ -2535,20 +2522,20 @@ var Vo = class {
|
|
|
2535
2522
|
const { host: r } = this, o = Qe(r.options.remotes, e);
|
|
2536
2523
|
let n = e, s = o == null ? void 0 : o.expose, i = o ? K(o.remote) : void 0, c;
|
|
2537
2524
|
try {
|
|
2538
|
-
const { loadFactory: a = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo:
|
|
2539
|
-
n = p, s = d, i = K(
|
|
2525
|
+
const { loadFactory: a = !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;
|
|
2526
|
+
n = p, s = d, i = K(h);
|
|
2540
2527
|
const y = await l.get(p, d, t, E), R = await this.hooks.lifecycle.onLoad.emit({
|
|
2541
2528
|
id: p,
|
|
2542
2529
|
pkgNameOrAlias: m,
|
|
2543
2530
|
expose: d,
|
|
2544
2531
|
exposeModule: a ? y : void 0,
|
|
2545
2532
|
exposeModuleFactory: a ? void 0 : y,
|
|
2546
|
-
remote:
|
|
2533
|
+
remote: h,
|
|
2547
2534
|
options: u,
|
|
2548
2535
|
moduleInstance: l,
|
|
2549
2536
|
origin: r
|
|
2550
2537
|
});
|
|
2551
|
-
return this.setIdToRemoteMap(e,
|
|
2538
|
+
return this.setIdToRemoteMap(e, f), c = {
|
|
2552
2539
|
id: n,
|
|
2553
2540
|
expose: s,
|
|
2554
2541
|
remote: i,
|
|
@@ -2568,15 +2555,15 @@ var Vo = class {
|
|
|
2568
2555
|
remote: i,
|
|
2569
2556
|
origin: r
|
|
2570
2557
|
});
|
|
2571
|
-
} catch (
|
|
2558
|
+
} catch (f) {
|
|
2572
2559
|
throw c = {
|
|
2573
2560
|
id: n,
|
|
2574
2561
|
expose: s,
|
|
2575
2562
|
remote: i,
|
|
2576
2563
|
options: t,
|
|
2577
|
-
error:
|
|
2564
|
+
error: f,
|
|
2578
2565
|
origin: r
|
|
2579
|
-
},
|
|
2566
|
+
}, f;
|
|
2580
2567
|
}
|
|
2581
2568
|
if (!u)
|
|
2582
2569
|
throw c = {
|
|
@@ -2607,17 +2594,17 @@ var Vo = class {
|
|
|
2607
2594
|
options: t.options,
|
|
2608
2595
|
origin: t
|
|
2609
2596
|
});
|
|
2610
|
-
const o =
|
|
2597
|
+
const o = Co(t.options.remotes, e), n = (c) => {
|
|
2611
2598
|
const { preloadConfig: a, remote: l } = c, u = a.exposes || [];
|
|
2612
|
-
return u.length ? u.map((
|
|
2599
|
+
return u.length ? u.map((f) => ({
|
|
2613
2600
|
ops: {
|
|
2614
2601
|
...c,
|
|
2615
2602
|
preloadConfig: {
|
|
2616
2603
|
...a,
|
|
2617
|
-
exposes: [
|
|
2604
|
+
exposes: [f]
|
|
2618
2605
|
}
|
|
2619
2606
|
},
|
|
2620
|
-
id: Ge(l.name,
|
|
2607
|
+
id: Ge(l.name, f)
|
|
2621
2608
|
})) : [{
|
|
2622
2609
|
ops: c,
|
|
2623
2610
|
id: `${l.name}/*`
|
|
@@ -2625,9 +2612,9 @@ var Vo = class {
|
|
|
2625
2612
|
};
|
|
2626
2613
|
let s;
|
|
2627
2614
|
await Promise.all(o.flatMap(n).map(async (c) => {
|
|
2628
|
-
const { ops: a, id: l } = c, { remote: u, preloadConfig:
|
|
2615
|
+
const { ops: a, id: l } = c, { remote: u, preloadConfig: f } = a, m = K(u);
|
|
2629
2616
|
try {
|
|
2630
|
-
const { globalSnapshot:
|
|
2617
|
+
const { globalSnapshot: h, remoteSnapshot: d } = await t.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2631
2618
|
moduleInfo: u,
|
|
2632
2619
|
id: l,
|
|
2633
2620
|
initiator: "preloadRemote"
|
|
@@ -2636,26 +2623,26 @@ var Vo = class {
|
|
|
2636
2623
|
preloadOptions: a,
|
|
2637
2624
|
remote: u,
|
|
2638
2625
|
remoteInfo: m,
|
|
2639
|
-
globalSnapshot:
|
|
2626
|
+
globalSnapshot: h,
|
|
2640
2627
|
remoteSnapshot: d
|
|
2641
2628
|
});
|
|
2642
2629
|
if (!p) return;
|
|
2643
|
-
const E = await
|
|
2630
|
+
const E = await Wt(m, t, p, !0, {
|
|
2644
2631
|
initiator: "preloadRemote",
|
|
2645
2632
|
id: l
|
|
2646
2633
|
});
|
|
2647
2634
|
r.push({
|
|
2648
2635
|
remote: u,
|
|
2649
2636
|
remoteInfo: m,
|
|
2650
|
-
preloadConfig:
|
|
2637
|
+
preloadConfig: f,
|
|
2651
2638
|
id: l,
|
|
2652
2639
|
results: E
|
|
2653
2640
|
});
|
|
2654
|
-
} catch (
|
|
2641
|
+
} catch (h) {
|
|
2655
2642
|
r.push({
|
|
2656
2643
|
remote: u,
|
|
2657
2644
|
remoteInfo: m,
|
|
2658
|
-
preloadConfig:
|
|
2645
|
+
preloadConfig: f,
|
|
2659
2646
|
id: l,
|
|
2660
2647
|
results: [{
|
|
2661
2648
|
url: m.entry,
|
|
@@ -2663,7 +2650,7 @@ var Vo = class {
|
|
|
2663
2650
|
resourceType: /\.json(?:$|[?#])/i.test(m.entry) ? "manifest" : "remoteEntry",
|
|
2664
2651
|
initiator: "preloadRemote",
|
|
2665
2652
|
id: l,
|
|
2666
|
-
error:
|
|
2653
|
+
error: h
|
|
2667
2654
|
}]
|
|
2668
2655
|
});
|
|
2669
2656
|
}
|
|
@@ -2705,15 +2692,15 @@ var Vo = class {
|
|
|
2705
2692
|
options: t.options,
|
|
2706
2693
|
origin: t
|
|
2707
2694
|
});
|
|
2708
|
-
} catch (
|
|
2695
|
+
} catch (h) {
|
|
2709
2696
|
if (o = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2710
2697
|
id: r,
|
|
2711
2698
|
options: t.options,
|
|
2712
2699
|
origin: t,
|
|
2713
2700
|
from: "runtime",
|
|
2714
|
-
error:
|
|
2701
|
+
error: h,
|
|
2715
2702
|
lifecycle: "beforeRequest"
|
|
2716
|
-
}), !o) throw
|
|
2703
|
+
}), !o) throw h;
|
|
2717
2704
|
}
|
|
2718
2705
|
const { id: n } = o, s = Qe(t.options.remotes, n);
|
|
2719
2706
|
if (!s) try {
|
|
@@ -2721,13 +2708,13 @@ var Vo = class {
|
|
|
2721
2708
|
hostName: t.options.name,
|
|
2722
2709
|
requestId: n
|
|
2723
2710
|
}, void 0, F(t.options));
|
|
2724
|
-
} catch (
|
|
2711
|
+
} catch (h) {
|
|
2725
2712
|
throw await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
2726
2713
|
id: n,
|
|
2727
2714
|
options: t.options,
|
|
2728
|
-
error:
|
|
2715
|
+
error: h,
|
|
2729
2716
|
origin: t
|
|
2730
|
-
}),
|
|
2717
|
+
}), h;
|
|
2731
2718
|
}
|
|
2732
2719
|
const { remote: i } = s, c = K(i);
|
|
2733
2720
|
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
@@ -2745,13 +2732,13 @@ var Vo = class {
|
|
|
2745
2732
|
remoteInfo: c
|
|
2746
2733
|
}), { remote: l, expose: u } = a;
|
|
2747
2734
|
L(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
|
|
2748
|
-
let
|
|
2735
|
+
let f = t.moduleCache.get(l.name);
|
|
2749
2736
|
const m = {
|
|
2750
2737
|
host: t,
|
|
2751
2738
|
remoteInfo: c
|
|
2752
2739
|
};
|
|
2753
|
-
return
|
|
2754
|
-
module:
|
|
2740
|
+
return f || (f = new et(m), t.moduleCache.set(l.name, f)), {
|
|
2741
|
+
module: f,
|
|
2755
2742
|
moduleOptions: m,
|
|
2756
2743
|
remoteMatchInfo: a
|
|
2757
2744
|
};
|
|
@@ -2765,7 +2752,7 @@ var Vo = class {
|
|
|
2765
2752
|
});
|
|
2766
2753
|
L(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2767
2754
|
}
|
|
2768
|
-
"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 =
|
|
2755
|
+
"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);
|
|
2769
2756
|
};
|
|
2770
2757
|
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2771
2758
|
remote: e,
|
|
@@ -2790,9 +2777,9 @@ var Vo = class {
|
|
|
2790
2777
|
try {
|
|
2791
2778
|
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((a) => a.name === o);
|
|
2792
2779
|
n !== -1 && r.options.remotes.splice(n, 1);
|
|
2793
|
-
const s = W(v.__FEDERATION__.moduleInfo,
|
|
2794
|
-
delete v.__FEDERATION__.moduleInfo[s], "entry" in e && (r.snapshotHandler.manifestCache.delete(e.entry), delete
|
|
2795
|
-
const { hostGlobalSnapshot: i } =
|
|
2780
|
+
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 be.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);
|
|
2782
|
+
const { hostGlobalSnapshot: i } = Kt(e, r);
|
|
2796
2783
|
if (i) {
|
|
2797
2784
|
const a = i && "remotesInfo" in i && i.remotesInfo && W(i.remotesInfo, e.name).key;
|
|
2798
2785
|
a && delete i.remotesInfo[a];
|
|
@@ -2803,11 +2790,11 @@ var Vo = class {
|
|
|
2803
2790
|
v[l] && ((t = Object.getOwnPropertyDescriptor(v, l)) != null && t.configurable ? delete v[l] : v[l] = void 0);
|
|
2804
2791
|
const u = Le(c.remoteInfo);
|
|
2805
2792
|
J[u] && delete J[u];
|
|
2806
|
-
let
|
|
2807
|
-
const m = v.__FEDERATION__.__INSTANCES__.findIndex((
|
|
2793
|
+
let f = a.buildVersion ? st(a.name, a.buildVersion) : a.name;
|
|
2794
|
+
const m = v.__FEDERATION__.__INSTANCES__.findIndex((h) => a.buildVersion ? h.options.id === f : h.name === f);
|
|
2808
2795
|
if (m !== -1) {
|
|
2809
|
-
const
|
|
2810
|
-
|
|
2796
|
+
const h = v.__FEDERATION__.__INSTANCES__[m];
|
|
2797
|
+
f = h.options.id || f;
|
|
2811
2798
|
const d = Nt();
|
|
2812
2799
|
let p = !0;
|
|
2813
2800
|
const E = [];
|
|
@@ -2815,27 +2802,27 @@ var Vo = class {
|
|
|
2815
2802
|
const R = d[y];
|
|
2816
2803
|
R && Object.keys(R).forEach((g) => {
|
|
2817
2804
|
const _ = R[g];
|
|
2818
|
-
_ && Object.keys(_).forEach((
|
|
2819
|
-
const I = _[
|
|
2820
|
-
I && Object.keys(I).forEach((
|
|
2821
|
-
const $ = I[
|
|
2805
|
+
_ && Object.keys(_).forEach((b) => {
|
|
2806
|
+
const I = _[b];
|
|
2807
|
+
I && Object.keys(I).forEach((S) => {
|
|
2808
|
+
const $ = I[S];
|
|
2822
2809
|
$ && typeof $ == "object" && $.from === a.name && ($.loaded || $.loading ? ($.useIn = $.useIn.filter((P) => P !== a.name), $.useIn.length ? p = !1 : E.push([
|
|
2823
2810
|
y,
|
|
2824
2811
|
g,
|
|
2825
|
-
|
|
2826
|
-
|
|
2812
|
+
b,
|
|
2813
|
+
S
|
|
2827
2814
|
])) : E.push([
|
|
2828
2815
|
y,
|
|
2829
2816
|
g,
|
|
2830
|
-
|
|
2831
|
-
|
|
2817
|
+
b,
|
|
2818
|
+
S
|
|
2832
2819
|
]));
|
|
2833
2820
|
});
|
|
2834
2821
|
});
|
|
2835
2822
|
});
|
|
2836
|
-
}), p && (
|
|
2837
|
-
var
|
|
2838
|
-
(
|
|
2823
|
+
}), p && (h.shareScopeMap = {}, delete d[f]), E.forEach(([y, R, g, _]) => {
|
|
2824
|
+
var b, I, S;
|
|
2825
|
+
(S = (I = (b = d[y]) == null ? void 0 : b[R]) == null ? void 0 : I[g]) == null || delete S[_];
|
|
2839
2826
|
}), v.__FEDERATION__.__INSTANCES__.splice(m, 1);
|
|
2840
2827
|
}
|
|
2841
2828
|
r.moduleCache.delete(e.name);
|
|
@@ -2845,15 +2832,15 @@ var Vo = class {
|
|
|
2845
2832
|
}
|
|
2846
2833
|
}
|
|
2847
2834
|
};
|
|
2848
|
-
const
|
|
2849
|
-
var
|
|
2835
|
+
const Xo = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0, ve = typeof FEDERATION_OPTIMIZE_NO_REMOTE == "boolean" ? !FEDERATION_OPTIMIZE_NO_REMOTE : !0, tt = typeof FEDERATION_OPTIMIZE_NO_SHARED == "boolean" ? !FEDERATION_OPTIMIZE_NO_SHARED : !0;
|
|
2836
|
+
var Yo = class {
|
|
2850
2837
|
constructor(e) {
|
|
2851
2838
|
this.hooks = new H({
|
|
2852
2839
|
beforeInit: new X("beforeInit"),
|
|
2853
2840
|
init: new A(),
|
|
2854
2841
|
beforeInitContainer: new D("beforeInitContainer"),
|
|
2855
2842
|
initContainer: new D("initContainer")
|
|
2856
|
-
}), this.version = "2.8.
|
|
2843
|
+
}), this.version = "2.8.1", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new H({
|
|
2857
2844
|
getModuleInfo: new A(),
|
|
2858
2845
|
createScript: new A(),
|
|
2859
2846
|
createLink: new A(),
|
|
@@ -2873,15 +2860,15 @@ var Xo = class {
|
|
|
2873
2860
|
beforeBridgeDestroy: new A(),
|
|
2874
2861
|
afterBridgeDestroy: new A()
|
|
2875
2862
|
});
|
|
2876
|
-
const t = ve &&
|
|
2877
|
-
id:
|
|
2863
|
+
const t = ve && Xo ? [Bo(), Vo()] : [], r = {
|
|
2864
|
+
id: ko(),
|
|
2878
2865
|
name: e.name,
|
|
2879
2866
|
plugins: t,
|
|
2880
2867
|
remotes: [],
|
|
2881
2868
|
shared: {},
|
|
2882
2869
|
inBrowser: G
|
|
2883
2870
|
};
|
|
2884
|
-
this.name = e.name, this.options = r, this.snapshotHandler = ve ? new
|
|
2871
|
+
this.name = e.name, this.options = r, this.snapshotHandler = ve ? new qo(this) : new zo(), this.sharedHandler = tt ? new Ko(this) : new Jo(), this.remoteHandler = ve ? new Zo(this) : new Uo(), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2885
2872
|
}
|
|
2886
2873
|
initOptions(e) {
|
|
2887
2874
|
e.name && e.name !== this.options.name && w(yt(Ct, M)), this.registerPlugins(e.plugins);
|
|
@@ -2894,7 +2881,7 @@ var Xo = class {
|
|
|
2894
2881
|
loadShareSync(e, t) {
|
|
2895
2882
|
return this.sharedHandler.loadShareSync(e, t);
|
|
2896
2883
|
}
|
|
2897
|
-
initializeSharing(e =
|
|
2884
|
+
initializeSharing(e = ae, t) {
|
|
2898
2885
|
return this.sharedHandler.initializeSharing(e, t);
|
|
2899
2886
|
}
|
|
2900
2887
|
initRawContainer(e, t, r) {
|
|
@@ -2933,7 +2920,7 @@ var Xo = class {
|
|
|
2933
2920
|
}), a;
|
|
2934
2921
|
}
|
|
2935
2922
|
registerPlugins(e) {
|
|
2936
|
-
const t =
|
|
2923
|
+
const t = Oo(e, this);
|
|
2937
2924
|
this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
|
|
2938
2925
|
}
|
|
2939
2926
|
registerRemotes(e, t) {
|
|
@@ -2946,12 +2933,12 @@ var Xo = class {
|
|
|
2946
2933
|
});
|
|
2947
2934
|
}
|
|
2948
2935
|
};
|
|
2949
|
-
let
|
|
2950
|
-
function
|
|
2951
|
-
return
|
|
2936
|
+
let Qo = null;
|
|
2937
|
+
function Jt(e) {
|
|
2938
|
+
return Qo;
|
|
2952
2939
|
}
|
|
2953
|
-
|
|
2954
|
-
function
|
|
2940
|
+
xr(Yo);
|
|
2941
|
+
function Zt(e, t) {
|
|
2955
2942
|
const r = (o) => {
|
|
2956
2943
|
if (!o.startsWith("/")) return o;
|
|
2957
2944
|
const n = o.length > 1 && o.endsWith("/"), s = `${t}/${o}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
@@ -2965,33 +2952,33 @@ function Jt(e, t) {
|
|
|
2965
2952
|
return typeof o.redirect == "string" ? n.redirect = r(o.redirect) : o.redirect && typeof o.redirect == "object" && "path" in o.redirect && typeof o.redirect.path == "string" && (n.redirect = {
|
|
2966
2953
|
...o.redirect,
|
|
2967
2954
|
path: r(o.redirect.path)
|
|
2968
|
-
}), o.children && o.children.length > 0 && (n.children =
|
|
2955
|
+
}), o.children && o.children.length > 0 && (n.children = Zt(
|
|
2969
2956
|
o.children,
|
|
2970
2957
|
t
|
|
2971
2958
|
)), n;
|
|
2972
2959
|
});
|
|
2973
2960
|
}
|
|
2974
|
-
function
|
|
2961
|
+
function en(e) {
|
|
2975
2962
|
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;
|
|
2976
2963
|
return (s) => {
|
|
2977
2964
|
const i = s.push.bind(s), c = s.replace.bind(s), a = s.resolve.bind(s);
|
|
2978
2965
|
s.push = (l) => i(n(l)), s.replace = (l) => c(n(l)), s.resolve = (l, ...u) => a(n(l), ...u);
|
|
2979
2966
|
};
|
|
2980
2967
|
}
|
|
2981
|
-
function
|
|
2968
|
+
function tn(e) {
|
|
2982
2969
|
const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
|
|
2983
|
-
(
|
|
2970
|
+
(h, d) => h.path.split("/").filter((p) => p).length - d.path.split("/").filter((p) => p).length
|
|
2984
2971
|
), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
2985
|
-
s.forEach((
|
|
2986
|
-
const d = i.get(
|
|
2987
|
-
d.push(
|
|
2972
|
+
s.forEach((h) => {
|
|
2973
|
+
const d = i.get(h.path) || [];
|
|
2974
|
+
d.push(h), i.set(h.path, d);
|
|
2988
2975
|
});
|
|
2989
|
-
const a = (
|
|
2990
|
-
if (!
|
|
2991
|
-
return
|
|
2992
|
-
for (let p = 0; p <
|
|
2993
|
-
const E =
|
|
2994
|
-
(_) => !c.has(_) && _ !==
|
|
2976
|
+
const a = (h, d) => `${h}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (h, d = "") => {
|
|
2977
|
+
if (!h.children || h.children.length === 0)
|
|
2978
|
+
return h;
|
|
2979
|
+
for (let p = 0; p < h.children.length; p++) {
|
|
2980
|
+
const E = h.children[p], y = a(d, E.path), g = (i.get(y) || []).find(
|
|
2981
|
+
(_) => !c.has(_) && _ !== h && (E.name == null || _.name === E.name)
|
|
2995
2982
|
);
|
|
2996
2983
|
if (g) {
|
|
2997
2984
|
const _ = {
|
|
@@ -2999,24 +2986,24 @@ function en(e) {
|
|
|
2999
2986
|
path: E.path
|
|
3000
2987
|
// Keep the original relative path from static route
|
|
3001
2988
|
};
|
|
3002
|
-
|
|
2989
|
+
h.children[p] = _, c.add(g), l(_, y);
|
|
3003
2990
|
}
|
|
3004
2991
|
}
|
|
3005
|
-
return
|
|
2992
|
+
return h;
|
|
3006
2993
|
};
|
|
3007
2994
|
let u = [];
|
|
3008
|
-
for (const
|
|
3009
|
-
if (!c.has(
|
|
3010
|
-
const d = l(
|
|
3011
|
-
c.add(
|
|
2995
|
+
for (const h of s)
|
|
2996
|
+
if (!c.has(h)) {
|
|
2997
|
+
const d = l(h, h.path);
|
|
2998
|
+
c.add(h), u.push(d);
|
|
3012
2999
|
}
|
|
3013
|
-
let
|
|
3014
|
-
return o ?
|
|
3000
|
+
let f, m;
|
|
3001
|
+
return o ? f = de.createMemoryHistory(r) : n ? (f = de.createWebHashHistory(), r && (u = Zt(u, r), m = en(r))) : f = de.createWebHistory(r), { history: f, routes: u, patchRouter: m };
|
|
3015
3002
|
}
|
|
3016
|
-
function
|
|
3017
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
3003
|
+
function cn(e) {
|
|
3004
|
+
const t = /* @__PURE__ */ new Map(), r = Jt();
|
|
3018
3005
|
return () => ({
|
|
3019
|
-
__APP_VERSION__: "2.8.
|
|
3006
|
+
__APP_VERSION__: "2.8.1",
|
|
3020
3007
|
async render(o) {
|
|
3021
3008
|
var d, p, E, y, R, g;
|
|
3022
3009
|
C.debug("createBridgeComponent render Info", o);
|
|
@@ -3027,9 +3014,9 @@ function an(e) {
|
|
|
3027
3014
|
memoryRoute: c,
|
|
3028
3015
|
hashRoute: a,
|
|
3029
3016
|
...l
|
|
3030
|
-
} = o, u =
|
|
3017
|
+
} = o, u = Xt.createApp(e.rootComponent, l);
|
|
3031
3018
|
t.set(s, u);
|
|
3032
|
-
const
|
|
3019
|
+
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({
|
|
3033
3020
|
app: u,
|
|
3034
3021
|
basename: i,
|
|
3035
3022
|
memoryRoute: c,
|
|
@@ -3037,21 +3024,21 @@ function an(e) {
|
|
|
3037
3024
|
...l,
|
|
3038
3025
|
...m
|
|
3039
3026
|
});
|
|
3040
|
-
if (
|
|
3041
|
-
const { history: _, routes:
|
|
3042
|
-
router:
|
|
3027
|
+
if (h != null && h.router) {
|
|
3028
|
+
const { history: _, routes: b, patchRouter: I } = tn({
|
|
3029
|
+
router: h.router,
|
|
3043
3030
|
basename: o.basename,
|
|
3044
3031
|
memoryRoute: o.memoryRoute,
|
|
3045
3032
|
hashRoute: o.hashRoute
|
|
3046
|
-
}),
|
|
3047
|
-
...
|
|
3033
|
+
}), S = de.createRouter({
|
|
3034
|
+
...h.router.options,
|
|
3048
3035
|
history: _,
|
|
3049
|
-
routes:
|
|
3036
|
+
routes: b
|
|
3050
3037
|
});
|
|
3051
|
-
I && I(
|
|
3038
|
+
I && I(S), h.afterRouterCreate && h.afterRouterCreate(S), C.debug("createBridgeComponent render router info>>>", {
|
|
3052
3039
|
moduleName: n,
|
|
3053
|
-
router:
|
|
3054
|
-
}), c && await
|
|
3040
|
+
router: S
|
|
3041
|
+
}), c && await S.push(c.entryPath), u.use(S);
|
|
3055
3042
|
}
|
|
3056
3043
|
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);
|
|
3057
3044
|
},
|
|
@@ -3063,11 +3050,11 @@ function an(e) {
|
|
|
3063
3050
|
}
|
|
3064
3051
|
});
|
|
3065
3052
|
}
|
|
3066
|
-
function
|
|
3053
|
+
function rn() {
|
|
3067
3054
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
3068
3055
|
window.dispatchEvent(e);
|
|
3069
3056
|
}
|
|
3070
|
-
const
|
|
3057
|
+
const on = /* @__PURE__ */ Yt({
|
|
3071
3058
|
name: "RemoteApp",
|
|
3072
3059
|
props: {
|
|
3073
3060
|
moduleName: String,
|
|
@@ -3079,14 +3066,14 @@ const rn = /* @__PURE__ */ Xt({
|
|
|
3079
3066
|
},
|
|
3080
3067
|
inheritAttrs: !1,
|
|
3081
3068
|
setup(e) {
|
|
3082
|
-
const t = V(null), r = V(null), o = V(""), n = V(!1), s = V(!1), i = V(!1), c = rt(), a =
|
|
3069
|
+
const t = V(null), r = V(null), o = V(""), n = V(!1), s = V(!1), i = V(!1), c = rt(), a = Jt(), l = Qt(), u = () => ({
|
|
3083
3070
|
name: e.moduleName,
|
|
3084
3071
|
dom: t.value,
|
|
3085
3072
|
basename: e.basename,
|
|
3086
3073
|
memoryRoute: e.memoryRoute,
|
|
3087
3074
|
hashRoute: e.hashRoute
|
|
3088
|
-
}),
|
|
3089
|
-
var y, R, g, _,
|
|
3075
|
+
}), f = async () => {
|
|
3076
|
+
var y, R, g, _, b, I, S;
|
|
3090
3077
|
if (!t.value || n.value)
|
|
3091
3078
|
return;
|
|
3092
3079
|
const d = (y = e.providerInfo) == null ? void 0 : y.call(e);
|
|
@@ -3104,9 +3091,9 @@ const rn = /* @__PURE__ */ Xt({
|
|
|
3104
3091
|
p = {
|
|
3105
3092
|
...p,
|
|
3106
3093
|
...E.extraProps
|
|
3107
|
-
}, d.render(p), n.value = !0, (
|
|
3094
|
+
}, d.render(p), n.value = !0, (S = (I = (b = a == null ? void 0 : a.bridgeHook) == null ? void 0 : b.lifecycle) == null ? void 0 : I.afterBridgeRender) == null || S.emit(p);
|
|
3108
3095
|
}, m = () => {
|
|
3109
|
-
var E, y, R, g, _,
|
|
3096
|
+
var E, y, R, g, _, b;
|
|
3110
3097
|
const d = r.value;
|
|
3111
3098
|
if (!d || !n.value)
|
|
3112
3099
|
return;
|
|
@@ -3116,30 +3103,30 @@ const rn = /* @__PURE__ */ Xt({
|
|
|
3116
3103
|
const p = u();
|
|
3117
3104
|
(R = (y = (E = a == null ? void 0 : a.bridgeHook) == null ? void 0 : E.lifecycle) == null ? void 0 : y.beforeBridgeDestroy) == null || R.emit(p), d.destroy({
|
|
3118
3105
|
dom: t.value
|
|
3119
|
-
}), r.value = null, n.value = !1, (
|
|
3120
|
-
},
|
|
3106
|
+
}), r.value = null, n.value = !1, (b = (_ = (g = a == null ? void 0 : a.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : _.afterBridgeDestroy) == null || b.emit(p);
|
|
3107
|
+
}, h = er(() => c == null ? void 0 : c.path, (d) => {
|
|
3121
3108
|
s.value && o.value !== "" && o.value !== d && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
3122
3109
|
...e,
|
|
3123
3110
|
pathname: c.path
|
|
3124
|
-
}),
|
|
3111
|
+
}), rn()), o.value = d;
|
|
3125
3112
|
});
|
|
3126
|
-
return
|
|
3127
|
-
s.value = !0,
|
|
3128
|
-
}),
|
|
3129
|
-
s.value = !0, i.value && (i.value = !1, await
|
|
3130
|
-
}), or(() => {
|
|
3131
|
-
s.value = !1, i.value = !0, m();
|
|
3113
|
+
return tr(() => {
|
|
3114
|
+
s.value = !0, f();
|
|
3115
|
+
}), rr(async () => {
|
|
3116
|
+
s.value = !0, i.value && (i.value = !1, await or(), f());
|
|
3132
3117
|
}), nr(() => {
|
|
3133
|
-
|
|
3134
|
-
}), () =>
|
|
3118
|
+
s.value = !1, i.value = !0, m();
|
|
3119
|
+
}), sr(() => {
|
|
3120
|
+
h(), m();
|
|
3121
|
+
}), () => ir("div", ar(e.rootAttrs || {}, {
|
|
3135
3122
|
ref: t
|
|
3136
3123
|
}), null);
|
|
3137
3124
|
}
|
|
3138
3125
|
});
|
|
3139
|
-
function
|
|
3140
|
-
return
|
|
3126
|
+
function nn(e) {
|
|
3127
|
+
return cr({
|
|
3141
3128
|
// @ts-ignore
|
|
3142
|
-
__APP_VERSION__: "2.8.
|
|
3129
|
+
__APP_VERSION__: "2.8.1",
|
|
3143
3130
|
...e.asyncComponentOptions,
|
|
3144
3131
|
//@ts-ignore
|
|
3145
3132
|
loader: async () => {
|
|
@@ -3163,7 +3150,7 @@ function on(e) {
|
|
|
3163
3150
|
), n in s && typeof c == "function")
|
|
3164
3151
|
return {
|
|
3165
3152
|
render() {
|
|
3166
|
-
return
|
|
3153
|
+
return lr(on, {
|
|
3167
3154
|
moduleName: i,
|
|
3168
3155
|
providerInfo: c,
|
|
3169
3156
|
basename: r,
|
|
@@ -3177,13 +3164,13 @@ function on(e) {
|
|
|
3177
3164
|
}
|
|
3178
3165
|
});
|
|
3179
3166
|
}
|
|
3180
|
-
function
|
|
3167
|
+
function ln(e) {
|
|
3181
3168
|
return C.warn(
|
|
3182
3169
|
"createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
3183
|
-
),
|
|
3170
|
+
), nn(e);
|
|
3184
3171
|
}
|
|
3185
3172
|
export {
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3173
|
+
cn as createBridgeComponent,
|
|
3174
|
+
nn as createRemoteAppComponent,
|
|
3175
|
+
ln as createRemoteComponent
|
|
3189
3176
|
};
|