@module-federation/bridge-vue3 2.1.0 → 2.2.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/CHANGELOG.md +11 -2
- package/dist/index.cjs +6 -6
- package/dist/index.js +808 -748
- package/package.json +4 -5
- package/project.json +0 -15
package/dist/index.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { defineComponent as
|
|
1
|
+
import * as Ft from "vue";
|
|
2
|
+
import { defineComponent as Ht, ref as Ee, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Vt, createVNode as Bt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
|
|
3
3
|
import * as ae from "vue-router";
|
|
4
4
|
import { useRoute as Ke } from "vue-router";
|
|
5
|
-
const
|
|
5
|
+
const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
|
|
6
6
|
let $e = /* @__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
|
-
|
|
10
|
-
|
|
9
|
+
const F = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
10
|
+
function ze() {
|
|
11
|
+
return F;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function Je() {
|
|
13
14
|
return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function Xt() {
|
|
16
17
|
try {
|
|
17
|
-
if (
|
|
18
|
+
if (ze() && window.localStorage) return !!localStorage.getItem(zt);
|
|
18
19
|
} catch {
|
|
19
20
|
return !1;
|
|
20
21
|
}
|
|
21
22
|
return !1;
|
|
22
23
|
}
|
|
23
24
|
function we() {
|
|
24
|
-
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 :
|
|
25
|
+
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : Xt();
|
|
25
26
|
}
|
|
26
|
-
const
|
|
27
|
-
return e.length ? e.reduce((t, r) => r ? t ? `${t}${
|
|
28
|
-
},
|
|
27
|
+
const Yt = "[ Federation Runtime ]", Xe = function(...e) {
|
|
28
|
+
return e.length ? e.reduce((t, r) => r ? t ? `${t}${Jt}${r}` : r : t, "") : "";
|
|
29
|
+
}, Ne = (e, t) => {
|
|
29
30
|
if ("getPublicPath" in e) {
|
|
30
31
|
let r;
|
|
31
32
|
return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
|
|
32
|
-
} else return "publicPath" in e ? !
|
|
33
|
-
},
|
|
34
|
-
console.warn(`${
|
|
33
|
+
} else return "publicPath" in e ? !ze() && !Je() && "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
|
+
}, Ye = (e) => {
|
|
35
|
+
console.warn(`${Yt}: ${e}`);
|
|
35
36
|
};
|
|
36
|
-
function
|
|
37
|
+
function Ze(e) {
|
|
37
38
|
try {
|
|
38
39
|
return JSON.stringify(e, null, 2);
|
|
39
40
|
} catch {
|
|
@@ -53,36 +54,36 @@ const ne = (e, t) => {
|
|
|
53
54
|
})(e);
|
|
54
55
|
return n ? n.endsWith("/") ? `${n}${t}` : `${n}/${t}` : t;
|
|
55
56
|
};
|
|
56
|
-
function
|
|
57
|
+
function Zt(e) {
|
|
57
58
|
return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
var g, b,
|
|
60
|
+
function Qt(e, t = {}) {
|
|
61
|
+
var g, b, N;
|
|
61
62
|
const { remotes: r = {}, overrides: n = {}, version: o } = t;
|
|
62
63
|
let s;
|
|
63
|
-
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ?
|
|
64
|
-
let
|
|
65
|
-
Object.keys(r).length || (
|
|
64
|
+
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Zt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
|
|
65
|
+
let l = {};
|
|
66
|
+
Object.keys(r).length || (l = ((g = e.remotes) == null ? void 0 : g.reduce((_, $) => {
|
|
66
67
|
let R;
|
|
67
|
-
const
|
|
68
|
-
return a.includes(
|
|
69
|
-
}, {})) || {}), Object.keys(r).forEach((_) =>
|
|
70
|
-
const { remoteEntry: { path:
|
|
68
|
+
const w = $.federationContainerName;
|
|
69
|
+
return a.includes(w) ? R = n[w] : "version" in $ ? R = $.version : R = $.entry, _[w] = { matchedVersion: R }, _;
|
|
70
|
+
}, {})) || {}), Object.keys(r).forEach((_) => l[_] = { matchedVersion: a.includes(_) ? n[_] : r[_] });
|
|
71
|
+
const { remoteEntry: { path: c, name: f, type: h }, types: u = {
|
|
71
72
|
path: "",
|
|
72
73
|
name: "",
|
|
73
74
|
zip: "",
|
|
74
75
|
api: ""
|
|
75
|
-
}, buildInfo: { buildVersion:
|
|
76
|
-
let
|
|
76
|
+
}, buildInfo: { buildVersion: d }, globalName: m, ssrRemoteEntry: y } = e.metaData, { exposes: E } = e;
|
|
77
|
+
let p = {
|
|
77
78
|
version: o || "",
|
|
78
|
-
buildVersion:
|
|
79
|
-
globalName:
|
|
80
|
-
remoteEntry: ne(
|
|
81
|
-
remoteEntryType:
|
|
79
|
+
buildVersion: d,
|
|
80
|
+
globalName: m,
|
|
81
|
+
remoteEntry: ne(c, f),
|
|
82
|
+
remoteEntryType: h,
|
|
82
83
|
remoteTypes: ne(u.path, u.name),
|
|
83
84
|
remoteTypesZip: u.zip || "",
|
|
84
85
|
remoteTypesAPI: u.api || "",
|
|
85
|
-
remotesInfo:
|
|
86
|
+
remotesInfo: l,
|
|
86
87
|
shared: e == null ? void 0 : e.shared.map((_) => ({
|
|
87
88
|
assets: _.assets,
|
|
88
89
|
sharedName: _.name,
|
|
@@ -97,24 +98,24 @@ function Xt(e, t = {}) {
|
|
|
97
98
|
};
|
|
98
99
|
if ((b = e.metaData) != null && b.prefetchInterface) {
|
|
99
100
|
const _ = e.metaData.prefetchInterface;
|
|
100
|
-
|
|
101
|
-
...
|
|
101
|
+
p = {
|
|
102
|
+
...p,
|
|
102
103
|
prefetchInterface: _
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
|
-
if ((
|
|
106
|
-
const { path: _, name:
|
|
107
|
-
|
|
108
|
-
...
|
|
109
|
-
prefetchEntry: ne(_,
|
|
106
|
+
if ((N = e.metaData) != null && N.prefetchEntry) {
|
|
107
|
+
const { path: _, name: $, type: R } = e.metaData.prefetchEntry;
|
|
108
|
+
p = {
|
|
109
|
+
...p,
|
|
110
|
+
prefetchEntry: ne(_, $),
|
|
110
111
|
prefetchEntryType: R
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
if ("publicPath" in e.metaData ? (s = {
|
|
114
|
-
...
|
|
115
|
+
...p,
|
|
115
116
|
publicPath: i()
|
|
116
117
|
}, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
|
|
117
|
-
...
|
|
118
|
+
...p,
|
|
118
119
|
getPublicPath: i()
|
|
119
120
|
}, y) {
|
|
120
121
|
const _ = ne(y.path, y.name);
|
|
@@ -122,10 +123,10 @@ function Xt(e, t = {}) {
|
|
|
122
123
|
}
|
|
123
124
|
return s;
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
return !!("remoteEntry" in e && e.remoteEntry.includes(
|
|
126
|
+
function Qe(e) {
|
|
127
|
+
return !!("remoteEntry" in e && e.remoteEntry.includes(Kt));
|
|
127
128
|
}
|
|
128
|
-
const
|
|
129
|
+
const er = "[ Module Federation ]", J = console, tr = [
|
|
129
130
|
"logger.ts",
|
|
130
131
|
"logger.js",
|
|
131
132
|
"captureStackTrace",
|
|
@@ -136,12 +137,12 @@ const Yt = "[ Module Federation ]", J = console, Zt = [
|
|
|
136
137
|
"Logger.error",
|
|
137
138
|
"Logger.debug"
|
|
138
139
|
];
|
|
139
|
-
function
|
|
140
|
+
function rr() {
|
|
140
141
|
try {
|
|
141
142
|
const e = (/* @__PURE__ */ new Error()).stack;
|
|
142
143
|
if (!e) return;
|
|
143
144
|
const [, ...t] = e.split(`
|
|
144
|
-
`), r = t.filter((n) => !
|
|
145
|
+
`), r = t.filter((n) => !tr.some((o) => n.includes(o)));
|
|
145
146
|
return r.length ? `Stack trace:
|
|
146
147
|
${r.slice(0, 5).join(`
|
|
147
148
|
`)}` : void 0;
|
|
@@ -149,7 +150,7 @@ ${r.slice(0, 5).join(`
|
|
|
149
150
|
return;
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
var
|
|
153
|
+
var et = class {
|
|
153
154
|
constructor(e, t = J) {
|
|
154
155
|
this.prefix = e, this.delegate = t ?? J;
|
|
155
156
|
}
|
|
@@ -160,7 +161,7 @@ var Ze = class {
|
|
|
160
161
|
this.delegate = e ?? J;
|
|
161
162
|
}
|
|
162
163
|
emit(e, t) {
|
|
163
|
-
const r = this.delegate, n = we() ?
|
|
164
|
+
const r = this.delegate, n = we() ? rr() : void 0, o = n ? [...t, n] : t, s = (() => {
|
|
164
165
|
switch (e) {
|
|
165
166
|
case "log":
|
|
166
167
|
return ["log", "info"];
|
|
@@ -219,68 +220,79 @@ var Ze = class {
|
|
|
219
220
|
we() && this.emit("debug", e);
|
|
220
221
|
}
|
|
221
222
|
};
|
|
222
|
-
function
|
|
223
|
-
return new
|
|
223
|
+
function tt(e) {
|
|
224
|
+
return new et(e);
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
-
const t = new
|
|
226
|
+
function nr(e) {
|
|
227
|
+
const t = new et(e);
|
|
227
228
|
return Object.defineProperty(t, "__mf_infrastructure_logger__", {
|
|
228
229
|
value: !0,
|
|
229
230
|
enumerable: !1,
|
|
230
231
|
configurable: !1
|
|
231
232
|
}), t;
|
|
232
233
|
}
|
|
233
|
-
er
|
|
234
|
-
async function
|
|
234
|
+
nr(er);
|
|
235
|
+
async function rt(e, t) {
|
|
235
236
|
try {
|
|
236
237
|
return await e();
|
|
237
238
|
} catch (r) {
|
|
238
|
-
|
|
239
|
+
Ye(r);
|
|
239
240
|
return;
|
|
240
241
|
}
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
+
function Ie(e, t) {
|
|
243
244
|
const r = /^(https?:)?\/\//i;
|
|
244
245
|
return e.replace(r, "").replace(/\/$/, "") === t.replace(r, "").replace(/\/$/, "");
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
+
function nt(e) {
|
|
247
248
|
let t = null, r = !0, n = 2e4, o;
|
|
248
249
|
const s = document.getElementsByTagName("script");
|
|
249
|
-
for (let
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
252
|
-
t =
|
|
250
|
+
for (let c = 0; c < s.length; c++) {
|
|
251
|
+
const f = s[c], h = f.getAttribute("src");
|
|
252
|
+
if (h && Ie(h, e.url)) {
|
|
253
|
+
t = f, r = !1;
|
|
253
254
|
break;
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
if (!t) {
|
|
257
|
-
const
|
|
258
|
-
t = document.createElement("script"), t.type = (
|
|
259
|
-
let
|
|
260
|
-
e.createScriptHook && (
|
|
261
|
-
t && (
|
|
258
|
+
const c = e.attrs;
|
|
259
|
+
t = document.createElement("script"), t.type = (c == null ? void 0 : c.type) === "module" ? "module" : "text/javascript";
|
|
260
|
+
let f;
|
|
261
|
+
e.createScriptHook && (f = e.createScriptHook(e.url, e.attrs), f instanceof HTMLScriptElement ? t = f : typeof f == "object" && ("script" in f && f.script && (t = f.script), "timeout" in f && f.timeout && (n = f.timeout))), t.src || (t.src = e.url), c && !f && Object.keys(c).forEach((h) => {
|
|
262
|
+
t && (h === "async" || h === "defer" ? t[h] = c[h] : t.getAttribute(h) || t.setAttribute(h, c[h]));
|
|
262
263
|
});
|
|
263
264
|
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
let i = null;
|
|
266
|
+
const a = typeof window < "u" ? (c) => {
|
|
267
|
+
if (c.filename && Ie(c.filename, e.url)) {
|
|
268
|
+
const f = /* @__PURE__ */ new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);
|
|
269
|
+
f.name = "ScriptExecutionError", i = f;
|
|
270
|
+
}
|
|
271
|
+
} : null;
|
|
272
|
+
a && window.addEventListener("error", a);
|
|
273
|
+
const l = async (c, f) => {
|
|
274
|
+
clearTimeout(o), a && window.removeEventListener("error", a);
|
|
275
|
+
const h = () => {
|
|
276
|
+
if ((f == null ? void 0 : f.type) === "error") {
|
|
277
|
+
const u = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
|
|
278
|
+
u.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(u));
|
|
279
|
+
} else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
|
|
268
280
|
};
|
|
269
|
-
if (t && (t.onerror = null, t.onload = null,
|
|
270
|
-
const { needDeleteScript:
|
|
271
|
-
|
|
272
|
-
}),
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
const d = await
|
|
276
|
-
return
|
|
281
|
+
if (t && (t.onerror = null, t.onload = null, rt(() => {
|
|
282
|
+
const { needDeleteScript: u = !0 } = e;
|
|
283
|
+
u && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
284
|
+
}), c && typeof c == "function")) {
|
|
285
|
+
const u = c(f);
|
|
286
|
+
if (u instanceof Promise) {
|
|
287
|
+
const d = await u;
|
|
288
|
+
return h(), d;
|
|
277
289
|
}
|
|
278
|
-
return
|
|
290
|
+
return h(), u;
|
|
279
291
|
}
|
|
280
|
-
|
|
292
|
+
h();
|
|
281
293
|
};
|
|
282
|
-
return t.onerror =
|
|
283
|
-
|
|
294
|
+
return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), o = setTimeout(() => {
|
|
295
|
+
l(null, /* @__PURE__ */ new Error(`Remote script "${e.url}" time-outed.`));
|
|
284
296
|
}, n), {
|
|
285
297
|
script: t,
|
|
286
298
|
needAttach: r
|
|
@@ -290,8 +302,8 @@ function ge(e) {
|
|
|
290
302
|
let t = null, r = !0;
|
|
291
303
|
const n = document.getElementsByTagName("link");
|
|
292
304
|
for (let s = 0; s < n.length; s++) {
|
|
293
|
-
const i = n[s], a = i.getAttribute("href"),
|
|
294
|
-
if (a &&
|
|
305
|
+
const i = n[s], a = i.getAttribute("href"), l = i.getAttribute("rel");
|
|
306
|
+
if (a && Ie(a, e.url) && l === e.attrs.rel) {
|
|
295
307
|
t = i, r = !1;
|
|
296
308
|
break;
|
|
297
309
|
}
|
|
@@ -308,12 +320,12 @@ function ge(e) {
|
|
|
308
320
|
const a = () => {
|
|
309
321
|
(i == null ? void 0 : i.type) === "error" ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
|
|
310
322
|
};
|
|
311
|
-
if (t && (t.onerror = null, t.onload = null,
|
|
312
|
-
const { needDeleteLink:
|
|
313
|
-
|
|
323
|
+
if (t && (t.onerror = null, t.onload = null, rt(() => {
|
|
324
|
+
const { needDeleteLink: l = !0 } = e;
|
|
325
|
+
l && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
314
326
|
}), s)) {
|
|
315
|
-
const
|
|
316
|
-
return a(),
|
|
327
|
+
const l = s(i);
|
|
328
|
+
return a(), l;
|
|
317
329
|
}
|
|
318
330
|
a();
|
|
319
331
|
};
|
|
@@ -322,10 +334,10 @@ function ge(e) {
|
|
|
322
334
|
needAttach: r
|
|
323
335
|
};
|
|
324
336
|
}
|
|
325
|
-
function
|
|
337
|
+
function or(e, t) {
|
|
326
338
|
const { attrs: r = {}, createScriptHook: n } = t;
|
|
327
339
|
return new Promise((o, s) => {
|
|
328
|
-
const { script: i, needAttach: a } =
|
|
340
|
+
const { script: i, needAttach: a } = nt({
|
|
329
341
|
url: e,
|
|
330
342
|
cb: o,
|
|
331
343
|
onErrorCallback: s,
|
|
@@ -340,7 +352,7 @@ function tr(e, t) {
|
|
|
340
352
|
});
|
|
341
353
|
}
|
|
342
354
|
const oe = /* @__PURE__ */ new Map();
|
|
343
|
-
function
|
|
355
|
+
function V(e) {
|
|
344
356
|
if (!e) throw new Error("import specifier is required");
|
|
345
357
|
if (oe.has(e)) return oe.get(e);
|
|
346
358
|
const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
|
|
@@ -348,13 +360,13 @@ function B(e) {
|
|
|
348
360
|
});
|
|
349
361
|
return oe.set(e, t), t;
|
|
350
362
|
}
|
|
351
|
-
const
|
|
352
|
-
const e = await
|
|
363
|
+
const ot = async () => {
|
|
364
|
+
const e = await V("node-fetch");
|
|
353
365
|
return e.default || e;
|
|
354
|
-
},
|
|
366
|
+
}, sr = async (e, t, r) => {
|
|
355
367
|
const o = await ((s, i) => r.lifecycle.fetch.emit(s, i))(e, t || {});
|
|
356
|
-
return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await
|
|
357
|
-
},
|
|
368
|
+
return !o || !(o instanceof Response) ? (typeof fetch > "u" ? await ot() : fetch)(e, t || {}) : o;
|
|
369
|
+
}, ir = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t, r, n) => {
|
|
358
370
|
if (n != null && n.createScriptHook) {
|
|
359
371
|
const a = n.createScriptHook(e);
|
|
360
372
|
a && typeof a == "object" && "url" in a && (e = a.url);
|
|
@@ -366,20 +378,20 @@ const nt = async () => {
|
|
|
366
378
|
console.error("Error constructing URL:", a), t(/* @__PURE__ */ new Error(`Invalid URL: ${a}`));
|
|
367
379
|
return;
|
|
368
380
|
}
|
|
369
|
-
const s = async () => n != null && n.fetch ? (a,
|
|
370
|
-
var
|
|
381
|
+
const s = async () => n != null && n.fetch ? (a, l) => sr(a, l, n) : typeof fetch > "u" ? ot() : fetch, i = async (a, l) => {
|
|
382
|
+
var c;
|
|
371
383
|
try {
|
|
372
|
-
const
|
|
384
|
+
const h = await (await a(l.href)).text(), [u, d] = await Promise.all([V("path"), V("vm")]), m = {
|
|
373
385
|
exports: {},
|
|
374
386
|
module: { exports: {} }
|
|
375
|
-
}, y =
|
|
387
|
+
}, y = l.pathname.split("/").slice(0, -1).join("/"), E = u.basename(l.pathname), p = new d.Script(`(function(exports, module, require, __dirname, __filename) {${h}
|
|
376
388
|
})`, {
|
|
377
389
|
filename: E,
|
|
378
|
-
importModuleDynamically: ((
|
|
390
|
+
importModuleDynamically: ((c = d.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? V
|
|
379
391
|
});
|
|
380
392
|
let g;
|
|
381
|
-
g = (await
|
|
382
|
-
const b =
|
|
393
|
+
g = (await V("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : u.join(process.cwd(), "__mf_require_base__.js")), p.runInThisContext()(m.exports, m.module, g, y, E);
|
|
394
|
+
const b = m.module.exports || m.exports;
|
|
383
395
|
if (r && b && r.globalName) {
|
|
384
396
|
t(void 0, b[r.globalName] || b);
|
|
385
397
|
return;
|
|
@@ -390,13 +402,13 @@ const nt = async () => {
|
|
|
390
402
|
}
|
|
391
403
|
};
|
|
392
404
|
s().then(async (a) => {
|
|
393
|
-
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return
|
|
405
|
+
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return Te(o.href, {
|
|
394
406
|
fetch: a,
|
|
395
|
-
vm: await
|
|
396
|
-
}).then(async (
|
|
397
|
-
await
|
|
398
|
-
}).catch((
|
|
399
|
-
t(
|
|
407
|
+
vm: await V("vm")
|
|
408
|
+
}).then(async (l) => {
|
|
409
|
+
await l.evaluate(), t(void 0, l.namespace);
|
|
410
|
+
}).catch((l) => {
|
|
411
|
+
t(l instanceof Error ? l : /* @__PURE__ */ new Error(`Script execution error: ${l}`));
|
|
400
412
|
});
|
|
401
413
|
i(a, o);
|
|
402
414
|
}).catch((a) => {
|
|
@@ -404,68 +416,81 @@ const nt = async () => {
|
|
|
404
416
|
});
|
|
405
417
|
} : (e, t, r, n) => {
|
|
406
418
|
t(/* @__PURE__ */ new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
407
|
-
},
|
|
408
|
-
|
|
419
|
+
}, ar = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (e, t) => new Promise((r, n) => {
|
|
420
|
+
ir(e, (o, s) => {
|
|
409
421
|
var i, a;
|
|
410
422
|
if (o) n(o);
|
|
411
423
|
else {
|
|
412
|
-
const
|
|
413
|
-
r(globalThis[
|
|
424
|
+
const l = ((i = t == null ? void 0 : t.attrs) == null ? void 0 : i.globalName) || `__FEDERATION_${(a = t == null ? void 0 : t.attrs) == null ? void 0 : a.name}:custom__`;
|
|
425
|
+
r(globalThis[l] = s);
|
|
414
426
|
}
|
|
415
427
|
}, t.attrs, t.loaderHook);
|
|
416
428
|
}) : (e, t) => {
|
|
417
429
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
418
430
|
}, _e = /* @__PURE__ */ new Map();
|
|
419
|
-
async function
|
|
431
|
+
async function Te(e, t) {
|
|
420
432
|
if (_e.has(e)) return _e.get(e);
|
|
421
433
|
const { fetch: r, vm: n } = t, o = await (await r(e)).text(), s = new n.SourceTextModule(o, { importModuleDynamically: async (i, a) => {
|
|
422
|
-
const
|
|
423
|
-
return
|
|
434
|
+
const l = new URL(i, e).href;
|
|
435
|
+
return Te(l, t);
|
|
424
436
|
} });
|
|
425
437
|
return _e.set(e, s), await s.link(async (i) => {
|
|
426
438
|
const a = new URL(i, e).href;
|
|
427
|
-
return await
|
|
439
|
+
return await Te(a, t);
|
|
428
440
|
}), s;
|
|
429
441
|
}
|
|
430
|
-
const C =
|
|
431
|
-
|
|
432
|
-
e
|
|
442
|
+
const C = tt("[ Module Federation Bridge Vue3 ]"), cr = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, st = (e, t, r, n) => {
|
|
443
|
+
const o = [`${[t[e]]} #${e}`];
|
|
444
|
+
return r && o.push(`args: ${JSON.stringify(r)}`), o.push(cr(e)), n && o.push(`Original Error Message:
|
|
445
|
+
${n}`), o.join(`
|
|
446
|
+
`);
|
|
447
|
+
};
|
|
448
|
+
function lr(e, t, r, n, o, s) {
|
|
449
|
+
return n(st(e, t, r, o));
|
|
433
450
|
}
|
|
434
|
-
|
|
435
|
-
|
|
451
|
+
const H = "[ Federation Runtime ]", ve = tt(H);
|
|
452
|
+
function P(e, t, r, n, o) {
|
|
453
|
+
e || S(t);
|
|
436
454
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
455
|
+
function S(e, t, r, n, o) {
|
|
456
|
+
if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
|
|
457
|
+
throw new Error(`${H}: ${i}`);
|
|
458
|
+
}, n);
|
|
459
|
+
const s = e;
|
|
460
|
+
throw s instanceof Error ? (s.message.startsWith(H) || (s.message = `${H}: ${s.message}`), s) : new Error(`${H}: ${s}`);
|
|
439
461
|
}
|
|
440
|
-
function
|
|
462
|
+
function Oe(e) {
|
|
463
|
+
e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)), ve.warn(e);
|
|
464
|
+
}
|
|
465
|
+
function ur(e, t) {
|
|
441
466
|
return e.findIndex((r) => r === t) === -1 && e.push(t), e;
|
|
442
467
|
}
|
|
443
468
|
function Z(e) {
|
|
444
469
|
return "version" in e && e.version ? `${e.name}:${e.version}` : "entry" in e && e.entry ? `${e.name}:${e.entry}` : `${e.name}`;
|
|
445
470
|
}
|
|
446
|
-
function
|
|
471
|
+
function Le(e) {
|
|
447
472
|
return typeof e.entry < "u";
|
|
448
473
|
}
|
|
449
|
-
function
|
|
474
|
+
function it(e) {
|
|
450
475
|
return !e.entry.includes(".json");
|
|
451
476
|
}
|
|
452
|
-
function
|
|
477
|
+
function Me(e) {
|
|
453
478
|
return e && typeof e == "object";
|
|
454
479
|
}
|
|
455
|
-
const
|
|
456
|
-
function
|
|
457
|
-
return
|
|
480
|
+
const fr = Object.prototype.toString;
|
|
481
|
+
function hr(e) {
|
|
482
|
+
return fr.call(e) === "[object Object]";
|
|
458
483
|
}
|
|
459
|
-
function
|
|
484
|
+
function at(e) {
|
|
460
485
|
return Array.isArray(e) ? e : [e];
|
|
461
486
|
}
|
|
462
|
-
function
|
|
487
|
+
function ct(e) {
|
|
463
488
|
const t = {
|
|
464
489
|
url: "",
|
|
465
490
|
type: "global",
|
|
466
491
|
globalName: ""
|
|
467
492
|
};
|
|
468
|
-
return F
|
|
493
|
+
return F || Je() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
|
|
469
494
|
url: e.remoteEntry,
|
|
470
495
|
type: e.remoteEntryType,
|
|
471
496
|
globalName: e.globalName
|
|
@@ -475,16 +500,16 @@ function it(e) {
|
|
|
475
500
|
globalName: e.globalName
|
|
476
501
|
} : t;
|
|
477
502
|
}
|
|
478
|
-
const
|
|
503
|
+
const dr = (e, t) => {
|
|
479
504
|
let r;
|
|
480
505
|
return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
|
|
481
|
-
}, I = typeof globalThis == "object" ? globalThis : window,
|
|
506
|
+
}, I = typeof globalThis == "object" ? globalThis : window, k = (() => {
|
|
482
507
|
try {
|
|
483
508
|
return document.defaultView;
|
|
484
509
|
} catch {
|
|
485
510
|
return I;
|
|
486
511
|
}
|
|
487
|
-
})(), Q =
|
|
512
|
+
})(), Q = k;
|
|
488
513
|
function ce(e, t, r) {
|
|
489
514
|
Object.defineProperty(e, t, {
|
|
490
515
|
value: r,
|
|
@@ -496,8 +521,8 @@ function le(e, t) {
|
|
|
496
521
|
return Object.hasOwnProperty.call(e, t);
|
|
497
522
|
}
|
|
498
523
|
le(I, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ce(I, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
499
|
-
const
|
|
500
|
-
function
|
|
524
|
+
const B = I.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
525
|
+
function lt(e) {
|
|
501
526
|
var t, r, n, o, s, i;
|
|
502
527
|
le(e, "__VMOK__") && !le(e, "__FEDERATION__") && ce(e, "__FEDERATION__", e.__VMOK__), le(e, "__FEDERATION__") || (ce(e, "__FEDERATION__", {
|
|
503
528
|
__GLOBAL_PLUGIN__: [],
|
|
@@ -508,10 +533,10 @@ function at(e) {
|
|
|
508
533
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
509
534
|
}), ce(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (n = e.__FEDERATION__).moduleInfo ?? (n.moduleInfo = {}), (o = e.__FEDERATION__).__SHARE__ ?? (o.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
510
535
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
function
|
|
514
|
-
t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.
|
|
536
|
+
lt(I);
|
|
537
|
+
lt(k);
|
|
538
|
+
function mr(e, t = we()) {
|
|
539
|
+
t && (I.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, I.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.2.0");
|
|
515
540
|
}
|
|
516
541
|
function q(e, t) {
|
|
517
542
|
if (typeof t == "string") {
|
|
@@ -533,81 +558,81 @@ function q(e, t) {
|
|
|
533
558
|
key: t
|
|
534
559
|
};
|
|
535
560
|
}
|
|
536
|
-
} else
|
|
561
|
+
} else S(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
537
562
|
}
|
|
538
|
-
const
|
|
563
|
+
const Ge = () => k.__FEDERATION__.moduleInfo, pr = (e, t) => {
|
|
539
564
|
const r = q(t, Z(e)).value;
|
|
540
565
|
if (r && !r.version && "version" in e && e.version && (r.version = e.version), r) return r;
|
|
541
566
|
if ("version" in e && e.version) {
|
|
542
|
-
const { version: n, ...o } = e, s = Z(o), i = q(
|
|
567
|
+
const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
|
|
543
568
|
if ((i == null ? void 0 : i.version) === n) return i;
|
|
544
569
|
}
|
|
545
|
-
}, ue = (e) =>
|
|
570
|
+
}, ue = (e) => pr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
|
|
546
571
|
const r = Z(e);
|
|
547
|
-
return
|
|
548
|
-
},
|
|
549
|
-
...
|
|
572
|
+
return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
|
|
573
|
+
}, yr = (e) => (k.__FEDERATION__.moduleInfo = {
|
|
574
|
+
...k.__FEDERATION__.moduleInfo,
|
|
550
575
|
...e
|
|
551
576
|
}, () => {
|
|
552
577
|
const t = Object.keys(e);
|
|
553
|
-
for (const r of t) delete
|
|
554
|
-
}),
|
|
578
|
+
for (const r of t) delete k.__FEDERATION__.moduleInfo[r];
|
|
579
|
+
}), Ce = (e, t) => {
|
|
555
580
|
const r = t || `__FEDERATION_${e}:custom__`;
|
|
556
581
|
return {
|
|
557
582
|
remoteEntryKey: r,
|
|
558
583
|
entryExports: I[r]
|
|
559
584
|
};
|
|
560
|
-
},
|
|
585
|
+
}, Er = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, gr = (e) => I.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => I.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", fe = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Ve = `(?:${fe}|${ut})`, br = `(?:-?(${Ve}(?:\\.${Ve})*))`, Be = `(?:${Y}|${ut})`, ft = `(?:-(${Be}(?:\\.${Be})*))`, be = `${Y}|x|X|\\*`, K = `[v=\\s]*(${be})(?:\\.(${be})(?:\\.(${be})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${fe})\\.(${fe})\\.(${fe})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Ir = "(<|>)?=?\\s*\\*", Tr = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
|
|
561
586
|
function M(e) {
|
|
562
587
|
return new RegExp(e);
|
|
563
588
|
}
|
|
564
|
-
function
|
|
589
|
+
function T(e) {
|
|
565
590
|
return !e || e.toLowerCase() === "x" || e === "*";
|
|
566
591
|
}
|
|
567
|
-
function
|
|
592
|
+
function mt(...e) {
|
|
568
593
|
return (t) => e.reduce((r, n) => n(r), t);
|
|
569
594
|
}
|
|
570
|
-
function
|
|
571
|
-
return e.match(M(
|
|
595
|
+
function We(e) {
|
|
596
|
+
return e.match(M(kr));
|
|
572
597
|
}
|
|
573
|
-
function
|
|
598
|
+
function je(e, t, r, n) {
|
|
574
599
|
const o = `${e}.${t}.${r}`;
|
|
575
600
|
return n ? `${o}-${n}` : o;
|
|
576
601
|
}
|
|
577
|
-
function
|
|
578
|
-
return e.replace(M(
|
|
602
|
+
function Lr(e) {
|
|
603
|
+
return e.replace(M(Rr), (t, r, n, o, s, i, a, l, c, f, h, u) => (T(n) ? r = "" : T(o) ? r = `>=${n}.0.0` : T(s) ? r = `>=${n}.${o}.0` : r = `>=${r}`, T(c) ? l = "" : T(f) ? l = `<${Number(c) + 1}.0.0-0` : T(h) ? l = `<${c}.${Number(f) + 1}.0-0` : u ? l = `<=${c}.${f}.${h}-${u}` : l = `<=${l}`, `${r} ${l}`.trim()));
|
|
579
604
|
}
|
|
580
|
-
function
|
|
581
|
-
return e.replace(M(
|
|
605
|
+
function Mr(e) {
|
|
606
|
+
return e.replace(M($r), "$1$2$3");
|
|
582
607
|
}
|
|
583
|
-
function
|
|
584
|
-
return e.replace(M(
|
|
608
|
+
function Cr(e) {
|
|
609
|
+
return e.replace(M(wr), "$1~");
|
|
585
610
|
}
|
|
586
|
-
function
|
|
587
|
-
return e.replace(M(
|
|
611
|
+
function Dr(e) {
|
|
612
|
+
return e.replace(M(Nr), "$1^");
|
|
588
613
|
}
|
|
589
|
-
function
|
|
590
|
-
return e.trim().split(/\s+/).map((t) => t.replace(M(
|
|
614
|
+
function Fr(e) {
|
|
615
|
+
return e.trim().split(/\s+/).map((t) => t.replace(M(Tr), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? n === "0" ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.0 <${Number(n) + 1}.0.0-0` : i ? n === "0" ? o === "0" ? `>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s}-${i} <${Number(n) + 1}.0.0-0` : n === "0" ? o === "0" ? `>=${n}.${o}.${s} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${Number(n) + 1}.0.0-0`)).join(" ");
|
|
591
616
|
}
|
|
592
|
-
function
|
|
593
|
-
return e.trim().split(/\s+/).map((t) => t.replace(M(
|
|
617
|
+
function Hr(e) {
|
|
618
|
+
return e.trim().split(/\s+/).map((t) => t.replace(M(Ar), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : i ? `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0`)).join(" ");
|
|
594
619
|
}
|
|
595
|
-
function
|
|
596
|
-
return e.split(/\s+/).map((t) => t.trim().replace(M(
|
|
597
|
-
const
|
|
598
|
-
return n === "=" && f && (n = ""), a = "",
|
|
620
|
+
function Gr(e) {
|
|
621
|
+
return e.split(/\s+/).map((t) => t.trim().replace(M(Pr), (r, n, o, s, i, a) => {
|
|
622
|
+
const l = T(o), c = l || T(s), f = c || T(i);
|
|
623
|
+
return n === "=" && f && (n = ""), a = "", l ? n === ">" || n === "<" ? "<0.0.0-0" : "*" : n && f ? (c && (s = 0), i = 0, n === ">" ? (n = ">=", c ? (o = Number(o) + 1, s = 0, i = 0) : (s = Number(s) + 1, i = 0)) : n === "<=" && (n = "<", c ? o = Number(o) + 1 : s = Number(s) + 1), n === "<" && (a = "-0"), `${n + o}.${s}.${i}${a}`) : c ? `>=${o}.0.0${a} <${Number(o) + 1}.0.0-0` : f ? `>=${o}.${s}.0${a} <${o}.${Number(s) + 1}.0-0` : r;
|
|
599
624
|
})).join(" ");
|
|
600
625
|
}
|
|
601
|
-
function
|
|
602
|
-
return e.trim().replace(M(
|
|
626
|
+
function xr(e) {
|
|
627
|
+
return e.trim().replace(M(Ir), "");
|
|
603
628
|
}
|
|
604
|
-
function
|
|
605
|
-
return e.trim().replace(M(
|
|
629
|
+
function Ur(e) {
|
|
630
|
+
return e.trim().replace(M(Or), "");
|
|
606
631
|
}
|
|
607
632
|
function he(e, t) {
|
|
608
633
|
return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
|
|
609
634
|
}
|
|
610
|
-
function
|
|
635
|
+
function Vr(e, t) {
|
|
611
636
|
const { preRelease: r } = e, { preRelease: n } = t;
|
|
612
637
|
if (r === void 0 && n) return 1;
|
|
613
638
|
if (r && n === void 0) return -1;
|
|
@@ -620,12 +645,12 @@ function Fr(e, t) {
|
|
|
620
645
|
return 0;
|
|
621
646
|
}
|
|
622
647
|
function se(e, t) {
|
|
623
|
-
return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) ||
|
|
648
|
+
return he(e.major, t.major) || he(e.minor, t.minor) || he(e.patch, t.patch) || Vr(e, t);
|
|
624
649
|
}
|
|
625
650
|
function Re(e, t) {
|
|
626
651
|
return e.version === t.version;
|
|
627
652
|
}
|
|
628
|
-
function
|
|
653
|
+
function Br(e, t) {
|
|
629
654
|
switch (e.operator) {
|
|
630
655
|
case "":
|
|
631
656
|
case "=":
|
|
@@ -644,70 +669,69 @@ function Hr(e, t) {
|
|
|
644
669
|
return !1;
|
|
645
670
|
}
|
|
646
671
|
}
|
|
647
|
-
function
|
|
648
|
-
return
|
|
672
|
+
function Wr(e) {
|
|
673
|
+
return mt(Fr, Hr, Gr, xr)(e);
|
|
649
674
|
}
|
|
650
|
-
function
|
|
651
|
-
return
|
|
675
|
+
function jr(e) {
|
|
676
|
+
return mt(Lr, Mr, Cr, Dr)(e.trim()).split(/\s+/).join(" ");
|
|
652
677
|
}
|
|
653
678
|
function X(e, t) {
|
|
654
679
|
if (!e) return !1;
|
|
655
|
-
const r =
|
|
680
|
+
const r = We(e);
|
|
656
681
|
if (!r) return !1;
|
|
657
|
-
const [, n, , o, s, i, a] = r,
|
|
682
|
+
const [, n, , o, s, i, a] = r, l = {
|
|
658
683
|
operator: n,
|
|
659
|
-
version:
|
|
684
|
+
version: je(o, s, i, a),
|
|
660
685
|
major: o,
|
|
661
686
|
minor: s,
|
|
662
687
|
patch: i,
|
|
663
688
|
preRelease: a == null ? void 0 : a.split(".")
|
|
664
|
-
},
|
|
665
|
-
for (const f of
|
|
666
|
-
const
|
|
667
|
-
if (!
|
|
689
|
+
}, c = t.split("||");
|
|
690
|
+
for (const f of c) {
|
|
691
|
+
const h = f.trim();
|
|
692
|
+
if (!h || h === "*" || h === "x") return !0;
|
|
668
693
|
try {
|
|
669
|
-
const u =
|
|
694
|
+
const u = jr(h);
|
|
670
695
|
if (!u.trim()) return !0;
|
|
671
|
-
const
|
|
672
|
-
if (!
|
|
673
|
-
const
|
|
674
|
-
if (
|
|
696
|
+
const d = u.split(" ").map((E) => Wr(E)).join(" ");
|
|
697
|
+
if (!d.trim()) return !0;
|
|
698
|
+
const m = d.split(/\s+/).map((E) => Ur(E)).filter(Boolean);
|
|
699
|
+
if (m.length === 0) continue;
|
|
675
700
|
let y = !0;
|
|
676
|
-
for (const E of
|
|
677
|
-
const
|
|
678
|
-
if (!
|
|
701
|
+
for (const E of m) {
|
|
702
|
+
const p = We(E);
|
|
703
|
+
if (!p) {
|
|
679
704
|
y = !1;
|
|
680
705
|
break;
|
|
681
706
|
}
|
|
682
|
-
const [, g, , b,
|
|
683
|
-
if (!
|
|
707
|
+
const [, g, , b, N, _, $] = p;
|
|
708
|
+
if (!Br({
|
|
684
709
|
operator: g,
|
|
685
|
-
version:
|
|
710
|
+
version: je(b, N, _, $),
|
|
686
711
|
major: b,
|
|
687
|
-
minor:
|
|
712
|
+
minor: N,
|
|
688
713
|
patch: _,
|
|
689
|
-
preRelease:
|
|
690
|
-
},
|
|
714
|
+
preRelease: $ == null ? void 0 : $.split(".")
|
|
715
|
+
}, l)) {
|
|
691
716
|
y = !1;
|
|
692
717
|
break;
|
|
693
718
|
}
|
|
694
719
|
}
|
|
695
720
|
if (y) return !0;
|
|
696
721
|
} catch (u) {
|
|
697
|
-
console.error(`[semver] Error processing range part "${
|
|
722
|
+
console.error(`[semver] Error processing range part "${h}":`, u);
|
|
698
723
|
continue;
|
|
699
724
|
}
|
|
700
725
|
}
|
|
701
726
|
return !1;
|
|
702
727
|
}
|
|
703
|
-
const re = "default",
|
|
704
|
-
function
|
|
728
|
+
const re = "default", pt = "global";
|
|
729
|
+
function qr(e, t, r, n) {
|
|
705
730
|
var s, i;
|
|
706
731
|
let o;
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode)
|
|
710
|
-
return {
|
|
732
|
+
return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
|
|
733
|
+
S(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
|
|
734
|
+
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && S(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
|
|
711
735
|
deps: [],
|
|
712
736
|
useIn: [],
|
|
713
737
|
from: t,
|
|
@@ -733,16 +757,16 @@ function xr(e, t, r, n) {
|
|
|
733
757
|
} : void 0
|
|
734
758
|
};
|
|
735
759
|
}
|
|
736
|
-
function
|
|
760
|
+
function yt(e, t) {
|
|
737
761
|
const r = t.shared || {}, n = t.name, o = Object.keys(r).reduce((i, a) => {
|
|
738
|
-
const
|
|
739
|
-
return i[a] = i[a] || [],
|
|
740
|
-
i[a].push(
|
|
762
|
+
const l = at(r[a]);
|
|
763
|
+
return i[a] = i[a] || [], l.forEach((c) => {
|
|
764
|
+
i[a].push(qr(c, n, a, t.shareStrategy));
|
|
741
765
|
}), i;
|
|
742
766
|
}, {}), s = { ...e.shared };
|
|
743
767
|
return Object.keys(o).forEach((i) => {
|
|
744
768
|
s[i] ? o[i].forEach((a) => {
|
|
745
|
-
s[i].find((
|
|
769
|
+
s[i].find((l) => l.version === a.version) || s[i].push(a);
|
|
746
770
|
}) : s[i] = o[i];
|
|
747
771
|
}), {
|
|
748
772
|
allShareInfos: s,
|
|
@@ -752,7 +776,7 @@ function pt(e, t) {
|
|
|
752
776
|
function ee(e, t) {
|
|
753
777
|
if (!e) return !1;
|
|
754
778
|
const { status: r, mode: n } = e;
|
|
755
|
-
return r === $e.NO_USE ? !1 : r === $e.CALCULATED ? !0 : n === "runtime-infer" ? t ?
|
|
779
|
+
return r === $e.NO_USE ? !1 : r === $e.CALCULATED ? !0 : n === "runtime-infer" ? t ? zr(e, t) : !0 : !1;
|
|
756
780
|
}
|
|
757
781
|
function G(e, t) {
|
|
758
782
|
const r = (n) => {
|
|
@@ -771,16 +795,16 @@ const te = (e, t) => {
|
|
|
771
795
|
return G(n, o);
|
|
772
796
|
};
|
|
773
797
|
return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
|
|
774
|
-
},
|
|
798
|
+
}, me = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
|
|
775
799
|
if (!e || !t) return !1;
|
|
776
800
|
const { usedExports: r } = e;
|
|
777
801
|
return r ? !!t.every((n) => r.includes(n)) : !1;
|
|
778
802
|
};
|
|
779
|
-
function
|
|
803
|
+
function Jr(e, t, r, n) {
|
|
780
804
|
const o = e[t][r];
|
|
781
805
|
let s = "", i = ee(n);
|
|
782
|
-
const a = function(
|
|
783
|
-
return i ? o[
|
|
806
|
+
const a = function(l, c) {
|
|
807
|
+
return i ? o[l].treeShaking ? o[c].treeShaking ? !me(o[l].treeShaking) && G(l, c) : !1 : !0 : !me(o[l]) && G(l, c);
|
|
784
808
|
};
|
|
785
809
|
if (i) {
|
|
786
810
|
if (s = te(e[t][r], a), s) return {
|
|
@@ -794,18 +818,18 @@ function Wr(e, t, r, n) {
|
|
|
794
818
|
useTreesShaking: i
|
|
795
819
|
};
|
|
796
820
|
}
|
|
797
|
-
const
|
|
798
|
-
function
|
|
821
|
+
const x = (e) => me(e) || Kr(e);
|
|
822
|
+
function Xr(e, t, r, n) {
|
|
799
823
|
const o = e[t][r];
|
|
800
824
|
let s = "", i = ee(n);
|
|
801
|
-
const a = function(
|
|
825
|
+
const a = function(l, c) {
|
|
802
826
|
if (i) {
|
|
803
|
-
if (!o[
|
|
804
|
-
if (!o[
|
|
805
|
-
if (
|
|
806
|
-
if (
|
|
827
|
+
if (!o[l].treeShaking) return !0;
|
|
828
|
+
if (!o[c].treeShaking) return !1;
|
|
829
|
+
if (x(o[c].treeShaking)) return x(o[l].treeShaking) ? !!G(l, c) : !0;
|
|
830
|
+
if (x(o[l].treeShaking)) return !1;
|
|
807
831
|
}
|
|
808
|
-
return
|
|
832
|
+
return x(o[c]) ? x(o[l]) ? !!G(l, c) : !0 : x(o[l]) ? !1 : G(l, c);
|
|
809
833
|
};
|
|
810
834
|
if (i) {
|
|
811
835
|
if (s = te(e[t][r], a), s) return {
|
|
@@ -819,19 +843,19 @@ function jr(e, t, r, n) {
|
|
|
819
843
|
useTreesShaking: i
|
|
820
844
|
};
|
|
821
845
|
}
|
|
822
|
-
function
|
|
823
|
-
return e === "loaded-first" ?
|
|
846
|
+
function Yr(e) {
|
|
847
|
+
return e === "loaded-first" ? Xr : Jr;
|
|
824
848
|
}
|
|
825
849
|
function de(e, t, r, n) {
|
|
826
850
|
if (!e) return;
|
|
827
|
-
const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r,
|
|
828
|
-
for (const
|
|
829
|
-
const { requiredVersion: f } = o, { version:
|
|
830
|
-
const y = e[
|
|
851
|
+
const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
|
|
852
|
+
for (const c of l) if (o && e[c] && e[c][t]) {
|
|
853
|
+
const { requiredVersion: f } = o, { version: h, useTreesShaking: u } = Yr(i)(e, c, t, a), d = () => {
|
|
854
|
+
const y = e[c][t][h];
|
|
831
855
|
if (o.singleton) {
|
|
832
|
-
if (typeof f == "string" && !X(
|
|
833
|
-
const E = `Version ${
|
|
834
|
-
o.strictVersion ?
|
|
856
|
+
if (typeof f == "string" && !X(h, f)) {
|
|
857
|
+
const E = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
|
|
858
|
+
o.strictVersion ? S(E) : Oe(E);
|
|
835
859
|
}
|
|
836
860
|
return {
|
|
837
861
|
shared: y,
|
|
@@ -842,67 +866,67 @@ function de(e, t, r, n) {
|
|
|
842
866
|
shared: y,
|
|
843
867
|
useTreesShaking: u
|
|
844
868
|
};
|
|
845
|
-
if (X(
|
|
869
|
+
if (X(h, f)) return {
|
|
846
870
|
shared: y,
|
|
847
871
|
useTreesShaking: u
|
|
848
872
|
};
|
|
849
873
|
const E = ee(a);
|
|
850
874
|
if (E) {
|
|
851
|
-
for (const [
|
|
852
|
-
if (ee(g.treeShaking, a == null ? void 0 : a.usedExports) && X(
|
|
875
|
+
for (const [p, g] of Object.entries(e[c][t]))
|
|
876
|
+
if (ee(g.treeShaking, a == null ? void 0 : a.usedExports) && X(p, f))
|
|
853
877
|
return {
|
|
854
878
|
shared: g,
|
|
855
879
|
useTreesShaking: E
|
|
856
880
|
};
|
|
857
881
|
}
|
|
858
|
-
for (const [
|
|
882
|
+
for (const [p, g] of Object.entries(e[c][t])) if (X(p, f)) return {
|
|
859
883
|
shared: g,
|
|
860
884
|
useTreesShaking: !1
|
|
861
885
|
};
|
|
862
886
|
}
|
|
863
|
-
},
|
|
887
|
+
}, m = {
|
|
864
888
|
shareScopeMap: e,
|
|
865
|
-
scope:
|
|
889
|
+
scope: c,
|
|
866
890
|
pkgName: t,
|
|
867
|
-
version:
|
|
891
|
+
version: h,
|
|
868
892
|
GlobalFederation: Q.__FEDERATION__,
|
|
869
893
|
shareInfo: r,
|
|
870
|
-
resolver:
|
|
894
|
+
resolver: d
|
|
871
895
|
};
|
|
872
|
-
return (n.emit(
|
|
896
|
+
return (n.emit(m) || m).resolver();
|
|
873
897
|
}
|
|
874
898
|
}
|
|
875
|
-
function
|
|
899
|
+
function Et() {
|
|
876
900
|
return Q.__FEDERATION__.__SHARE__;
|
|
877
901
|
}
|
|
878
|
-
function
|
|
879
|
-
const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (
|
|
880
|
-
if (!
|
|
881
|
-
const
|
|
882
|
-
return
|
|
883
|
-
|
|
884
|
-
}),
|
|
885
|
-
return !
|
|
902
|
+
function qe(e) {
|
|
903
|
+
const { pkgName: t, extraOptions: r, shareInfos: n } = e, o = (l) => {
|
|
904
|
+
if (!l) return;
|
|
905
|
+
const c = {};
|
|
906
|
+
return l.forEach((h) => {
|
|
907
|
+
c[h.version] = h;
|
|
908
|
+
}), c[te(c, function(h, u) {
|
|
909
|
+
return !me(c[h]) && G(h, u);
|
|
886
910
|
})];
|
|
887
|
-
}, s = (r == null ? void 0 : r.resolver) ?? o, i = (
|
|
888
|
-
const
|
|
889
|
-
for (const f of
|
|
911
|
+
}, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
|
|
912
|
+
const c = {};
|
|
913
|
+
for (const f of l)
|
|
890
914
|
if (f)
|
|
891
|
-
for (const [
|
|
892
|
-
const
|
|
893
|
-
i(
|
|
915
|
+
for (const [h, u] of Object.entries(f)) {
|
|
916
|
+
const d = c[h];
|
|
917
|
+
i(d) && i(u) ? c[h] = a(d, u) : u !== void 0 && (c[h] = u);
|
|
894
918
|
}
|
|
895
|
-
return
|
|
919
|
+
return c;
|
|
896
920
|
};
|
|
897
921
|
return a(s(n[t]), r == null ? void 0 : r.customShareInfo);
|
|
898
922
|
}
|
|
899
|
-
const
|
|
900
|
-
e.useIn || (e.useIn = []),
|
|
923
|
+
const U = (e, t) => {
|
|
924
|
+
e.useIn || (e.useIn = []), ur(e.useIn, t);
|
|
901
925
|
};
|
|
902
926
|
function ie(e, t) {
|
|
903
927
|
return t && e.treeShaking ? e.treeShaking : e;
|
|
904
928
|
}
|
|
905
|
-
function
|
|
929
|
+
function Zr(e, t) {
|
|
906
930
|
for (const r of e) {
|
|
907
931
|
const n = t.startsWith(r.name);
|
|
908
932
|
let o = t.replace(r.name, "");
|
|
@@ -938,96 +962,95 @@ function qr(e, t) {
|
|
|
938
962
|
}
|
|
939
963
|
}
|
|
940
964
|
}
|
|
941
|
-
function
|
|
965
|
+
function Qr(e, t) {
|
|
942
966
|
for (const r of e)
|
|
943
967
|
if (t === r.name || r.alias && t === r.alias) return r;
|
|
944
968
|
}
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
[yt]: "Failed to get remoteEntry exports.",
|
|
952
|
-
[Et]: 'The remote entry interface does not contain "init"',
|
|
953
|
-
[gt]: "Failed to get manifest.",
|
|
954
|
-
[_t]: "Failed to locate remote.",
|
|
955
|
-
[bt]: "Invalid loadShareSync function call from bundler runtime",
|
|
969
|
+
const gt = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Ae = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", O = {
|
|
970
|
+
[gt]: "Failed to get remoteEntry exports.",
|
|
971
|
+
[_t]: 'The remote entry interface does not contain "init"',
|
|
972
|
+
[bt]: "Failed to get manifest.",
|
|
973
|
+
[Rt]: "Failed to locate remote.",
|
|
974
|
+
[St]: "Invalid loadShareSync function call from bundler runtime",
|
|
956
975
|
[Ae]: "Invalid loadShareSync function call from runtime",
|
|
957
|
-
[
|
|
958
|
-
[
|
|
959
|
-
[
|
|
960
|
-
[
|
|
976
|
+
[$t]: "Failed to get remote snapshot.",
|
|
977
|
+
[He]: "Failed to load script resources.",
|
|
978
|
+
[en]: "Please call createInstance first.",
|
|
979
|
+
[wt]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
|
|
980
|
+
[Nt]: "The remoteEntry URL is missing from the remote snapshot."
|
|
961
981
|
};
|
|
962
982
|
({
|
|
963
|
-
...
|
|
983
|
+
...O
|
|
964
984
|
});
|
|
965
|
-
const
|
|
966
|
-
async function
|
|
985
|
+
const It = ".then(callbacks[0]).catch(callbacks[1])";
|
|
986
|
+
async function tn({ entry: e, remoteEntryExports: t }) {
|
|
967
987
|
return new Promise((r, n) => {
|
|
968
988
|
try {
|
|
969
|
-
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${
|
|
989
|
+
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${It}`)([r, n]) : import(
|
|
970
990
|
/* webpackIgnore: true */
|
|
971
991
|
/* @vite-ignore */
|
|
972
992
|
e
|
|
973
993
|
).then(r).catch(n);
|
|
974
994
|
} catch (o) {
|
|
975
|
-
|
|
995
|
+
S(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
|
|
976
996
|
}
|
|
977
997
|
});
|
|
978
998
|
}
|
|
979
|
-
async function
|
|
999
|
+
async function rn({ entry: e, remoteEntryExports: t }) {
|
|
980
1000
|
return new Promise((r, n) => {
|
|
981
1001
|
try {
|
|
982
|
-
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${
|
|
1002
|
+
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${It}`)([r, n]);
|
|
983
1003
|
} catch (o) {
|
|
984
|
-
|
|
1004
|
+
S(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
|
|
985
1005
|
}
|
|
986
1006
|
});
|
|
987
1007
|
}
|
|
988
|
-
function
|
|
989
|
-
const { remoteEntryKey: n, entryExports: o } =
|
|
990
|
-
return
|
|
1008
|
+
function Tt(e, t, r) {
|
|
1009
|
+
const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
|
|
1010
|
+
return o || S(gt, O, {
|
|
991
1011
|
remoteName: e,
|
|
992
1012
|
remoteEntryUrl: r,
|
|
993
1013
|
remoteEntryKey: n
|
|
994
|
-
})
|
|
1014
|
+
}), o;
|
|
995
1015
|
}
|
|
996
|
-
async function
|
|
997
|
-
const { entryExports: s } =
|
|
998
|
-
|
|
1016
|
+
async function nn({ name: e, globalName: t, entry: r, loaderHook: n, getEntryUrl: o }) {
|
|
1017
|
+
const { entryExports: s } = Ce(e, t);
|
|
1018
|
+
if (s) return s;
|
|
1019
|
+
const i = o ? o(r) : r;
|
|
1020
|
+
return or(i, {
|
|
999
1021
|
attrs: {},
|
|
1000
|
-
createScriptHook: (
|
|
1022
|
+
createScriptHook: (a, l) => {
|
|
1001
1023
|
const c = n.lifecycle.createScript.emit({
|
|
1002
|
-
url:
|
|
1003
|
-
attrs:
|
|
1024
|
+
url: a,
|
|
1025
|
+
attrs: l
|
|
1004
1026
|
});
|
|
1005
1027
|
if (c && (c instanceof HTMLScriptElement || "script" in c || "timeout" in c))
|
|
1006
1028
|
return c;
|
|
1007
1029
|
}
|
|
1008
|
-
}).then(() =>
|
|
1009
|
-
|
|
1030
|
+
}).then(() => Tt(e, t, r), (a) => {
|
|
1031
|
+
const l = a instanceof Error ? a.message : String(a);
|
|
1032
|
+
S(He, O, {
|
|
1010
1033
|
remoteName: e,
|
|
1011
|
-
resourceUrl:
|
|
1012
|
-
}
|
|
1034
|
+
resourceUrl: i
|
|
1035
|
+
}, l);
|
|
1013
1036
|
});
|
|
1014
1037
|
}
|
|
1015
|
-
async function
|
|
1038
|
+
async function on({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
|
|
1016
1039
|
const { entry: o, entryGlobalName: s, name: i, type: a } = e;
|
|
1017
1040
|
switch (a) {
|
|
1018
1041
|
case "esm":
|
|
1019
1042
|
case "module":
|
|
1020
|
-
return
|
|
1043
|
+
return tn({
|
|
1021
1044
|
entry: o,
|
|
1022
1045
|
remoteEntryExports: t
|
|
1023
1046
|
});
|
|
1024
1047
|
case "system":
|
|
1025
|
-
return
|
|
1048
|
+
return rn({
|
|
1026
1049
|
entry: o,
|
|
1027
1050
|
remoteEntryExports: t
|
|
1028
1051
|
});
|
|
1029
1052
|
default:
|
|
1030
|
-
return
|
|
1053
|
+
return nn({
|
|
1031
1054
|
entry: o,
|
|
1032
1055
|
globalName: s,
|
|
1033
1056
|
name: i,
|
|
@@ -1036,82 +1059,82 @@ async function en({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
|
|
|
1036
1059
|
});
|
|
1037
1060
|
}
|
|
1038
1061
|
}
|
|
1039
|
-
async function
|
|
1040
|
-
const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } =
|
|
1041
|
-
return i ||
|
|
1062
|
+
async function sn({ remoteInfo: e, loaderHook: t }) {
|
|
1063
|
+
const { entry: r, entryGlobalName: n, name: o, type: s } = e, { entryExports: i } = Ce(o, n);
|
|
1064
|
+
return i || ar(r, {
|
|
1042
1065
|
attrs: {
|
|
1043
1066
|
name: o,
|
|
1044
1067
|
globalName: n,
|
|
1045
1068
|
type: s
|
|
1046
1069
|
},
|
|
1047
|
-
loaderHook: { createScriptHook: (a,
|
|
1048
|
-
const
|
|
1070
|
+
loaderHook: { createScriptHook: (a, l = {}) => {
|
|
1071
|
+
const c = t.lifecycle.createScript.emit({
|
|
1049
1072
|
url: a,
|
|
1050
|
-
attrs:
|
|
1073
|
+
attrs: l
|
|
1051
1074
|
});
|
|
1052
|
-
if (
|
|
1053
|
-
return
|
|
1075
|
+
if (c && "url" in c)
|
|
1076
|
+
return c;
|
|
1054
1077
|
} }
|
|
1055
|
-
}).then(() =>
|
|
1056
|
-
|
|
1078
|
+
}).then(() => Tt(o, n, r)).catch((a) => {
|
|
1079
|
+
S(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
|
|
1057
1080
|
});
|
|
1058
1081
|
}
|
|
1059
|
-
function
|
|
1082
|
+
function Pe(e) {
|
|
1060
1083
|
const { entry: t, name: r } = e;
|
|
1061
|
-
return
|
|
1084
|
+
return Xe(r, t);
|
|
1062
1085
|
}
|
|
1063
|
-
async function
|
|
1064
|
-
const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i =
|
|
1086
|
+
async function pe(e) {
|
|
1087
|
+
const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = Pe(n);
|
|
1065
1088
|
if (r) return r;
|
|
1066
|
-
if (!
|
|
1067
|
-
const a = t.remoteHandler.hooks.lifecycle.loadEntry,
|
|
1068
|
-
|
|
1069
|
-
loaderHook:
|
|
1089
|
+
if (!B[i]) {
|
|
1090
|
+
const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
|
|
1091
|
+
B[i] = a.emit({
|
|
1092
|
+
loaderHook: l,
|
|
1070
1093
|
remoteInfo: n,
|
|
1071
1094
|
remoteEntryExports: r
|
|
1072
|
-
}).then((
|
|
1095
|
+
}).then((c) => c || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : F) ? on({
|
|
1073
1096
|
remoteInfo: n,
|
|
1074
1097
|
remoteEntryExports: r,
|
|
1075
|
-
loaderHook:
|
|
1098
|
+
loaderHook: l,
|
|
1076
1099
|
getEntryUrl: o
|
|
1077
|
-
}) :
|
|
1100
|
+
}) : sn({
|
|
1078
1101
|
remoteInfo: n,
|
|
1079
|
-
loaderHook:
|
|
1080
|
-
}))).catch(async (
|
|
1081
|
-
const f =
|
|
1082
|
-
if (
|
|
1083
|
-
const
|
|
1084
|
-
...
|
|
1102
|
+
loaderHook: l
|
|
1103
|
+
}))).catch(async (c) => {
|
|
1104
|
+
const f = Pe(n), h = c instanceof Error && c.message.includes("ScriptExecutionError");
|
|
1105
|
+
if (c instanceof Error && c.message.includes(He) && !h && !s) {
|
|
1106
|
+
const u = (m) => pe({
|
|
1107
|
+
...m,
|
|
1085
1108
|
_inErrorHandling: !0
|
|
1086
|
-
}),
|
|
1087
|
-
getRemoteEntry:
|
|
1109
|
+
}), d = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
1110
|
+
getRemoteEntry: u,
|
|
1088
1111
|
origin: t,
|
|
1089
1112
|
remoteInfo: n,
|
|
1090
1113
|
remoteEntryExports: r,
|
|
1091
|
-
globalLoading:
|
|
1114
|
+
globalLoading: B,
|
|
1092
1115
|
uniqueKey: f
|
|
1093
1116
|
});
|
|
1094
|
-
if (
|
|
1117
|
+
if (d) return d;
|
|
1095
1118
|
}
|
|
1096
|
-
throw
|
|
1119
|
+
throw c;
|
|
1097
1120
|
});
|
|
1098
1121
|
}
|
|
1099
|
-
return
|
|
1122
|
+
return B[i];
|
|
1100
1123
|
}
|
|
1101
|
-
function
|
|
1124
|
+
function ke(e) {
|
|
1102
1125
|
return {
|
|
1103
1126
|
...e,
|
|
1104
1127
|
entry: "entry" in e ? e.entry : "",
|
|
1105
|
-
type: e.type ||
|
|
1128
|
+
type: e.type || pt,
|
|
1106
1129
|
entryGlobalName: e.entryGlobalName || e.name,
|
|
1107
1130
|
shareScope: e.shareScope || re
|
|
1108
1131
|
};
|
|
1109
1132
|
}
|
|
1110
|
-
function
|
|
1133
|
+
function an() {
|
|
1111
1134
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1112
1135
|
}
|
|
1113
|
-
function
|
|
1114
|
-
const r =
|
|
1136
|
+
function cn(e, t) {
|
|
1137
|
+
const r = Er(), n = [
|
|
1115
1138
|
t.hooks,
|
|
1116
1139
|
t.remoteHandler.hooks,
|
|
1117
1140
|
t.sharedHandler.hooks,
|
|
@@ -1127,7 +1150,43 @@ function nn(e, t) {
|
|
|
1127
1150
|
});
|
|
1128
1151
|
}), e;
|
|
1129
1152
|
}
|
|
1130
|
-
function
|
|
1153
|
+
function ln(e) {
|
|
1154
|
+
return {
|
|
1155
|
+
name: e.name,
|
|
1156
|
+
alias: e.alias,
|
|
1157
|
+
entry: "entry" in e ? e.entry : void 0,
|
|
1158
|
+
version: "version" in e ? e.version : void 0,
|
|
1159
|
+
type: e.type,
|
|
1160
|
+
entryGlobalName: e.entryGlobalName,
|
|
1161
|
+
shareScope: e.shareScope
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
function z(e) {
|
|
1165
|
+
var r, n, o, s, i, a;
|
|
1166
|
+
const t = {};
|
|
1167
|
+
for (const [l, c] of Object.entries(e.shared)) {
|
|
1168
|
+
const f = c[0];
|
|
1169
|
+
f && (t[l] = {
|
|
1170
|
+
version: f.version,
|
|
1171
|
+
singleton: (r = f.shareConfig) == null ? void 0 : r.singleton,
|
|
1172
|
+
requiredVersion: ((n = f.shareConfig) == null ? void 0 : n.requiredVersion) === !1 ? !1 : (o = f.shareConfig) == null ? void 0 : o.requiredVersion,
|
|
1173
|
+
eager: f.eager,
|
|
1174
|
+
strictVersion: (s = f.shareConfig) == null ? void 0 : s.strictVersion
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
return {
|
|
1178
|
+
project: {
|
|
1179
|
+
name: e.name,
|
|
1180
|
+
mfRole: ((i = e.remotes) == null ? void 0 : i.length) > 0 ? "host" : "unknown"
|
|
1181
|
+
},
|
|
1182
|
+
mfConfig: {
|
|
1183
|
+
name: e.name,
|
|
1184
|
+
remotes: ((a = e.remotes) == null ? void 0 : a.map(ln)) ?? [],
|
|
1185
|
+
shared: t
|
|
1186
|
+
}
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
function vt(e) {
|
|
1131
1190
|
return {
|
|
1132
1191
|
resourceCategory: "sync",
|
|
1133
1192
|
share: !0,
|
|
@@ -1136,33 +1195,33 @@ function It(e) {
|
|
|
1136
1195
|
...e
|
|
1137
1196
|
};
|
|
1138
1197
|
}
|
|
1139
|
-
function
|
|
1198
|
+
function un(e, t) {
|
|
1140
1199
|
return t.map((r) => {
|
|
1141
|
-
const n =
|
|
1142
|
-
return
|
|
1200
|
+
const n = Qr(e, r.nameOrAlias);
|
|
1201
|
+
return P(n, `Unable to preload ${r.nameOrAlias} as it is not included in ${!n && Ze({
|
|
1143
1202
|
remoteInfo: n,
|
|
1144
1203
|
remotes: e
|
|
1145
1204
|
})}`), {
|
|
1146
1205
|
remote: n,
|
|
1147
|
-
preloadConfig:
|
|
1206
|
+
preloadConfig: vt(r)
|
|
1148
1207
|
};
|
|
1149
1208
|
});
|
|
1150
1209
|
}
|
|
1151
|
-
function
|
|
1210
|
+
function fn(e) {
|
|
1152
1211
|
return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1153
1212
|
}
|
|
1154
|
-
function
|
|
1213
|
+
function At(e, t, r, n = !0) {
|
|
1155
1214
|
const { cssAssets: o, jsAssetsWithoutEntry: s, entryAssets: i } = r;
|
|
1156
1215
|
if (t.options.inBrowser) {
|
|
1157
1216
|
if (i.forEach((a) => {
|
|
1158
|
-
const { moduleInfo:
|
|
1159
|
-
|
|
1217
|
+
const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
|
|
1218
|
+
pe(c ? {
|
|
1160
1219
|
origin: t,
|
|
1161
|
-
remoteInfo:
|
|
1162
|
-
remoteEntryExports:
|
|
1220
|
+
remoteInfo: l,
|
|
1221
|
+
remoteEntryExports: c.remoteEntryExports
|
|
1163
1222
|
} : {
|
|
1164
1223
|
origin: t,
|
|
1165
|
-
remoteInfo:
|
|
1224
|
+
remoteInfo: l,
|
|
1166
1225
|
remoteEntryExports: void 0
|
|
1167
1226
|
});
|
|
1168
1227
|
}), n) {
|
|
@@ -1170,43 +1229,43 @@ function Nt(e, t, r, n = !0) {
|
|
|
1170
1229
|
rel: "preload",
|
|
1171
1230
|
as: "style"
|
|
1172
1231
|
};
|
|
1173
|
-
o.forEach((
|
|
1174
|
-
const { link:
|
|
1175
|
-
url:
|
|
1232
|
+
o.forEach((l) => {
|
|
1233
|
+
const { link: c, needAttach: f } = ge({
|
|
1234
|
+
url: l,
|
|
1176
1235
|
cb: () => {
|
|
1177
1236
|
},
|
|
1178
1237
|
attrs: a,
|
|
1179
|
-
createLinkHook: (
|
|
1180
|
-
const
|
|
1181
|
-
url:
|
|
1238
|
+
createLinkHook: (h, u) => {
|
|
1239
|
+
const d = t.loaderHook.lifecycle.createLink.emit({
|
|
1240
|
+
url: h,
|
|
1182
1241
|
attrs: u
|
|
1183
1242
|
});
|
|
1184
|
-
if (
|
|
1243
|
+
if (d instanceof HTMLLinkElement) return d;
|
|
1185
1244
|
}
|
|
1186
1245
|
});
|
|
1187
|
-
f && document.head.appendChild(
|
|
1246
|
+
f && document.head.appendChild(c);
|
|
1188
1247
|
});
|
|
1189
1248
|
} else {
|
|
1190
1249
|
const a = {
|
|
1191
1250
|
rel: "stylesheet",
|
|
1192
1251
|
type: "text/css"
|
|
1193
1252
|
};
|
|
1194
|
-
o.forEach((
|
|
1195
|
-
const { link:
|
|
1196
|
-
url:
|
|
1253
|
+
o.forEach((l) => {
|
|
1254
|
+
const { link: c, needAttach: f } = ge({
|
|
1255
|
+
url: l,
|
|
1197
1256
|
cb: () => {
|
|
1198
1257
|
},
|
|
1199
1258
|
attrs: a,
|
|
1200
|
-
createLinkHook: (
|
|
1201
|
-
const
|
|
1202
|
-
url:
|
|
1259
|
+
createLinkHook: (h, u) => {
|
|
1260
|
+
const d = t.loaderHook.lifecycle.createLink.emit({
|
|
1261
|
+
url: h,
|
|
1203
1262
|
attrs: u
|
|
1204
1263
|
});
|
|
1205
|
-
if (
|
|
1264
|
+
if (d instanceof HTMLLinkElement) return d;
|
|
1206
1265
|
},
|
|
1207
1266
|
needDeleteLink: !1
|
|
1208
1267
|
});
|
|
1209
|
-
f && document.head.appendChild(
|
|
1268
|
+
f && document.head.appendChild(c);
|
|
1210
1269
|
});
|
|
1211
1270
|
}
|
|
1212
1271
|
if (n) {
|
|
@@ -1214,48 +1273,48 @@ function Nt(e, t, r, n = !0) {
|
|
|
1214
1273
|
rel: "preload",
|
|
1215
1274
|
as: "script"
|
|
1216
1275
|
};
|
|
1217
|
-
s.forEach((
|
|
1218
|
-
const { link:
|
|
1219
|
-
url:
|
|
1276
|
+
s.forEach((l) => {
|
|
1277
|
+
const { link: c, needAttach: f } = ge({
|
|
1278
|
+
url: l,
|
|
1220
1279
|
cb: () => {
|
|
1221
1280
|
},
|
|
1222
1281
|
attrs: a,
|
|
1223
|
-
createLinkHook: (
|
|
1224
|
-
const
|
|
1225
|
-
url:
|
|
1282
|
+
createLinkHook: (h, u) => {
|
|
1283
|
+
const d = t.loaderHook.lifecycle.createLink.emit({
|
|
1284
|
+
url: h,
|
|
1226
1285
|
attrs: u
|
|
1227
1286
|
});
|
|
1228
|
-
if (
|
|
1287
|
+
if (d instanceof HTMLLinkElement) return d;
|
|
1229
1288
|
}
|
|
1230
1289
|
});
|
|
1231
|
-
f && document.head.appendChild(
|
|
1290
|
+
f && document.head.appendChild(c);
|
|
1232
1291
|
});
|
|
1233
1292
|
} else {
|
|
1234
1293
|
const a = {
|
|
1235
1294
|
fetchpriority: "high",
|
|
1236
1295
|
type: (e == null ? void 0 : e.type) === "module" ? "module" : "text/javascript"
|
|
1237
1296
|
};
|
|
1238
|
-
s.forEach((
|
|
1239
|
-
const { script:
|
|
1240
|
-
url:
|
|
1297
|
+
s.forEach((l) => {
|
|
1298
|
+
const { script: c, needAttach: f } = nt({
|
|
1299
|
+
url: l,
|
|
1241
1300
|
cb: () => {
|
|
1242
1301
|
},
|
|
1243
1302
|
attrs: a,
|
|
1244
|
-
createScriptHook: (
|
|
1245
|
-
const
|
|
1246
|
-
url:
|
|
1303
|
+
createScriptHook: (h, u) => {
|
|
1304
|
+
const d = t.loaderHook.lifecycle.createScript.emit({
|
|
1305
|
+
url: h,
|
|
1247
1306
|
attrs: u
|
|
1248
1307
|
});
|
|
1249
|
-
if (
|
|
1308
|
+
if (d instanceof HTMLScriptElement) return d;
|
|
1250
1309
|
},
|
|
1251
1310
|
needDeleteScript: !0
|
|
1252
1311
|
});
|
|
1253
|
-
f && document.head.appendChild(
|
|
1312
|
+
f && document.head.appendChild(c);
|
|
1254
1313
|
});
|
|
1255
1314
|
}
|
|
1256
1315
|
}
|
|
1257
1316
|
}
|
|
1258
|
-
function
|
|
1317
|
+
function hn(e, t, r) {
|
|
1259
1318
|
const n = t, o = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1260
1319
|
o.length || o.push("default"), o.forEach((i) => {
|
|
1261
1320
|
n[i] || (n[i] = {});
|
|
@@ -1273,19 +1332,19 @@ function an(e, t, r) {
|
|
|
1273
1332
|
initScope: r ?? []
|
|
1274
1333
|
};
|
|
1275
1334
|
}
|
|
1276
|
-
var
|
|
1335
|
+
var Pt = class {
|
|
1277
1336
|
constructor({ remoteInfo: e, host: t }) {
|
|
1278
1337
|
this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
|
|
1279
1338
|
}
|
|
1280
1339
|
async getEntry() {
|
|
1281
1340
|
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1282
|
-
const e = await
|
|
1341
|
+
const e = await pe({
|
|
1283
1342
|
origin: this.host,
|
|
1284
1343
|
remoteInfo: this.remoteInfo,
|
|
1285
1344
|
remoteEntryExports: this.remoteEntryExports
|
|
1286
1345
|
});
|
|
1287
|
-
return
|
|
1288
|
-
${
|
|
1346
|
+
return P(e, `remoteEntryExports is undefined
|
|
1347
|
+
${Ze(this.remoteInfo)}`), this.remoteEntryExports = e, this.remoteEntryExports;
|
|
1289
1348
|
}
|
|
1290
1349
|
async init(e, t, r) {
|
|
1291
1350
|
const n = await this.getEntry();
|
|
@@ -1293,19 +1352,19 @@ var Tt = class {
|
|
|
1293
1352
|
if (this.initPromise)
|
|
1294
1353
|
return await this.initPromise, n;
|
|
1295
1354
|
this.initing = !0, this.initPromise = (async () => {
|
|
1296
|
-
const { remoteEntryInitOptions: o, shareScope: s, initScope: i } =
|
|
1355
|
+
const { remoteEntryInitOptions: o, shareScope: s, initScope: i } = hn(this.remoteInfo, this.host.shareScopeMap, r), a = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1297
1356
|
shareScope: s,
|
|
1298
1357
|
remoteEntryInitOptions: o,
|
|
1299
1358
|
initScope: i,
|
|
1300
1359
|
remoteInfo: this.remoteInfo,
|
|
1301
1360
|
origin: this.host
|
|
1302
1361
|
});
|
|
1303
|
-
typeof (n == null ? void 0 : n.init) > "u" &&
|
|
1362
|
+
typeof (n == null ? void 0 : n.init) > "u" && S(_t, O, {
|
|
1304
1363
|
hostName: this.host.name,
|
|
1305
1364
|
remoteName: this.remoteInfo.name,
|
|
1306
1365
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1307
1366
|
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1308
|
-
})), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
|
|
1367
|
+
}, void 0, z(this.host.options)), await n.init(a.shareScope, a.initScope, a.remoteEntryInitOptions), await this.host.hooks.lifecycle.initContainer.emit({
|
|
1309
1368
|
...a,
|
|
1310
1369
|
id: e,
|
|
1311
1370
|
remoteSnapshot: t,
|
|
@@ -1327,9 +1386,9 @@ var Tt = class {
|
|
|
1327
1386
|
remoteEntryExports: s,
|
|
1328
1387
|
expose: t,
|
|
1329
1388
|
moduleInfo: this.remoteInfo
|
|
1330
|
-
}), i || (i = await s.get(t)),
|
|
1331
|
-
const a =
|
|
1332
|
-
return o ? await
|
|
1389
|
+
}), i || (i = await s.get(t)), P(i, `${Z(this.remoteInfo)} remote don't export ${t}.`);
|
|
1390
|
+
const a = dr(this.remoteInfo.name, t), l = this.wraperFactory(i, a);
|
|
1391
|
+
return o ? await l() : l;
|
|
1333
1392
|
}
|
|
1334
1393
|
wraperFactory(e, t) {
|
|
1335
1394
|
function r(n, o) {
|
|
@@ -1346,7 +1405,7 @@ var Tt = class {
|
|
|
1346
1405
|
return r(n, t), n;
|
|
1347
1406
|
};
|
|
1348
1407
|
}
|
|
1349
|
-
},
|
|
1408
|
+
}, v = class {
|
|
1350
1409
|
constructor(e) {
|
|
1351
1410
|
this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
|
|
1352
1411
|
}
|
|
@@ -1371,7 +1430,7 @@ var Tt = class {
|
|
|
1371
1430
|
removeAll() {
|
|
1372
1431
|
this.listeners.clear();
|
|
1373
1432
|
}
|
|
1374
|
-
},
|
|
1433
|
+
}, A = class extends v {
|
|
1375
1434
|
emit(...e) {
|
|
1376
1435
|
let t;
|
|
1377
1436
|
const r = Array.from(this.listeners);
|
|
@@ -1383,42 +1442,42 @@ var Tt = class {
|
|
|
1383
1442
|
return Promise.resolve(t);
|
|
1384
1443
|
}
|
|
1385
1444
|
};
|
|
1386
|
-
function
|
|
1387
|
-
if (!
|
|
1445
|
+
function kt(e, t) {
|
|
1446
|
+
if (!Me(t)) return !1;
|
|
1388
1447
|
if (e !== t) {
|
|
1389
1448
|
for (const r in e) if (!(r in t)) return !1;
|
|
1390
1449
|
}
|
|
1391
1450
|
return !0;
|
|
1392
1451
|
}
|
|
1393
|
-
var
|
|
1452
|
+
var W = class extends v {
|
|
1394
1453
|
constructor(e) {
|
|
1395
|
-
super(), this.onerror =
|
|
1454
|
+
super(), this.onerror = S, this.type = e;
|
|
1396
1455
|
}
|
|
1397
1456
|
emit(e) {
|
|
1398
|
-
|
|
1457
|
+
Me(e) || S(`The data for the "${this.type}" hook should be an object.`);
|
|
1399
1458
|
for (const t of this.listeners) try {
|
|
1400
1459
|
const r = t(e);
|
|
1401
|
-
if (
|
|
1460
|
+
if (kt(e, r)) e = r;
|
|
1402
1461
|
else {
|
|
1403
1462
|
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1404
1463
|
break;
|
|
1405
1464
|
}
|
|
1406
1465
|
} catch (r) {
|
|
1407
|
-
|
|
1466
|
+
Oe(r), this.onerror(r);
|
|
1408
1467
|
}
|
|
1409
1468
|
return e;
|
|
1410
1469
|
}
|
|
1411
|
-
},
|
|
1470
|
+
}, D = class extends v {
|
|
1412
1471
|
constructor(e) {
|
|
1413
|
-
super(), this.onerror =
|
|
1472
|
+
super(), this.onerror = S, this.type = e;
|
|
1414
1473
|
}
|
|
1415
1474
|
emit(e) {
|
|
1416
|
-
|
|
1475
|
+
Me(e) || S(`The response data for the "${this.type}" hook must be an object.`);
|
|
1417
1476
|
const t = Array.from(this.listeners);
|
|
1418
1477
|
if (t.length > 0) {
|
|
1419
1478
|
let r = 0;
|
|
1420
|
-
const n = (s) => (
|
|
1421
|
-
if (
|
|
1479
|
+
const n = (s) => (Oe(s), this.onerror(s), e), o = (s) => {
|
|
1480
|
+
if (kt(e, s)) {
|
|
1422
1481
|
if (e = s, r < t.length) try {
|
|
1423
1482
|
return Promise.resolve(t[r++](e)).then(o, n);
|
|
1424
1483
|
} catch (i) {
|
|
@@ -1431,45 +1490,45 @@ var j = class extends A {
|
|
|
1431
1490
|
}
|
|
1432
1491
|
return Promise.resolve(e);
|
|
1433
1492
|
}
|
|
1434
|
-
},
|
|
1493
|
+
}, j = class {
|
|
1435
1494
|
constructor(e) {
|
|
1436
1495
|
this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
|
|
1437
1496
|
}
|
|
1438
1497
|
applyPlugin(e, t) {
|
|
1439
1498
|
var n;
|
|
1440
|
-
|
|
1499
|
+
P(hr(e), "Plugin configuration is invalid.");
|
|
1441
1500
|
const r = e.name;
|
|
1442
|
-
|
|
1501
|
+
P(r, "A name must be provided by the plugin."), this.registerPlugins[r] || (this.registerPlugins[r] = e, (n = e.apply) == null || n.call(e, t), Object.keys(this.lifecycle).forEach((o) => {
|
|
1443
1502
|
const s = e[o];
|
|
1444
1503
|
s && this.lifecycle[o].on(s);
|
|
1445
1504
|
}));
|
|
1446
1505
|
}
|
|
1447
1506
|
removePlugin(e) {
|
|
1448
|
-
|
|
1507
|
+
P(e, "A name is required.");
|
|
1449
1508
|
const t = this.registerPlugins[e];
|
|
1450
|
-
|
|
1509
|
+
P(t, `The plugin "${e}" is not registered.`), Object.keys(t).forEach((r) => {
|
|
1451
1510
|
r !== "name" && this.lifecycle[r].remove(t[r]);
|
|
1452
1511
|
});
|
|
1453
1512
|
}
|
|
1454
1513
|
};
|
|
1455
|
-
function
|
|
1456
|
-
const r =
|
|
1457
|
-
r.url ||
|
|
1458
|
-
let n =
|
|
1459
|
-
!F
|
|
1514
|
+
function Ot(e, t) {
|
|
1515
|
+
const r = ct(t);
|
|
1516
|
+
r.url || S(Nt, O, { remoteName: e.name });
|
|
1517
|
+
let n = Ne(t, r.url);
|
|
1518
|
+
!F && !n.startsWith("http") && (n = `https:${n}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = n, e.version = t.version, e.buildVersion = t.buildVersion;
|
|
1460
1519
|
}
|
|
1461
|
-
function
|
|
1520
|
+
function dn() {
|
|
1462
1521
|
return {
|
|
1463
1522
|
name: "snapshot-plugin",
|
|
1464
1523
|
async afterResolve(e) {
|
|
1465
1524
|
const { remote: t, pkgNameOrAlias: r, expose: n, origin: o, remoteInfo: s, id: i } = e;
|
|
1466
|
-
if (!
|
|
1467
|
-
const { remoteSnapshot: a, globalSnapshot:
|
|
1525
|
+
if (!Le(t) || !it(t)) {
|
|
1526
|
+
const { remoteSnapshot: a, globalSnapshot: l } = await o.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1468
1527
|
moduleInfo: t,
|
|
1469
1528
|
id: i
|
|
1470
1529
|
});
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1530
|
+
Ot(s, a);
|
|
1531
|
+
const c = {
|
|
1473
1532
|
remote: t,
|
|
1474
1533
|
preloadConfig: {
|
|
1475
1534
|
nameOrAlias: r,
|
|
@@ -1480,13 +1539,13 @@ function cn() {
|
|
|
1480
1539
|
}
|
|
1481
1540
|
}, f = await o.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1482
1541
|
origin: o,
|
|
1483
|
-
preloadOptions:
|
|
1542
|
+
preloadOptions: c,
|
|
1484
1543
|
remoteInfo: s,
|
|
1485
1544
|
remote: t,
|
|
1486
1545
|
remoteSnapshot: a,
|
|
1487
|
-
globalSnapshot:
|
|
1546
|
+
globalSnapshot: l
|
|
1488
1547
|
});
|
|
1489
|
-
return f &&
|
|
1548
|
+
return f && At(s, o, f, !1), {
|
|
1490
1549
|
...e,
|
|
1491
1550
|
remoteSnapshot: a
|
|
1492
1551
|
};
|
|
@@ -1495,7 +1554,7 @@ function cn() {
|
|
|
1495
1554
|
}
|
|
1496
1555
|
};
|
|
1497
1556
|
}
|
|
1498
|
-
function
|
|
1557
|
+
function mn(e) {
|
|
1499
1558
|
const t = e.split(":");
|
|
1500
1559
|
return t.length === 1 ? {
|
|
1501
1560
|
name: t[0],
|
|
@@ -1508,100 +1567,100 @@ function ln(e) {
|
|
|
1508
1567
|
version: t[2]
|
|
1509
1568
|
};
|
|
1510
1569
|
}
|
|
1511
|
-
function
|
|
1570
|
+
function Lt(e, t, r, n, o = {}, s) {
|
|
1512
1571
|
const { value: i } = q(e, Z(t)), a = s || i;
|
|
1513
|
-
if (a && !
|
|
1514
|
-
const
|
|
1515
|
-
for (const
|
|
1516
|
-
if (o[
|
|
1517
|
-
o[
|
|
1518
|
-
const f =
|
|
1519
|
-
|
|
1572
|
+
if (a && !Qe(a) && (r(a, t, n), a.remotesInfo)) {
|
|
1573
|
+
const l = Object.keys(a.remotesInfo);
|
|
1574
|
+
for (const c of l) {
|
|
1575
|
+
if (o[c]) continue;
|
|
1576
|
+
o[c] = !0;
|
|
1577
|
+
const f = mn(c), h = a.remotesInfo[c];
|
|
1578
|
+
Lt(e, {
|
|
1520
1579
|
name: f.name,
|
|
1521
|
-
version:
|
|
1580
|
+
version: h.matchedVersion
|
|
1522
1581
|
}, r, !1, o, void 0);
|
|
1523
1582
|
}
|
|
1524
1583
|
}
|
|
1525
1584
|
}
|
|
1526
1585
|
const Se = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1527
|
-
function
|
|
1528
|
-
const s = [], i = [], a = [],
|
|
1529
|
-
if (
|
|
1530
|
-
var
|
|
1531
|
-
let
|
|
1532
|
-
if (E)
|
|
1586
|
+
function pn(e, t, r, n, o) {
|
|
1587
|
+
const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: f } = e, { preloadConfig: h } = t, { depsRemote: u } = h;
|
|
1588
|
+
if (Lt(n, r, (m, y, E) => {
|
|
1589
|
+
var $;
|
|
1590
|
+
let p;
|
|
1591
|
+
if (E) p = h;
|
|
1533
1592
|
else if (Array.isArray(u)) {
|
|
1534
|
-
const R = u.find((
|
|
1593
|
+
const R = u.find((w) => w.nameOrAlias === y.name || w.nameOrAlias === y.alias);
|
|
1535
1594
|
if (!R) return;
|
|
1536
|
-
|
|
1537
|
-
} else if (u === !0)
|
|
1595
|
+
p = vt(R);
|
|
1596
|
+
} else if (u === !0) p = h;
|
|
1538
1597
|
else return;
|
|
1539
|
-
const g =
|
|
1598
|
+
const g = Ne(m, ct(m).url);
|
|
1540
1599
|
g && a.push({
|
|
1541
1600
|
name: y.name,
|
|
1542
1601
|
moduleInfo: {
|
|
1543
1602
|
name: y.name,
|
|
1544
1603
|
entry: g,
|
|
1545
|
-
type: "remoteEntryType" in
|
|
1546
|
-
entryGlobalName: "globalName" in
|
|
1604
|
+
type: "remoteEntryType" in m ? m.remoteEntryType : "global",
|
|
1605
|
+
entryGlobalName: "globalName" in m ? m.globalName : y.name,
|
|
1547
1606
|
shareScope: "",
|
|
1548
|
-
version: "version" in
|
|
1607
|
+
version: "version" in m ? m.version : void 0
|
|
1549
1608
|
},
|
|
1550
1609
|
url: g
|
|
1551
1610
|
});
|
|
1552
|
-
let b = "modules" in
|
|
1553
|
-
const
|
|
1554
|
-
|
|
1611
|
+
let b = "modules" in m ? m.modules : [];
|
|
1612
|
+
const N = fn(p.exposes);
|
|
1613
|
+
N.length && "modules" in m && (b = ($ = m == null ? void 0 : m.modules) == null ? void 0 : $.reduce((R, w) => ((N == null ? void 0 : N.indexOf(w.moduleName)) !== -1 && R.push(w), R), []));
|
|
1555
1614
|
function _(R) {
|
|
1556
|
-
const
|
|
1557
|
-
return
|
|
1615
|
+
const w = R.map((L) => Ne(m, L));
|
|
1616
|
+
return p.filter ? w.filter(p.filter) : w;
|
|
1558
1617
|
}
|
|
1559
1618
|
if (b) {
|
|
1560
1619
|
const R = b.length;
|
|
1561
|
-
for (let
|
|
1562
|
-
const
|
|
1620
|
+
for (let w = 0; w < R; w++) {
|
|
1621
|
+
const L = b[w], ye = `${y.name}/${L.moduleName}`;
|
|
1563
1622
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1564
|
-
id:
|
|
1623
|
+
id: L.moduleName === "." ? y.name : ye,
|
|
1565
1624
|
name: y.name,
|
|
1566
|
-
remoteSnapshot:
|
|
1567
|
-
preloadConfig:
|
|
1625
|
+
remoteSnapshot: m,
|
|
1626
|
+
preloadConfig: p,
|
|
1568
1627
|
remote: y,
|
|
1569
1628
|
origin: e
|
|
1570
|
-
}), !
|
|
1629
|
+
}), !gr(ye) && (p.resourceCategory === "all" ? (s.push(..._(L.assets.css.async)), s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.async)), i.push(..._(L.assets.js.sync))) : p.resourceCategory === "sync" && (s.push(..._(L.assets.css.sync)), i.push(..._(L.assets.js.sync))), _r(ye));
|
|
1571
1630
|
}
|
|
1572
1631
|
}
|
|
1573
1632
|
}, !0, {}, o), o.shared && o.shared.length > 0) {
|
|
1574
|
-
const
|
|
1575
|
-
const { shared:
|
|
1576
|
-
|
|
1577
|
-
c.add(g);
|
|
1578
|
-
}), E.assets.css.sync.forEach((g) => {
|
|
1633
|
+
const m = (y, E) => {
|
|
1634
|
+
const { shared: p } = de(e.shareScopeMap, E.sharedName, y, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1635
|
+
p && typeof p.lib == "function" && (E.assets.js.sync.forEach((g) => {
|
|
1579
1636
|
l.add(g);
|
|
1637
|
+
}), E.assets.css.sync.forEach((g) => {
|
|
1638
|
+
c.add(g);
|
|
1580
1639
|
}));
|
|
1581
1640
|
};
|
|
1582
1641
|
o.shared.forEach((y) => {
|
|
1583
1642
|
var g;
|
|
1584
1643
|
const E = (g = f.shared) == null ? void 0 : g[y.sharedName];
|
|
1585
1644
|
if (!E) return;
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
|
|
1645
|
+
const p = y.version ? E.find((b) => b.version === y.version) : E;
|
|
1646
|
+
p && at(p).forEach((b) => {
|
|
1647
|
+
m(b, y);
|
|
1589
1648
|
});
|
|
1590
1649
|
});
|
|
1591
1650
|
}
|
|
1592
|
-
const
|
|
1651
|
+
const d = i.filter((m) => !l.has(m) && !Se("script", m));
|
|
1593
1652
|
return {
|
|
1594
|
-
cssAssets: s.filter((
|
|
1595
|
-
jsAssetsWithoutEntry:
|
|
1596
|
-
entryAssets: a.filter((
|
|
1653
|
+
cssAssets: s.filter((m) => !c.has(m) && !Se("link", m)),
|
|
1654
|
+
jsAssetsWithoutEntry: d,
|
|
1655
|
+
entryAssets: a.filter((m) => !Se("script", m.url))
|
|
1597
1656
|
};
|
|
1598
1657
|
}
|
|
1599
|
-
const
|
|
1658
|
+
const yn = function() {
|
|
1600
1659
|
return {
|
|
1601
1660
|
name: "generate-preload-assets-plugin",
|
|
1602
1661
|
async generatePreloadAssets(e) {
|
|
1603
1662
|
const { origin: t, preloadOptions: r, remoteInfo: n, remote: o, globalSnapshot: s, remoteSnapshot: i } = e;
|
|
1604
|
-
return F
|
|
1663
|
+
return F ? Le(o) && it(o) ? {
|
|
1605
1664
|
cssAssets: [],
|
|
1606
1665
|
jsAssetsWithoutEntry: [],
|
|
1607
1666
|
entryAssets: [{
|
|
@@ -1615,7 +1674,7 @@ const fn = function() {
|
|
|
1615
1674
|
shareScope: ""
|
|
1616
1675
|
}
|
|
1617
1676
|
}]
|
|
1618
|
-
} : (
|
|
1677
|
+
} : (Ot(n, i), pn(t, r, n, s, i)) : {
|
|
1619
1678
|
cssAssets: [],
|
|
1620
1679
|
jsAssetsWithoutEntry: [],
|
|
1621
1680
|
entryAssets: []
|
|
@@ -1623,34 +1682,34 @@ const fn = function() {
|
|
|
1623
1682
|
}
|
|
1624
1683
|
};
|
|
1625
1684
|
};
|
|
1626
|
-
function
|
|
1685
|
+
function Mt(e, t) {
|
|
1627
1686
|
const r = ue({
|
|
1628
1687
|
name: t.name,
|
|
1629
1688
|
version: t.options.version
|
|
1630
1689
|
}), n = r && "remotesInfo" in r && r.remotesInfo && q(r.remotesInfo, e.name).value;
|
|
1631
1690
|
return n && n.matchedVersion ? {
|
|
1632
1691
|
hostGlobalSnapshot: r,
|
|
1633
|
-
globalSnapshot:
|
|
1692
|
+
globalSnapshot: Ge(),
|
|
1634
1693
|
remoteSnapshot: ue({
|
|
1635
1694
|
name: e.name,
|
|
1636
1695
|
version: n.matchedVersion
|
|
1637
1696
|
})
|
|
1638
1697
|
} : {
|
|
1639
1698
|
hostGlobalSnapshot: void 0,
|
|
1640
|
-
globalSnapshot:
|
|
1699
|
+
globalSnapshot: Ge(),
|
|
1641
1700
|
remoteSnapshot: ue({
|
|
1642
1701
|
name: e.name,
|
|
1643
1702
|
version: "version" in e ? e.version : void 0
|
|
1644
1703
|
})
|
|
1645
1704
|
};
|
|
1646
1705
|
}
|
|
1647
|
-
var
|
|
1706
|
+
var En = class {
|
|
1648
1707
|
constructor(e) {
|
|
1649
|
-
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new
|
|
1650
|
-
beforeLoadRemoteSnapshot: new
|
|
1651
|
-
loadSnapshot: new
|
|
1652
|
-
loadRemoteSnapshot: new
|
|
1653
|
-
afterLoadSnapshot: new
|
|
1708
|
+
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new j({
|
|
1709
|
+
beforeLoadRemoteSnapshot: new A("beforeLoadRemoteSnapshot"),
|
|
1710
|
+
loadSnapshot: new D("loadGlobalSnapshot"),
|
|
1711
|
+
loadRemoteSnapshot: new D("loadRemoteSnapshot"),
|
|
1712
|
+
afterLoadSnapshot: new D("afterLoadSnapshot")
|
|
1654
1713
|
}), this.manifestLoading = Q.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
1655
1714
|
}
|
|
1656
1715
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, expose: r }) {
|
|
@@ -1667,46 +1726,47 @@ var hn = class {
|
|
|
1667
1726
|
version: this.HostInstance.options.version || "",
|
|
1668
1727
|
remoteEntry: "",
|
|
1669
1728
|
remotesInfo: {}
|
|
1670
|
-
},
|
|
1729
|
+
}, yr({ [this.HostInstance.options.name]: o })), o && "remotesInfo" in o && !q(o.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (o.remotesInfo = {
|
|
1671
1730
|
...o == null ? void 0 : o.remotesInfo,
|
|
1672
1731
|
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
1673
1732
|
});
|
|
1674
|
-
const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot:
|
|
1733
|
+
const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: l, globalSnapshot: c } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1675
1734
|
options: n,
|
|
1676
1735
|
moduleInfo: e,
|
|
1677
1736
|
hostGlobalSnapshot: s,
|
|
1678
1737
|
remoteSnapshot: i,
|
|
1679
1738
|
globalSnapshot: a
|
|
1680
1739
|
});
|
|
1681
|
-
let f,
|
|
1682
|
-
if (
|
|
1683
|
-
const u = F
|
|
1740
|
+
let f, h;
|
|
1741
|
+
if (l) if (Qe(l)) {
|
|
1742
|
+
const u = F ? l.remoteEntry : l.ssrRemoteEntry || l.remoteEntry || "", d = await this.getManifestJson(u, e, {}), m = xe({
|
|
1684
1743
|
...e,
|
|
1685
1744
|
entry: u
|
|
1686
|
-
},
|
|
1687
|
-
f =
|
|
1745
|
+
}, d);
|
|
1746
|
+
f = d, h = m;
|
|
1688
1747
|
} else {
|
|
1689
1748
|
const { remoteSnapshot: u } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1690
1749
|
options: this.HostInstance.options,
|
|
1691
1750
|
moduleInfo: e,
|
|
1692
|
-
remoteSnapshot:
|
|
1751
|
+
remoteSnapshot: l,
|
|
1693
1752
|
from: "global"
|
|
1694
1753
|
});
|
|
1695
|
-
f = u,
|
|
1754
|
+
f = u, h = c;
|
|
1696
1755
|
}
|
|
1697
|
-
else if (
|
|
1698
|
-
const u = await this.getManifestJson(e.entry, e, {}),
|
|
1756
|
+
else if (Le(e)) {
|
|
1757
|
+
const u = await this.getManifestJson(e.entry, e, {}), d = xe(e, u), { remoteSnapshot: m } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1699
1758
|
options: this.HostInstance.options,
|
|
1700
1759
|
moduleInfo: e,
|
|
1701
1760
|
remoteSnapshot: u,
|
|
1702
1761
|
from: "global"
|
|
1703
1762
|
});
|
|
1704
|
-
f =
|
|
1705
|
-
} else
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1763
|
+
f = m, h = d;
|
|
1764
|
+
} else S($t, O, {
|
|
1765
|
+
remoteName: e.name,
|
|
1766
|
+
remoteVersion: e.version,
|
|
1767
|
+
hostName: this.HostInstance.options.name,
|
|
1768
|
+
globalSnapshot: JSON.stringify(c)
|
|
1769
|
+
}, void 0, z(this.HostInstance.options));
|
|
1710
1770
|
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1711
1771
|
id: t,
|
|
1712
1772
|
host: this.HostInstance,
|
|
@@ -1715,11 +1775,11 @@ var hn = class {
|
|
|
1715
1775
|
remoteSnapshot: f
|
|
1716
1776
|
}), {
|
|
1717
1777
|
remoteSnapshot: f,
|
|
1718
|
-
globalSnapshot:
|
|
1778
|
+
globalSnapshot: h
|
|
1719
1779
|
};
|
|
1720
1780
|
}
|
|
1721
1781
|
getGlobalRemoteInfo(e) {
|
|
1722
|
-
return
|
|
1782
|
+
return Mt(e, this.HostInstance);
|
|
1723
1783
|
}
|
|
1724
1784
|
async getManifestJson(e, t, r) {
|
|
1725
1785
|
const n = async () => {
|
|
@@ -1735,15 +1795,19 @@ var hn = class {
|
|
|
1735
1795
|
from: "runtime",
|
|
1736
1796
|
lifecycle: "afterResolve",
|
|
1737
1797
|
origin: this.HostInstance
|
|
1738
|
-
}), s || (delete this.manifestLoading[e],
|
|
1798
|
+
}), s || (delete this.manifestLoading[e], S(bt, O, {
|
|
1739
1799
|
manifestUrl: e,
|
|
1740
1800
|
moduleName: t.name,
|
|
1741
1801
|
hostName: this.HostInstance.options.name
|
|
1742
|
-
}, `${i}
|
|
1802
|
+
}, `${i}`, z(this.HostInstance.options)));
|
|
1743
1803
|
}
|
|
1744
|
-
return
|
|
1804
|
+
return P(s.metaData && s.exposes && s.shared, `"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${[
|
|
1805
|
+
!s.metaData && "metaData",
|
|
1806
|
+
!s.exposes && "exposes",
|
|
1807
|
+
!s.shared && "shared"
|
|
1808
|
+
].filter(Boolean).join(", ")}.`), this.manifestCache.set(e, s), s;
|
|
1745
1809
|
}, o = async () => {
|
|
1746
|
-
const s = await n(), i =
|
|
1810
|
+
const s = await n(), i = Qt(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1747
1811
|
options: this.HostInstance.options,
|
|
1748
1812
|
moduleInfo: t,
|
|
1749
1813
|
manifestJson: s,
|
|
@@ -1755,19 +1819,19 @@ var hn = class {
|
|
|
1755
1819
|
};
|
|
1756
1820
|
return this.manifestLoading[e] || (this.manifestLoading[e] = o().then((s) => s)), this.manifestLoading[e];
|
|
1757
1821
|
}
|
|
1758
|
-
},
|
|
1822
|
+
}, gn = class {
|
|
1759
1823
|
constructor(e) {
|
|
1760
|
-
this.hooks = new
|
|
1761
|
-
beforeRegisterShare: new
|
|
1762
|
-
afterResolve: new
|
|
1763
|
-
beforeLoadShare: new
|
|
1764
|
-
loadShare: new
|
|
1765
|
-
resolveShare: new
|
|
1766
|
-
initContainerShareScopeMap: new
|
|
1824
|
+
this.hooks = new j({
|
|
1825
|
+
beforeRegisterShare: new W("beforeRegisterShare"),
|
|
1826
|
+
afterResolve: new D("afterResolve"),
|
|
1827
|
+
beforeLoadShare: new D("beforeLoadShare"),
|
|
1828
|
+
loadShare: new A(),
|
|
1829
|
+
resolveShare: new W("resolveShare"),
|
|
1830
|
+
initContainerShareScopeMap: new W("initContainerShareScopeMap")
|
|
1767
1831
|
}), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
|
|
1768
1832
|
}
|
|
1769
1833
|
registerShared(e, t) {
|
|
1770
|
-
const { newShareInfos: r, allShareInfos: n } =
|
|
1834
|
+
const { newShareInfos: r, allShareInfos: n } = yt(e, t);
|
|
1771
1835
|
return Object.keys(r).forEach((o) => {
|
|
1772
1836
|
r[o].forEach((s) => {
|
|
1773
1837
|
s.scope.forEach((i) => {
|
|
@@ -1792,7 +1856,7 @@ var hn = class {
|
|
|
1792
1856
|
};
|
|
1793
1857
|
}
|
|
1794
1858
|
async loadShare(e, t) {
|
|
1795
|
-
const { host: r } = this, n =
|
|
1859
|
+
const { host: r } = this, n = qe({
|
|
1796
1860
|
pkgName: e,
|
|
1797
1861
|
extraOptions: t,
|
|
1798
1862
|
shareInfos: r.options.shared
|
|
@@ -1806,19 +1870,19 @@ var hn = class {
|
|
|
1806
1870
|
shared: r.options.shared,
|
|
1807
1871
|
origin: r
|
|
1808
1872
|
});
|
|
1809
|
-
|
|
1873
|
+
P(o, `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.`);
|
|
1810
1874
|
const { shared: s, useTreesShaking: i } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
1811
1875
|
if (s) {
|
|
1812
1876
|
const a = ie(s, i);
|
|
1813
1877
|
if (a.lib)
|
|
1814
|
-
return
|
|
1878
|
+
return U(a, r.options.name), a.lib;
|
|
1815
1879
|
if (a.loading && !a.loaded) {
|
|
1816
|
-
const
|
|
1817
|
-
return a.loaded = !0, a.lib || (a.lib =
|
|
1880
|
+
const l = await a.loading;
|
|
1881
|
+
return a.loaded = !0, a.lib || (a.lib = l), U(a, r.options.name), l;
|
|
1818
1882
|
} else {
|
|
1819
|
-
const
|
|
1883
|
+
const c = (async () => {
|
|
1820
1884
|
const f = await a.get();
|
|
1821
|
-
return
|
|
1885
|
+
return U(a, r.options.name), a.loaded = !0, a.lib = f, f;
|
|
1822
1886
|
})();
|
|
1823
1887
|
return this.setShared({
|
|
1824
1888
|
pkgName: e,
|
|
@@ -1826,21 +1890,21 @@ var hn = class {
|
|
|
1826
1890
|
shared: s,
|
|
1827
1891
|
from: r.options.name,
|
|
1828
1892
|
lib: null,
|
|
1829
|
-
loading:
|
|
1893
|
+
loading: c,
|
|
1830
1894
|
treeShaking: i ? a : void 0
|
|
1831
|
-
}),
|
|
1895
|
+
}), c;
|
|
1832
1896
|
}
|
|
1833
1897
|
} else {
|
|
1834
1898
|
if (t != null && t.customShareInfo) return !1;
|
|
1835
|
-
const a = ee(o.treeShaking),
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
const { shared: u, useTreesShaking:
|
|
1899
|
+
const a = ee(o.treeShaking), l = ie(o, a), f = (async () => {
|
|
1900
|
+
const h = await l.get();
|
|
1901
|
+
l.lib = h, l.loaded = !0, U(l, r.options.name);
|
|
1902
|
+
const { shared: u, useTreesShaking: d } = de(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
1839
1903
|
if (u) {
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1904
|
+
const m = ie(u, d);
|
|
1905
|
+
m.lib = h, m.loaded = !0, u.from = o.from;
|
|
1842
1906
|
}
|
|
1843
|
-
return
|
|
1907
|
+
return h;
|
|
1844
1908
|
})();
|
|
1845
1909
|
return this.setShared({
|
|
1846
1910
|
pkgName: e,
|
|
@@ -1849,7 +1913,7 @@ var hn = class {
|
|
|
1849
1913
|
from: r.options.name,
|
|
1850
1914
|
lib: null,
|
|
1851
1915
|
loading: f,
|
|
1852
|
-
treeShaking: a ?
|
|
1916
|
+
treeShaking: a ? l : void 0
|
|
1853
1917
|
}), f;
|
|
1854
1918
|
}
|
|
1855
1919
|
}
|
|
@@ -1865,45 +1929,45 @@ var hn = class {
|
|
|
1865
1929
|
if (n !== "build") {
|
|
1866
1930
|
const { initTokens: u } = this;
|
|
1867
1931
|
s || (s = []);
|
|
1868
|
-
let
|
|
1869
|
-
if (
|
|
1870
|
-
s.push(
|
|
1932
|
+
let d = u[e];
|
|
1933
|
+
if (d || (d = u[e] = { from: this.host.name }), s.indexOf(d) >= 0) return i;
|
|
1934
|
+
s.push(d);
|
|
1871
1935
|
}
|
|
1872
|
-
const a = this.shareScopeMap,
|
|
1936
|
+
const a = this.shareScopeMap, l = r.options.name;
|
|
1873
1937
|
a[e] || (a[e] = {});
|
|
1874
|
-
const
|
|
1938
|
+
const c = a[e], f = (u, d) => {
|
|
1875
1939
|
var b;
|
|
1876
|
-
const { version:
|
|
1877
|
-
|
|
1878
|
-
const E =
|
|
1879
|
-
(!
|
|
1880
|
-
},
|
|
1881
|
-
const { module:
|
|
1882
|
-
let
|
|
1940
|
+
const { version: m, eager: y } = d;
|
|
1941
|
+
c[u] = c[u] || {};
|
|
1942
|
+
const E = c[u], p = E[m] && ie(E[m]), g = !!(p && ("eager" in p && p.eager || "shareConfig" in p && ((b = p.shareConfig) != null && b.eager)));
|
|
1943
|
+
(!p || p.strategy !== "loaded-first" && !p.loaded && (!y != !g ? y : l > E[m].from)) && (E[m] = d);
|
|
1944
|
+
}, h = async (u) => {
|
|
1945
|
+
const { module: d } = await r.remoteHandler.getRemoteModuleAndOptions({ id: u });
|
|
1946
|
+
let m;
|
|
1883
1947
|
try {
|
|
1884
|
-
|
|
1948
|
+
m = await d.getEntry();
|
|
1885
1949
|
} catch (y) {
|
|
1886
|
-
|
|
1950
|
+
if (m = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
1887
1951
|
id: u,
|
|
1888
1952
|
error: y,
|
|
1889
1953
|
from: "runtime",
|
|
1890
1954
|
lifecycle: "beforeLoadShare",
|
|
1891
1955
|
origin: r
|
|
1892
|
-
});
|
|
1956
|
+
}), !m) return;
|
|
1893
1957
|
} finally {
|
|
1894
|
-
|
|
1958
|
+
m != null && m.init && !d.initing && (d.remoteEntryExports = m, await d.init(void 0, void 0, s));
|
|
1895
1959
|
}
|
|
1896
1960
|
};
|
|
1897
1961
|
return Object.keys(r.options.shared).forEach((u) => {
|
|
1898
|
-
r.options.shared[u].forEach((
|
|
1899
|
-
|
|
1962
|
+
r.options.shared[u].forEach((d) => {
|
|
1963
|
+
d.scope.includes(e) && f(u, d);
|
|
1900
1964
|
});
|
|
1901
1965
|
}), (r.options.shareStrategy === "version-first" || o === "version-first") && r.options.remotes.forEach((u) => {
|
|
1902
|
-
u.shareScope === e && i.push(
|
|
1966
|
+
u.shareScope === e && i.push(h(u.name));
|
|
1903
1967
|
}), i;
|
|
1904
1968
|
}
|
|
1905
1969
|
loadShareSync(e, t) {
|
|
1906
|
-
const { host: r } = this, n =
|
|
1970
|
+
const { host: r } = this, n = qe({
|
|
1907
1971
|
pkgName: e,
|
|
1908
1972
|
extraOptions: t,
|
|
1909
1973
|
shareInfos: r.options.shared
|
|
@@ -1914,11 +1978,11 @@ var hn = class {
|
|
|
1914
1978
|
const { shared: o, useTreesShaking: s } = de(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
|
|
1915
1979
|
if (o) {
|
|
1916
1980
|
if (typeof o.lib == "function")
|
|
1917
|
-
return
|
|
1981
|
+
return U(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
|
|
1918
1982
|
if (typeof o.get == "function") {
|
|
1919
1983
|
const i = o.get();
|
|
1920
1984
|
if (!(i instanceof Promise))
|
|
1921
|
-
return
|
|
1985
|
+
return U(o, r.options.name), this.setShared({
|
|
1922
1986
|
pkgName: e,
|
|
1923
1987
|
loaded: !0,
|
|
1924
1988
|
from: r.options.name,
|
|
@@ -1931,14 +1995,10 @@ var hn = class {
|
|
|
1931
1995
|
return n.loaded || (n.loaded = !0), n.lib;
|
|
1932
1996
|
if (n.get) {
|
|
1933
1997
|
const i = n.get();
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
sharedPkgName: e
|
|
1939
|
-
}));
|
|
1940
|
-
}
|
|
1941
|
-
return n.lib = i, this.setShared({
|
|
1998
|
+
return i instanceof Promise && S((t == null ? void 0 : t.from) === "build" ? St : Ae, O, {
|
|
1999
|
+
hostName: r.options.name,
|
|
2000
|
+
sharedPkgName: e
|
|
2001
|
+
}, void 0, z(r.options)), n.lib = i, this.setShared({
|
|
1942
2002
|
pkgName: e,
|
|
1943
2003
|
loaded: !0,
|
|
1944
2004
|
from: r.options.name,
|
|
@@ -1946,10 +2006,10 @@ var hn = class {
|
|
|
1946
2006
|
shared: n
|
|
1947
2007
|
}), n.lib;
|
|
1948
2008
|
}
|
|
1949
|
-
|
|
2009
|
+
S(Ae, O, {
|
|
1950
2010
|
hostName: r.options.name,
|
|
1951
2011
|
sharedPkgName: e
|
|
1952
|
-
}));
|
|
2012
|
+
}, void 0, z(r.options));
|
|
1953
2013
|
}
|
|
1954
2014
|
initShareScopeMap(e, t, r = {}) {
|
|
1955
2015
|
const { host: n } = this;
|
|
@@ -1962,40 +2022,40 @@ var hn = class {
|
|
|
1962
2022
|
});
|
|
1963
2023
|
}
|
|
1964
2024
|
setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
|
|
1965
|
-
const { version:
|
|
1966
|
-
const
|
|
1967
|
-
g && !E[
|
|
1968
|
-
}, y = a ?
|
|
1969
|
-
|
|
2025
|
+
const { version: l, scope: c = "default", ...f } = t, h = Array.isArray(c) ? c : [c], u = (d) => {
|
|
2026
|
+
const m = (E, p, g) => {
|
|
2027
|
+
g && !E[p] && (E[p] = g);
|
|
2028
|
+
}, y = a ? d.treeShaking : d;
|
|
2029
|
+
m(y, "loaded", s), m(y, "loading", o), m(y, "get", i);
|
|
1970
2030
|
};
|
|
1971
|
-
|
|
1972
|
-
this.shareScopeMap[
|
|
1973
|
-
version:
|
|
1974
|
-
scope: [
|
|
2031
|
+
h.forEach((d) => {
|
|
2032
|
+
this.shareScopeMap[d] || (this.shareScopeMap[d] = {}), this.shareScopeMap[d][e] || (this.shareScopeMap[d][e] = {}), this.shareScopeMap[d][e][l] || (this.shareScopeMap[d][e][l] = {
|
|
2033
|
+
version: l,
|
|
2034
|
+
scope: [d],
|
|
1975
2035
|
...f,
|
|
1976
2036
|
lib: n
|
|
1977
2037
|
});
|
|
1978
|
-
const
|
|
1979
|
-
u(
|
|
2038
|
+
const m = this.shareScopeMap[d][e][l];
|
|
2039
|
+
u(m), r && m.from !== r && (m.from = r);
|
|
1980
2040
|
});
|
|
1981
2041
|
}
|
|
1982
2042
|
_setGlobalShareScopeMap(e) {
|
|
1983
|
-
const t =
|
|
2043
|
+
const t = Et(), r = e.id || e.name;
|
|
1984
2044
|
r && !t[r] && (t[r] = this.shareScopeMap);
|
|
1985
2045
|
}
|
|
1986
|
-
},
|
|
2046
|
+
}, _n = class {
|
|
1987
2047
|
constructor(e) {
|
|
1988
|
-
this.hooks = new
|
|
1989
|
-
beforeRegisterRemote: new
|
|
1990
|
-
registerRemote: new
|
|
1991
|
-
beforeRequest: new
|
|
1992
|
-
onLoad: new
|
|
1993
|
-
handlePreloadModule: new
|
|
1994
|
-
errorLoadRemote: new
|
|
1995
|
-
beforePreloadRemote: new
|
|
1996
|
-
generatePreloadAssets: new
|
|
1997
|
-
afterPreloadRemote: new
|
|
1998
|
-
loadEntry: new
|
|
2048
|
+
this.hooks = new j({
|
|
2049
|
+
beforeRegisterRemote: new W("beforeRegisterRemote"),
|
|
2050
|
+
registerRemote: new W("registerRemote"),
|
|
2051
|
+
beforeRequest: new D("beforeRequest"),
|
|
2052
|
+
onLoad: new A("onLoad"),
|
|
2053
|
+
handlePreloadModule: new v("handlePreloadModule"),
|
|
2054
|
+
errorLoadRemote: new A("errorLoadRemote"),
|
|
2055
|
+
beforePreloadRemote: new A("beforePreloadRemote"),
|
|
2056
|
+
generatePreloadAssets: new A("generatePreloadAssets"),
|
|
2057
|
+
afterPreloadRemote: new A(),
|
|
2058
|
+
loadEntry: new A()
|
|
1999
2059
|
}), this.host = e, this.idToRemoteMap = {};
|
|
2000
2060
|
}
|
|
2001
2061
|
formatAndRegisterRemote(e, t) {
|
|
@@ -2025,18 +2085,18 @@ var hn = class {
|
|
|
2025
2085
|
async loadRemote(e, t) {
|
|
2026
2086
|
const { host: r } = this;
|
|
2027
2087
|
try {
|
|
2028
|
-
const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote:
|
|
2088
|
+
const { loadFactory: n = !0 } = t || { loadFactory: !0 }, { module: o, moduleOptions: s, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: a, remote: l, expose: c, id: f, remoteSnapshot: h } = i, u = await o.get(f, c, t, h), d = await this.hooks.lifecycle.onLoad.emit({
|
|
2029
2089
|
id: f,
|
|
2030
2090
|
pkgNameOrAlias: a,
|
|
2031
|
-
expose:
|
|
2091
|
+
expose: c,
|
|
2032
2092
|
exposeModule: n ? u : void 0,
|
|
2033
2093
|
exposeModuleFactory: n ? void 0 : u,
|
|
2034
|
-
remote:
|
|
2094
|
+
remote: l,
|
|
2035
2095
|
options: s,
|
|
2036
2096
|
moduleInstance: o,
|
|
2037
2097
|
origin: r
|
|
2038
2098
|
});
|
|
2039
|
-
return this.setIdToRemoteMap(e, i), typeof
|
|
2099
|
+
return this.setIdToRemoteMap(e, i), typeof d == "function" ? d : u;
|
|
2040
2100
|
} catch (n) {
|
|
2041
2101
|
const { from: o = "runtime" } = t || { from: "runtime" }, s = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2042
2102
|
id: e,
|
|
@@ -2056,9 +2116,9 @@ var hn = class {
|
|
|
2056
2116
|
options: t.options,
|
|
2057
2117
|
origin: t
|
|
2058
2118
|
});
|
|
2059
|
-
const r =
|
|
2119
|
+
const r = un(t.options.remotes, e);
|
|
2060
2120
|
await Promise.all(r.map(async (n) => {
|
|
2061
|
-
const { remote: o } = n, s =
|
|
2121
|
+
const { remote: o } = n, s = ke(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2062
2122
|
origin: t,
|
|
2063
2123
|
preloadOptions: n,
|
|
2064
2124
|
remote: o,
|
|
@@ -2066,7 +2126,7 @@ var hn = class {
|
|
|
2066
2126
|
globalSnapshot: i,
|
|
2067
2127
|
remoteSnapshot: a
|
|
2068
2128
|
});
|
|
2069
|
-
|
|
2129
|
+
l && At(s, t, l);
|
|
2070
2130
|
}));
|
|
2071
2131
|
}
|
|
2072
2132
|
registerRemotes(e, t) {
|
|
@@ -2084,50 +2144,50 @@ var hn = class {
|
|
|
2084
2144
|
options: t.options,
|
|
2085
2145
|
origin: t
|
|
2086
2146
|
});
|
|
2087
|
-
} catch (
|
|
2147
|
+
} catch (d) {
|
|
2088
2148
|
if (n = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2089
2149
|
id: r,
|
|
2090
2150
|
options: t.options,
|
|
2091
2151
|
origin: t,
|
|
2092
2152
|
from: "runtime",
|
|
2093
|
-
error:
|
|
2153
|
+
error: d,
|
|
2094
2154
|
lifecycle: "beforeRequest"
|
|
2095
|
-
}), !n) throw
|
|
2155
|
+
}), !n) throw d;
|
|
2096
2156
|
}
|
|
2097
|
-
const { id: o } = n, s =
|
|
2098
|
-
|
|
2157
|
+
const { id: o } = n, s = Zr(t.options.remotes, o);
|
|
2158
|
+
s || S(Rt, O, {
|
|
2099
2159
|
hostName: t.options.name,
|
|
2100
2160
|
requestId: o
|
|
2101
|
-
}));
|
|
2102
|
-
const { remote: i } = s, a =
|
|
2161
|
+
}, void 0, z(t.options));
|
|
2162
|
+
const { remote: i } = s, a = ke(i), l = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2103
2163
|
id: o,
|
|
2104
2164
|
...s,
|
|
2105
2165
|
options: t.options,
|
|
2106
2166
|
origin: t,
|
|
2107
2167
|
remoteInfo: a
|
|
2108
|
-
}), { remote:
|
|
2109
|
-
|
|
2110
|
-
let
|
|
2168
|
+
}), { remote: c, expose: f } = l;
|
|
2169
|
+
P(c && f, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${o}.`);
|
|
2170
|
+
let h = t.moduleCache.get(c.name);
|
|
2111
2171
|
const u = {
|
|
2112
2172
|
host: t,
|
|
2113
2173
|
remoteInfo: a
|
|
2114
2174
|
};
|
|
2115
|
-
return
|
|
2116
|
-
module:
|
|
2175
|
+
return h || (h = new Pt(u), t.moduleCache.set(c.name, h)), {
|
|
2176
|
+
module: h,
|
|
2117
2177
|
moduleOptions: u,
|
|
2118
|
-
remoteMatchInfo:
|
|
2178
|
+
remoteMatchInfo: l
|
|
2119
2179
|
};
|
|
2120
2180
|
}
|
|
2121
2181
|
registerRemote(e, t, r) {
|
|
2122
2182
|
const { host: n } = this, o = () => {
|
|
2123
2183
|
if (e.alias) {
|
|
2124
2184
|
const i = t.find((a) => {
|
|
2125
|
-
var
|
|
2126
|
-
return e.alias && (a.name.startsWith(e.alias) || ((
|
|
2185
|
+
var l;
|
|
2186
|
+
return e.alias && (a.name.startsWith(e.alias) || ((l = a.alias) == null ? void 0 : l.startsWith(e.alias)));
|
|
2127
2187
|
});
|
|
2128
|
-
|
|
2188
|
+
P(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2129
2189
|
}
|
|
2130
|
-
"entry" in e && F
|
|
2190
|
+
"entry" in e && F && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = re), e.type || (e.type = pt);
|
|
2131
2191
|
};
|
|
2132
2192
|
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2133
2193
|
remote: e,
|
|
@@ -2144,7 +2204,7 @@ var hn = class {
|
|
|
2144
2204
|
r != null && r.force && (this.removeRemote(s), o(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2145
2205
|
remote: e,
|
|
2146
2206
|
origin: n
|
|
2147
|
-
}),
|
|
2207
|
+
}), Ye(i.join(" ")));
|
|
2148
2208
|
}
|
|
2149
2209
|
}
|
|
2150
2210
|
removeRemote(e) {
|
|
@@ -2156,88 +2216,88 @@ var hn = class {
|
|
|
2156
2216
|
if (s) {
|
|
2157
2217
|
const i = s.remoteInfo, a = i.entryGlobalName;
|
|
2158
2218
|
I[a] && ((t = Object.getOwnPropertyDescriptor(I, a)) != null && t.configurable ? delete I[a] : I[a] = void 0);
|
|
2159
|
-
const
|
|
2160
|
-
|
|
2161
|
-
let
|
|
2162
|
-
const f = I.__FEDERATION__.__INSTANCES__.findIndex((u) => i.buildVersion ? u.options.id ===
|
|
2219
|
+
const l = Pe(s.remoteInfo);
|
|
2220
|
+
B[l] && delete B[l], r.snapshotHandler.manifestCache.delete(i.entry);
|
|
2221
|
+
let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
|
|
2222
|
+
const f = I.__FEDERATION__.__INSTANCES__.findIndex((u) => i.buildVersion ? u.options.id === c : u.name === c);
|
|
2163
2223
|
if (f !== -1) {
|
|
2164
2224
|
const u = I.__FEDERATION__.__INSTANCES__[f];
|
|
2165
|
-
|
|
2166
|
-
const
|
|
2167
|
-
let
|
|
2225
|
+
c = u.options.id || c;
|
|
2226
|
+
const d = Et();
|
|
2227
|
+
let m = !0;
|
|
2168
2228
|
const y = [];
|
|
2169
|
-
Object.keys(
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2172
|
-
const b =
|
|
2173
|
-
b && Object.keys(b).forEach((
|
|
2174
|
-
const _ = b[
|
|
2175
|
-
_ && Object.keys(_).forEach((
|
|
2176
|
-
const R = _[
|
|
2177
|
-
R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((
|
|
2229
|
+
Object.keys(d).forEach((E) => {
|
|
2230
|
+
const p = d[E];
|
|
2231
|
+
p && Object.keys(p).forEach((g) => {
|
|
2232
|
+
const b = p[g];
|
|
2233
|
+
b && Object.keys(b).forEach((N) => {
|
|
2234
|
+
const _ = b[N];
|
|
2235
|
+
_ && Object.keys(_).forEach(($) => {
|
|
2236
|
+
const R = _[$];
|
|
2237
|
+
R && typeof R == "object" && R.from === i.name && (R.loaded || R.loading ? (R.useIn = R.useIn.filter((w) => w !== i.name), R.useIn.length ? m = !1 : y.push([
|
|
2178
2238
|
E,
|
|
2179
2239
|
g,
|
|
2180
|
-
|
|
2181
|
-
|
|
2240
|
+
N,
|
|
2241
|
+
$
|
|
2182
2242
|
])) : y.push([
|
|
2183
2243
|
E,
|
|
2184
2244
|
g,
|
|
2185
|
-
|
|
2186
|
-
|
|
2245
|
+
N,
|
|
2246
|
+
$
|
|
2187
2247
|
]));
|
|
2188
2248
|
});
|
|
2189
2249
|
});
|
|
2190
2250
|
});
|
|
2191
|
-
}),
|
|
2192
|
-
var
|
|
2193
|
-
(
|
|
2251
|
+
}), m && (u.shareScopeMap = {}, delete d[c]), y.forEach(([E, p, g, b]) => {
|
|
2252
|
+
var N, _, $;
|
|
2253
|
+
($ = (_ = (N = d[E]) == null ? void 0 : N[p]) == null ? void 0 : _[g]) == null || delete $[b];
|
|
2194
2254
|
}), I.__FEDERATION__.__INSTANCES__.splice(f, 1);
|
|
2195
2255
|
}
|
|
2196
|
-
const { hostGlobalSnapshot:
|
|
2197
|
-
if (
|
|
2198
|
-
const u =
|
|
2199
|
-
u && (delete
|
|
2256
|
+
const { hostGlobalSnapshot: h } = Mt(e, r);
|
|
2257
|
+
if (h) {
|
|
2258
|
+
const u = h && "remotesInfo" in h && h.remotesInfo && q(h.remotesInfo, e.name).key;
|
|
2259
|
+
u && (delete h.remotesInfo[u], Q.__FEDERATION__.__MANIFEST_LOADING__[u] && delete Q.__FEDERATION__.__MANIFEST_LOADING__[u]);
|
|
2200
2260
|
}
|
|
2201
2261
|
r.moduleCache.delete(e.name);
|
|
2202
2262
|
}
|
|
2203
2263
|
} catch (r) {
|
|
2204
|
-
|
|
2264
|
+
ve.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
|
|
2205
2265
|
}
|
|
2206
2266
|
}
|
|
2207
2267
|
};
|
|
2208
|
-
const
|
|
2209
|
-
var
|
|
2268
|
+
const bn = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : !0;
|
|
2269
|
+
var Rn = class {
|
|
2210
2270
|
constructor(e) {
|
|
2211
|
-
this.hooks = new
|
|
2212
|
-
beforeInit: new
|
|
2213
|
-
init: new
|
|
2214
|
-
beforeInitContainer: new
|
|
2215
|
-
initContainer: new
|
|
2216
|
-
}), this.version = "2.
|
|
2217
|
-
getModuleInfo: new
|
|
2218
|
-
createScript: new
|
|
2219
|
-
createLink: new
|
|
2220
|
-
fetch: new
|
|
2221
|
-
loadEntryError: new
|
|
2222
|
-
getModuleFactory: new
|
|
2223
|
-
}), this.bridgeHook = new
|
|
2224
|
-
beforeBridgeRender: new
|
|
2225
|
-
afterBridgeRender: new
|
|
2226
|
-
beforeBridgeDestroy: new
|
|
2227
|
-
afterBridgeDestroy: new
|
|
2271
|
+
this.hooks = new j({
|
|
2272
|
+
beforeInit: new W("beforeInit"),
|
|
2273
|
+
init: new v(),
|
|
2274
|
+
beforeInitContainer: new D("beforeInitContainer"),
|
|
2275
|
+
initContainer: new D("initContainer")
|
|
2276
|
+
}), this.version = "2.2.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
|
|
2277
|
+
getModuleInfo: new v(),
|
|
2278
|
+
createScript: new v(),
|
|
2279
|
+
createLink: new v(),
|
|
2280
|
+
fetch: new A(),
|
|
2281
|
+
loadEntryError: new A(),
|
|
2282
|
+
getModuleFactory: new A()
|
|
2283
|
+
}), this.bridgeHook = new j({
|
|
2284
|
+
beforeBridgeRender: new v(),
|
|
2285
|
+
afterBridgeRender: new v(),
|
|
2286
|
+
beforeBridgeDestroy: new v(),
|
|
2287
|
+
afterBridgeDestroy: new v()
|
|
2228
2288
|
});
|
|
2229
|
-
const t =
|
|
2230
|
-
id:
|
|
2289
|
+
const t = bn ? [dn(), yn()] : [], r = {
|
|
2290
|
+
id: an(),
|
|
2231
2291
|
name: e.name,
|
|
2232
2292
|
plugins: t,
|
|
2233
2293
|
remotes: [],
|
|
2234
2294
|
shared: {},
|
|
2235
|
-
inBrowser: F
|
|
2295
|
+
inBrowser: F
|
|
2236
2296
|
};
|
|
2237
|
-
this.name = e.name, this.options = r, this.snapshotHandler = new
|
|
2297
|
+
this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new gn(this), this.remoteHandler = new _n(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2238
2298
|
}
|
|
2239
2299
|
initOptions(e) {
|
|
2240
|
-
e.name && e.name !== this.options.name &&
|
|
2300
|
+
e.name && e.name !== this.options.name && S(st(wt, O)), this.registerPlugins(e.plugins);
|
|
2241
2301
|
const t = this.formatOptions(this.options, e);
|
|
2242
2302
|
return this.options = t, t;
|
|
2243
2303
|
}
|
|
@@ -2251,10 +2311,10 @@ var yn = class {
|
|
|
2251
2311
|
return this.sharedHandler.initializeSharing(e, t);
|
|
2252
2312
|
}
|
|
2253
2313
|
initRawContainer(e, t, r) {
|
|
2254
|
-
const n =
|
|
2314
|
+
const n = ke({
|
|
2255
2315
|
name: e,
|
|
2256
2316
|
entry: t
|
|
2257
|
-
}), o = new
|
|
2317
|
+
}), o = new Pt({
|
|
2258
2318
|
host: this,
|
|
2259
2319
|
remoteInfo: n
|
|
2260
2320
|
});
|
|
@@ -2270,16 +2330,16 @@ var yn = class {
|
|
|
2270
2330
|
this.sharedHandler.initShareScopeMap(e, t, r);
|
|
2271
2331
|
}
|
|
2272
2332
|
formatOptions(e, t) {
|
|
2273
|
-
const { allShareInfos: r } =
|
|
2333
|
+
const { allShareInfos: r } = yt(e, t), { userOptions: n, options: o } = this.hooks.lifecycle.beforeInit.emit({
|
|
2274
2334
|
origin: this,
|
|
2275
2335
|
userOptions: t,
|
|
2276
2336
|
options: e,
|
|
2277
2337
|
shareInfo: r
|
|
2278
2338
|
}), s = this.remoteHandler.formatAndRegisterRemote(o, n), { allShareInfos: i } = this.sharedHandler.registerShared(o, n), a = [...o.plugins];
|
|
2279
|
-
n.plugins && n.plugins.forEach((
|
|
2280
|
-
a.includes(
|
|
2339
|
+
n.plugins && n.plugins.forEach((c) => {
|
|
2340
|
+
a.includes(c) || a.push(c);
|
|
2281
2341
|
});
|
|
2282
|
-
const
|
|
2342
|
+
const l = {
|
|
2283
2343
|
...e,
|
|
2284
2344
|
...t,
|
|
2285
2345
|
plugins: a,
|
|
@@ -2288,11 +2348,11 @@ var yn = class {
|
|
|
2288
2348
|
};
|
|
2289
2349
|
return this.hooks.lifecycle.init.emit({
|
|
2290
2350
|
origin: this,
|
|
2291
|
-
options:
|
|
2292
|
-
}),
|
|
2351
|
+
options: l
|
|
2352
|
+
}), l;
|
|
2293
2353
|
}
|
|
2294
2354
|
registerPlugins(e) {
|
|
2295
|
-
const t =
|
|
2355
|
+
const t = cn(e, this);
|
|
2296
2356
|
this.options.plugins = this.options.plugins.reduce((r, n) => (n && r && !r.find((o) => o.name === n.name) && r.push(n), r), t || []);
|
|
2297
2357
|
}
|
|
2298
2358
|
registerRemotes(e, t) {
|
|
@@ -2305,42 +2365,42 @@ var yn = class {
|
|
|
2305
2365
|
});
|
|
2306
2366
|
}
|
|
2307
2367
|
};
|
|
2308
|
-
let
|
|
2309
|
-
function
|
|
2310
|
-
return
|
|
2368
|
+
let Sn = null;
|
|
2369
|
+
function Ct() {
|
|
2370
|
+
return Sn;
|
|
2311
2371
|
}
|
|
2312
|
-
|
|
2313
|
-
function
|
|
2372
|
+
mr(Rn);
|
|
2373
|
+
function Dt(e, t) {
|
|
2314
2374
|
return e.map((r) => {
|
|
2315
2375
|
const n = {
|
|
2316
2376
|
...r,
|
|
2317
2377
|
path: t + r.path
|
|
2318
2378
|
};
|
|
2319
|
-
return r.children && r.children.length > 0 && (n.children =
|
|
2379
|
+
return r.children && r.children.length > 0 && (n.children = Dt(
|
|
2320
2380
|
r.children,
|
|
2321
2381
|
t
|
|
2322
2382
|
)), n;
|
|
2323
2383
|
});
|
|
2324
2384
|
}
|
|
2325
|
-
function
|
|
2385
|
+
function $n(e) {
|
|
2326
2386
|
const { router: t, basename: r, memoryRoute: n, hashRoute: o } = e, s = t.getRoutes().sort(
|
|
2327
|
-
(u,
|
|
2387
|
+
(u, d) => u.path.split("/").filter((m) => m).length - d.path.split("/").filter((m) => m).length
|
|
2328
2388
|
), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
2329
2389
|
s.forEach((u) => {
|
|
2330
2390
|
i.set(u.path, u);
|
|
2331
2391
|
});
|
|
2332
|
-
const
|
|
2392
|
+
const l = (u, d) => `${u}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (u, d = "") => {
|
|
2333
2393
|
if (!u.children || u.children.length === 0)
|
|
2334
2394
|
return u;
|
|
2335
|
-
for (let
|
|
2336
|
-
const y = u.children[
|
|
2337
|
-
if (
|
|
2395
|
+
for (let m = 0; m < u.children.length; m++) {
|
|
2396
|
+
const y = u.children[m], E = l(d, y.path), p = i.get(E);
|
|
2397
|
+
if (p && !a.has(p)) {
|
|
2338
2398
|
const g = {
|
|
2339
|
-
...
|
|
2399
|
+
...p,
|
|
2340
2400
|
path: y.path
|
|
2341
2401
|
// Keep the original relative path from static route
|
|
2342
2402
|
};
|
|
2343
|
-
u.children[
|
|
2403
|
+
u.children[m] = g, a.add(p), c(g, E);
|
|
2344
2404
|
}
|
|
2345
2405
|
}
|
|
2346
2406
|
return u;
|
|
@@ -2348,48 +2408,48 @@ function gn(e) {
|
|
|
2348
2408
|
let f = [];
|
|
2349
2409
|
for (const u of s)
|
|
2350
2410
|
if (!a.has(u)) {
|
|
2351
|
-
const
|
|
2352
|
-
a.add(u), f.push(
|
|
2411
|
+
const d = c(u, u.path);
|
|
2412
|
+
a.add(u), f.push(d);
|
|
2353
2413
|
}
|
|
2354
|
-
let
|
|
2355
|
-
return n ?
|
|
2356
|
-
history:
|
|
2414
|
+
let h;
|
|
2415
|
+
return n ? h = ae.createMemoryHistory(r) : o ? (h = ae.createWebHashHistory(), r && (f = Dt(f, r))) : h = ae.createWebHistory(r), {
|
|
2416
|
+
history: h,
|
|
2357
2417
|
routes: f
|
|
2358
2418
|
};
|
|
2359
2419
|
}
|
|
2360
|
-
function
|
|
2361
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
2420
|
+
function An(e) {
|
|
2421
|
+
const t = /* @__PURE__ */ new Map(), r = Ct();
|
|
2362
2422
|
return () => ({
|
|
2363
|
-
__APP_VERSION__: "2.
|
|
2423
|
+
__APP_VERSION__: "2.2.0",
|
|
2364
2424
|
async render(n) {
|
|
2365
|
-
var
|
|
2425
|
+
var m, y, E;
|
|
2366
2426
|
C.debug("createBridgeComponent render Info", n);
|
|
2367
2427
|
const {
|
|
2368
2428
|
moduleName: o,
|
|
2369
2429
|
dom: s,
|
|
2370
2430
|
basename: i,
|
|
2371
2431
|
memoryRoute: a,
|
|
2372
|
-
hashRoute:
|
|
2373
|
-
...
|
|
2374
|
-
} = n, f =
|
|
2432
|
+
hashRoute: l,
|
|
2433
|
+
...c
|
|
2434
|
+
} = n, f = Ft.createApp(e.rootComponent, c);
|
|
2375
2435
|
t.set(s, f);
|
|
2376
|
-
const
|
|
2436
|
+
const h = await ((E = (y = (m = r == null ? void 0 : r.bridgeHook) == null ? void 0 : m.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : E.emit(n)), u = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
|
|
2377
2437
|
app: f,
|
|
2378
2438
|
basename: i,
|
|
2379
2439
|
memoryRoute: a,
|
|
2380
|
-
hashRoute:
|
|
2381
|
-
...
|
|
2440
|
+
hashRoute: l,
|
|
2441
|
+
...c,
|
|
2382
2442
|
...u
|
|
2383
2443
|
});
|
|
2384
|
-
if (
|
|
2385
|
-
const { history:
|
|
2386
|
-
router:
|
|
2444
|
+
if (d != null && d.router) {
|
|
2445
|
+
const { history: p, routes: g } = $n({
|
|
2446
|
+
router: d.router,
|
|
2387
2447
|
basename: n.basename,
|
|
2388
2448
|
memoryRoute: n.memoryRoute,
|
|
2389
2449
|
hashRoute: n.hashRoute
|
|
2390
2450
|
}), b = ae.createRouter({
|
|
2391
|
-
...
|
|
2392
|
-
history:
|
|
2451
|
+
...d.router.options,
|
|
2452
|
+
history: p,
|
|
2393
2453
|
routes: g
|
|
2394
2454
|
});
|
|
2395
2455
|
C.debug("createBridgeComponent render router info>>>", {
|
|
@@ -2406,11 +2466,11 @@ function wn(e) {
|
|
|
2406
2466
|
}
|
|
2407
2467
|
});
|
|
2408
2468
|
}
|
|
2409
|
-
function
|
|
2469
|
+
function wn() {
|
|
2410
2470
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
2411
2471
|
window.dispatchEvent(e);
|
|
2412
2472
|
}
|
|
2413
|
-
const
|
|
2473
|
+
const Nn = /* @__PURE__ */ Ht({
|
|
2414
2474
|
name: "RemoteApp",
|
|
2415
2475
|
props: {
|
|
2416
2476
|
moduleName: String,
|
|
@@ -2422,10 +2482,10 @@ const bn = /* @__PURE__ */ Ct({
|
|
|
2422
2482
|
},
|
|
2423
2483
|
inheritAttrs: !1,
|
|
2424
2484
|
setup(e) {
|
|
2425
|
-
const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s =
|
|
2426
|
-
var u,
|
|
2427
|
-
const
|
|
2428
|
-
r.value =
|
|
2485
|
+
const t = Ee(null), r = Ee(null), n = Ee(""), o = Ke(), s = Ct(), i = Gt(), a = async () => {
|
|
2486
|
+
var u, d, m, y;
|
|
2487
|
+
const c = (u = e.providerInfo) == null ? void 0 : u.call(e);
|
|
2488
|
+
r.value = c;
|
|
2429
2489
|
let f = {
|
|
2430
2490
|
...i,
|
|
2431
2491
|
moduleName: e.moduleName,
|
|
@@ -2435,41 +2495,41 @@ const bn = /* @__PURE__ */ Ct({
|
|
|
2435
2495
|
hashRoute: e.hashRoute
|
|
2436
2496
|
};
|
|
2437
2497
|
C.debug("createRemoteAppComponent LazyComponent render >>>", f);
|
|
2438
|
-
const
|
|
2498
|
+
const h = await ((y = (m = (d = s == null ? void 0 : s.bridgeHook) == null ? void 0 : d.lifecycle) == null ? void 0 : m.beforeBridgeRender) == null ? void 0 : y.emit(f)) || {};
|
|
2439
2499
|
f = {
|
|
2440
2500
|
...f,
|
|
2441
|
-
...
|
|
2442
|
-
},
|
|
2443
|
-
},
|
|
2444
|
-
|
|
2501
|
+
...h.extraProps
|
|
2502
|
+
}, c.render(f);
|
|
2503
|
+
}, l = xt(() => o == null ? void 0 : o.path, (c) => {
|
|
2504
|
+
c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
2445
2505
|
...e,
|
|
2446
2506
|
pathname: o.path
|
|
2447
|
-
}),
|
|
2507
|
+
}), wn()), n.value = c;
|
|
2448
2508
|
});
|
|
2449
|
-
return
|
|
2509
|
+
return Ut(() => {
|
|
2450
2510
|
a();
|
|
2451
|
-
}),
|
|
2452
|
-
var
|
|
2511
|
+
}), Vt(() => {
|
|
2512
|
+
var c;
|
|
2453
2513
|
C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
|
|
2454
2514
|
...e
|
|
2455
|
-
}),
|
|
2515
|
+
}), l(), (c = r.value) == null || c.destroy({
|
|
2456
2516
|
dom: t.value
|
|
2457
2517
|
});
|
|
2458
|
-
}), () =>
|
|
2518
|
+
}), () => Bt("div", Wt(e.rootAttrs || {}, {
|
|
2459
2519
|
ref: t
|
|
2460
2520
|
}), null);
|
|
2461
2521
|
}
|
|
2462
2522
|
});
|
|
2463
|
-
function
|
|
2464
|
-
return
|
|
2465
|
-
__APP_VERSION__: "2.
|
|
2523
|
+
function In(e) {
|
|
2524
|
+
return jt({
|
|
2525
|
+
__APP_VERSION__: "2.2.0",
|
|
2466
2526
|
...e.asyncComponentOptions,
|
|
2467
2527
|
//@ts-ignore
|
|
2468
2528
|
loader: async () => {
|
|
2469
|
-
var
|
|
2529
|
+
var l, c;
|
|
2470
2530
|
const t = Ke();
|
|
2471
2531
|
let r = "/";
|
|
2472
|
-
const n = (
|
|
2532
|
+
const n = (c = (l = t == null ? void 0 : t.matched) == null ? void 0 : l[0]) == null ? void 0 : c.path;
|
|
2473
2533
|
n && (n.endsWith("/:pathMatch(.*)*") ? r = n.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
|
|
2474
2534
|
const o = (e == null ? void 0 : e.export) || "default";
|
|
2475
2535
|
C.debug(
|
|
@@ -2486,7 +2546,7 @@ function Rn(e) {
|
|
|
2486
2546
|
), o in s && typeof a == "function")
|
|
2487
2547
|
return {
|
|
2488
2548
|
render() {
|
|
2489
|
-
return
|
|
2549
|
+
return qt(Nn, {
|
|
2490
2550
|
moduleName: i,
|
|
2491
2551
|
providerInfo: a,
|
|
2492
2552
|
basename: r,
|
|
@@ -2498,13 +2558,13 @@ function Rn(e) {
|
|
|
2498
2558
|
}
|
|
2499
2559
|
});
|
|
2500
2560
|
}
|
|
2501
|
-
function
|
|
2561
|
+
function Pn(e) {
|
|
2502
2562
|
return C.warn(
|
|
2503
2563
|
"createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
2504
|
-
),
|
|
2564
|
+
), In(e);
|
|
2505
2565
|
}
|
|
2506
2566
|
export {
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2567
|
+
An as createBridgeComponent,
|
|
2568
|
+
In as createRemoteAppComponent,
|
|
2569
|
+
Pn as createRemoteComponent
|
|
2510
2570
|
};
|