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