@module-federation/bridge-vue3 2.5.1 → 2.7.0
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.d.ts +0 -67
- package/dist/index.js +760 -712
- package/package.json +8 -6
package/dist/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import * as
|
|
1
|
+
import * as Kt from "vue";
|
|
2
|
+
import { defineComponent as zt, ref as W, useAttrs as Jt, watch as Xt, onMounted as Yt, onActivated as Zt, nextTick as Qt, onDeactivated as er, onBeforeUnmount as tr, createVNode as rr, mergeProps as or, defineAsyncComponent as nr, h as sr } from "vue";
|
|
3
|
+
import * as fe from "vue-router";
|
|
4
4
|
import { useRoute as Ze } from "vue-router";
|
|
5
|
-
const
|
|
6
|
-
let
|
|
5
|
+
const ir = ".json", ar = "FEDERATION_DEBUG", cr = ":";
|
|
6
|
+
let ve = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e[e.UNKNOWN = 1] = "UNKNOWN", e[e.CALCULATED = 2] = "CALCULATED", e[e.NO_USE = 0] = "NO_USE", e;
|
|
8
8
|
}({});
|
|
9
|
-
const
|
|
9
|
+
const x = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
10
10
|
function Qe() {
|
|
11
|
-
return
|
|
11
|
+
return x;
|
|
12
12
|
}
|
|
13
13
|
function et() {
|
|
14
14
|
return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function lr() {
|
|
17
17
|
try {
|
|
18
|
-
if (Qe() && window.localStorage) return !!localStorage.getItem(
|
|
18
|
+
if (Qe() && window.localStorage) return !!localStorage.getItem(ar);
|
|
19
19
|
} catch {
|
|
20
20
|
return !1;
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 :
|
|
24
|
+
function Ne() {
|
|
25
|
+
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : lr();
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
return e.length ? e.reduce((t, r) => r ? t ? `${t}${
|
|
29
|
-
},
|
|
27
|
+
const ur = "[ Federation Runtime ]", tt = function(...e) {
|
|
28
|
+
return e.length ? e.reduce((t, r) => r ? t ? `${t}${cr}${r}` : r : t, "") : "";
|
|
29
|
+
}, Te = (e, t) => {
|
|
30
30
|
if ("getPublicPath" in e) {
|
|
31
31
|
let r;
|
|
32
32
|
return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
|
|
33
33
|
} else return "publicPath" in e ? !Qe() && !et() && "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
34
|
}, rt = (e) => {
|
|
35
|
-
console.warn(`${
|
|
35
|
+
console.warn(`${ur}: ${e}`);
|
|
36
36
|
};
|
|
37
37
|
function ot(e) {
|
|
38
38
|
try {
|
|
@@ -41,7 +41,7 @@ function ot(e) {
|
|
|
41
41
|
return "";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const be = (e, t) => {
|
|
45
45
|
if (!e) return t;
|
|
46
46
|
const o = ((n) => {
|
|
47
47
|
if (n === ".") return "";
|
|
@@ -54,35 +54,35 @@ const Re = (e, t) => {
|
|
|
54
54
|
})(e);
|
|
55
55
|
return o ? o.endsWith("/") ? `${o}${t}` : `${o}/${t}` : t;
|
|
56
56
|
};
|
|
57
|
-
function
|
|
57
|
+
function fr(e) {
|
|
58
58
|
return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
var
|
|
60
|
+
function hr(e, t = {}) {
|
|
61
|
+
var R;
|
|
62
62
|
const { remotes: r = {}, overrides: o = {}, version: n } = t;
|
|
63
63
|
let s;
|
|
64
|
-
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ?
|
|
64
|
+
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && n ? fr(n) : e.metaData.publicPath : e.metaData.getPublicPath, c = Object.keys(o);
|
|
65
65
|
let a = {};
|
|
66
|
-
Object.keys(r).length || (a = ((
|
|
67
|
-
let
|
|
68
|
-
const $ =
|
|
69
|
-
return c.includes($) ?
|
|
66
|
+
Object.keys(r).length || (a = ((R = e.remotes) == null ? void 0 : R.reduce((g, _) => {
|
|
67
|
+
let b;
|
|
68
|
+
const $ = _.federationContainerName;
|
|
69
|
+
return c.includes($) ? b = o[$] : "version" in _ ? b = _.version : b = _.entry, g[$] = { matchedVersion: b }, g;
|
|
70
70
|
}, {})) || {}), Object.keys(r).forEach((g) => a[g] = { matchedVersion: c.includes(g) ? o[g] : r[g] });
|
|
71
|
-
const { remoteEntry: { path: l, name: u, type: f }, types:
|
|
71
|
+
const { remoteEntry: { path: l, name: u, type: f }, types: m = {
|
|
72
72
|
path: "",
|
|
73
73
|
name: "",
|
|
74
74
|
zip: "",
|
|
75
75
|
api: ""
|
|
76
|
-
}, buildInfo: { buildVersion: h }, globalName:
|
|
77
|
-
let
|
|
76
|
+
}, buildInfo: { buildVersion: h }, globalName: d, ssrRemoteEntry: p } = e.metaData, { exposes: E } = e;
|
|
77
|
+
let y = {
|
|
78
78
|
version: n || "",
|
|
79
79
|
buildVersion: h,
|
|
80
|
-
globalName:
|
|
81
|
-
remoteEntry:
|
|
80
|
+
globalName: d,
|
|
81
|
+
remoteEntry: be(l, u),
|
|
82
82
|
remoteEntryType: f,
|
|
83
|
-
remoteTypes:
|
|
84
|
-
remoteTypesZip:
|
|
85
|
-
remoteTypesAPI:
|
|
83
|
+
remoteTypes: be(m.path, m.name),
|
|
84
|
+
remoteTypesZip: m.zip || "",
|
|
85
|
+
remoteTypesAPI: m.api || "",
|
|
86
86
|
remotesInfo: a,
|
|
87
87
|
shared: e == null ? void 0 : e.shared.map((g) => ({
|
|
88
88
|
assets: g.assets,
|
|
@@ -90,28 +90,28 @@ function ar(e, t = {}) {
|
|
|
90
90
|
version: g.version,
|
|
91
91
|
usedExports: g.referenceExports || []
|
|
92
92
|
})),
|
|
93
|
-
modules:
|
|
93
|
+
modules: E == null ? void 0 : E.map((g) => ({
|
|
94
94
|
moduleName: g.name,
|
|
95
95
|
modulePath: g.path,
|
|
96
96
|
assets: g.assets
|
|
97
97
|
}))
|
|
98
98
|
};
|
|
99
99
|
if ("publicPath" in e.metaData ? (s = {
|
|
100
|
-
...
|
|
100
|
+
...y,
|
|
101
101
|
publicPath: i()
|
|
102
102
|
}, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
|
|
103
|
-
...
|
|
103
|
+
...y,
|
|
104
104
|
getPublicPath: i()
|
|
105
105
|
}, p) {
|
|
106
|
-
const g =
|
|
106
|
+
const g = be(p.path, p.name);
|
|
107
107
|
s.ssrRemoteEntry = g, s.ssrRemoteEntryType = p.type || "commonjs-module";
|
|
108
108
|
}
|
|
109
109
|
return s;
|
|
110
110
|
}
|
|
111
111
|
function nt(e) {
|
|
112
|
-
return !!("remoteEntry" in e && e.remoteEntry.includes(
|
|
112
|
+
return !!("remoteEntry" in e && e.remoteEntry.includes(ir));
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const dr = "[ Module Federation ]", Q = console, mr = [
|
|
115
115
|
"logger.ts",
|
|
116
116
|
"logger.js",
|
|
117
117
|
"captureStackTrace",
|
|
@@ -122,12 +122,12 @@ const cr = "[ Module Federation ]", Y = console, lr = [
|
|
|
122
122
|
"Logger.error",
|
|
123
123
|
"Logger.debug"
|
|
124
124
|
];
|
|
125
|
-
function
|
|
125
|
+
function pr() {
|
|
126
126
|
try {
|
|
127
127
|
const e = (/* @__PURE__ */ new Error()).stack;
|
|
128
128
|
if (!e) return;
|
|
129
129
|
const [, ...t] = e.split(`
|
|
130
|
-
`), r = t.filter((o) => !
|
|
130
|
+
`), r = t.filter((o) => !mr.some((n) => o.includes(n)));
|
|
131
131
|
return r.length ? `Stack trace:
|
|
132
132
|
${r.slice(0, 5).join(`
|
|
133
133
|
`)}` : void 0;
|
|
@@ -136,17 +136,17 @@ ${r.slice(0, 5).join(`
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
var st = class {
|
|
139
|
-
constructor(e, t =
|
|
140
|
-
this.prefix = e, this.delegate = t ??
|
|
139
|
+
constructor(e, t = Q) {
|
|
140
|
+
this.prefix = e, this.delegate = t ?? Q;
|
|
141
141
|
}
|
|
142
142
|
setPrefix(e) {
|
|
143
143
|
this.prefix = e;
|
|
144
144
|
}
|
|
145
145
|
setDelegate(e) {
|
|
146
|
-
this.delegate = e ??
|
|
146
|
+
this.delegate = e ?? Q;
|
|
147
147
|
}
|
|
148
148
|
emit(e, t) {
|
|
149
|
-
const r = this.delegate, o =
|
|
149
|
+
const r = this.delegate, o = Ne() ? pr() : void 0, n = o ? [...t, o] : t, s = (() => {
|
|
150
150
|
switch (e) {
|
|
151
151
|
case "log":
|
|
152
152
|
return ["log", "info"];
|
|
@@ -176,9 +176,9 @@ var st = class {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
for (const i of s) {
|
|
179
|
-
const c =
|
|
179
|
+
const c = Q[i];
|
|
180
180
|
if (typeof c == "function") {
|
|
181
|
-
c.call(
|
|
181
|
+
c.call(Q, this.prefix, ...n);
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -202,13 +202,13 @@ var st = class {
|
|
|
202
202
|
this.emit("info", e);
|
|
203
203
|
}
|
|
204
204
|
debug(...e) {
|
|
205
|
-
|
|
205
|
+
Ne() && this.emit("debug", e);
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
208
|
function it(e) {
|
|
209
209
|
return new st(e);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function yr(e) {
|
|
212
212
|
const t = new st(e);
|
|
213
213
|
return Object.defineProperty(t, "__mf_infrastructure_logger__", {
|
|
214
214
|
value: !0,
|
|
@@ -216,7 +216,7 @@ function fr(e) {
|
|
|
216
216
|
configurable: !1
|
|
217
217
|
}), t;
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
yr(dr);
|
|
220
220
|
async function at(e, t) {
|
|
221
221
|
try {
|
|
222
222
|
return await e();
|
|
@@ -259,20 +259,20 @@ function ct(e) {
|
|
|
259
259
|
clearTimeout(n), c && window.removeEventListener("error", c);
|
|
260
260
|
const f = () => {
|
|
261
261
|
if ((u == null ? void 0 : u.type) === "error") {
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
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
|
+
m.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(m));
|
|
264
264
|
} else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
|
|
265
265
|
};
|
|
266
266
|
if (t && (t.onerror = null, t.onload = null, at(() => {
|
|
267
|
-
const { needDeleteScript:
|
|
268
|
-
|
|
267
|
+
const { needDeleteScript: m = !0 } = e;
|
|
268
|
+
m && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
269
269
|
}), l && typeof l == "function")) {
|
|
270
|
-
const
|
|
271
|
-
if (
|
|
272
|
-
const h = await
|
|
270
|
+
const m = l(u);
|
|
271
|
+
if (m instanceof Promise) {
|
|
272
|
+
const h = await m;
|
|
273
273
|
return f(), h;
|
|
274
274
|
}
|
|
275
|
-
return f(),
|
|
275
|
+
return f(), m;
|
|
276
276
|
}
|
|
277
277
|
f();
|
|
278
278
|
};
|
|
@@ -286,7 +286,7 @@ function ct(e) {
|
|
|
286
286
|
needAttach: r
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Er(e) {
|
|
290
290
|
let t = null, r = !0, o = 2e4, n;
|
|
291
291
|
const s = document.getElementsByTagName("link");
|
|
292
292
|
for (let c = 0; c < s.length; c++) {
|
|
@@ -338,7 +338,7 @@ function hr(e) {
|
|
|
338
338
|
needAttach: r
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function gr(e, t) {
|
|
342
342
|
const { attrs: r = {}, createScriptHook: o } = t;
|
|
343
343
|
return new Promise((n, s) => {
|
|
344
344
|
const { script: i, needAttach: c } = ct({
|
|
@@ -355,22 +355,19 @@ function dr(e, t) {
|
|
|
355
355
|
c && document.head.appendChild(i);
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
|
-
const
|
|
359
|
-
function
|
|
358
|
+
const ce = /* @__PURE__ */ new Map();
|
|
359
|
+
function H(e) {
|
|
360
360
|
if (!e) throw new Error("import specifier is required");
|
|
361
|
-
if (
|
|
361
|
+
if (ce.has(e)) return ce.get(e);
|
|
362
362
|
const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
|
|
363
|
-
throw console.error(`Error importing module ${e}:`, r),
|
|
363
|
+
throw console.error(`Error importing module ${e}:`, r), ce.delete(e), r;
|
|
364
364
|
});
|
|
365
|
-
return
|
|
365
|
+
return ce.set(e, t), t;
|
|
366
366
|
}
|
|
367
|
-
const
|
|
368
|
-
const e = await W("node-fetch");
|
|
369
|
-
return e.default || e;
|
|
370
|
-
}, mr = async (e, t, r) => {
|
|
367
|
+
const Rr = async (e, t, r) => {
|
|
371
368
|
const n = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
|
|
372
|
-
return !n || !(n instanceof Response) ?
|
|
373
|
-
},
|
|
369
|
+
return !n || !(n instanceof Response) ? fetch(e, t || {}) : n;
|
|
370
|
+
}, _r = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, o) => {
|
|
374
371
|
if (o != null && o.createScriptHook) {
|
|
375
372
|
const c = o.createScriptHook(e);
|
|
376
373
|
c && typeof c == "object" && "url" in c && (e = c.url);
|
|
@@ -382,20 +379,20 @@ const lt = async () => {
|
|
|
382
379
|
console.error("Error constructing URL:", c), t(/* @__PURE__ */ new Error(`Invalid URL: ${c}`));
|
|
383
380
|
return;
|
|
384
381
|
}
|
|
385
|
-
const s = async () => o != null && o.fetch ? (c, a) =>
|
|
382
|
+
const s = async () => o != null && o.fetch ? (c, a) => Rr(c, a, o) : fetch, i = async (c, a) => {
|
|
386
383
|
var l;
|
|
387
384
|
try {
|
|
388
|
-
const f = await (await c(a.href)).text(), [
|
|
385
|
+
const f = await (await c(a.href)).text(), [m, h] = await Promise.all([H("path"), H("vm")]), d = {
|
|
389
386
|
exports: {},
|
|
390
387
|
module: { exports: {} }
|
|
391
|
-
}, p = a.pathname.split("/").slice(0, -1).join("/"),
|
|
388
|
+
}, p = a.pathname.split("/").slice(0, -1).join("/"), E = m.basename(a.pathname), y = new h.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
392
389
|
})`, {
|
|
393
|
-
filename:
|
|
394
|
-
importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ??
|
|
390
|
+
filename: E,
|
|
391
|
+
importModuleDynamically: ((l = h.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? H
|
|
395
392
|
});
|
|
396
|
-
let
|
|
397
|
-
|
|
398
|
-
const g =
|
|
393
|
+
let R;
|
|
394
|
+
R = (await H("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);
|
|
395
|
+
const g = d.module.exports || d.exports;
|
|
399
396
|
if (r && g && r.globalName) {
|
|
400
397
|
t(void 0, g[r.globalName] || g);
|
|
401
398
|
return;
|
|
@@ -406,9 +403,9 @@ const lt = async () => {
|
|
|
406
403
|
}
|
|
407
404
|
};
|
|
408
405
|
s().then(async (c) => {
|
|
409
|
-
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return
|
|
406
|
+
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ft(n.href, {
|
|
410
407
|
fetch: c,
|
|
411
|
-
vm: await
|
|
408
|
+
vm: await H("vm")
|
|
412
409
|
}).then(async (a) => {
|
|
413
410
|
await a.evaluate(), t(void 0, a.namespace);
|
|
414
411
|
}).catch((a) => {
|
|
@@ -420,8 +417,8 @@ const lt = async () => {
|
|
|
420
417
|
});
|
|
421
418
|
} : (e, t, r, o) => {
|
|
422
419
|
t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
423
|
-
},
|
|
424
|
-
|
|
420
|
+
}, br = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, o) => {
|
|
421
|
+
_r(e, (n, s) => {
|
|
425
422
|
var i, c;
|
|
426
423
|
if (n) o(n);
|
|
427
424
|
else {
|
|
@@ -431,70 +428,111 @@ const lt = async () => {
|
|
|
431
428
|
}, t.attrs, t.loaderHook);
|
|
432
429
|
}) : (e, t) => {
|
|
433
430
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
434
|
-
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
return
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
446
|
-
|
|
431
|
+
}, J = /* @__PURE__ */ new Map(), lt = (e) => e.startsWith("http:") || e.startsWith("https:"), ut = (e) => !e.startsWith("./") && !e.startsWith("../") && !e.startsWith("/") && !e.includes(":");
|
|
432
|
+
function Sr(e) {
|
|
433
|
+
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
|
+
return `/${r}/${o}${n}${s ? `/${s}` : ""}`;
|
|
435
|
+
}
|
|
436
|
+
function wr(e, t) {
|
|
437
|
+
const r = t.endsWith("/") ? t : `${t}/`;
|
|
438
|
+
return new URL(`__module_federation_remote__${Sr(e)}`, r).href;
|
|
439
|
+
}
|
|
440
|
+
async function $r(e) {
|
|
441
|
+
return e.startsWith("node:") ? !0 : ut(e) ? (await H("node:module")).builtinModules.includes(e) : !1;
|
|
442
|
+
}
|
|
443
|
+
function Ir(e) {
|
|
444
|
+
const t = e && (typeof e == "object" || typeof e == "function") ? e : { default: e }, r = { ...t };
|
|
445
|
+
return Object.prototype.hasOwnProperty.call(r, "default") || (r.default = t), r;
|
|
446
|
+
}
|
|
447
|
+
async function vr(e, t, r) {
|
|
448
|
+
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 = Ir(t), n = Object.keys(o), s = new r.SyntheticModule(n, function() {
|
|
450
|
+
for (const c of n) this.setExport(c, o[c]);
|
|
451
|
+
}, { identifier: e });
|
|
452
|
+
return J.set(e, s), await s.link(async () => {
|
|
453
|
+
throw new Error(`Node.js built-in module "${e}" should not request child modules.`);
|
|
454
|
+
}), await s.evaluate(), s;
|
|
455
|
+
}
|
|
456
|
+
async function Nr(e, t) {
|
|
457
|
+
const r = `node-builtin:${e}`;
|
|
458
|
+
return J.has(r) ? J.get(r) : vr(r, await H(e), t);
|
|
459
|
+
}
|
|
460
|
+
async function Be(e, t, r) {
|
|
461
|
+
if (await $r(e)) return Nr(e, r.vm);
|
|
462
|
+
if (ut(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
|
+
const o = new URL(e, t).href;
|
|
464
|
+
if (!lt(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
|
+
return ft(o, r);
|
|
466
|
+
}
|
|
467
|
+
async function Tr(e) {
|
|
468
|
+
if (e.status === "linked" && await e.evaluate(), e.status === "errored") throw e.error;
|
|
469
|
+
return e;
|
|
470
|
+
}
|
|
471
|
+
async function ft(e, t) {
|
|
472
|
+
if (J.has(e)) return J.get(e);
|
|
473
|
+
const { fetch: r, vm: o } = t;
|
|
474
|
+
if (!lt(e)) throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);
|
|
475
|
+
const n = await (await r(e)).text(), s = (await H("node:url")).pathToFileURL(process.cwd()).href, i = new o.SourceTextModule(n, {
|
|
476
|
+
identifier: e,
|
|
477
|
+
initializeImportMeta: (c) => {
|
|
478
|
+
c.url = wr(e, s);
|
|
479
|
+
},
|
|
480
|
+
importModuleDynamically: async (c) => Tr(await Be(c, e, t))
|
|
481
|
+
});
|
|
482
|
+
return J.set(e, i), await i.link(async (c) => Be(c, e, t)), i;
|
|
483
|
+
}
|
|
484
|
+
const C = it("[ Module Federation Bridge Vue3 ]"), Ar = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, ht = (e, t, r, o) => {
|
|
447
485
|
const n = [`${[t[e]]} #${e}`];
|
|
448
|
-
return r && n.push(`args: ${JSON.stringify(r)}`), n.push(
|
|
486
|
+
return r && n.push(`args: ${JSON.stringify(r)}`), n.push(Ar(e)), o && n.push(`Original Error Message:
|
|
449
487
|
${o}`), n.join(`
|
|
450
488
|
`);
|
|
451
489
|
};
|
|
452
|
-
function
|
|
453
|
-
return o(
|
|
490
|
+
function Pr(e, t, r, o, n, s) {
|
|
491
|
+
return o(ht(e, t, r, n));
|
|
454
492
|
}
|
|
455
|
-
const
|
|
493
|
+
const G = "[ Federation Runtime ]", Pe = it(G);
|
|
456
494
|
function O(e, t, r, o, n) {
|
|
457
|
-
e ||
|
|
495
|
+
e || w(t);
|
|
458
496
|
}
|
|
459
|
-
function
|
|
460
|
-
if (t !== void 0) return
|
|
461
|
-
throw new Error(`${
|
|
497
|
+
function w(e, t, r, o, n) {
|
|
498
|
+
if (t !== void 0) return Pr(e, t, r ?? {}, (i) => {
|
|
499
|
+
throw new Error(`${G}: ${i}`);
|
|
462
500
|
}, o);
|
|
463
501
|
const s = e;
|
|
464
|
-
throw s instanceof Error ? (s.message.startsWith(
|
|
502
|
+
throw s instanceof Error ? (s.message.startsWith(G) || (s.message = `${G}: ${s.message}`), s) : new Error(`${G}: ${s}`);
|
|
465
503
|
}
|
|
466
|
-
function
|
|
467
|
-
e instanceof Error && (e.message.startsWith(
|
|
504
|
+
function oe(e) {
|
|
505
|
+
e instanceof Error && (e.message.startsWith(G) || (e.message = `${G}: ${e.message}`)), Pe.warn(e);
|
|
468
506
|
}
|
|
469
|
-
function
|
|
507
|
+
function kr(e, t) {
|
|
470
508
|
return e.findIndex((r) => r === t) === -1 && e.push(t), e;
|
|
471
509
|
}
|
|
472
|
-
function
|
|
510
|
+
function ne(e) {
|
|
473
511
|
return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
|
|
474
512
|
}
|
|
475
|
-
function
|
|
513
|
+
function Le(e) {
|
|
476
514
|
return typeof e.entry < "u";
|
|
477
515
|
}
|
|
478
|
-
function
|
|
516
|
+
function dt(e) {
|
|
479
517
|
return !e.entry.includes(".json");
|
|
480
518
|
}
|
|
481
|
-
function
|
|
519
|
+
function Oe(e) {
|
|
482
520
|
return e && typeof e == "object";
|
|
483
521
|
}
|
|
484
|
-
const
|
|
485
|
-
function
|
|
486
|
-
return
|
|
522
|
+
const Mr = Object.prototype.toString;
|
|
523
|
+
function Lr(e) {
|
|
524
|
+
return Mr.call(e) === "[object Object]";
|
|
487
525
|
}
|
|
488
|
-
function
|
|
526
|
+
function mt(e) {
|
|
489
527
|
return Array.isArray(e) ? e : [e];
|
|
490
528
|
}
|
|
491
|
-
function
|
|
529
|
+
function pt(e) {
|
|
492
530
|
const t = {
|
|
493
531
|
url: "",
|
|
494
532
|
type: "global",
|
|
495
533
|
globalName: ""
|
|
496
534
|
};
|
|
497
|
-
return
|
|
535
|
+
return x || et() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
|
|
498
536
|
url: e.remoteEntry,
|
|
499
537
|
type: e.remoteEntryType,
|
|
500
538
|
globalName: e.globalName
|
|
@@ -504,45 +542,45 @@ function dt(e) {
|
|
|
504
542
|
globalName: e.globalName
|
|
505
543
|
} : t;
|
|
506
544
|
}
|
|
507
|
-
const
|
|
545
|
+
const Or = (e, t) => {
|
|
508
546
|
let r;
|
|
509
547
|
return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
|
|
510
|
-
}, N = typeof globalThis == "object" ? globalThis : window,
|
|
548
|
+
}, N = typeof globalThis == "object" ? globalThis : window, M = (() => {
|
|
511
549
|
try {
|
|
512
550
|
return document.defaultView;
|
|
513
551
|
} catch {
|
|
514
552
|
return N;
|
|
515
553
|
}
|
|
516
|
-
})(),
|
|
517
|
-
function
|
|
554
|
+
})(), Re = M;
|
|
555
|
+
function he(e, t, r) {
|
|
518
556
|
Object.defineProperty(e, t, {
|
|
519
557
|
value: r,
|
|
520
558
|
configurable: !1,
|
|
521
559
|
writable: !0
|
|
522
560
|
});
|
|
523
561
|
}
|
|
524
|
-
function
|
|
562
|
+
function de(e, t) {
|
|
525
563
|
return Object.hasOwnProperty.call(e, t);
|
|
526
564
|
}
|
|
527
|
-
|
|
528
|
-
const
|
|
529
|
-
function
|
|
565
|
+
de(N, "__GLOBAL_LOADING_REMOTE_ENTRY__") || he(N, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
566
|
+
const K = N.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
567
|
+
function yt(e) {
|
|
530
568
|
var t, r, o, n, s, i;
|
|
531
|
-
|
|
569
|
+
de(e, "__VMOK__") && !de(e, "__FEDERATION__") && he(e, "__FEDERATION__", e.__VMOK__), de(e, "__FEDERATION__") || (he(e, "__FEDERATION__", {
|
|
532
570
|
__GLOBAL_PLUGIN__: [],
|
|
533
571
|
__INSTANCES__: [],
|
|
534
572
|
moduleInfo: {},
|
|
535
573
|
__SHARE__: {},
|
|
536
574
|
__MANIFEST_LOADING__: {},
|
|
537
575
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
538
|
-
}),
|
|
576
|
+
}), he(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());
|
|
539
577
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
function
|
|
543
|
-
t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.
|
|
578
|
+
yt(N);
|
|
579
|
+
yt(M);
|
|
580
|
+
function Cr(e, t = Ne()) {
|
|
581
|
+
t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.7.0");
|
|
544
582
|
}
|
|
545
|
-
function
|
|
583
|
+
function j(e, t) {
|
|
546
584
|
if (typeof t == "string") {
|
|
547
585
|
if (e[t]) return {
|
|
548
586
|
value: e[t],
|
|
@@ -562,81 +600,81 @@ function J(e, t) {
|
|
|
562
600
|
key: t
|
|
563
601
|
};
|
|
564
602
|
}
|
|
565
|
-
} else
|
|
603
|
+
} else w(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
566
604
|
}
|
|
567
|
-
const
|
|
568
|
-
const r =
|
|
605
|
+
const je = () => M.__FEDERATION__.moduleInfo, Fr = (e, t) => {
|
|
606
|
+
const r = j(t, ne(e)).value;
|
|
569
607
|
if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
|
|
570
608
|
if ("version" in e && e.version) {
|
|
571
|
-
const { version: o, ...n } = e, s =
|
|
609
|
+
const { version: o, ...n } = e, s = ne(n), i = j(M.__FEDERATION__.moduleInfo, s).value;
|
|
572
610
|
if ((i == null ? void 0 : i.version) === o) return i;
|
|
573
611
|
}
|
|
574
|
-
},
|
|
575
|
-
const r =
|
|
576
|
-
return
|
|
577
|
-
},
|
|
578
|
-
...
|
|
612
|
+
}, me = (e) => Fr(e, M.__FEDERATION__.moduleInfo), We = (e, t) => {
|
|
613
|
+
const r = ne(e);
|
|
614
|
+
return M.__FEDERATION__.moduleInfo[r] = t, M.__FEDERATION__.moduleInfo;
|
|
615
|
+
}, Hr = (e) => (M.__FEDERATION__.moduleInfo = {
|
|
616
|
+
...M.__FEDERATION__.moduleInfo,
|
|
579
617
|
...e
|
|
580
618
|
}, () => {
|
|
581
619
|
const t = Object.keys(e);
|
|
582
|
-
for (const r of t) delete
|
|
583
|
-
}),
|
|
620
|
+
for (const r of t) delete M.__FEDERATION__.moduleInfo[r];
|
|
621
|
+
}), Ce = (e, t) => {
|
|
584
622
|
const r = t || `__FEDERATION_${e}:custom__`;
|
|
585
623
|
return {
|
|
586
624
|
remoteEntryKey: r,
|
|
587
625
|
entryExports: N[r]
|
|
588
626
|
};
|
|
589
|
-
},
|
|
590
|
-
function
|
|
627
|
+
}, Dr = () => M.__FEDERATION__.__GLOBAL_PLUGIN__, xr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.get(e), Gr = (e) => N.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ve = "[0-9A-Za-z-]+", Fe = `(?:\\+(${Ve}(?:\\.${Ve})*))`, re = "0|[1-9]\\d*", pe = "[0-9]+", Et = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", qe = `(?:${pe}|${Et})`, Ur = `(?:-?(${qe}(?:\\.${qe})*))`, Ke = `(?:${re}|${Et})`, gt = `(?:-(${Ke}(?:\\.${Ke})*))`, Se = `${re}|x|X|\\*`, Z = `[v=\\s]*(${Se})(?:\\.(${Se})(?:\\.(${Se})(?:${gt})?${Fe}?)?)?`, Br = `^\\s*(${Z})\\s+-\\s+(${Z})\\s*$`, jr = `[v=\\s]*${`(${pe})\\.(${pe})\\.(${pe})`}${Ur}?${Fe}?`, He = "((?:<|>)?=?)", Wr = `(\\s*)${He}\\s*(${jr}|${Z})`, Rt = "(?:~>?)", Vr = `(\\s*)${Rt}\\s+`, _t = "(?:\\^)", qr = `(\\s*)${_t}\\s+`, Kr = "(<|>)?=?\\s*\\*", zr = `^${_t}${Z}$`, Jr = `v?${`(${re})\\.(${re})\\.(${re})`}${gt}?${Fe}?`, Xr = `^${Rt}${Z}$`, Yr = `^${He}\\s*${Z}$`, Zr = `^${He}\\s*(${Jr})$|^$`, Qr = "^\\s*>=\\s*0.0.0\\s*$";
|
|
628
|
+
function L(e) {
|
|
591
629
|
return new RegExp(e);
|
|
592
630
|
}
|
|
593
631
|
function T(e) {
|
|
594
632
|
return !e || e.toLowerCase() === "x" || e === "*";
|
|
595
633
|
}
|
|
596
|
-
function
|
|
634
|
+
function bt(...e) {
|
|
597
635
|
return (t) => e.reduce((r, o) => o(r), t);
|
|
598
636
|
}
|
|
599
637
|
function ze(e) {
|
|
600
|
-
return e.match(
|
|
638
|
+
return e.match(L(Zr));
|
|
601
639
|
}
|
|
602
640
|
function Je(e, t, r, o) {
|
|
603
641
|
const n = `${e}.${t}.${r}`;
|
|
604
642
|
return o ? `${n}-${o}` : n;
|
|
605
643
|
}
|
|
606
|
-
function
|
|
607
|
-
return e.replace(
|
|
644
|
+
function eo(e) {
|
|
645
|
+
return e.replace(L(Br), (t, r, o, n, s, i, c, a, l, u, f, m) => (T(o) ? r = "" : T(n) ? r = `>=${o}.0.0` : T(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, T(l) ? a = "" : T(u) ? a = `<${Number(l) + 1}.0.0-0` : T(f) ? a = `<${l}.${Number(u) + 1}.0-0` : m ? a = `<=${l}.${u}.${f}-${m}` : a = `<=${a}`, `${r} ${a}`.trim()));
|
|
608
646
|
}
|
|
609
|
-
function
|
|
610
|
-
return e.replace(
|
|
647
|
+
function to(e) {
|
|
648
|
+
return e.replace(L(Wr), "$1$2$3");
|
|
611
649
|
}
|
|
612
|
-
function
|
|
613
|
-
return e.replace(
|
|
650
|
+
function ro(e) {
|
|
651
|
+
return e.replace(L(Vr), "$1~");
|
|
614
652
|
}
|
|
615
|
-
function
|
|
616
|
-
return e.replace(
|
|
653
|
+
function oo(e) {
|
|
654
|
+
return e.replace(L(qr), "$1^");
|
|
617
655
|
}
|
|
618
|
-
function
|
|
619
|
-
return e.trim().split(/\s+/).map((t) => t.replace(
|
|
656
|
+
function no(e) {
|
|
657
|
+
return e.trim().split(/\s+/).map((t) => t.replace(L(zr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(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(" ");
|
|
620
658
|
}
|
|
621
|
-
function
|
|
622
|
-
return e.trim().split(/\s+/).map((t) => t.replace(
|
|
659
|
+
function so(e) {
|
|
660
|
+
return e.trim().split(/\s+/).map((t) => t.replace(L(Xr), (r, o, n, s, i) => T(o) ? "" : T(n) ? `>=${o}.0.0 <${Number(o) + 1}.0.0-0` : T(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(" ");
|
|
623
661
|
}
|
|
624
|
-
function
|
|
625
|
-
return e.split(/\s+/).map((t) => t.trim().replace(
|
|
662
|
+
function io(e) {
|
|
663
|
+
return e.split(/\s+/).map((t) => t.trim().replace(L(Yr), (r, o, n, s, i, c) => {
|
|
626
664
|
const a = T(n), l = a || T(s), u = l || T(i);
|
|
627
665
|
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;
|
|
628
666
|
})).join(" ");
|
|
629
667
|
}
|
|
630
|
-
function
|
|
631
|
-
return e.trim().replace(
|
|
668
|
+
function ao(e) {
|
|
669
|
+
return e.trim().replace(L(Kr), "");
|
|
632
670
|
}
|
|
633
|
-
function
|
|
634
|
-
return e.trim().replace(
|
|
671
|
+
function co(e) {
|
|
672
|
+
return e.trim().replace(L(Qr), "");
|
|
635
673
|
}
|
|
636
|
-
function
|
|
674
|
+
function ye(e, t) {
|
|
637
675
|
return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
|
|
638
676
|
}
|
|
639
|
-
function
|
|
677
|
+
function lo(e, t) {
|
|
640
678
|
const { preRelease: r } = e, { preRelease: o } = t;
|
|
641
679
|
if (r === void 0 && o) return 1;
|
|
642
680
|
if (r && o === void 0) return -1;
|
|
@@ -644,42 +682,42 @@ function Yr(e, t) {
|
|
|
644
682
|
for (let n = 0, s = r.length; n <= s; n++) {
|
|
645
683
|
const i = r[n], c = o[n];
|
|
646
684
|
if (i !== c)
|
|
647
|
-
return i === void 0 && c === void 0 ? 0 : i ? c ?
|
|
685
|
+
return i === void 0 && c === void 0 ? 0 : i ? c ? ye(i, c) : -1 : 1;
|
|
648
686
|
}
|
|
649
687
|
return 0;
|
|
650
688
|
}
|
|
651
|
-
function
|
|
652
|
-
return
|
|
689
|
+
function le(e, t) {
|
|
690
|
+
return ye(e.major, t.major) || ye(e.minor, t.minor) || ye(e.patch, t.patch) || lo(e, t);
|
|
653
691
|
}
|
|
654
692
|
function we(e, t) {
|
|
655
693
|
return e.version === t.version;
|
|
656
694
|
}
|
|
657
|
-
function
|
|
695
|
+
function uo(e, t) {
|
|
658
696
|
switch (e.operator) {
|
|
659
697
|
case "":
|
|
660
698
|
case "=":
|
|
661
699
|
return we(e, t);
|
|
662
700
|
case ">":
|
|
663
|
-
return
|
|
701
|
+
return le(e, t) < 0;
|
|
664
702
|
case ">=":
|
|
665
|
-
return we(e, t) ||
|
|
703
|
+
return we(e, t) || le(e, t) < 0;
|
|
666
704
|
case "<":
|
|
667
|
-
return
|
|
705
|
+
return le(e, t) > 0;
|
|
668
706
|
case "<=":
|
|
669
|
-
return we(e, t) ||
|
|
707
|
+
return we(e, t) || le(e, t) > 0;
|
|
670
708
|
case void 0:
|
|
671
709
|
return !0;
|
|
672
710
|
default:
|
|
673
711
|
return !1;
|
|
674
712
|
}
|
|
675
713
|
}
|
|
676
|
-
function
|
|
677
|
-
return
|
|
714
|
+
function fo(e) {
|
|
715
|
+
return bt(no, so, io, ao)(e);
|
|
678
716
|
}
|
|
679
|
-
function
|
|
680
|
-
return
|
|
717
|
+
function ho(e) {
|
|
718
|
+
return bt(eo, to, ro, oo)(e.trim()).split(/\s+/).join(" ");
|
|
681
719
|
}
|
|
682
|
-
function
|
|
720
|
+
function te(e, t) {
|
|
683
721
|
if (!e) return !1;
|
|
684
722
|
const r = ze(e);
|
|
685
723
|
if (!r) return !1;
|
|
@@ -695,26 +733,26 @@ function Q(e, t) {
|
|
|
695
733
|
const f = u.trim();
|
|
696
734
|
if (!f || f === "*" || f === "x") return !0;
|
|
697
735
|
try {
|
|
698
|
-
const
|
|
699
|
-
if (!
|
|
700
|
-
const h =
|
|
736
|
+
const m = ho(f);
|
|
737
|
+
if (!m.trim()) return !0;
|
|
738
|
+
const h = m.split(" ").map((E) => fo(E)).join(" ");
|
|
701
739
|
if (!h.trim()) return !0;
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
740
|
+
const d = h.split(/\s+/).map((E) => co(E)).filter(Boolean);
|
|
741
|
+
if (d.length === 0) continue;
|
|
704
742
|
let p = !0;
|
|
705
|
-
for (const
|
|
706
|
-
const
|
|
707
|
-
if (!
|
|
743
|
+
for (const E of d) {
|
|
744
|
+
const y = ze(E);
|
|
745
|
+
if (!y) {
|
|
708
746
|
p = !1;
|
|
709
747
|
break;
|
|
710
748
|
}
|
|
711
|
-
const [,
|
|
712
|
-
if (!
|
|
713
|
-
operator:
|
|
714
|
-
version: Je(g,
|
|
749
|
+
const [, R, , g, _, b, $] = y;
|
|
750
|
+
if (!uo({
|
|
751
|
+
operator: R,
|
|
752
|
+
version: Je(g, _, b, $),
|
|
715
753
|
major: g,
|
|
716
|
-
minor:
|
|
717
|
-
patch:
|
|
754
|
+
minor: _,
|
|
755
|
+
patch: b,
|
|
718
756
|
preRelease: $ == null ? void 0 : $.split(".")
|
|
719
757
|
}, a)) {
|
|
720
758
|
p = !1;
|
|
@@ -722,20 +760,20 @@ function Q(e, t) {
|
|
|
722
760
|
}
|
|
723
761
|
}
|
|
724
762
|
if (p) return !0;
|
|
725
|
-
} catch (
|
|
726
|
-
console.error(`[semver] Error processing range part "${f}":`,
|
|
763
|
+
} catch (m) {
|
|
764
|
+
console.error(`[semver] Error processing range part "${f}":`, m);
|
|
727
765
|
continue;
|
|
728
766
|
}
|
|
729
767
|
}
|
|
730
768
|
return !1;
|
|
731
769
|
}
|
|
732
|
-
const
|
|
733
|
-
function
|
|
770
|
+
const ae = "default", St = "global";
|
|
771
|
+
function mo(e, t, r, o) {
|
|
734
772
|
var s, i;
|
|
735
773
|
let n;
|
|
736
774
|
return "get" in e ? n = e.get : "lib" in e ? n = () => Promise.resolve(e.lib) : n = () => Promise.resolve(() => {
|
|
737
|
-
|
|
738
|
-
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) &&
|
|
775
|
+
w(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
|
|
776
|
+
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && w(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
|
|
739
777
|
deps: [],
|
|
740
778
|
useIn: [],
|
|
741
779
|
from: t,
|
|
@@ -756,16 +794,16 @@ function to(e, t, r, o) {
|
|
|
756
794
|
treeShaking: e.treeShaking ? {
|
|
757
795
|
...e.treeShaking,
|
|
758
796
|
mode: e.treeShaking.mode ?? "server-calc",
|
|
759
|
-
status: e.treeShaking.status ??
|
|
797
|
+
status: e.treeShaking.status ?? ve.UNKNOWN,
|
|
760
798
|
useIn: []
|
|
761
799
|
} : void 0
|
|
762
800
|
};
|
|
763
801
|
}
|
|
764
|
-
function
|
|
802
|
+
function wt(e, t) {
|
|
765
803
|
const r = t.shared || {}, o = t.name, n = Object.keys(r).reduce((i, c) => {
|
|
766
|
-
const a =
|
|
804
|
+
const a = mt(r[c]);
|
|
767
805
|
return i[c] = i[c] || [], a.forEach((l) => {
|
|
768
|
-
i[c].push(
|
|
806
|
+
i[c].push(mo(l, o, c, t.shareStrategy));
|
|
769
807
|
}), i;
|
|
770
808
|
}, {}), s = { ...e.shared };
|
|
771
809
|
return Object.keys(n).forEach((i) => {
|
|
@@ -777,12 +815,12 @@ function bt(e, t) {
|
|
|
777
815
|
newShareInfos: n
|
|
778
816
|
};
|
|
779
817
|
}
|
|
780
|
-
function
|
|
818
|
+
function se(e, t) {
|
|
781
819
|
if (!e) return !1;
|
|
782
820
|
const { status: r, mode: o } = e;
|
|
783
|
-
return r ===
|
|
821
|
+
return r === ve.NO_USE ? !1 : r === ve.CALCULATED ? !0 : o === "runtime-infer" ? t ? yo(e, t) : !0 : !1;
|
|
784
822
|
}
|
|
785
|
-
function
|
|
823
|
+
function U(e, t) {
|
|
786
824
|
const r = (o) => {
|
|
787
825
|
if (!Number.isNaN(Number(o))) {
|
|
788
826
|
const n = o.split(".");
|
|
@@ -792,116 +830,116 @@ function G(e, t) {
|
|
|
792
830
|
}
|
|
793
831
|
return o;
|
|
794
832
|
};
|
|
795
|
-
return !!
|
|
833
|
+
return !!te(r(e), `<=${r(t)}`);
|
|
796
834
|
}
|
|
797
|
-
const
|
|
835
|
+
const ie = (e, t) => {
|
|
798
836
|
const r = t || function(o, n) {
|
|
799
|
-
return
|
|
837
|
+
return U(o, n);
|
|
800
838
|
};
|
|
801
839
|
return Object.keys(e).reduce((o, n) => !o || r(o, n) || o === "0" ? n : o, 0);
|
|
802
|
-
},
|
|
840
|
+
}, ge = (e) => !!e.loaded || typeof e.lib == "function", po = (e) => !!e.loading, yo = (e, t) => {
|
|
803
841
|
if (!e || !t) return !1;
|
|
804
842
|
const { usedExports: r } = e;
|
|
805
843
|
return r ? !!t.every((o) => r.includes(o)) : !1;
|
|
806
844
|
};
|
|
807
|
-
function
|
|
845
|
+
function Eo(e, t, r, o) {
|
|
808
846
|
const n = e[t][r];
|
|
809
|
-
let s = "", i =
|
|
847
|
+
let s = "", i = se(o);
|
|
810
848
|
const c = function(a, l) {
|
|
811
|
-
return i ? n[a].treeShaking ? n[l].treeShaking ? !
|
|
849
|
+
return i ? n[a].treeShaking ? n[l].treeShaking ? !ge(n[a].treeShaking) && U(a, l) : !1 : !0 : !ge(n[a]) && U(a, l);
|
|
812
850
|
};
|
|
813
851
|
if (i) {
|
|
814
|
-
if (s =
|
|
852
|
+
if (s = ie(e[t][r], c), s) return {
|
|
815
853
|
version: s,
|
|
816
854
|
useTreesShaking: i
|
|
817
855
|
};
|
|
818
856
|
i = !1;
|
|
819
857
|
}
|
|
820
858
|
return {
|
|
821
|
-
version:
|
|
859
|
+
version: ie(e[t][r], c),
|
|
822
860
|
useTreesShaking: i
|
|
823
861
|
};
|
|
824
862
|
}
|
|
825
|
-
const
|
|
826
|
-
function
|
|
863
|
+
const V = (e) => ge(e) || po(e);
|
|
864
|
+
function go(e, t, r, o) {
|
|
827
865
|
const n = e[t][r];
|
|
828
|
-
let s = "", i =
|
|
866
|
+
let s = "", i = se(o);
|
|
829
867
|
const c = function(a, l) {
|
|
830
868
|
if (i) {
|
|
831
869
|
if (!n[a].treeShaking) return !0;
|
|
832
870
|
if (!n[l].treeShaking) return !1;
|
|
833
|
-
if (
|
|
834
|
-
if (
|
|
871
|
+
if (V(n[l].treeShaking)) return V(n[a].treeShaking) ? !!U(a, l) : !0;
|
|
872
|
+
if (V(n[a].treeShaking)) return !1;
|
|
835
873
|
}
|
|
836
|
-
return
|
|
874
|
+
return V(n[l]) ? V(n[a]) ? !!U(a, l) : !0 : V(n[a]) ? !1 : U(a, l);
|
|
837
875
|
};
|
|
838
876
|
if (i) {
|
|
839
|
-
if (s =
|
|
877
|
+
if (s = ie(e[t][r], c), s) return {
|
|
840
878
|
version: s,
|
|
841
879
|
useTreesShaking: i
|
|
842
880
|
};
|
|
843
881
|
i = !1;
|
|
844
882
|
}
|
|
845
883
|
return {
|
|
846
|
-
version:
|
|
884
|
+
version: ie(e[t][r], c),
|
|
847
885
|
useTreesShaking: i
|
|
848
886
|
};
|
|
849
887
|
}
|
|
850
|
-
function
|
|
851
|
-
return e === "loaded-first" ?
|
|
888
|
+
function Ro(e) {
|
|
889
|
+
return e === "loaded-first" ? go : Eo;
|
|
852
890
|
}
|
|
853
|
-
function
|
|
891
|
+
function Ee(e, t, r, o) {
|
|
854
892
|
if (!e) return;
|
|
855
|
-
const { shareConfig: n, scope: s =
|
|
893
|
+
const { shareConfig: n, scope: s = ae, strategy: i, treeShaking: c } = r, a = Array.isArray(s) ? s : [s];
|
|
856
894
|
for (const l of a) if (n && e[l] && e[l][t]) {
|
|
857
|
-
const { requiredVersion: u } = n, { version: f, useTreesShaking:
|
|
895
|
+
const { requiredVersion: u } = n, { version: f, useTreesShaking: m } = Ro(i)(e, l, t, c), h = () => {
|
|
858
896
|
const p = e[l][t][f];
|
|
859
897
|
if (n.singleton) {
|
|
860
|
-
if (typeof u == "string" && !
|
|
861
|
-
const
|
|
862
|
-
n.strictVersion ?
|
|
898
|
+
if (typeof u == "string" && !te(f, u)) {
|
|
899
|
+
const E = `Version ${f} from ${f && p.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
|
|
900
|
+
n.strictVersion ? w(E) : oe(E);
|
|
863
901
|
}
|
|
864
902
|
return {
|
|
865
903
|
shared: p,
|
|
866
|
-
useTreesShaking:
|
|
904
|
+
useTreesShaking: m
|
|
867
905
|
};
|
|
868
906
|
} else {
|
|
869
907
|
if (u === !1 || u === "*") return {
|
|
870
908
|
shared: p,
|
|
871
|
-
useTreesShaking:
|
|
909
|
+
useTreesShaking: m
|
|
872
910
|
};
|
|
873
|
-
if (
|
|
911
|
+
if (te(f, u)) return {
|
|
874
912
|
shared: p,
|
|
875
|
-
useTreesShaking:
|
|
913
|
+
useTreesShaking: m
|
|
876
914
|
};
|
|
877
|
-
const
|
|
878
|
-
if (
|
|
879
|
-
for (const [
|
|
880
|
-
if (
|
|
915
|
+
const E = se(c);
|
|
916
|
+
if (E) {
|
|
917
|
+
for (const [y, R] of Object.entries(e[l][t]))
|
|
918
|
+
if (se(R.treeShaking, c == null ? void 0 : c.usedExports) && te(y, u))
|
|
881
919
|
return {
|
|
882
|
-
shared:
|
|
883
|
-
useTreesShaking:
|
|
920
|
+
shared: R,
|
|
921
|
+
useTreesShaking: E
|
|
884
922
|
};
|
|
885
923
|
}
|
|
886
|
-
for (const [
|
|
887
|
-
shared:
|
|
924
|
+
for (const [y, R] of Object.entries(e[l][t])) if (te(y, u)) return {
|
|
925
|
+
shared: R,
|
|
888
926
|
useTreesShaking: !1
|
|
889
927
|
};
|
|
890
928
|
}
|
|
891
|
-
},
|
|
929
|
+
}, d = {
|
|
892
930
|
shareScopeMap: e,
|
|
893
931
|
scope: l,
|
|
894
932
|
pkgName: t,
|
|
895
933
|
version: f,
|
|
896
|
-
GlobalFederation:
|
|
934
|
+
GlobalFederation: Re.__FEDERATION__,
|
|
897
935
|
shareInfo: r,
|
|
898
936
|
resolver: h
|
|
899
937
|
};
|
|
900
|
-
return (o.emit(
|
|
938
|
+
return (o.emit(d) || d).resolver();
|
|
901
939
|
}
|
|
902
940
|
}
|
|
903
|
-
function
|
|
904
|
-
return
|
|
941
|
+
function $t() {
|
|
942
|
+
return Re.__FEDERATION__.__SHARE__;
|
|
905
943
|
}
|
|
906
944
|
function Xe(e) {
|
|
907
945
|
const { pkgName: t, extraOptions: r, shareInfos: o } = e, n = (a) => {
|
|
@@ -909,28 +947,28 @@ function Xe(e) {
|
|
|
909
947
|
const l = {};
|
|
910
948
|
return a.forEach((f) => {
|
|
911
949
|
l[f.version] = f;
|
|
912
|
-
}), l[
|
|
913
|
-
return !
|
|
950
|
+
}), l[ie(l, function(f, m) {
|
|
951
|
+
return !ge(l[f]) && U(f, m);
|
|
914
952
|
})];
|
|
915
953
|
}, s = (r == null ? void 0 : r.resolver) ?? n, i = (a) => a !== null && typeof a == "object" && !Array.isArray(a), c = (...a) => {
|
|
916
954
|
const l = {};
|
|
917
955
|
for (const u of a)
|
|
918
956
|
if (u)
|
|
919
|
-
for (const [f,
|
|
957
|
+
for (const [f, m] of Object.entries(u)) {
|
|
920
958
|
const h = l[f];
|
|
921
|
-
i(h) && i(
|
|
959
|
+
i(h) && i(m) ? l[f] = c(h, m) : m !== void 0 && (l[f] = m);
|
|
922
960
|
}
|
|
923
961
|
return l;
|
|
924
962
|
};
|
|
925
963
|
return c(s(o[t]), r == null ? void 0 : r.customShareInfo);
|
|
926
964
|
}
|
|
927
|
-
const
|
|
928
|
-
e.useIn || (e.useIn = []),
|
|
965
|
+
const q = (e, t) => {
|
|
966
|
+
e.useIn || (e.useIn = []), kr(e.useIn, t);
|
|
929
967
|
};
|
|
930
|
-
function
|
|
968
|
+
function ue(e, t) {
|
|
931
969
|
return t && e.treeShaking ? e.treeShaking : e;
|
|
932
970
|
}
|
|
933
|
-
function
|
|
971
|
+
function De(e, t) {
|
|
934
972
|
return !t || t === "." ? e : `${e}/${t.replace(/^\.\//, "")}`;
|
|
935
973
|
}
|
|
936
974
|
function Ye(e, t) {
|
|
@@ -969,66 +1007,66 @@ function Ye(e, t) {
|
|
|
969
1007
|
}
|
|
970
1008
|
}
|
|
971
1009
|
}
|
|
972
|
-
function
|
|
1010
|
+
function _o(e, t) {
|
|
973
1011
|
for (const r of e)
|
|
974
1012
|
if (t === r.name || r.alias && t === r.alias) return r;
|
|
975
1013
|
}
|
|
976
|
-
const
|
|
977
|
-
[
|
|
978
|
-
[
|
|
979
|
-
[
|
|
980
|
-
[
|
|
981
|
-
[
|
|
982
|
-
[
|
|
983
|
-
[
|
|
984
|
-
[
|
|
985
|
-
[
|
|
986
|
-
[
|
|
987
|
-
[
|
|
988
|
-
[
|
|
989
|
-
[
|
|
990
|
-
[
|
|
991
|
-
[
|
|
1014
|
+
const It = "RUNTIME-001", vt = "RUNTIME-002", Nt = "RUNTIME-003", Tt = "RUNTIME-004", At = "RUNTIME-005", ke = "RUNTIME-006", Pt = "RUNTIME-007", xe = "RUNTIME-008", bo = "RUNTIME-009", kt = "RUNTIME-010", Mt = "RUNTIME-011", So = "RUNTIME-012", Lt = "RUNTIME-013", Ot = "RUNTIME-014", Ct = "RUNTIME-015", P = {
|
|
1015
|
+
[It]: "Failed to get remoteEntry exports.",
|
|
1016
|
+
[vt]: 'The remote entry interface does not contain "init"',
|
|
1017
|
+
[Nt]: "Failed to get manifest.",
|
|
1018
|
+
[Tt]: "Failed to locate remote.",
|
|
1019
|
+
[At]: "Invalid loadShareSync function call from bundler runtime",
|
|
1020
|
+
[ke]: "Invalid loadShareSync function call from runtime",
|
|
1021
|
+
[Pt]: "Failed to get remote snapshot.",
|
|
1022
|
+
[xe]: "Failed to load script resources.",
|
|
1023
|
+
[bo]: "Please call createInstance first.",
|
|
1024
|
+
[kt]: '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
|
+
[Mt]: "The remoteEntry URL is missing from the remote snapshot.",
|
|
1026
|
+
[So]: '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
|
+
[Lt]: "The manifest is not a valid Module Federation manifest.",
|
|
1028
|
+
[Ot]: "The remote does not expose the requested module.",
|
|
1029
|
+
[Ct]: "Remote container initialization failed."
|
|
992
1030
|
};
|
|
993
1031
|
({
|
|
994
|
-
...
|
|
1032
|
+
...P
|
|
995
1033
|
});
|
|
996
|
-
const
|
|
997
|
-
async function
|
|
1034
|
+
const Ft = ".then(callbacks[0]).catch(callbacks[1])";
|
|
1035
|
+
async function wo({ entry: e, remoteEntryExports: t }) {
|
|
998
1036
|
return new Promise((r, o) => {
|
|
999
1037
|
try {
|
|
1000
|
-
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${
|
|
1038
|
+
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Ft}`)([r, o]) : import(
|
|
1001
1039
|
/* webpackIgnore: true */
|
|
1002
1040
|
/* @vite-ignore */
|
|
1003
1041
|
e
|
|
1004
1042
|
).then(r).catch(o);
|
|
1005
1043
|
} catch (n) {
|
|
1006
|
-
|
|
1044
|
+
w(`Failed to load ESM entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
|
|
1007
1045
|
}
|
|
1008
1046
|
});
|
|
1009
1047
|
}
|
|
1010
|
-
async function
|
|
1048
|
+
async function $o({ entry: e, remoteEntryExports: t }) {
|
|
1011
1049
|
return new Promise((r, o) => {
|
|
1012
1050
|
try {
|
|
1013
|
-
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${
|
|
1051
|
+
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(o) : new Function("callbacks", `System.import("${e}")${Ft}`)([r, o]);
|
|
1014
1052
|
} catch (n) {
|
|
1015
|
-
|
|
1053
|
+
w(`Failed to load SystemJS entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
|
|
1016
1054
|
}
|
|
1017
1055
|
});
|
|
1018
1056
|
}
|
|
1019
|
-
function
|
|
1020
|
-
const { remoteEntryKey: o, entryExports: n } =
|
|
1021
|
-
return n ||
|
|
1057
|
+
function Ht(e, t, r) {
|
|
1058
|
+
const { remoteEntryKey: o, entryExports: n } = Ce(e, t);
|
|
1059
|
+
return n || w(It, P, {
|
|
1022
1060
|
remoteName: e,
|
|
1023
1061
|
remoteEntryUrl: r,
|
|
1024
1062
|
remoteEntryKey: o
|
|
1025
1063
|
}), n;
|
|
1026
1064
|
}
|
|
1027
|
-
async function
|
|
1028
|
-
const { entryExports: c } =
|
|
1065
|
+
async function Io({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook: n, getEntryUrl: s, resourceContext: i }) {
|
|
1066
|
+
const { entryExports: c } = Ce(e, t);
|
|
1029
1067
|
if (c) return c;
|
|
1030
1068
|
const a = s ? s(r) : r;
|
|
1031
|
-
return
|
|
1069
|
+
return gr(a, {
|
|
1032
1070
|
attrs: {},
|
|
1033
1071
|
createScriptHook: (l, u) => {
|
|
1034
1072
|
const f = n.lifecycle.createScript.emit({
|
|
@@ -1043,30 +1081,30 @@ async function ho({ name: e, globalName: t, entry: r, remoteInfo: o, loaderHook:
|
|
|
1043
1081
|
if (f && (f instanceof HTMLScriptElement || "script" in f || "timeout" in f))
|
|
1044
1082
|
return f;
|
|
1045
1083
|
}
|
|
1046
|
-
}).then(() =>
|
|
1084
|
+
}).then(() => Ht(e, t, r), (l) => {
|
|
1047
1085
|
const u = l instanceof Error ? l.message : String(l);
|
|
1048
|
-
|
|
1086
|
+
w(xe, P, {
|
|
1049
1087
|
remoteName: e,
|
|
1050
1088
|
resourceUrl: a
|
|
1051
1089
|
}, u);
|
|
1052
1090
|
});
|
|
1053
1091
|
}
|
|
1054
|
-
async function
|
|
1092
|
+
async function vo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: o, resourceContext: n }) {
|
|
1055
1093
|
const { entry: s, entryGlobalName: i, name: c, type: a } = e;
|
|
1056
1094
|
switch (a) {
|
|
1057
1095
|
case "esm":
|
|
1058
1096
|
case "module":
|
|
1059
|
-
return
|
|
1097
|
+
return wo({
|
|
1060
1098
|
entry: s,
|
|
1061
1099
|
remoteEntryExports: t
|
|
1062
1100
|
});
|
|
1063
1101
|
case "system":
|
|
1064
|
-
return
|
|
1102
|
+
return $o({
|
|
1065
1103
|
entry: s,
|
|
1066
1104
|
remoteEntryExports: t
|
|
1067
1105
|
});
|
|
1068
1106
|
default:
|
|
1069
|
-
return
|
|
1107
|
+
return Io({
|
|
1070
1108
|
entry: s,
|
|
1071
1109
|
globalName: i,
|
|
1072
1110
|
name: c,
|
|
@@ -1077,9 +1115,9 @@ async function mo({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
|
|
|
1077
1115
|
});
|
|
1078
1116
|
}
|
|
1079
1117
|
}
|
|
1080
|
-
async function
|
|
1081
|
-
const { entry: o, entryGlobalName: n, name: s, type: i } = e, { entryExports: c } =
|
|
1082
|
-
return c ||
|
|
1118
|
+
async function No({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
|
|
1119
|
+
const { entry: o, entryGlobalName: n, name: s, type: i } = e, { entryExports: c } = Ce(s, n);
|
|
1120
|
+
return c || br(o, {
|
|
1083
1121
|
attrs: {
|
|
1084
1122
|
name: s,
|
|
1085
1123
|
globalName: n,
|
|
@@ -1098,31 +1136,31 @@ async function po({ remoteInfo: e, loaderHook: t, resourceContext: r }) {
|
|
|
1098
1136
|
if (u && "url" in u)
|
|
1099
1137
|
return u;
|
|
1100
1138
|
} }
|
|
1101
|
-
}).then(() =>
|
|
1102
|
-
|
|
1139
|
+
}).then(() => Ht(s, n, o)).catch((a) => {
|
|
1140
|
+
w(`Failed to load Node.js entry for remote "${s}" from "${o}". ${a instanceof Error ? a.message : String(a)}`);
|
|
1103
1141
|
});
|
|
1104
1142
|
}
|
|
1105
1143
|
function Me(e) {
|
|
1106
1144
|
const { entry: t, name: r } = e;
|
|
1107
1145
|
return tt(r, t);
|
|
1108
1146
|
}
|
|
1109
|
-
async function
|
|
1147
|
+
async function Ge(e) {
|
|
1110
1148
|
const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling: i = !1 } = e, c = Me(o);
|
|
1111
1149
|
if (r) return r;
|
|
1112
|
-
if (!
|
|
1150
|
+
if (!K[c]) {
|
|
1113
1151
|
const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
|
|
1114
|
-
|
|
1152
|
+
K[c] = a.emit({
|
|
1115
1153
|
origin: t,
|
|
1116
1154
|
loaderHook: l,
|
|
1117
1155
|
remoteInfo: o,
|
|
1118
1156
|
remoteEntryExports: r
|
|
1119
|
-
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" :
|
|
1157
|
+
}).then((u) => u || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : x) ? vo({
|
|
1120
1158
|
remoteInfo: o,
|
|
1121
1159
|
remoteEntryExports: r,
|
|
1122
1160
|
loaderHook: l,
|
|
1123
1161
|
getEntryUrl: n,
|
|
1124
1162
|
resourceContext: s
|
|
1125
|
-
}) :
|
|
1163
|
+
}) : No({
|
|
1126
1164
|
remoteInfo: o,
|
|
1127
1165
|
loaderHook: l,
|
|
1128
1166
|
resourceContext: s
|
|
@@ -1131,26 +1169,26 @@ async function Ue(e) {
|
|
|
1131
1169
|
remoteInfo: o,
|
|
1132
1170
|
remoteEntryExports: u
|
|
1133
1171
|
}), u)).catch(async (u) => {
|
|
1134
|
-
const f = Me(o),
|
|
1135
|
-
if (u instanceof Error && u.message.includes(
|
|
1136
|
-
const h = (p) =>
|
|
1172
|
+
const f = Me(o), m = u instanceof Error && u.message.includes("ScriptExecutionError");
|
|
1173
|
+
if (u instanceof Error && u.message.includes(xe) && !m && !i) {
|
|
1174
|
+
const h = (p) => Ge({
|
|
1137
1175
|
...p,
|
|
1138
1176
|
_inErrorHandling: !0
|
|
1139
|
-
}),
|
|
1177
|
+
}), d = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
1140
1178
|
getRemoteEntry: h,
|
|
1141
1179
|
origin: t,
|
|
1142
1180
|
remoteInfo: o,
|
|
1143
1181
|
remoteEntryExports: r,
|
|
1144
|
-
globalLoading:
|
|
1182
|
+
globalLoading: K,
|
|
1145
1183
|
uniqueKey: f
|
|
1146
1184
|
});
|
|
1147
|
-
if (
|
|
1185
|
+
if (d)
|
|
1148
1186
|
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1149
1187
|
origin: t,
|
|
1150
1188
|
remoteInfo: o,
|
|
1151
|
-
remoteEntryExports:
|
|
1189
|
+
remoteEntryExports: d,
|
|
1152
1190
|
recovered: !0
|
|
1153
|
-
}),
|
|
1191
|
+
}), d;
|
|
1154
1192
|
}
|
|
1155
1193
|
throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1156
1194
|
origin: t,
|
|
@@ -1159,22 +1197,22 @@ async function Ue(e) {
|
|
|
1159
1197
|
}), u;
|
|
1160
1198
|
});
|
|
1161
1199
|
}
|
|
1162
|
-
return
|
|
1200
|
+
return K[c];
|
|
1163
1201
|
}
|
|
1164
|
-
function
|
|
1202
|
+
function z(e) {
|
|
1165
1203
|
return {
|
|
1166
1204
|
...e,
|
|
1167
1205
|
entry: "entry" in e ? e.entry : "",
|
|
1168
|
-
type: e.type ||
|
|
1206
|
+
type: e.type || St,
|
|
1169
1207
|
entryGlobalName: e.entryGlobalName || e.name,
|
|
1170
|
-
shareScope: e.shareScope ||
|
|
1208
|
+
shareScope: e.shareScope || ae
|
|
1171
1209
|
};
|
|
1172
1210
|
}
|
|
1173
|
-
function
|
|
1211
|
+
function To() {
|
|
1174
1212
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1175
1213
|
}
|
|
1176
|
-
function
|
|
1177
|
-
const r =
|
|
1214
|
+
function Ao(e, t) {
|
|
1215
|
+
const r = Dr(), o = [
|
|
1178
1216
|
t.hooks,
|
|
1179
1217
|
t.remoteHandler.hooks,
|
|
1180
1218
|
t.sharedHandler.hooks,
|
|
@@ -1190,7 +1228,7 @@ function Eo(e, t) {
|
|
|
1190
1228
|
});
|
|
1191
1229
|
}), e;
|
|
1192
1230
|
}
|
|
1193
|
-
function
|
|
1231
|
+
function Po(e) {
|
|
1194
1232
|
return {
|
|
1195
1233
|
name: e.name,
|
|
1196
1234
|
alias: e.alias,
|
|
@@ -1221,12 +1259,12 @@ function F(e) {
|
|
|
1221
1259
|
},
|
|
1222
1260
|
mfConfig: {
|
|
1223
1261
|
name: e.name,
|
|
1224
|
-
remotes: ((c = e.remotes) == null ? void 0 : c.map(
|
|
1262
|
+
remotes: ((c = e.remotes) == null ? void 0 : c.map(Po)) ?? [],
|
|
1225
1263
|
shared: t
|
|
1226
1264
|
}
|
|
1227
1265
|
};
|
|
1228
1266
|
}
|
|
1229
|
-
function
|
|
1267
|
+
function Dt(e) {
|
|
1230
1268
|
return {
|
|
1231
1269
|
resourceCategory: "sync",
|
|
1232
1270
|
share: !0,
|
|
@@ -1234,25 +1272,25 @@ function Ft(e) {
|
|
|
1234
1272
|
...e
|
|
1235
1273
|
};
|
|
1236
1274
|
}
|
|
1237
|
-
function
|
|
1275
|
+
function ko(e, t) {
|
|
1238
1276
|
return t.map((r) => {
|
|
1239
|
-
const o =
|
|
1277
|
+
const o = _o(e, r.nameOrAlias);
|
|
1240
1278
|
return O(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && ot({
|
|
1241
1279
|
remoteInfo: o,
|
|
1242
1280
|
remotes: e
|
|
1243
1281
|
})}`), {
|
|
1244
1282
|
remote: o,
|
|
1245
|
-
preloadConfig:
|
|
1283
|
+
preloadConfig: Dt(r)
|
|
1246
1284
|
};
|
|
1247
1285
|
});
|
|
1248
1286
|
}
|
|
1249
|
-
function
|
|
1287
|
+
function Mo(e) {
|
|
1250
1288
|
return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1251
1289
|
}
|
|
1252
|
-
function
|
|
1290
|
+
function Ue(e) {
|
|
1253
1291
|
return e instanceof Error ? e.message.includes("timed out") || e.name.includes("Timeout") : !1;
|
|
1254
1292
|
}
|
|
1255
|
-
function
|
|
1293
|
+
function B(e, t, r, o) {
|
|
1256
1294
|
return {
|
|
1257
1295
|
url: t,
|
|
1258
1296
|
status: r,
|
|
@@ -1262,11 +1300,11 @@ function U(e, t, r, o) {
|
|
|
1262
1300
|
error: o
|
|
1263
1301
|
};
|
|
1264
1302
|
}
|
|
1265
|
-
async function
|
|
1303
|
+
async function Lo(e, t, r, o) {
|
|
1266
1304
|
const n = e.moduleCache.get(r.name), s = r.entry;
|
|
1267
|
-
if (n != null && n.remoteEntryExports) return
|
|
1305
|
+
if (n != null && n.remoteEntryExports) return B(o, s, "cached");
|
|
1268
1306
|
try {
|
|
1269
|
-
if (!await
|
|
1307
|
+
if (!await Ge({
|
|
1270
1308
|
origin: e,
|
|
1271
1309
|
remoteInfo: r,
|
|
1272
1310
|
remoteEntryExports: n == null ? void 0 : n.remoteEntryExports,
|
|
@@ -1275,20 +1313,20 @@ async function bo(e, t, r, o) {
|
|
|
1275
1313
|
url: s
|
|
1276
1314
|
}
|
|
1277
1315
|
})) throw new Error(`Failed to load remoteEntry "${s}".`);
|
|
1278
|
-
return
|
|
1316
|
+
return B(o, s, "success");
|
|
1279
1317
|
} catch (i) {
|
|
1280
|
-
return
|
|
1318
|
+
return B(o, s, Ue(i) ? "timeout" : "error", i);
|
|
1281
1319
|
}
|
|
1282
1320
|
}
|
|
1283
1321
|
function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
|
|
1284
1322
|
return new Promise((i) => {
|
|
1285
|
-
const { link: c, needAttach: a } =
|
|
1323
|
+
const { link: c, needAttach: a } = Er({
|
|
1286
1324
|
url: r,
|
|
1287
1325
|
cb: () => {
|
|
1288
|
-
i(
|
|
1326
|
+
i(B(n, r, a ? "success" : "cached"));
|
|
1289
1327
|
},
|
|
1290
1328
|
onErrorCallback: (l) => {
|
|
1291
|
-
i(
|
|
1329
|
+
i(B(n, r, Ue(l) ? "timeout" : "error", l));
|
|
1292
1330
|
},
|
|
1293
1331
|
attrs: o,
|
|
1294
1332
|
createLinkHook: (l, u) => {
|
|
@@ -1308,15 +1346,15 @@ function $e({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1308
1346
|
a && document.head.appendChild(c);
|
|
1309
1347
|
});
|
|
1310
1348
|
}
|
|
1311
|
-
function
|
|
1349
|
+
function Oo({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
1312
1350
|
return new Promise((s) => {
|
|
1313
1351
|
const { script: i, needAttach: c } = ct({
|
|
1314
1352
|
url: r,
|
|
1315
1353
|
cb: () => {
|
|
1316
|
-
s(
|
|
1354
|
+
s(B(n, r, c ? "success" : "cached"));
|
|
1317
1355
|
},
|
|
1318
1356
|
onErrorCallback: (a) => {
|
|
1319
|
-
s(
|
|
1357
|
+
s(B(n, r, Ue(a) ? "timeout" : "error", a));
|
|
1320
1358
|
},
|
|
1321
1359
|
attrs: o,
|
|
1322
1360
|
createScriptHook: (a, l) => {
|
|
@@ -1336,13 +1374,13 @@ function So({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
|
1336
1374
|
c && document.head.appendChild(i);
|
|
1337
1375
|
});
|
|
1338
1376
|
}
|
|
1339
|
-
function
|
|
1377
|
+
function ee(e, t) {
|
|
1340
1378
|
return {
|
|
1341
1379
|
...e,
|
|
1342
1380
|
resourceType: t
|
|
1343
1381
|
};
|
|
1344
1382
|
}
|
|
1345
|
-
function
|
|
1383
|
+
function xt(e, t, r, o = !0, n = {
|
|
1346
1384
|
initiator: "preloadRemote",
|
|
1347
1385
|
id: e.name
|
|
1348
1386
|
}) {
|
|
@@ -1350,7 +1388,7 @@ function Ht(e, t, r, o = !0, n = {
|
|
|
1350
1388
|
if (t.options.inBrowser) {
|
|
1351
1389
|
if (c.forEach((l) => {
|
|
1352
1390
|
const { moduleInfo: u } = l;
|
|
1353
|
-
a.push(
|
|
1391
|
+
a.push(Lo(t, e, u, ee(n, "remoteEntry")));
|
|
1354
1392
|
}), o) {
|
|
1355
1393
|
const l = {
|
|
1356
1394
|
rel: "preload",
|
|
@@ -1362,7 +1400,7 @@ function Ht(e, t, r, o = !0, n = {
|
|
|
1362
1400
|
remoteInfo: e,
|
|
1363
1401
|
url: u,
|
|
1364
1402
|
attrs: l,
|
|
1365
|
-
context:
|
|
1403
|
+
context: ee(n, "css")
|
|
1366
1404
|
}));
|
|
1367
1405
|
});
|
|
1368
1406
|
} else {
|
|
@@ -1377,7 +1415,7 @@ function Ht(e, t, r, o = !0, n = {
|
|
|
1377
1415
|
url: u,
|
|
1378
1416
|
attrs: l,
|
|
1379
1417
|
needDeleteLink: !1,
|
|
1380
|
-
context:
|
|
1418
|
+
context: ee(n, "css")
|
|
1381
1419
|
}));
|
|
1382
1420
|
});
|
|
1383
1421
|
}
|
|
@@ -1392,7 +1430,7 @@ function Ht(e, t, r, o = !0, n = {
|
|
|
1392
1430
|
remoteInfo: e,
|
|
1393
1431
|
url: u,
|
|
1394
1432
|
attrs: l,
|
|
1395
|
-
context:
|
|
1433
|
+
context: ee(n, "js")
|
|
1396
1434
|
}));
|
|
1397
1435
|
});
|
|
1398
1436
|
} else {
|
|
@@ -1401,24 +1439,24 @@ function Ht(e, t, r, o = !0, n = {
|
|
|
1401
1439
|
type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
|
|
1402
1440
|
};
|
|
1403
1441
|
i.forEach((u) => {
|
|
1404
|
-
a.push(
|
|
1442
|
+
a.push(Oo({
|
|
1405
1443
|
host: t,
|
|
1406
1444
|
remoteInfo: e,
|
|
1407
1445
|
url: u,
|
|
1408
1446
|
attrs: l,
|
|
1409
|
-
context:
|
|
1447
|
+
context: ee(n, "js")
|
|
1410
1448
|
}));
|
|
1411
1449
|
});
|
|
1412
1450
|
}
|
|
1413
1451
|
}
|
|
1414
1452
|
return Promise.all(a);
|
|
1415
1453
|
}
|
|
1416
|
-
function
|
|
1454
|
+
function Co(e) {
|
|
1417
1455
|
if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
|
|
1418
1456
|
const t = e.modules.map((r) => r.moduleName).filter(Boolean);
|
|
1419
1457
|
return t.length ? t.join(",") : void 0;
|
|
1420
1458
|
}
|
|
1421
|
-
function
|
|
1459
|
+
function Fo(e, t, r) {
|
|
1422
1460
|
const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1423
1461
|
n.length || n.push("default"), n.forEach((i) => {
|
|
1424
1462
|
o[i] || (o[i] = {});
|
|
@@ -1436,19 +1474,19 @@ function $o(e, t, r) {
|
|
|
1436
1474
|
initScope: r ?? []
|
|
1437
1475
|
};
|
|
1438
1476
|
}
|
|
1439
|
-
var
|
|
1477
|
+
var Gt = class {
|
|
1440
1478
|
constructor({ remoteInfo: e, host: t }) {
|
|
1441
1479
|
this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
|
|
1442
1480
|
}
|
|
1443
1481
|
async getEntry(e) {
|
|
1444
1482
|
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1445
|
-
const t = await
|
|
1483
|
+
const t = await Ge({
|
|
1446
1484
|
origin: this.host,
|
|
1447
1485
|
remoteInfo: this.remoteInfo,
|
|
1448
1486
|
remoteEntryExports: this.remoteEntryExports,
|
|
1449
1487
|
resourceContext: {
|
|
1450
1488
|
initiator: "loadRemote",
|
|
1451
|
-
id:
|
|
1489
|
+
id: De(this.remoteInfo.name, e),
|
|
1452
1490
|
resourceType: "remoteEntry"
|
|
1453
1491
|
}
|
|
1454
1492
|
});
|
|
@@ -1496,14 +1534,14 @@ var Dt = class {
|
|
|
1496
1534
|
remoteSnapshot: t,
|
|
1497
1535
|
origin: this.host
|
|
1498
1536
|
});
|
|
1499
|
-
const { remoteEntryInitOptions: s, shareScope: i, initScope: c } =
|
|
1537
|
+
const { remoteEntryInitOptions: s, shareScope: i, initScope: c } = Fo(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1500
1538
|
shareScope: i,
|
|
1501
1539
|
remoteEntryInitOptions: s,
|
|
1502
1540
|
initScope: c,
|
|
1503
1541
|
remoteInfo: this.remoteInfo,
|
|
1504
1542
|
origin: this.host
|
|
1505
1543
|
});
|
|
1506
|
-
typeof (n == null ? void 0 : n.init) > "u" &&
|
|
1544
|
+
typeof (n == null ? void 0 : n.init) > "u" && w(vt, P, {
|
|
1507
1545
|
hostName: this.host.name,
|
|
1508
1546
|
remoteName: this.remoteInfo.name,
|
|
1509
1547
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
@@ -1512,7 +1550,7 @@ var Dt = class {
|
|
|
1512
1550
|
try {
|
|
1513
1551
|
await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions);
|
|
1514
1552
|
} catch (l) {
|
|
1515
|
-
|
|
1553
|
+
w(Ct, P, {
|
|
1516
1554
|
hostName: this.host.name,
|
|
1517
1555
|
remoteName: this.remoteInfo.name,
|
|
1518
1556
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
@@ -1565,13 +1603,13 @@ var Dt = class {
|
|
|
1565
1603
|
expose: t,
|
|
1566
1604
|
moduleInfo: this.remoteInfo
|
|
1567
1605
|
});
|
|
1568
|
-
i = typeof l == "function" ? l : void 0, i || (i = await s.get(t)), i ||
|
|
1606
|
+
i = typeof l == "function" ? l : void 0, i || (i = await s.get(t)), i || w(Ot, P, {
|
|
1569
1607
|
hostName: this.host.name,
|
|
1570
1608
|
remoteName: this.remoteInfo.name,
|
|
1571
1609
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1572
1610
|
expose: t,
|
|
1573
1611
|
requestId: e,
|
|
1574
|
-
availableExposes:
|
|
1612
|
+
availableExposes: Co(o)
|
|
1575
1613
|
}, void 0, F(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1576
1614
|
id: e,
|
|
1577
1615
|
expose: t,
|
|
@@ -1590,7 +1628,7 @@ var Dt = class {
|
|
|
1590
1628
|
origin: this.host
|
|
1591
1629
|
}), l;
|
|
1592
1630
|
}
|
|
1593
|
-
const c =
|
|
1631
|
+
const c = Or(this.remoteInfo.name, t), a = this.wraperFactory(i, c);
|
|
1594
1632
|
if (!n) return a;
|
|
1595
1633
|
await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
|
|
1596
1634
|
id: e,
|
|
@@ -1658,7 +1696,7 @@ var Dt = class {
|
|
|
1658
1696
|
removeAll() {
|
|
1659
1697
|
this.listeners.clear();
|
|
1660
1698
|
}
|
|
1661
|
-
},
|
|
1699
|
+
}, v = class extends A {
|
|
1662
1700
|
emit(...e) {
|
|
1663
1701
|
let t;
|
|
1664
1702
|
const r = Array.from(this.listeners);
|
|
@@ -1670,43 +1708,43 @@ var Dt = class {
|
|
|
1670
1708
|
return Promise.resolve(t);
|
|
1671
1709
|
}
|
|
1672
1710
|
};
|
|
1673
|
-
function
|
|
1674
|
-
if (!
|
|
1711
|
+
function Ut(e, t) {
|
|
1712
|
+
if (!Oe(t)) return !1;
|
|
1675
1713
|
if (e !== t) {
|
|
1676
1714
|
for (const r in e) if (!(r in t)) return !1;
|
|
1677
1715
|
}
|
|
1678
1716
|
return !0;
|
|
1679
1717
|
}
|
|
1680
|
-
var
|
|
1718
|
+
var X = class extends A {
|
|
1681
1719
|
constructor(e) {
|
|
1682
|
-
super(), this.onerror =
|
|
1720
|
+
super(), this.onerror = w, this.type = e;
|
|
1683
1721
|
}
|
|
1684
1722
|
emit(e) {
|
|
1685
|
-
|
|
1723
|
+
Oe(e) || w(`The data for the "${this.type}" hook should be an object.`);
|
|
1686
1724
|
for (const t of this.listeners) try {
|
|
1687
1725
|
const r = t(e);
|
|
1688
1726
|
if (r === void 0) continue;
|
|
1689
|
-
if (
|
|
1727
|
+
if (Ut(e, r)) e = r;
|
|
1690
1728
|
else {
|
|
1691
1729
|
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1692
1730
|
break;
|
|
1693
1731
|
}
|
|
1694
1732
|
} catch (r) {
|
|
1695
|
-
|
|
1733
|
+
oe(r), this.onerror(r);
|
|
1696
1734
|
}
|
|
1697
1735
|
return e;
|
|
1698
1736
|
}
|
|
1699
|
-
},
|
|
1737
|
+
}, D = class extends A {
|
|
1700
1738
|
constructor(e) {
|
|
1701
|
-
super(), this.onerror =
|
|
1739
|
+
super(), this.onerror = w, this.type = e;
|
|
1702
1740
|
}
|
|
1703
1741
|
emit(e) {
|
|
1704
|
-
|
|
1742
|
+
Oe(e) || w(`The response data for the "${this.type}" hook must be an object.`);
|
|
1705
1743
|
const t = Array.from(this.listeners);
|
|
1706
1744
|
if (t.length > 0) {
|
|
1707
1745
|
let r = 0;
|
|
1708
|
-
const o = (s) => (
|
|
1709
|
-
if (s !== void 0 &&
|
|
1746
|
+
const o = (s) => (oe(s), this.onerror(s), e), n = (s) => {
|
|
1747
|
+
if (s !== void 0 && Ut(e, s)) e = s;
|
|
1710
1748
|
else if (s !== void 0)
|
|
1711
1749
|
return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
|
|
1712
1750
|
if (r < t.length) try {
|
|
@@ -1720,13 +1758,13 @@ var K = class extends A {
|
|
|
1720
1758
|
}
|
|
1721
1759
|
return Promise.resolve(e);
|
|
1722
1760
|
}
|
|
1723
|
-
},
|
|
1761
|
+
}, Y = class {
|
|
1724
1762
|
constructor(e) {
|
|
1725
1763
|
this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
|
|
1726
1764
|
}
|
|
1727
1765
|
applyPlugin(e, t) {
|
|
1728
1766
|
var o;
|
|
1729
|
-
O(
|
|
1767
|
+
O(Lr(e), "Plugin configuration is invalid.");
|
|
1730
1768
|
const r = e.name;
|
|
1731
1769
|
O(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) => {
|
|
1732
1770
|
const s = e[n];
|
|
@@ -1741,23 +1779,23 @@ var K = class extends A {
|
|
|
1741
1779
|
});
|
|
1742
1780
|
}
|
|
1743
1781
|
};
|
|
1744
|
-
function
|
|
1745
|
-
const r =
|
|
1746
|
-
r.url ||
|
|
1747
|
-
let o =
|
|
1748
|
-
!
|
|
1782
|
+
function Bt(e, t) {
|
|
1783
|
+
const r = pt(t);
|
|
1784
|
+
r.url || w(Mt, P, { remoteName: e.name });
|
|
1785
|
+
let o = Te(t, r.url);
|
|
1786
|
+
!x && !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;
|
|
1749
1787
|
}
|
|
1750
|
-
function
|
|
1788
|
+
function Ho() {
|
|
1751
1789
|
return {
|
|
1752
1790
|
name: "snapshot-plugin",
|
|
1753
1791
|
async afterResolve(e) {
|
|
1754
1792
|
const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id: i } = e;
|
|
1755
|
-
if (!
|
|
1793
|
+
if (!Le(t) || !dt(t)) {
|
|
1756
1794
|
const { remoteSnapshot: c, globalSnapshot: a } = await n.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1757
1795
|
moduleInfo: t,
|
|
1758
|
-
id:
|
|
1796
|
+
id: De(t.name, o)
|
|
1759
1797
|
});
|
|
1760
|
-
|
|
1798
|
+
Bt(s, c);
|
|
1761
1799
|
const l = {
|
|
1762
1800
|
remote: t,
|
|
1763
1801
|
preloadConfig: {
|
|
@@ -1775,7 +1813,7 @@ function Io() {
|
|
|
1775
1813
|
remoteSnapshot: c,
|
|
1776
1814
|
globalSnapshot: a
|
|
1777
1815
|
});
|
|
1778
|
-
return u &&
|
|
1816
|
+
return u && xt(s, n, u, !1, {
|
|
1779
1817
|
initiator: "loadRemote",
|
|
1780
1818
|
id: i
|
|
1781
1819
|
}).catch(() => {
|
|
@@ -1788,7 +1826,7 @@ function Io() {
|
|
|
1788
1826
|
}
|
|
1789
1827
|
};
|
|
1790
1828
|
}
|
|
1791
|
-
function
|
|
1829
|
+
function Do(e) {
|
|
1792
1830
|
const t = e.split(":");
|
|
1793
1831
|
return t.length === 1 ? {
|
|
1794
1832
|
name: t[0],
|
|
@@ -1801,15 +1839,15 @@ function No(e) {
|
|
|
1801
1839
|
version: t[2]
|
|
1802
1840
|
};
|
|
1803
1841
|
}
|
|
1804
|
-
function
|
|
1805
|
-
const { value: i } =
|
|
1842
|
+
function jt(e, t, r, o, n = {}, s) {
|
|
1843
|
+
const { value: i } = j(e, ne(t)), c = s || i;
|
|
1806
1844
|
if (c && !nt(c) && (r(c, t, o), c.remotesInfo)) {
|
|
1807
1845
|
const a = Object.keys(c.remotesInfo);
|
|
1808
1846
|
for (const l of a) {
|
|
1809
1847
|
if (n[l]) continue;
|
|
1810
1848
|
n[l] = !0;
|
|
1811
|
-
const u =
|
|
1812
|
-
|
|
1849
|
+
const u = Do(l), f = c.remotesInfo[l];
|
|
1850
|
+
jt(e, {
|
|
1813
1851
|
name: u.name,
|
|
1814
1852
|
version: f.matchedVersion
|
|
1815
1853
|
}, r, !1, n, void 0);
|
|
@@ -1817,84 +1855,84 @@ function Ut(e, t, r, o, n = {}, s) {
|
|
|
1817
1855
|
}
|
|
1818
1856
|
}
|
|
1819
1857
|
const Ie = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1820
|
-
function
|
|
1821
|
-
const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote:
|
|
1822
|
-
if (
|
|
1858
|
+
function xo(e, t, r, o, n) {
|
|
1859
|
+
const s = [], i = [], c = [], a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: m } = f;
|
|
1860
|
+
if (jt(o, r, (d, p, E) => {
|
|
1823
1861
|
var $;
|
|
1824
|
-
let
|
|
1825
|
-
if (
|
|
1826
|
-
else if (Array.isArray(
|
|
1827
|
-
const S =
|
|
1862
|
+
let y;
|
|
1863
|
+
if (E) y = f;
|
|
1864
|
+
else if (Array.isArray(m)) {
|
|
1865
|
+
const S = m.find((I) => I.nameOrAlias === p.name || I.nameOrAlias === p.alias);
|
|
1828
1866
|
if (!S) return;
|
|
1829
|
-
|
|
1830
|
-
} else if (
|
|
1867
|
+
y = Dt(S);
|
|
1868
|
+
} else if (m === !0) y = f;
|
|
1831
1869
|
else return;
|
|
1832
|
-
const
|
|
1833
|
-
|
|
1870
|
+
const R = Te(d, pt(d).url);
|
|
1871
|
+
R && c.push({
|
|
1834
1872
|
name: p.name,
|
|
1835
1873
|
moduleInfo: {
|
|
1836
1874
|
name: p.name,
|
|
1837
|
-
entry:
|
|
1838
|
-
type: "remoteEntryType" in
|
|
1839
|
-
entryGlobalName: "globalName" in
|
|
1875
|
+
entry: R,
|
|
1876
|
+
type: "remoteEntryType" in d ? d.remoteEntryType : "global",
|
|
1877
|
+
entryGlobalName: "globalName" in d ? d.globalName : p.name,
|
|
1840
1878
|
shareScope: "",
|
|
1841
|
-
version: "version" in
|
|
1879
|
+
version: "version" in d ? d.version : void 0
|
|
1842
1880
|
},
|
|
1843
|
-
url:
|
|
1881
|
+
url: R
|
|
1844
1882
|
});
|
|
1845
|
-
let g = "modules" in
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1848
|
-
function
|
|
1849
|
-
const
|
|
1850
|
-
return
|
|
1883
|
+
let g = "modules" in d ? d.modules : [];
|
|
1884
|
+
const _ = Mo(y.exposes);
|
|
1885
|
+
_.length && "modules" in d && (g = ($ = d == null ? void 0 : d.modules) == null ? void 0 : $.reduce((S, I) => ((_ == null ? void 0 : _.indexOf(I.moduleName)) !== -1 && S.push(I), S), []));
|
|
1886
|
+
function b(S) {
|
|
1887
|
+
const I = S.map((k) => Te(d, k));
|
|
1888
|
+
return y.filter ? I.filter(y.filter) : I;
|
|
1851
1889
|
}
|
|
1852
1890
|
if (g) {
|
|
1853
1891
|
const S = g.length;
|
|
1854
|
-
for (let
|
|
1855
|
-
const
|
|
1892
|
+
for (let I = 0; I < S; I++) {
|
|
1893
|
+
const k = g[I], _e = `${p.name}/${k.moduleName}`;
|
|
1856
1894
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1857
|
-
id:
|
|
1895
|
+
id: k.moduleName === "." ? p.name : _e,
|
|
1858
1896
|
name: p.name,
|
|
1859
|
-
remoteSnapshot:
|
|
1860
|
-
preloadConfig:
|
|
1897
|
+
remoteSnapshot: d,
|
|
1898
|
+
preloadConfig: y,
|
|
1861
1899
|
remote: p,
|
|
1862
1900
|
origin: e
|
|
1863
|
-
}), !
|
|
1901
|
+
}), !xr(_e) && (y.resourceCategory === "all" ? (s.push(...b(k.assets.css.async)), s.push(...b(k.assets.css.sync)), i.push(...b(k.assets.js.async)), i.push(...b(k.assets.js.sync))) : y.resourceCategory === "sync" && (s.push(...b(k.assets.css.sync)), i.push(...b(k.assets.js.sync))), Gr(_e));
|
|
1864
1902
|
}
|
|
1865
1903
|
}
|
|
1866
1904
|
}, !0, {}, n), n.shared && n.shared.length > 0) {
|
|
1867
|
-
const
|
|
1868
|
-
const { shared:
|
|
1869
|
-
|
|
1870
|
-
a.add(
|
|
1871
|
-
}),
|
|
1872
|
-
l.add(
|
|
1905
|
+
const d = (p, E) => {
|
|
1906
|
+
const { shared: y } = Ee(e.shareScopeMap, E.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1907
|
+
y && typeof y.lib == "function" && (E.assets.js.sync.forEach((R) => {
|
|
1908
|
+
a.add(R);
|
|
1909
|
+
}), E.assets.css.sync.forEach((R) => {
|
|
1910
|
+
l.add(R);
|
|
1873
1911
|
}));
|
|
1874
1912
|
};
|
|
1875
1913
|
n.shared.forEach((p) => {
|
|
1876
|
-
var
|
|
1877
|
-
const
|
|
1878
|
-
if (!
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1881
|
-
|
|
1914
|
+
var R;
|
|
1915
|
+
const E = (R = u.shared) == null ? void 0 : R[p.sharedName];
|
|
1916
|
+
if (!E) return;
|
|
1917
|
+
const y = p.version ? E.find((g) => g.version === p.version) : E;
|
|
1918
|
+
y && mt(y).forEach((g) => {
|
|
1919
|
+
d(g, p);
|
|
1882
1920
|
});
|
|
1883
1921
|
});
|
|
1884
1922
|
}
|
|
1885
|
-
const h = i.filter((
|
|
1923
|
+
const h = i.filter((d) => !a.has(d) && !Ie("script", d));
|
|
1886
1924
|
return {
|
|
1887
|
-
cssAssets: s.filter((
|
|
1925
|
+
cssAssets: s.filter((d) => !l.has(d) && !Ie("link", d)),
|
|
1888
1926
|
jsAssetsWithoutEntry: h,
|
|
1889
|
-
entryAssets: c.filter((
|
|
1927
|
+
entryAssets: c.filter((d) => !Ie("script", d.url))
|
|
1890
1928
|
};
|
|
1891
1929
|
}
|
|
1892
|
-
const
|
|
1930
|
+
const Go = function() {
|
|
1893
1931
|
return {
|
|
1894
1932
|
name: "generate-preload-assets-plugin",
|
|
1895
1933
|
async generatePreloadAssets(e) {
|
|
1896
1934
|
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: i } = e;
|
|
1897
|
-
return
|
|
1935
|
+
return x ? Le(n) && dt(n) ? {
|
|
1898
1936
|
cssAssets: [],
|
|
1899
1937
|
jsAssetsWithoutEntry: [],
|
|
1900
1938
|
entryAssets: [{
|
|
@@ -1908,7 +1946,7 @@ const vo = function() {
|
|
|
1908
1946
|
shareScope: ""
|
|
1909
1947
|
}
|
|
1910
1948
|
}]
|
|
1911
|
-
} : (
|
|
1949
|
+
} : (Bt(o, i), xo(t, r, o, s, i)) : {
|
|
1912
1950
|
cssAssets: [],
|
|
1913
1951
|
jsAssetsWithoutEntry: [],
|
|
1914
1952
|
entryAssets: []
|
|
@@ -1916,35 +1954,35 @@ const vo = function() {
|
|
|
1916
1954
|
}
|
|
1917
1955
|
};
|
|
1918
1956
|
};
|
|
1919
|
-
function
|
|
1920
|
-
const r =
|
|
1957
|
+
function Wt(e, t) {
|
|
1958
|
+
const r = me({
|
|
1921
1959
|
name: t.name,
|
|
1922
1960
|
version: t.options.version
|
|
1923
|
-
}), o = r && "remotesInfo" in r && r.remotesInfo &&
|
|
1961
|
+
}), o = r && "remotesInfo" in r && r.remotesInfo && j(r.remotesInfo, e.name).value;
|
|
1924
1962
|
return o && o.matchedVersion ? {
|
|
1925
1963
|
hostGlobalSnapshot: r,
|
|
1926
|
-
globalSnapshot:
|
|
1927
|
-
remoteSnapshot:
|
|
1964
|
+
globalSnapshot: je(),
|
|
1965
|
+
remoteSnapshot: me({
|
|
1928
1966
|
name: e.name,
|
|
1929
1967
|
version: o.matchedVersion
|
|
1930
1968
|
})
|
|
1931
1969
|
} : {
|
|
1932
1970
|
hostGlobalSnapshot: void 0,
|
|
1933
|
-
globalSnapshot:
|
|
1934
|
-
remoteSnapshot:
|
|
1971
|
+
globalSnapshot: je(),
|
|
1972
|
+
remoteSnapshot: me({
|
|
1935
1973
|
name: e.name,
|
|
1936
1974
|
version: "version" in e ? e.version : void 0
|
|
1937
1975
|
})
|
|
1938
1976
|
};
|
|
1939
1977
|
}
|
|
1940
|
-
var
|
|
1978
|
+
var Uo = class {
|
|
1941
1979
|
constructor(e) {
|
|
1942
|
-
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new
|
|
1943
|
-
beforeLoadRemoteSnapshot: new
|
|
1944
|
-
loadSnapshot: new
|
|
1945
|
-
loadRemoteSnapshot: new
|
|
1946
|
-
afterLoadSnapshot: new
|
|
1947
|
-
}), this.manifestLoading =
|
|
1980
|
+
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new Y({
|
|
1981
|
+
beforeLoadRemoteSnapshot: new v("beforeLoadRemoteSnapshot"),
|
|
1982
|
+
loadSnapshot: new D("loadGlobalSnapshot"),
|
|
1983
|
+
loadRemoteSnapshot: new D("loadRemoteSnapshot"),
|
|
1984
|
+
afterLoadSnapshot: new D("afterLoadSnapshot")
|
|
1985
|
+
}), this.manifestLoading = Re.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
1948
1986
|
}
|
|
1949
1987
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
|
|
1950
1988
|
const { options: o } = this.HostInstance;
|
|
@@ -1953,7 +1991,7 @@ var Ao = class {
|
|
|
1953
1991
|
moduleInfo: e,
|
|
1954
1992
|
origin: this.HostInstance
|
|
1955
1993
|
});
|
|
1956
|
-
let n =
|
|
1994
|
+
let n = me({
|
|
1957
1995
|
name: this.HostInstance.options.name,
|
|
1958
1996
|
version: this.HostInstance.options.version
|
|
1959
1997
|
});
|
|
@@ -1961,7 +1999,7 @@ var Ao = class {
|
|
|
1961
1999
|
version: this.HostInstance.options.version || "",
|
|
1962
2000
|
remoteEntry: "",
|
|
1963
2001
|
remotesInfo: {}
|
|
1964
|
-
},
|
|
2002
|
+
}, Hr({ [this.HostInstance.options.name]: n })), n && "remotesInfo" in n && !j(n.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (n.remotesInfo = {
|
|
1965
2003
|
...n == null ? void 0 : n.remotesInfo,
|
|
1966
2004
|
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
1967
2005
|
});
|
|
@@ -1974,30 +2012,30 @@ var Ao = class {
|
|
|
1974
2012
|
});
|
|
1975
2013
|
let u, f;
|
|
1976
2014
|
if (a) if (nt(a)) {
|
|
1977
|
-
const
|
|
2015
|
+
const m = x ? a.remoteEntry : a.ssrRemoteEntry || a.remoteEntry || "", h = await this.loadManifestSnapshot(m, e, {}, {
|
|
1978
2016
|
initiator: r,
|
|
1979
2017
|
id: t || e.name
|
|
1980
|
-
}),
|
|
2018
|
+
}), d = We({
|
|
1981
2019
|
...e,
|
|
1982
|
-
entry:
|
|
2020
|
+
entry: m
|
|
1983
2021
|
}, h);
|
|
1984
|
-
u = h, f =
|
|
2022
|
+
u = h, f = d;
|
|
1985
2023
|
} else {
|
|
1986
|
-
const { remoteSnapshot:
|
|
2024
|
+
const { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1987
2025
|
options: this.HostInstance.options,
|
|
1988
2026
|
moduleInfo: e,
|
|
1989
2027
|
remoteSnapshot: a,
|
|
1990
2028
|
from: "global"
|
|
1991
2029
|
});
|
|
1992
|
-
u =
|
|
2030
|
+
u = m, f = l;
|
|
1993
2031
|
}
|
|
1994
|
-
else if (
|
|
1995
|
-
const
|
|
2032
|
+
else if (Le(e)) {
|
|
2033
|
+
const m = await this.loadManifestSnapshot(e.entry, e, {}, {
|
|
1996
2034
|
initiator: r,
|
|
1997
2035
|
id: t || e.name
|
|
1998
|
-
}), h = We(e,
|
|
1999
|
-
u =
|
|
2000
|
-
} else
|
|
2036
|
+
}), h = We(e, m);
|
|
2037
|
+
u = m, f = h;
|
|
2038
|
+
} else w(Pt, P, {
|
|
2001
2039
|
remoteName: e.name,
|
|
2002
2040
|
remoteVersion: e.version,
|
|
2003
2041
|
hostName: this.HostInstance.options.name,
|
|
@@ -2015,11 +2053,11 @@ var Ao = class {
|
|
|
2015
2053
|
};
|
|
2016
2054
|
}
|
|
2017
2055
|
getGlobalRemoteInfo(e) {
|
|
2018
|
-
return
|
|
2056
|
+
return Wt(e, this.HostInstance);
|
|
2019
2057
|
}
|
|
2020
2058
|
async getManifestJson(e, t, r, o) {
|
|
2021
2059
|
return (async () => {
|
|
2022
|
-
const s =
|
|
2060
|
+
const s = z(t);
|
|
2023
2061
|
let i = this.manifestCache.get(e);
|
|
2024
2062
|
if (i) return i;
|
|
2025
2063
|
try {
|
|
@@ -2037,7 +2075,7 @@ var Ao = class {
|
|
|
2037
2075
|
lifecycle: "afterResolve",
|
|
2038
2076
|
remote: s,
|
|
2039
2077
|
origin: this.HostInstance
|
|
2040
|
-
}), i || (delete this.manifestLoading[e],
|
|
2078
|
+
}), i || (delete this.manifestLoading[e], w(Nt, P, {
|
|
2041
2079
|
manifestUrl: e,
|
|
2042
2080
|
moduleName: t.name,
|
|
2043
2081
|
hostName: this.HostInstance.options.name
|
|
@@ -2055,7 +2093,7 @@ var Ao = class {
|
|
|
2055
2093
|
lifecycle: "afterResolve",
|
|
2056
2094
|
remote: s,
|
|
2057
2095
|
origin: this.HostInstance
|
|
2058
|
-
}), c.length > 0 &&
|
|
2096
|
+
}), c.length > 0 && w(Lt, P, {
|
|
2059
2097
|
manifestUrl: e,
|
|
2060
2098
|
moduleName: t.name,
|
|
2061
2099
|
hostName: this.HostInstance.options.name,
|
|
@@ -2065,7 +2103,7 @@ var Ao = class {
|
|
|
2065
2103
|
}
|
|
2066
2104
|
async loadManifestSnapshot(e, t, r, o) {
|
|
2067
2105
|
const n = async () => {
|
|
2068
|
-
const s = await this.getManifestJson(e, t, r, o), i =
|
|
2106
|
+
const s = await this.getManifestJson(e, t, r, o), i = hr(s, { version: e }), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2069
2107
|
options: this.HostInstance.options,
|
|
2070
2108
|
moduleInfo: t,
|
|
2071
2109
|
manifestJson: s,
|
|
@@ -2077,17 +2115,17 @@ var Ao = class {
|
|
|
2077
2115
|
};
|
|
2078
2116
|
return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
|
|
2079
2117
|
}
|
|
2080
|
-
},
|
|
2118
|
+
}, Bo = class {
|
|
2081
2119
|
constructor(e) {
|
|
2082
|
-
this.hooks = new
|
|
2083
|
-
beforeRegisterShare: new
|
|
2084
|
-
afterResolve: new
|
|
2085
|
-
beforeLoadShare: new
|
|
2086
|
-
loadShare: new
|
|
2120
|
+
this.hooks = new Y({
|
|
2121
|
+
beforeRegisterShare: new X("beforeRegisterShare"),
|
|
2122
|
+
afterResolve: new D("afterResolve"),
|
|
2123
|
+
beforeLoadShare: new D("beforeLoadShare"),
|
|
2124
|
+
loadShare: new v(),
|
|
2087
2125
|
afterLoadShare: new A("afterLoadShare"),
|
|
2088
2126
|
errorLoadShare: new A("errorLoadShare"),
|
|
2089
|
-
resolveShare: new
|
|
2090
|
-
initContainerShareScopeMap: new
|
|
2127
|
+
resolveShare: new X("resolveShare"),
|
|
2128
|
+
initContainerShareScopeMap: new X("initContainerShareScopeMap")
|
|
2091
2129
|
}), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
|
|
2092
2130
|
}
|
|
2093
2131
|
emitAfterLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, selectedShared: o }) {
|
|
@@ -2102,7 +2140,7 @@ var Ao = class {
|
|
|
2102
2140
|
origin: this.host
|
|
2103
2141
|
});
|
|
2104
2142
|
} catch (n) {
|
|
2105
|
-
|
|
2143
|
+
oe(n);
|
|
2106
2144
|
}
|
|
2107
2145
|
}
|
|
2108
2146
|
emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n }) {
|
|
@@ -2118,11 +2156,11 @@ var Ao = class {
|
|
|
2118
2156
|
recovered: n
|
|
2119
2157
|
});
|
|
2120
2158
|
} catch (s) {
|
|
2121
|
-
|
|
2159
|
+
oe(s);
|
|
2122
2160
|
}
|
|
2123
2161
|
}
|
|
2124
2162
|
registerShared(e, t) {
|
|
2125
|
-
const { newShareInfos: r, allShareInfos: o } =
|
|
2163
|
+
const { newShareInfos: r, allShareInfos: o } = wt(e, t);
|
|
2126
2164
|
return Object.keys(r).forEach((n) => {
|
|
2127
2165
|
r[n].forEach((s) => {
|
|
2128
2166
|
s.scope.forEach((i) => {
|
|
@@ -2162,11 +2200,11 @@ var Ao = class {
|
|
|
2162
2200
|
shared: r.options.shared,
|
|
2163
2201
|
origin: r
|
|
2164
2202
|
})).shareInfo, O(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.`);
|
|
2165
|
-
const s = n, { shared: i, useTreesShaking: c } =
|
|
2203
|
+
const s = n, { shared: i, useTreesShaking: c } = Ee(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
|
|
2166
2204
|
if (i) {
|
|
2167
|
-
const a =
|
|
2205
|
+
const a = ue(i, c);
|
|
2168
2206
|
if (a.lib)
|
|
2169
|
-
return
|
|
2207
|
+
return q(a, r.options.name), this.emitAfterLoadShare({
|
|
2170
2208
|
lifecycle: "loadShare",
|
|
2171
2209
|
pkgName: e,
|
|
2172
2210
|
shareInfo: s,
|
|
@@ -2174,7 +2212,7 @@ var Ao = class {
|
|
|
2174
2212
|
}), a.lib;
|
|
2175
2213
|
if (a.loading && !a.loaded) {
|
|
2176
2214
|
const l = await a.loading;
|
|
2177
|
-
return a.loaded = !0, a.lib || (a.lib = l),
|
|
2215
|
+
return a.loaded = !0, a.lib || (a.lib = l), q(a, r.options.name), this.emitAfterLoadShare({
|
|
2178
2216
|
lifecycle: "loadShare",
|
|
2179
2217
|
pkgName: e,
|
|
2180
2218
|
shareInfo: s,
|
|
@@ -2182,8 +2220,8 @@ var Ao = class {
|
|
|
2182
2220
|
}), l;
|
|
2183
2221
|
} else {
|
|
2184
2222
|
const u = (async () => {
|
|
2185
|
-
const
|
|
2186
|
-
return
|
|
2223
|
+
const m = await a.get();
|
|
2224
|
+
return q(a, r.options.name), a.loaded = !0, a.lib = m, m;
|
|
2187
2225
|
})();
|
|
2188
2226
|
this.setShared({
|
|
2189
2227
|
pkgName: e,
|
|
@@ -2210,13 +2248,13 @@ var Ao = class {
|
|
|
2210
2248
|
shareInfo: s,
|
|
2211
2249
|
recovered: !0
|
|
2212
2250
|
}), !1;
|
|
2213
|
-
const a =
|
|
2251
|
+
const a = se(s.treeShaking), l = ue(s, a), f = (async () => {
|
|
2214
2252
|
const h = await l.get();
|
|
2215
|
-
l.lib = h, l.loaded = !0,
|
|
2216
|
-
const { shared:
|
|
2217
|
-
if (
|
|
2218
|
-
const
|
|
2219
|
-
|
|
2253
|
+
l.lib = h, l.loaded = !0, q(l, r.options.name);
|
|
2254
|
+
const { shared: d, useTreesShaking: p } = Ee(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare) || {};
|
|
2255
|
+
if (d) {
|
|
2256
|
+
const E = ue(d, p);
|
|
2257
|
+
E.lib = h, E.loaded = !0, d.from = s.from;
|
|
2220
2258
|
}
|
|
2221
2259
|
return h;
|
|
2222
2260
|
})();
|
|
@@ -2229,13 +2267,13 @@ var Ao = class {
|
|
|
2229
2267
|
loading: f,
|
|
2230
2268
|
treeShaking: a ? l : void 0
|
|
2231
2269
|
});
|
|
2232
|
-
const
|
|
2270
|
+
const m = await f;
|
|
2233
2271
|
return this.emitAfterLoadShare({
|
|
2234
2272
|
lifecycle: "loadShare",
|
|
2235
2273
|
pkgName: e,
|
|
2236
2274
|
shareInfo: s,
|
|
2237
2275
|
selectedShared: s
|
|
2238
|
-
}),
|
|
2276
|
+
}), m;
|
|
2239
2277
|
}
|
|
2240
2278
|
} catch (s) {
|
|
2241
2279
|
throw this.emitErrorLoadShare({
|
|
@@ -2251,49 +2289,49 @@ var Ao = class {
|
|
|
2251
2289
|
* It accepts one argument, the name of the share scope.
|
|
2252
2290
|
* If the share scope does not exist, it creates one.
|
|
2253
2291
|
*/
|
|
2254
|
-
initializeSharing(e =
|
|
2292
|
+
initializeSharing(e = ae, t) {
|
|
2255
2293
|
const { host: r } = this, o = t == null ? void 0 : t.from, n = t == null ? void 0 : t.strategy;
|
|
2256
2294
|
let s = t == null ? void 0 : t.initScope;
|
|
2257
2295
|
const i = [];
|
|
2258
2296
|
if (o !== "build") {
|
|
2259
|
-
const { initTokens:
|
|
2297
|
+
const { initTokens: m } = this;
|
|
2260
2298
|
s || (s = []);
|
|
2261
|
-
let h =
|
|
2262
|
-
if (h || (h =
|
|
2299
|
+
let h = m[e];
|
|
2300
|
+
if (h || (h = m[e] = { from: this.host.name }), s.indexOf(h) >= 0) return i;
|
|
2263
2301
|
s.push(h);
|
|
2264
2302
|
}
|
|
2265
2303
|
const c = this.shareScopeMap, a = r.options.name;
|
|
2266
2304
|
c[e] || (c[e] = {});
|
|
2267
|
-
const l = c[e], u = (
|
|
2305
|
+
const l = c[e], u = (m, h) => {
|
|
2268
2306
|
var g;
|
|
2269
|
-
const { version:
|
|
2270
|
-
l[
|
|
2271
|
-
const
|
|
2272
|
-
(!
|
|
2273
|
-
}, f = async (
|
|
2274
|
-
const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id:
|
|
2275
|
-
let
|
|
2307
|
+
const { version: d, eager: p } = h;
|
|
2308
|
+
l[m] = l[m] || {};
|
|
2309
|
+
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)));
|
|
2310
|
+
(!y || y.strategy !== "loaded-first" && !y.loaded && (!p != !R ? p : a > E[d].from)) && (E[d] = h);
|
|
2311
|
+
}, f = async (m) => {
|
|
2312
|
+
const { module: h } = await r.remoteHandler.getRemoteModuleAndOptions({ id: m });
|
|
2313
|
+
let d;
|
|
2276
2314
|
try {
|
|
2277
|
-
|
|
2315
|
+
d = await h.getEntry();
|
|
2278
2316
|
} catch (p) {
|
|
2279
|
-
if (
|
|
2280
|
-
id:
|
|
2317
|
+
if (d = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2318
|
+
id: m,
|
|
2281
2319
|
error: p,
|
|
2282
2320
|
from: "runtime",
|
|
2283
2321
|
lifecycle: "beforeLoadShare",
|
|
2284
2322
|
remote: h.remoteInfo,
|
|
2285
2323
|
origin: r
|
|
2286
|
-
}), !
|
|
2324
|
+
}), !d) return;
|
|
2287
2325
|
} finally {
|
|
2288
|
-
|
|
2326
|
+
d != null && d.init && !h.initing && (h.remoteEntryExports = d, await h.init(void 0, void 0, s));
|
|
2289
2327
|
}
|
|
2290
2328
|
};
|
|
2291
|
-
return Object.keys(r.options.shared).forEach((
|
|
2292
|
-
r.options.shared[
|
|
2293
|
-
h.scope.includes(e) && u(
|
|
2329
|
+
return Object.keys(r.options.shared).forEach((m) => {
|
|
2330
|
+
r.options.shared[m].forEach((h) => {
|
|
2331
|
+
h.scope.includes(e) && u(m, h);
|
|
2294
2332
|
});
|
|
2295
|
-
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((
|
|
2296
|
-
|
|
2333
|
+
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((m) => {
|
|
2334
|
+
m.shareScope === e && i.push(f(m.name));
|
|
2297
2335
|
}), i;
|
|
2298
2336
|
}
|
|
2299
2337
|
loadShareSync(e, t) {
|
|
@@ -2306,10 +2344,10 @@ var Ao = class {
|
|
|
2306
2344
|
o != null && o.scope && o.scope.forEach((s) => {
|
|
2307
2345
|
this.initializeSharing(s, { strategy: o.strategy });
|
|
2308
2346
|
});
|
|
2309
|
-
const { shared: n } =
|
|
2347
|
+
const { shared: n } = Ee(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
2310
2348
|
if (n) {
|
|
2311
2349
|
if (typeof n.lib == "function")
|
|
2312
|
-
return
|
|
2350
|
+
return q(n, r.options.name), n.loaded || (n.loaded = !0, n.from === r.options.name && (o.loaded = !0)), this.emitAfterLoadShare({
|
|
2313
2351
|
lifecycle: "loadShareSync",
|
|
2314
2352
|
pkgName: e,
|
|
2315
2353
|
shareInfo: o,
|
|
@@ -2318,7 +2356,7 @@ var Ao = class {
|
|
|
2318
2356
|
if (typeof n.get == "function") {
|
|
2319
2357
|
const s = n.get();
|
|
2320
2358
|
if (!(s instanceof Promise))
|
|
2321
|
-
return
|
|
2359
|
+
return q(n, r.options.name), this.setShared({
|
|
2322
2360
|
pkgName: e,
|
|
2323
2361
|
loaded: !0,
|
|
2324
2362
|
from: r.options.name,
|
|
@@ -2341,7 +2379,7 @@ var Ao = class {
|
|
|
2341
2379
|
}), o.lib;
|
|
2342
2380
|
if (o.get) {
|
|
2343
2381
|
const s = o.get();
|
|
2344
|
-
return s instanceof Promise &&
|
|
2382
|
+
return s instanceof Promise && w((t == null ? void 0 : t.from) === "build" ? At : ke, P, {
|
|
2345
2383
|
hostName: r.options.name,
|
|
2346
2384
|
sharedPkgName: e
|
|
2347
2385
|
}, void 0, F(r.options)), o.lib = s, this.setShared({
|
|
@@ -2357,7 +2395,7 @@ var Ao = class {
|
|
|
2357
2395
|
selectedShared: o
|
|
2358
2396
|
}), o.lib;
|
|
2359
2397
|
}
|
|
2360
|
-
|
|
2398
|
+
w(ke, P, {
|
|
2361
2399
|
hostName: r.options.name,
|
|
2362
2400
|
sharedPkgName: e
|
|
2363
2401
|
}, void 0, F(r.options));
|
|
@@ -2381,11 +2419,11 @@ var Ao = class {
|
|
|
2381
2419
|
});
|
|
2382
2420
|
}
|
|
2383
2421
|
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: c }) {
|
|
2384
|
-
const { version: a, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l],
|
|
2385
|
-
const
|
|
2386
|
-
|
|
2422
|
+
const { version: a, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], m = (h) => {
|
|
2423
|
+
const d = (E, y, R) => {
|
|
2424
|
+
R && !E[y] && (E[y] = R);
|
|
2387
2425
|
}, p = c ? h.treeShaking : h;
|
|
2388
|
-
|
|
2426
|
+
d(p, "loaded", s), d(p, "loading", n), d(p, "get", i);
|
|
2389
2427
|
};
|
|
2390
2428
|
f.forEach((h) => {
|
|
2391
2429
|
this.shareScopeMap[h] || (this.shareScopeMap[h] = {}), this.shareScopeMap[h][e] || (this.shareScopeMap[h][e] = {}), this.shareScopeMap[h][e][a] || (this.shareScopeMap[h][e][a] = {
|
|
@@ -2394,29 +2432,29 @@ var Ao = class {
|
|
|
2394
2432
|
...u,
|
|
2395
2433
|
lib: o
|
|
2396
2434
|
});
|
|
2397
|
-
const
|
|
2398
|
-
d
|
|
2435
|
+
const d = this.shareScopeMap[h][e][a];
|
|
2436
|
+
m(d), r && d.from !== r && (d.from = r);
|
|
2399
2437
|
});
|
|
2400
2438
|
}
|
|
2401
2439
|
_setGlobalShareScopeMap(e) {
|
|
2402
|
-
const t =
|
|
2440
|
+
const t = $t(), r = e.id || e.name;
|
|
2403
2441
|
r && !t[r] && (t[r] = this.shareScopeMap);
|
|
2404
2442
|
}
|
|
2405
|
-
},
|
|
2443
|
+
}, jo = class {
|
|
2406
2444
|
constructor(e) {
|
|
2407
|
-
this.hooks = new
|
|
2408
|
-
beforeRegisterRemote: new
|
|
2409
|
-
registerRemote: new
|
|
2410
|
-
beforeRequest: new
|
|
2411
|
-
afterMatchRemote: new
|
|
2412
|
-
onLoad: new
|
|
2413
|
-
afterLoadRemote: new
|
|
2445
|
+
this.hooks = new Y({
|
|
2446
|
+
beforeRegisterRemote: new X("beforeRegisterRemote"),
|
|
2447
|
+
registerRemote: new X("registerRemote"),
|
|
2448
|
+
beforeRequest: new D("beforeRequest"),
|
|
2449
|
+
afterMatchRemote: new v("afterMatchRemote"),
|
|
2450
|
+
onLoad: new v("onLoad"),
|
|
2451
|
+
afterLoadRemote: new v("afterLoadRemote"),
|
|
2414
2452
|
handlePreloadModule: new A("handlePreloadModule"),
|
|
2415
|
-
errorLoadRemote: new
|
|
2416
|
-
beforePreloadRemote: new
|
|
2417
|
-
generatePreloadAssets: new
|
|
2418
|
-
afterPreloadRemote: new
|
|
2419
|
-
loadEntry: new
|
|
2453
|
+
errorLoadRemote: new v("errorLoadRemote"),
|
|
2454
|
+
beforePreloadRemote: new v("beforePreloadRemote"),
|
|
2455
|
+
generatePreloadAssets: new v("generatePreloadAssets"),
|
|
2456
|
+
afterPreloadRemote: new v("afterPreloadRemote"),
|
|
2457
|
+
loadEntry: new v()
|
|
2420
2458
|
}), this.host = e, this.idToRemoteMap = {};
|
|
2421
2459
|
}
|
|
2422
2460
|
formatAndRegisterRemote(e, t) {
|
|
@@ -2445,16 +2483,16 @@ var Ao = class {
|
|
|
2445
2483
|
}
|
|
2446
2484
|
async loadRemote(e, t) {
|
|
2447
2485
|
const { host: r } = this, o = Ye(r.options.remotes, e);
|
|
2448
|
-
let n = e, s = o == null ? void 0 : o.expose, i = o ?
|
|
2486
|
+
let n = e, s = o == null ? void 0 : o.expose, i = o ? z(o.remote) : void 0, c;
|
|
2449
2487
|
try {
|
|
2450
|
-
const { loadFactory: a = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias:
|
|
2451
|
-
n = p, s =
|
|
2452
|
-
const
|
|
2488
|
+
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;
|
|
2489
|
+
n = p, s = d, i = z(h);
|
|
2490
|
+
const y = await l.get(p, d, t, E), R = await this.hooks.lifecycle.onLoad.emit({
|
|
2453
2491
|
id: p,
|
|
2454
|
-
pkgNameOrAlias:
|
|
2455
|
-
expose:
|
|
2456
|
-
exposeModule: a ?
|
|
2457
|
-
exposeModuleFactory: a ? void 0 :
|
|
2492
|
+
pkgNameOrAlias: m,
|
|
2493
|
+
expose: d,
|
|
2494
|
+
exposeModule: a ? y : void 0,
|
|
2495
|
+
exposeModuleFactory: a ? void 0 : y,
|
|
2458
2496
|
remote: h,
|
|
2459
2497
|
options: u,
|
|
2460
2498
|
moduleInstance: l,
|
|
@@ -2466,7 +2504,7 @@ var Ao = class {
|
|
|
2466
2504
|
remote: i,
|
|
2467
2505
|
options: t,
|
|
2468
2506
|
origin: r
|
|
2469
|
-
}, typeof
|
|
2507
|
+
}, typeof R == "function" ? R : y;
|
|
2470
2508
|
} catch (a) {
|
|
2471
2509
|
const { from: l = "runtime" } = t || { from: "runtime" };
|
|
2472
2510
|
let u;
|
|
@@ -2519,7 +2557,7 @@ var Ao = class {
|
|
|
2519
2557
|
options: t.options,
|
|
2520
2558
|
origin: t
|
|
2521
2559
|
});
|
|
2522
|
-
const o =
|
|
2560
|
+
const o = ko(t.options.remotes, e), n = (c) => {
|
|
2523
2561
|
const { preloadConfig: a, remote: l } = c, u = a.exposes || [];
|
|
2524
2562
|
return u.length ? u.map((f) => ({
|
|
2525
2563
|
ops: {
|
|
@@ -2529,7 +2567,7 @@ var Ao = class {
|
|
|
2529
2567
|
exposes: [f]
|
|
2530
2568
|
}
|
|
2531
2569
|
},
|
|
2532
|
-
id:
|
|
2570
|
+
id: De(l.name, f)
|
|
2533
2571
|
})) : [{
|
|
2534
2572
|
ops: c,
|
|
2535
2573
|
id: `${l.name}/*`
|
|
@@ -2537,9 +2575,9 @@ var Ao = class {
|
|
|
2537
2575
|
};
|
|
2538
2576
|
let s;
|
|
2539
2577
|
await Promise.all(o.flatMap(n).map(async (c) => {
|
|
2540
|
-
const { ops: a, id: l } = c, { remote: u, preloadConfig: f } = a,
|
|
2578
|
+
const { ops: a, id: l } = c, { remote: u, preloadConfig: f } = a, m = z(u);
|
|
2541
2579
|
try {
|
|
2542
|
-
const { globalSnapshot: h, remoteSnapshot:
|
|
2580
|
+
const { globalSnapshot: h, remoteSnapshot: d } = await t.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2543
2581
|
moduleInfo: u,
|
|
2544
2582
|
id: l,
|
|
2545
2583
|
initiator: "preloadRemote"
|
|
@@ -2547,32 +2585,32 @@ var Ao = class {
|
|
|
2547
2585
|
origin: t,
|
|
2548
2586
|
preloadOptions: a,
|
|
2549
2587
|
remote: u,
|
|
2550
|
-
remoteInfo:
|
|
2588
|
+
remoteInfo: m,
|
|
2551
2589
|
globalSnapshot: h,
|
|
2552
|
-
remoteSnapshot:
|
|
2590
|
+
remoteSnapshot: d
|
|
2553
2591
|
});
|
|
2554
2592
|
if (!p) return;
|
|
2555
|
-
const
|
|
2593
|
+
const E = await xt(m, t, p, !0, {
|
|
2556
2594
|
initiator: "preloadRemote",
|
|
2557
2595
|
id: l
|
|
2558
2596
|
});
|
|
2559
2597
|
r.push({
|
|
2560
2598
|
remote: u,
|
|
2561
|
-
remoteInfo:
|
|
2599
|
+
remoteInfo: m,
|
|
2562
2600
|
preloadConfig: f,
|
|
2563
2601
|
id: l,
|
|
2564
|
-
results:
|
|
2602
|
+
results: E
|
|
2565
2603
|
});
|
|
2566
2604
|
} catch (h) {
|
|
2567
2605
|
r.push({
|
|
2568
2606
|
remote: u,
|
|
2569
|
-
remoteInfo:
|
|
2607
|
+
remoteInfo: m,
|
|
2570
2608
|
preloadConfig: f,
|
|
2571
2609
|
id: l,
|
|
2572
2610
|
results: [{
|
|
2573
|
-
url:
|
|
2611
|
+
url: m.entry,
|
|
2574
2612
|
status: "error",
|
|
2575
|
-
resourceType: /\.json(?:$|[?#])/i.test(
|
|
2613
|
+
resourceType: /\.json(?:$|[?#])/i.test(m.entry) ? "manifest" : "remoteEntry",
|
|
2576
2614
|
initiator: "preloadRemote",
|
|
2577
2615
|
id: l,
|
|
2578
2616
|
error: h
|
|
@@ -2619,7 +2657,7 @@ var Ao = class {
|
|
|
2619
2657
|
}
|
|
2620
2658
|
const { id: n } = o, s = Ye(t.options.remotes, n);
|
|
2621
2659
|
if (!s) try {
|
|
2622
|
-
|
|
2660
|
+
w(Tt, P, {
|
|
2623
2661
|
hostName: t.options.name,
|
|
2624
2662
|
requestId: n
|
|
2625
2663
|
}, void 0, F(t.options));
|
|
@@ -2631,7 +2669,7 @@ var Ao = class {
|
|
|
2631
2669
|
origin: t
|
|
2632
2670
|
}), h;
|
|
2633
2671
|
}
|
|
2634
|
-
const { remote: i } = s, c =
|
|
2672
|
+
const { remote: i } = s, c = z(i);
|
|
2635
2673
|
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
2636
2674
|
id: n,
|
|
2637
2675
|
...s,
|
|
@@ -2648,13 +2686,13 @@ var Ao = class {
|
|
|
2648
2686
|
}), { remote: l, expose: u } = a;
|
|
2649
2687
|
O(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
|
|
2650
2688
|
let f = t.moduleCache.get(l.name);
|
|
2651
|
-
const
|
|
2689
|
+
const m = {
|
|
2652
2690
|
host: t,
|
|
2653
2691
|
remoteInfo: c
|
|
2654
2692
|
};
|
|
2655
|
-
return f || (f = new
|
|
2693
|
+
return f || (f = new Gt(m), t.moduleCache.set(l.name, f)), {
|
|
2656
2694
|
module: f,
|
|
2657
|
-
moduleOptions:
|
|
2695
|
+
moduleOptions: m,
|
|
2658
2696
|
remoteMatchInfo: a
|
|
2659
2697
|
};
|
|
2660
2698
|
}
|
|
@@ -2667,7 +2705,7 @@ var Ao = class {
|
|
|
2667
2705
|
});
|
|
2668
2706
|
O(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2669
2707
|
}
|
|
2670
|
-
"entry" in e &&
|
|
2708
|
+
"entry" in e && x && 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 = St);
|
|
2671
2709
|
};
|
|
2672
2710
|
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2673
2711
|
remote: e,
|
|
@@ -2690,53 +2728,55 @@ var Ao = class {
|
|
|
2690
2728
|
removeRemote(e) {
|
|
2691
2729
|
var t;
|
|
2692
2730
|
try {
|
|
2693
|
-
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((
|
|
2731
|
+
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((a) => a.name === o);
|
|
2694
2732
|
n !== -1 && r.options.remotes.splice(n, 1);
|
|
2695
|
-
const s =
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
const a =
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2733
|
+
const s = j(N.__FEDERATION__.moduleInfo, ne(e)).key;
|
|
2734
|
+
delete N.__FEDERATION__.moduleInfo[s], "entry" in e && (r.snapshotHandler.manifestCache.delete(e.entry), delete Re.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);
|
|
2735
|
+
const { hostGlobalSnapshot: i } = Wt(e, r);
|
|
2736
|
+
if (i) {
|
|
2737
|
+
const a = i && "remotesInfo" in i && i.remotesInfo && j(i.remotesInfo, e.name).key;
|
|
2738
|
+
a && delete i.remotesInfo[a];
|
|
2739
|
+
}
|
|
2740
|
+
const c = r.moduleCache.get(e.name);
|
|
2741
|
+
if (c) {
|
|
2742
|
+
const a = c.remoteInfo, l = a.entryGlobalName;
|
|
2743
|
+
N[l] && ((t = Object.getOwnPropertyDescriptor(N, l)) != null && t.configurable ? delete N[l] : N[l] = void 0);
|
|
2744
|
+
const u = Me(c.remoteInfo);
|
|
2745
|
+
K[u] && delete K[u];
|
|
2746
|
+
let f = a.buildVersion ? tt(a.name, a.buildVersion) : a.name;
|
|
2747
|
+
const m = N.__FEDERATION__.__INSTANCES__.findIndex((h) => a.buildVersion ? h.options.id === f : h.name === f);
|
|
2748
|
+
if (m !== -1) {
|
|
2749
|
+
const h = N.__FEDERATION__.__INSTANCES__[m];
|
|
2750
|
+
f = h.options.id || f;
|
|
2751
|
+
const d = $t();
|
|
2752
|
+
let p = !0;
|
|
2753
|
+
const E = [];
|
|
2754
|
+
Object.keys(d).forEach((y) => {
|
|
2755
|
+
const R = d[y];
|
|
2756
|
+
R && Object.keys(R).forEach((g) => {
|
|
2757
|
+
const _ = R[g];
|
|
2758
|
+
_ && Object.keys(_).forEach((b) => {
|
|
2759
|
+
const $ = _[b];
|
|
2760
|
+
$ && Object.keys($).forEach((S) => {
|
|
2761
|
+
const I = $[S];
|
|
2762
|
+
I && typeof I == "object" && I.from === a.name && (I.loaded || I.loading ? (I.useIn = I.useIn.filter((k) => k !== a.name), I.useIn.length ? p = !1 : E.push([
|
|
2718
2763
|
y,
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
])) :
|
|
2764
|
+
g,
|
|
2765
|
+
b,
|
|
2766
|
+
S
|
|
2767
|
+
])) : E.push([
|
|
2723
2768
|
y,
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2769
|
+
g,
|
|
2770
|
+
b,
|
|
2771
|
+
S
|
|
2727
2772
|
]));
|
|
2728
2773
|
});
|
|
2729
2774
|
});
|
|
2730
2775
|
});
|
|
2731
|
-
}),
|
|
2732
|
-
var
|
|
2733
|
-
(
|
|
2734
|
-
}), N.__FEDERATION__.__INSTANCES__.splice(
|
|
2735
|
-
}
|
|
2736
|
-
const { hostGlobalSnapshot: f } = Bt(e, r);
|
|
2737
|
-
if (f) {
|
|
2738
|
-
const d = f && "remotesInfo" in f && f.remotesInfo && J(f.remotesInfo, e.name).key;
|
|
2739
|
-
d && (delete f.remotesInfo[d], re.__FEDERATION__.__MANIFEST_LOADING__[d] && delete re.__FEDERATION__.__MANIFEST_LOADING__[d]);
|
|
2776
|
+
}), p && (h.shareScopeMap = {}, delete d[f]), E.forEach(([y, R, g, _]) => {
|
|
2777
|
+
var b, $, S;
|
|
2778
|
+
(S = ($ = (b = d[y]) == null ? void 0 : b[R]) == null ? void 0 : $[g]) == null || delete S[_];
|
|
2779
|
+
}), N.__FEDERATION__.__INSTANCES__.splice(m, 1);
|
|
2740
2780
|
}
|
|
2741
2781
|
r.moduleCache.delete(e.name);
|
|
2742
2782
|
}
|
|
@@ -2745,46 +2785,46 @@ var Ao = class {
|
|
|
2745
2785
|
}
|
|
2746
2786
|
}
|
|
2747
2787
|
};
|
|
2748
|
-
const
|
|
2749
|
-
var
|
|
2788
|
+
const Wo = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
|
|
2789
|
+
var Vo = class {
|
|
2750
2790
|
constructor(e) {
|
|
2751
|
-
this.hooks = new
|
|
2752
|
-
beforeInit: new
|
|
2791
|
+
this.hooks = new Y({
|
|
2792
|
+
beforeInit: new X("beforeInit"),
|
|
2753
2793
|
init: new A(),
|
|
2754
|
-
beforeInitContainer: new
|
|
2755
|
-
initContainer: new
|
|
2756
|
-
}), this.version = "2.
|
|
2794
|
+
beforeInitContainer: new D("beforeInitContainer"),
|
|
2795
|
+
initContainer: new D("initContainer")
|
|
2796
|
+
}), this.version = "2.7.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new Y({
|
|
2757
2797
|
getModuleInfo: new A(),
|
|
2758
2798
|
createScript: new A(),
|
|
2759
2799
|
createLink: new A(),
|
|
2760
|
-
fetch: new
|
|
2761
|
-
loadEntryError: new
|
|
2762
|
-
afterLoadEntry: new
|
|
2763
|
-
beforeInitRemote: new
|
|
2764
|
-
afterInitRemote: new
|
|
2765
|
-
beforeGetExpose: new
|
|
2766
|
-
afterGetExpose: new
|
|
2767
|
-
beforeExecuteFactory: new
|
|
2768
|
-
afterExecuteFactory: new
|
|
2769
|
-
getModuleFactory: new
|
|
2770
|
-
}), this.bridgeHook = new
|
|
2800
|
+
fetch: new v(),
|
|
2801
|
+
loadEntryError: new v(),
|
|
2802
|
+
afterLoadEntry: new v("afterLoadEntry"),
|
|
2803
|
+
beforeInitRemote: new v("beforeInitRemote"),
|
|
2804
|
+
afterInitRemote: new v("afterInitRemote"),
|
|
2805
|
+
beforeGetExpose: new v("beforeGetExpose"),
|
|
2806
|
+
afterGetExpose: new v("afterGetExpose"),
|
|
2807
|
+
beforeExecuteFactory: new v("beforeExecuteFactory"),
|
|
2808
|
+
afterExecuteFactory: new v("afterExecuteFactory"),
|
|
2809
|
+
getModuleFactory: new v()
|
|
2810
|
+
}), this.bridgeHook = new Y({
|
|
2771
2811
|
beforeBridgeRender: new A(),
|
|
2772
2812
|
afterBridgeRender: new A(),
|
|
2773
2813
|
beforeBridgeDestroy: new A(),
|
|
2774
2814
|
afterBridgeDestroy: new A()
|
|
2775
2815
|
});
|
|
2776
|
-
const t =
|
|
2777
|
-
id:
|
|
2816
|
+
const t = Wo ? [Ho(), Go()] : [], r = {
|
|
2817
|
+
id: To(),
|
|
2778
2818
|
name: e.name,
|
|
2779
2819
|
plugins: t,
|
|
2780
2820
|
remotes: [],
|
|
2781
2821
|
shared: {},
|
|
2782
|
-
inBrowser:
|
|
2822
|
+
inBrowser: x
|
|
2783
2823
|
};
|
|
2784
|
-
this.name = e.name, this.options = r, this.snapshotHandler = new
|
|
2824
|
+
this.name = e.name, this.options = r, this.snapshotHandler = new Uo(this), this.sharedHandler = new Bo(this), this.remoteHandler = new jo(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2785
2825
|
}
|
|
2786
2826
|
initOptions(e) {
|
|
2787
|
-
e.name && e.name !== this.options.name &&
|
|
2827
|
+
e.name && e.name !== this.options.name && w(ht(kt, P)), this.registerPlugins(e.plugins);
|
|
2788
2828
|
const t = this.formatOptions(this.options, e);
|
|
2789
2829
|
return this.options = t, t;
|
|
2790
2830
|
}
|
|
@@ -2794,14 +2834,14 @@ var Mo = class {
|
|
|
2794
2834
|
loadShareSync(e, t) {
|
|
2795
2835
|
return this.sharedHandler.loadShareSync(e, t);
|
|
2796
2836
|
}
|
|
2797
|
-
initializeSharing(e =
|
|
2837
|
+
initializeSharing(e = ae, t) {
|
|
2798
2838
|
return this.sharedHandler.initializeSharing(e, t);
|
|
2799
2839
|
}
|
|
2800
2840
|
initRawContainer(e, t, r) {
|
|
2801
|
-
const o =
|
|
2841
|
+
const o = z({
|
|
2802
2842
|
name: e,
|
|
2803
2843
|
entry: t
|
|
2804
|
-
}), n = new
|
|
2844
|
+
}), n = new Gt({
|
|
2805
2845
|
host: this,
|
|
2806
2846
|
remoteInfo: o
|
|
2807
2847
|
});
|
|
@@ -2817,7 +2857,7 @@ var Mo = class {
|
|
|
2817
2857
|
this.sharedHandler.initShareScopeMap(e, t, r);
|
|
2818
2858
|
}
|
|
2819
2859
|
formatOptions(e, t) {
|
|
2820
|
-
const { allShareInfos: r } =
|
|
2860
|
+
const { allShareInfos: r } = wt(e, t), { userOptions: o, options: n } = this.hooks.lifecycle.beforeInit.emit({
|
|
2821
2861
|
origin: this,
|
|
2822
2862
|
userOptions: t,
|
|
2823
2863
|
options: e,
|
|
@@ -2840,7 +2880,7 @@ var Mo = class {
|
|
|
2840
2880
|
}), a;
|
|
2841
2881
|
}
|
|
2842
2882
|
registerPlugins(e) {
|
|
2843
|
-
const t =
|
|
2883
|
+
const t = Ao(e, this);
|
|
2844
2884
|
this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
|
|
2845
2885
|
}
|
|
2846
2886
|
registerRemotes(e, t) {
|
|
@@ -2853,12 +2893,12 @@ var Mo = class {
|
|
|
2853
2893
|
});
|
|
2854
2894
|
}
|
|
2855
2895
|
};
|
|
2856
|
-
let
|
|
2896
|
+
let qo = null;
|
|
2857
2897
|
function Vt(e) {
|
|
2858
|
-
return
|
|
2898
|
+
return qo;
|
|
2859
2899
|
}
|
|
2860
|
-
|
|
2861
|
-
function
|
|
2900
|
+
Cr(Vo);
|
|
2901
|
+
function qt(e, t) {
|
|
2862
2902
|
const r = (o) => {
|
|
2863
2903
|
if (!o.startsWith("/")) return o;
|
|
2864
2904
|
const n = o.length > 1 && o.endsWith("/"), s = `${t}/${o}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
@@ -2872,41 +2912,41 @@ function Wt(e, t) {
|
|
|
2872
2912
|
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 = {
|
|
2873
2913
|
...o.redirect,
|
|
2874
2914
|
path: r(o.redirect.path)
|
|
2875
|
-
}), o.children && o.children.length > 0 && (n.children =
|
|
2915
|
+
}), o.children && o.children.length > 0 && (n.children = qt(
|
|
2876
2916
|
o.children,
|
|
2877
2917
|
t
|
|
2878
2918
|
)), n;
|
|
2879
2919
|
});
|
|
2880
2920
|
}
|
|
2881
|
-
function
|
|
2921
|
+
function Ko(e) {
|
|
2882
2922
|
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;
|
|
2883
2923
|
return (s) => {
|
|
2884
2924
|
const i = s.push.bind(s), c = s.replace.bind(s), a = s.resolve.bind(s);
|
|
2885
2925
|
s.push = (l) => i(n(l)), s.replace = (l) => c(n(l)), s.resolve = (l, ...u) => a(n(l), ...u);
|
|
2886
2926
|
};
|
|
2887
2927
|
}
|
|
2888
|
-
function
|
|
2928
|
+
function zo(e) {
|
|
2889
2929
|
const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
|
|
2890
|
-
(h,
|
|
2930
|
+
(h, d) => h.path.split("/").filter((p) => p).length - d.path.split("/").filter((p) => p).length
|
|
2891
2931
|
), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
2892
2932
|
s.forEach((h) => {
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2933
|
+
const d = i.get(h.path) || [];
|
|
2934
|
+
d.push(h), i.set(h.path, d);
|
|
2895
2935
|
});
|
|
2896
|
-
const a = (h,
|
|
2936
|
+
const a = (h, d) => `${h}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (h, d = "") => {
|
|
2897
2937
|
if (!h.children || h.children.length === 0)
|
|
2898
2938
|
return h;
|
|
2899
2939
|
for (let p = 0; p < h.children.length; p++) {
|
|
2900
|
-
const
|
|
2901
|
-
(
|
|
2940
|
+
const E = h.children[p], y = a(d, E.path), g = (i.get(y) || []).find(
|
|
2941
|
+
(_) => !c.has(_) && _ !== h && (E.name == null || _.name === E.name)
|
|
2902
2942
|
);
|
|
2903
2943
|
if (g) {
|
|
2904
|
-
const
|
|
2944
|
+
const _ = {
|
|
2905
2945
|
...g,
|
|
2906
|
-
path:
|
|
2946
|
+
path: E.path
|
|
2907
2947
|
// Keep the original relative path from static route
|
|
2908
2948
|
};
|
|
2909
|
-
h.children[p] =
|
|
2949
|
+
h.children[p] = _, c.add(g), l(_, y);
|
|
2910
2950
|
}
|
|
2911
2951
|
}
|
|
2912
2952
|
return h;
|
|
@@ -2914,18 +2954,18 @@ function Fo(e) {
|
|
|
2914
2954
|
let u = [];
|
|
2915
2955
|
for (const h of s)
|
|
2916
2956
|
if (!c.has(h)) {
|
|
2917
|
-
const
|
|
2918
|
-
c.add(h), u.push(
|
|
2957
|
+
const d = l(h, h.path);
|
|
2958
|
+
c.add(h), u.push(d);
|
|
2919
2959
|
}
|
|
2920
|
-
let f,
|
|
2921
|
-
return o ? f =
|
|
2960
|
+
let f, m;
|
|
2961
|
+
return o ? f = fe.createMemoryHistory(r) : n ? (f = fe.createWebHashHistory(), r && (u = qt(u, r), m = Ko(r))) : f = fe.createWebHistory(r), { history: f, routes: u, patchRouter: m };
|
|
2922
2962
|
}
|
|
2923
|
-
function
|
|
2963
|
+
function en(e) {
|
|
2924
2964
|
const t = /* @__PURE__ */ new Map(), r = Vt();
|
|
2925
2965
|
return () => ({
|
|
2926
|
-
__APP_VERSION__: "2.
|
|
2966
|
+
__APP_VERSION__: "2.7.0",
|
|
2927
2967
|
async render(o) {
|
|
2928
|
-
var
|
|
2968
|
+
var d, p, E, y, R, g;
|
|
2929
2969
|
C.debug("createBridgeComponent render Info", o);
|
|
2930
2970
|
const {
|
|
2931
2971
|
moduleName: n,
|
|
@@ -2934,33 +2974,33 @@ function Bo(e) {
|
|
|
2934
2974
|
memoryRoute: c,
|
|
2935
2975
|
hashRoute: a,
|
|
2936
2976
|
...l
|
|
2937
|
-
} = o, u =
|
|
2977
|
+
} = o, u = Kt.createApp(e.rootComponent, l);
|
|
2938
2978
|
t.set(s, u);
|
|
2939
|
-
const f = await ((
|
|
2979
|
+
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({
|
|
2940
2980
|
app: u,
|
|
2941
2981
|
basename: i,
|
|
2942
2982
|
memoryRoute: c,
|
|
2943
2983
|
hashRoute: a,
|
|
2944
2984
|
...l,
|
|
2945
|
-
...
|
|
2985
|
+
...m
|
|
2946
2986
|
});
|
|
2947
2987
|
if (h != null && h.router) {
|
|
2948
|
-
const { history:
|
|
2988
|
+
const { history: _, routes: b, patchRouter: $ } = zo({
|
|
2949
2989
|
router: h.router,
|
|
2950
2990
|
basename: o.basename,
|
|
2951
2991
|
memoryRoute: o.memoryRoute,
|
|
2952
2992
|
hashRoute: o.hashRoute
|
|
2953
|
-
}), S =
|
|
2993
|
+
}), S = fe.createRouter({
|
|
2954
2994
|
...h.router.options,
|
|
2955
|
-
history:
|
|
2956
|
-
routes:
|
|
2995
|
+
history: _,
|
|
2996
|
+
routes: b
|
|
2957
2997
|
});
|
|
2958
2998
|
$ && $(S), h.afterRouterCreate && h.afterRouterCreate(S), C.debug("createBridgeComponent render router info>>>", {
|
|
2959
2999
|
moduleName: n,
|
|
2960
3000
|
router: S
|
|
2961
3001
|
}), c && await S.push(c.entryPath), u.use(S);
|
|
2962
3002
|
}
|
|
2963
|
-
u.mount(s), (g = (
|
|
3003
|
+
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);
|
|
2964
3004
|
},
|
|
2965
3005
|
destroy(o) {
|
|
2966
3006
|
var s, i, c, a, l, u;
|
|
@@ -2970,11 +3010,11 @@ function Bo(e) {
|
|
|
2970
3010
|
}
|
|
2971
3011
|
});
|
|
2972
3012
|
}
|
|
2973
|
-
function
|
|
3013
|
+
function Jo() {
|
|
2974
3014
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
2975
3015
|
window.dispatchEvent(e);
|
|
2976
3016
|
}
|
|
2977
|
-
const
|
|
3017
|
+
const Xo = /* @__PURE__ */ zt({
|
|
2978
3018
|
name: "RemoteApp",
|
|
2979
3019
|
props: {
|
|
2980
3020
|
moduleName: String,
|
|
@@ -2986,59 +3026,67 @@ const Do = /* @__PURE__ */ qt({
|
|
|
2986
3026
|
},
|
|
2987
3027
|
inheritAttrs: !1,
|
|
2988
3028
|
setup(e) {
|
|
2989
|
-
const t =
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
3029
|
+
const t = W(null), r = W(null), o = W(""), n = W(!1), s = W(!1), i = W(!1), c = Ze(), a = Vt(), l = Jt(), u = () => ({
|
|
3030
|
+
name: e.moduleName,
|
|
3031
|
+
dom: t.value,
|
|
3032
|
+
basename: e.basename,
|
|
3033
|
+
memoryRoute: e.memoryRoute,
|
|
3034
|
+
hashRoute: e.hashRoute
|
|
3035
|
+
}), f = async () => {
|
|
3036
|
+
var y, R, g, _, b, $, S;
|
|
3037
|
+
if (!t.value || n.value)
|
|
3038
|
+
return;
|
|
3039
|
+
const d = (y = e.providerInfo) == null ? void 0 : y.call(e);
|
|
3040
|
+
r.value = d;
|
|
3041
|
+
let p = {
|
|
3042
|
+
...l,
|
|
2995
3043
|
moduleName: e.moduleName,
|
|
2996
3044
|
dom: t.value,
|
|
2997
3045
|
basename: e.basename,
|
|
2998
3046
|
memoryRoute: e.memoryRoute,
|
|
2999
3047
|
hashRoute: e.hashRoute
|
|
3000
3048
|
};
|
|
3001
|
-
C.debug("createRemoteAppComponent LazyComponent render >>>",
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3004
|
-
...
|
|
3005
|
-
...
|
|
3006
|
-
},
|
|
3007
|
-
},
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
});
|
|
3013
|
-
return Jt(() => {
|
|
3014
|
-
c();
|
|
3015
|
-
}), Xt(() => {
|
|
3016
|
-
var l, u, f, d, h, m, p;
|
|
3049
|
+
C.debug("createRemoteAppComponent LazyComponent render >>>", p);
|
|
3050
|
+
const E = await ((_ = (g = (R = a == null ? void 0 : a.bridgeHook) == null ? void 0 : R.lifecycle) == null ? void 0 : g.beforeBridgeRender) == null ? void 0 : _.emit(p)) || {};
|
|
3051
|
+
p = {
|
|
3052
|
+
...p,
|
|
3053
|
+
...E.extraProps
|
|
3054
|
+
}, d.render(p), n.value = !0, (S = ($ = (b = a == null ? void 0 : a.bridgeHook) == null ? void 0 : b.lifecycle) == null ? void 0 : $.afterBridgeRender) == null || S.emit(p);
|
|
3055
|
+
}, m = () => {
|
|
3056
|
+
var E, y, R, g, _, b;
|
|
3057
|
+
const d = r.value;
|
|
3058
|
+
if (!d || !n.value)
|
|
3059
|
+
return;
|
|
3017
3060
|
C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
|
|
3018
3061
|
...e
|
|
3019
|
-
}), a(), (f = (u = (l = s == null ? void 0 : s.bridgeHook) == null ? void 0 : l.lifecycle) == null ? void 0 : u.beforeBridgeDestroy) == null || f.emit({
|
|
3020
|
-
name: e.moduleName,
|
|
3021
|
-
dom: t.value,
|
|
3022
|
-
basename: e.basename,
|
|
3023
|
-
memoryRoute: e.memoryRoute,
|
|
3024
|
-
hashRoute: e.hashRoute
|
|
3025
|
-
}), (d = r.value) == null || d.destroy({
|
|
3026
|
-
dom: t.value
|
|
3027
|
-
}), (p = (m = (h = s == null ? void 0 : s.bridgeHook) == null ? void 0 : h.lifecycle) == null ? void 0 : m.afterBridgeDestroy) == null || p.emit({
|
|
3028
|
-
name: e.moduleName,
|
|
3029
|
-
dom: t.value,
|
|
3030
|
-
basename: e.basename,
|
|
3031
|
-
memoryRoute: e.memoryRoute,
|
|
3032
|
-
hashRoute: e.hashRoute
|
|
3033
3062
|
});
|
|
3034
|
-
|
|
3063
|
+
const p = u();
|
|
3064
|
+
(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({
|
|
3065
|
+
dom: t.value
|
|
3066
|
+
}), 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);
|
|
3067
|
+
}, h = Xt(() => c == null ? void 0 : c.path, (d) => {
|
|
3068
|
+
s.value && o.value !== "" && o.value !== d && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
3069
|
+
...e,
|
|
3070
|
+
pathname: c.path
|
|
3071
|
+
}), Jo()), o.value = d;
|
|
3072
|
+
});
|
|
3073
|
+
return Yt(() => {
|
|
3074
|
+
s.value = !0, f();
|
|
3075
|
+
}), Zt(async () => {
|
|
3076
|
+
s.value = !0, i.value && (i.value = !1, await Qt(), f());
|
|
3077
|
+
}), er(() => {
|
|
3078
|
+
s.value = !1, i.value = !0, m();
|
|
3079
|
+
}), tr(() => {
|
|
3080
|
+
h(), m();
|
|
3081
|
+
}), () => rr("div", or(e.rootAttrs || {}, {
|
|
3035
3082
|
ref: t
|
|
3036
3083
|
}), null);
|
|
3037
3084
|
}
|
|
3038
3085
|
});
|
|
3039
|
-
function
|
|
3040
|
-
return
|
|
3041
|
-
|
|
3086
|
+
function Yo(e) {
|
|
3087
|
+
return nr({
|
|
3088
|
+
// @ts-ignore
|
|
3089
|
+
__APP_VERSION__: "2.7.0",
|
|
3042
3090
|
...e.asyncComponentOptions,
|
|
3043
3091
|
//@ts-ignore
|
|
3044
3092
|
loader: async () => {
|
|
@@ -3062,7 +3110,7 @@ function xo(e) {
|
|
|
3062
3110
|
), n in s && typeof c == "function")
|
|
3063
3111
|
return {
|
|
3064
3112
|
render() {
|
|
3065
|
-
return
|
|
3113
|
+
return sr(Xo, {
|
|
3066
3114
|
moduleName: i,
|
|
3067
3115
|
providerInfo: c,
|
|
3068
3116
|
basename: r,
|
|
@@ -3076,13 +3124,13 @@ function xo(e) {
|
|
|
3076
3124
|
}
|
|
3077
3125
|
});
|
|
3078
3126
|
}
|
|
3079
|
-
function
|
|
3127
|
+
function tn(e) {
|
|
3080
3128
|
return C.warn(
|
|
3081
3129
|
"createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
3082
|
-
),
|
|
3130
|
+
), Yo(e);
|
|
3083
3131
|
}
|
|
3084
3132
|
export {
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3133
|
+
en as createBridgeComponent,
|
|
3134
|
+
Yo as createRemoteAppComponent,
|
|
3135
|
+
tn as createRemoteComponent
|
|
3088
3136
|
};
|