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