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