@module-federation/bridge-vue3 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.js +272 -276
- package/package.json +5 -11
- package/CHANGELOG.md +0 -898
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -38
- package/src/create.ts +0 -83
- package/src/index.ts +0 -4
- package/src/provider.ts +0 -112
- package/src/remoteApp.tsx +0 -115
- package/src/routeUtils.ts +0 -218
- package/src/style.css +0 -79
- package/src/utils.ts +0 -3
- package/src/vite-env.d.ts +0 -1
- package/tsconfig.json +0 -41
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -30
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as Ft from "vue";
|
|
2
2
|
import { defineComponent as Ht, ref as ge, useAttrs as Gt, watch as xt, onMounted as Ut, onBeforeUnmount as Bt, createVNode as Vt, mergeProps as Wt, defineAsyncComponent as jt, h as qt } from "vue";
|
|
3
|
-
import * as
|
|
3
|
+
import * as ie from "vue-router";
|
|
4
4
|
import { useRoute as Ke } from "vue-router";
|
|
5
5
|
const Kt = ".json", zt = "FEDERATION_DEBUG", Jt = ":";
|
|
6
|
-
let
|
|
6
|
+
let we = /* @__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 F = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
@@ -21,12 +21,12 @@ function Xt() {
|
|
|
21
21
|
}
|
|
22
22
|
return !1;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ne() {
|
|
25
25
|
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : Xt();
|
|
26
26
|
}
|
|
27
27
|
const Yt = "[ Federation Runtime ]", Xe = function(...e) {
|
|
28
28
|
return e.length ? e.reduce((t, r) => r ? t ? `${t}${Jt}${r}` : r : t, "") : "";
|
|
29
|
-
},
|
|
29
|
+
}, Te = (e, t) => {
|
|
30
30
|
if ("getPublicPath" in e) {
|
|
31
31
|
let r;
|
|
32
32
|
return e.getPublicPath.startsWith("function") ? r = new Function("return " + e.getPublicPath)()() : r = new Function(e.getPublicPath)(), `${r}${t}`;
|
|
@@ -41,7 +41,7 @@ function Ze(e) {
|
|
|
41
41
|
return "";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const Ee = (e, t) => {
|
|
45
45
|
if (!e) return t;
|
|
46
46
|
const n = ((o) => {
|
|
47
47
|
if (o === ".") return "";
|
|
@@ -58,68 +58,53 @@ function Zt(e) {
|
|
|
58
58
|
return e.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
59
59
|
}
|
|
60
60
|
function Qt(e, t = {}) {
|
|
61
|
-
var
|
|
61
|
+
var _;
|
|
62
62
|
const { remotes: r = {}, overrides: n = {}, version: o } = t;
|
|
63
63
|
let s;
|
|
64
64
|
const i = () => "publicPath" in e.metaData ? (e.metaData.publicPath === "auto" || e.metaData.publicPath === "") && o ? Zt(o) : e.metaData.publicPath : e.metaData.getPublicPath, a = Object.keys(n);
|
|
65
65
|
let l = {};
|
|
66
|
-
Object.keys(r).length || (l = ((
|
|
67
|
-
let
|
|
68
|
-
const
|
|
69
|
-
return a.includes(
|
|
70
|
-
}, {})) || {}), Object.keys(r).forEach((
|
|
66
|
+
Object.keys(r).length || (l = ((_ = e.remotes) == null ? void 0 : _.reduce((y, b) => {
|
|
67
|
+
let S;
|
|
68
|
+
const $ = b.federationContainerName;
|
|
69
|
+
return a.includes($) ? S = n[$] : "version" in b ? S = b.version : S = b.entry, y[$] = { matchedVersion: S }, y;
|
|
70
|
+
}, {})) || {}), Object.keys(r).forEach((y) => l[y] = { matchedVersion: a.includes(y) ? n[y] : r[y] });
|
|
71
71
|
const { remoteEntry: { path: c, name: u, type: d }, types: h = {
|
|
72
72
|
path: "",
|
|
73
73
|
name: "",
|
|
74
74
|
zip: "",
|
|
75
75
|
api: ""
|
|
76
76
|
}, buildInfo: { buildVersion: f }, globalName: p, ssrRemoteEntry: m } = e.metaData, { exposes: g } = e;
|
|
77
|
-
let
|
|
77
|
+
let E = {
|
|
78
78
|
version: o || "",
|
|
79
79
|
buildVersion: f,
|
|
80
80
|
globalName: p,
|
|
81
|
-
remoteEntry:
|
|
81
|
+
remoteEntry: Ee(c, u),
|
|
82
82
|
remoteEntryType: d,
|
|
83
|
-
remoteTypes:
|
|
83
|
+
remoteTypes: Ee(h.path, h.name),
|
|
84
84
|
remoteTypesZip: h.zip || "",
|
|
85
85
|
remoteTypesAPI: h.api || "",
|
|
86
86
|
remotesInfo: l,
|
|
87
|
-
shared: e == null ? void 0 : e.shared.map((
|
|
88
|
-
assets:
|
|
89
|
-
sharedName:
|
|
90
|
-
version:
|
|
91
|
-
usedExports:
|
|
87
|
+
shared: e == null ? void 0 : e.shared.map((y) => ({
|
|
88
|
+
assets: y.assets,
|
|
89
|
+
sharedName: y.name,
|
|
90
|
+
version: y.version,
|
|
91
|
+
usedExports: y.referenceExports || []
|
|
92
92
|
})),
|
|
93
|
-
modules: g == null ? void 0 : g.map((
|
|
94
|
-
moduleName:
|
|
95
|
-
modulePath:
|
|
96
|
-
assets:
|
|
93
|
+
modules: g == null ? void 0 : g.map((y) => ({
|
|
94
|
+
moduleName: y.name,
|
|
95
|
+
modulePath: y.path,
|
|
96
|
+
assets: y.assets
|
|
97
97
|
}))
|
|
98
98
|
};
|
|
99
|
-
if ((b = e.metaData) != null && b.prefetchInterface) {
|
|
100
|
-
const _ = e.metaData.prefetchInterface;
|
|
101
|
-
y = {
|
|
102
|
-
...y,
|
|
103
|
-
prefetchInterface: _
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
if ((S = e.metaData) != null && S.prefetchEntry) {
|
|
107
|
-
const { path: _, name: w, type: R } = e.metaData.prefetchEntry;
|
|
108
|
-
y = {
|
|
109
|
-
...y,
|
|
110
|
-
prefetchEntry: ne(_, w),
|
|
111
|
-
prefetchEntryType: R
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
99
|
if ("publicPath" in e.metaData ? (s = {
|
|
115
|
-
...
|
|
100
|
+
...E,
|
|
116
101
|
publicPath: i()
|
|
117
102
|
}, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
|
|
118
|
-
...
|
|
103
|
+
...E,
|
|
119
104
|
getPublicPath: i()
|
|
120
105
|
}, m) {
|
|
121
|
-
const
|
|
122
|
-
s.ssrRemoteEntry =
|
|
106
|
+
const y = Ee(m.path, m.name);
|
|
107
|
+
s.ssrRemoteEntry = y, s.ssrRemoteEntryType = m.type || "commonjs-module";
|
|
123
108
|
}
|
|
124
109
|
return s;
|
|
125
110
|
}
|
|
@@ -161,7 +146,7 @@ var et = class {
|
|
|
161
146
|
this.delegate = e ?? J;
|
|
162
147
|
}
|
|
163
148
|
emit(e, t) {
|
|
164
|
-
const r = this.delegate, n =
|
|
149
|
+
const r = this.delegate, n = Ne() ? rr() : void 0, o = n ? [...t, n] : t, s = (() => {
|
|
165
150
|
switch (e) {
|
|
166
151
|
case "log":
|
|
167
152
|
return ["log", "info"];
|
|
@@ -217,7 +202,7 @@ var et = class {
|
|
|
217
202
|
this.emit("info", e);
|
|
218
203
|
}
|
|
219
204
|
debug(...e) {
|
|
220
|
-
|
|
205
|
+
Ne() && this.emit("debug", e);
|
|
221
206
|
}
|
|
222
207
|
};
|
|
223
208
|
function tt(e) {
|
|
@@ -301,7 +286,7 @@ function nt(e) {
|
|
|
301
286
|
needAttach: r
|
|
302
287
|
};
|
|
303
288
|
}
|
|
304
|
-
function
|
|
289
|
+
function _e(e) {
|
|
305
290
|
let t = null, r = !0;
|
|
306
291
|
const n = document.getElementsByTagName("link");
|
|
307
292
|
for (let s = 0; s < n.length; s++) {
|
|
@@ -354,14 +339,14 @@ function or(e, t) {
|
|
|
354
339
|
a && document.head.appendChild(i);
|
|
355
340
|
});
|
|
356
341
|
}
|
|
357
|
-
const
|
|
342
|
+
const ne = /* @__PURE__ */ new Map();
|
|
358
343
|
function B(e) {
|
|
359
344
|
if (!e) throw new Error("import specifier is required");
|
|
360
|
-
if (
|
|
345
|
+
if (ne.has(e)) return ne.get(e);
|
|
361
346
|
const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
|
|
362
|
-
throw console.error(`Error importing module ${e}:`, r),
|
|
347
|
+
throw console.error(`Error importing module ${e}:`, r), ne.delete(e), r;
|
|
363
348
|
});
|
|
364
|
-
return
|
|
349
|
+
return ne.set(e, t), t;
|
|
365
350
|
}
|
|
366
351
|
const ot = async () => {
|
|
367
352
|
const e = await B("node-fetch");
|
|
@@ -387,25 +372,25 @@ const ot = async () => {
|
|
|
387
372
|
const d = await (await a(l.href)).text(), [h, f] = await Promise.all([B("path"), B("vm")]), p = {
|
|
388
373
|
exports: {},
|
|
389
374
|
module: { exports: {} }
|
|
390
|
-
}, m = l.pathname.split("/").slice(0, -1).join("/"), g = h.basename(l.pathname),
|
|
375
|
+
}, m = l.pathname.split("/").slice(0, -1).join("/"), g = h.basename(l.pathname), E = new f.Script(`(function(exports, module, require, __dirname, __filename) {${d}
|
|
391
376
|
})`, {
|
|
392
377
|
filename: g,
|
|
393
378
|
importModuleDynamically: ((c = f.constants) == null ? void 0 : c.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? B
|
|
394
379
|
});
|
|
395
|
-
let
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
if (r &&
|
|
399
|
-
t(void 0,
|
|
380
|
+
let _;
|
|
381
|
+
_ = (await B("node:module")).createRequire(l.protocol === "file:" || l.protocol === "node:" ? l.href : h.join(process.cwd(), "__mf_require_base__.js")), E.runInThisContext()(p.exports, p.module, _, m, g);
|
|
382
|
+
const y = p.module.exports || p.exports;
|
|
383
|
+
if (r && y && r.globalName) {
|
|
384
|
+
t(void 0, y[r.globalName] || y);
|
|
400
385
|
return;
|
|
401
386
|
}
|
|
402
|
-
t(void 0,
|
|
387
|
+
t(void 0, y);
|
|
403
388
|
} catch (u) {
|
|
404
389
|
t(u instanceof Error ? u : /* @__PURE__ */ new Error(`Script execution error: ${u}`));
|
|
405
390
|
}
|
|
406
391
|
};
|
|
407
392
|
s().then(async (a) => {
|
|
408
|
-
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return
|
|
393
|
+
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return ve(o.href, {
|
|
409
394
|
fetch: a,
|
|
410
395
|
vm: await B("vm")
|
|
411
396
|
}).then(async (l) => {
|
|
@@ -430,16 +415,16 @@ const ot = async () => {
|
|
|
430
415
|
}, t.attrs, t.loaderHook);
|
|
431
416
|
}) : (e, t) => {
|
|
432
417
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
433
|
-
},
|
|
434
|
-
async function
|
|
435
|
-
if (
|
|
418
|
+
}, be = /* @__PURE__ */ new Map();
|
|
419
|
+
async function ve(e, t) {
|
|
420
|
+
if (be.has(e)) return be.get(e);
|
|
436
421
|
const { fetch: r, vm: n } = t, o = await (await r(e)).text(), s = new n.SourceTextModule(o, { importModuleDynamically: async (i, a) => {
|
|
437
422
|
const l = new URL(i, e).href;
|
|
438
|
-
return
|
|
423
|
+
return ve(l, t);
|
|
439
424
|
} });
|
|
440
|
-
return
|
|
425
|
+
return be.set(e, s), await s.link(async (i) => {
|
|
441
426
|
const a = new URL(i, e).href;
|
|
442
|
-
return await
|
|
427
|
+
return await ve(a, t);
|
|
443
428
|
}), s;
|
|
444
429
|
}
|
|
445
430
|
const C = tt("[ Module Federation Bridge Vue3 ]"), cr = (e) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`, st = (e, t, r, n) => {
|
|
@@ -451,11 +436,11 @@ const C = tt("[ Module Federation Bridge Vue3 ]"), cr = (e) => `View the docs to
|
|
|
451
436
|
function lr(e, t, r, n, o, s) {
|
|
452
437
|
return n(st(e, t, r, o));
|
|
453
438
|
}
|
|
454
|
-
const H = "[ Federation Runtime ]",
|
|
439
|
+
const H = "[ Federation Runtime ]", Ae = tt(H);
|
|
455
440
|
function P(e, t, r, n, o) {
|
|
456
|
-
e ||
|
|
441
|
+
e || R(t);
|
|
457
442
|
}
|
|
458
|
-
function
|
|
443
|
+
function R(e, t, r, n, o) {
|
|
459
444
|
if (t !== void 0) return lr(e, t, r ?? {}, (i) => {
|
|
460
445
|
throw new Error(`${H}: ${i}`);
|
|
461
446
|
}, n);
|
|
@@ -463,7 +448,7 @@ function $(e, t, r, n, o) {
|
|
|
463
448
|
throw s instanceof Error ? (s.message.startsWith(H) || (s.message = `${H}: ${s.message}`), s) : new Error(`${H}: ${s}`);
|
|
464
449
|
}
|
|
465
450
|
function Oe(e) {
|
|
466
|
-
e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)),
|
|
451
|
+
e instanceof Error && (e.message.startsWith(H) || (e.message = `${H}: ${e.message}`)), Ae.warn(e);
|
|
467
452
|
}
|
|
468
453
|
function ur(e, t) {
|
|
469
454
|
return e.findIndex((r) => r === t) === -1 && e.push(t), e;
|
|
@@ -506,40 +491,40 @@ function ct(e) {
|
|
|
506
491
|
const dr = (e, t) => {
|
|
507
492
|
let r;
|
|
508
493
|
return e.endsWith("/") ? r = e.slice(0, -1) : r = e, t.startsWith(".") && (t = t.slice(1)), r = r + t, r;
|
|
509
|
-
},
|
|
494
|
+
}, N = typeof globalThis == "object" ? globalThis : window, k = (() => {
|
|
510
495
|
try {
|
|
511
496
|
return document.defaultView;
|
|
512
497
|
} catch {
|
|
513
|
-
return
|
|
498
|
+
return N;
|
|
514
499
|
}
|
|
515
500
|
})(), Q = k;
|
|
516
|
-
function
|
|
501
|
+
function ae(e, t, r) {
|
|
517
502
|
Object.defineProperty(e, t, {
|
|
518
503
|
value: r,
|
|
519
504
|
configurable: !1,
|
|
520
505
|
writable: !0
|
|
521
506
|
});
|
|
522
507
|
}
|
|
523
|
-
function
|
|
508
|
+
function ce(e, t) {
|
|
524
509
|
return Object.hasOwnProperty.call(e, t);
|
|
525
510
|
}
|
|
526
|
-
|
|
527
|
-
const V =
|
|
511
|
+
ce(N, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ae(N, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
512
|
+
const V = N.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
528
513
|
function lt(e) {
|
|
529
514
|
var t, r, n, o, s, i;
|
|
530
|
-
|
|
515
|
+
ce(e, "__VMOK__") && !ce(e, "__FEDERATION__") && ae(e, "__FEDERATION__", e.__VMOK__), ce(e, "__FEDERATION__") || (ae(e, "__FEDERATION__", {
|
|
531
516
|
__GLOBAL_PLUGIN__: [],
|
|
532
517
|
__INSTANCES__: [],
|
|
533
518
|
moduleInfo: {},
|
|
534
519
|
__SHARE__: {},
|
|
535
520
|
__MANIFEST_LOADING__: {},
|
|
536
521
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
537
|
-
}),
|
|
522
|
+
}), ae(e, "__VMOK__", e.__FEDERATION__)), (t = e.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (t.__GLOBAL_PLUGIN__ = []), (r = e.__FEDERATION__).__INSTANCES__ ?? (r.__INSTANCES__ = []), (n = e.__FEDERATION__).moduleInfo ?? (n.moduleInfo = {}), (o = e.__FEDERATION__).__SHARE__ ?? (o.__SHARE__ = {}), (s = e.__FEDERATION__).__MANIFEST_LOADING__ ?? (s.__MANIFEST_LOADING__ = {}), (i = e.__FEDERATION__).__PRELOADED_MAP__ ?? (i.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
538
523
|
}
|
|
539
|
-
lt(
|
|
524
|
+
lt(N);
|
|
540
525
|
lt(k);
|
|
541
|
-
function pr(e, t =
|
|
542
|
-
t && (
|
|
526
|
+
function pr(e, t = Ne()) {
|
|
527
|
+
t && (N.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, N.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.4.0");
|
|
543
528
|
}
|
|
544
529
|
function q(e, t) {
|
|
545
530
|
if (typeof t == "string") {
|
|
@@ -561,7 +546,7 @@ function q(e, t) {
|
|
|
561
546
|
key: t
|
|
562
547
|
};
|
|
563
548
|
}
|
|
564
|
-
} else
|
|
549
|
+
} else R(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`);
|
|
565
550
|
}
|
|
566
551
|
const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
|
|
567
552
|
const r = q(t, Z(e)).value;
|
|
@@ -570,7 +555,7 @@ const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
|
|
|
570
555
|
const { version: n, ...o } = e, s = Z(o), i = q(k.__FEDERATION__.moduleInfo, s).value;
|
|
571
556
|
if ((i == null ? void 0 : i.version) === n) return i;
|
|
572
557
|
}
|
|
573
|
-
},
|
|
558
|
+
}, le = (e) => mr(e, k.__FEDERATION__.moduleInfo), xe = (e, t) => {
|
|
574
559
|
const r = Z(e);
|
|
575
560
|
return k.__FEDERATION__.moduleInfo[r] = t, k.__FEDERATION__.moduleInfo;
|
|
576
561
|
}, yr = (e) => (k.__FEDERATION__.moduleInfo = {
|
|
@@ -583,9 +568,9 @@ const Ge = () => k.__FEDERATION__.moduleInfo, mr = (e, t) => {
|
|
|
583
568
|
const r = t || `__FEDERATION_${e}:custom__`;
|
|
584
569
|
return {
|
|
585
570
|
remoteEntryKey: r,
|
|
586
|
-
entryExports:
|
|
571
|
+
entryExports: N[r]
|
|
587
572
|
};
|
|
588
|
-
}, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) =>
|
|
573
|
+
}, gr = () => k.__FEDERATION__.__GLOBAL_PLUGIN__, Er = (e) => N.__FEDERATION__.__PRELOADED_MAP__.get(e), _r = (e) => N.__FEDERATION__.__PRELOADED_MAP__.set(e, !0), Ue = "[0-9A-Za-z-]+", De = `(?:\\+(${Ue}(?:\\.${Ue})*))`, Y = "0|[1-9]\\d*", ue = "[0-9]+", ut = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", Be = `(?:${ue}|${ut})`, br = `(?:-?(${Be}(?:\\.${Be})*))`, Ve = `(?:${Y}|${ut})`, ft = `(?:-(${Ve}(?:\\.${Ve})*))`, Re = `${Y}|x|X|\\*`, K = `[v=\\s]*(${Re})(?:\\.(${Re})(?:\\.(${Re})(?:${ft})?${De}?)?)?`, Rr = `^\\s*(${K})\\s+-\\s+(${K})\\s*$`, Sr = `[v=\\s]*${`(${ue})\\.(${ue})\\.(${ue})`}${br}?${De}?`, Fe = "((?:<|>)?=?)", $r = `(\\s*)${Fe}\\s*(${Sr}|${K})`, ht = "(?:~>?)", wr = `(\\s*)${ht}\\s+`, dt = "(?:\\^)", Nr = `(\\s*)${dt}\\s+`, Tr = "(<|>)?=?\\s*\\*", Ir = `^${dt}${K}$`, vr = `v?${`(${Y})\\.(${Y})\\.(${Y})`}${ft}?${De}?`, Ar = `^${ht}${K}$`, Pr = `^${Fe}\\s*${K}$`, kr = `^${Fe}\\s*(${vr})$|^$`, Or = "^\\s*>=\\s*0.0.0\\s*$";
|
|
589
574
|
function M(e) {
|
|
590
575
|
return new RegExp(e);
|
|
591
576
|
}
|
|
@@ -615,7 +600,7 @@ function Dr(e) {
|
|
|
615
600
|
return e.replace(M(Nr), "$1^");
|
|
616
601
|
}
|
|
617
602
|
function Fr(e) {
|
|
618
|
-
return e.trim().split(/\s+/).map((t) => t.replace(M(
|
|
603
|
+
return e.trim().split(/\s+/).map((t) => t.replace(M(Ir), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? n === "0" ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.0 <${Number(n) + 1}.0.0-0` : i ? n === "0" ? o === "0" ? `>=${n}.${o}.${s}-${i} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s}-${i} <${Number(n) + 1}.0.0-0` : n === "0" ? o === "0" ? `>=${n}.${o}.${s} <${n}.${o}.${Number(s) + 1}-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${Number(n) + 1}.0.0-0`)).join(" ");
|
|
619
604
|
}
|
|
620
605
|
function Hr(e) {
|
|
621
606
|
return e.trim().split(/\s+/).map((t) => t.replace(M(Ar), (r, n, o, s, i) => T(n) ? "" : T(o) ? `>=${n}.0.0 <${Number(n) + 1}.0.0-0` : T(s) ? `>=${n}.${o}.0 <${n}.${Number(o) + 1}.0-0` : i ? `>=${n}.${o}.${s}-${i} <${n}.${Number(o) + 1}.0-0` : `>=${n}.${o}.${s} <${n}.${Number(o) + 1}.0-0`)).join(" ");
|
|
@@ -627,12 +612,12 @@ function Gr(e) {
|
|
|
627
612
|
})).join(" ");
|
|
628
613
|
}
|
|
629
614
|
function xr(e) {
|
|
630
|
-
return e.trim().replace(M(
|
|
615
|
+
return e.trim().replace(M(Tr), "");
|
|
631
616
|
}
|
|
632
617
|
function Ur(e) {
|
|
633
618
|
return e.trim().replace(M(Or), "");
|
|
634
619
|
}
|
|
635
|
-
function
|
|
620
|
+
function fe(e, t) {
|
|
636
621
|
return e = Number(e) || e, t = Number(t) || t, e > t ? 1 : e === t ? 0 : -1;
|
|
637
622
|
}
|
|
638
623
|
function Br(e, t) {
|
|
@@ -643,29 +628,29 @@ function Br(e, t) {
|
|
|
643
628
|
for (let o = 0, s = r.length; o <= s; o++) {
|
|
644
629
|
const i = r[o], a = n[o];
|
|
645
630
|
if (i !== a)
|
|
646
|
-
return i === void 0 && a === void 0 ? 0 : i ? a ?
|
|
631
|
+
return i === void 0 && a === void 0 ? 0 : i ? a ? fe(i, a) : -1 : 1;
|
|
647
632
|
}
|
|
648
633
|
return 0;
|
|
649
634
|
}
|
|
650
|
-
function
|
|
651
|
-
return
|
|
635
|
+
function oe(e, t) {
|
|
636
|
+
return fe(e.major, t.major) || fe(e.minor, t.minor) || fe(e.patch, t.patch) || Br(e, t);
|
|
652
637
|
}
|
|
653
|
-
function
|
|
638
|
+
function Se(e, t) {
|
|
654
639
|
return e.version === t.version;
|
|
655
640
|
}
|
|
656
641
|
function Vr(e, t) {
|
|
657
642
|
switch (e.operator) {
|
|
658
643
|
case "":
|
|
659
644
|
case "=":
|
|
660
|
-
return
|
|
645
|
+
return Se(e, t);
|
|
661
646
|
case ">":
|
|
662
|
-
return
|
|
647
|
+
return oe(e, t) < 0;
|
|
663
648
|
case ">=":
|
|
664
|
-
return
|
|
649
|
+
return Se(e, t) || oe(e, t) < 0;
|
|
665
650
|
case "<":
|
|
666
|
-
return
|
|
651
|
+
return oe(e, t) > 0;
|
|
667
652
|
case "<=":
|
|
668
|
-
return
|
|
653
|
+
return Se(e, t) || oe(e, t) > 0;
|
|
669
654
|
case void 0:
|
|
670
655
|
return !0;
|
|
671
656
|
default:
|
|
@@ -702,19 +687,19 @@ function X(e, t) {
|
|
|
702
687
|
if (p.length === 0) continue;
|
|
703
688
|
let m = !0;
|
|
704
689
|
for (const g of p) {
|
|
705
|
-
const
|
|
706
|
-
if (!
|
|
690
|
+
const E = We(g);
|
|
691
|
+
if (!E) {
|
|
707
692
|
m = !1;
|
|
708
693
|
break;
|
|
709
694
|
}
|
|
710
|
-
const [,
|
|
695
|
+
const [, _, , y, b, S, $] = E;
|
|
711
696
|
if (!Vr({
|
|
712
|
-
operator:
|
|
713
|
-
version: je(b, S,
|
|
714
|
-
major:
|
|
715
|
-
minor:
|
|
716
|
-
patch:
|
|
717
|
-
preRelease:
|
|
697
|
+
operator: _,
|
|
698
|
+
version: je(y, b, S, $),
|
|
699
|
+
major: y,
|
|
700
|
+
minor: b,
|
|
701
|
+
patch: S,
|
|
702
|
+
preRelease: $ == null ? void 0 : $.split(".")
|
|
718
703
|
}, l)) {
|
|
719
704
|
m = !1;
|
|
720
705
|
break;
|
|
@@ -733,8 +718,8 @@ function qr(e, t, r, n) {
|
|
|
733
718
|
var s, i;
|
|
734
719
|
let o;
|
|
735
720
|
return "get" in e ? o = e.get : "lib" in e ? o = () => Promise.resolve(e.lib) : o = () => Promise.resolve(() => {
|
|
736
|
-
|
|
737
|
-
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) &&
|
|
721
|
+
R(`Cannot get shared "${r}" from "${t}": neither "get" nor "lib" is provided in the share config.`);
|
|
722
|
+
}), (s = e.shareConfig) != null && s.eager && ((i = e.treeShaking) != null && i.mode) && R(`Invalid shared config for "${r}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`), {
|
|
738
723
|
deps: [],
|
|
739
724
|
useIn: [],
|
|
740
725
|
from: t,
|
|
@@ -755,7 +740,7 @@ function qr(e, t, r, n) {
|
|
|
755
740
|
treeShaking: e.treeShaking ? {
|
|
756
741
|
...e.treeShaking,
|
|
757
742
|
mode: e.treeShaking.mode ?? "server-calc",
|
|
758
|
-
status: e.treeShaking.status ??
|
|
743
|
+
status: e.treeShaking.status ?? we.UNKNOWN,
|
|
759
744
|
useIn: []
|
|
760
745
|
} : void 0
|
|
761
746
|
};
|
|
@@ -779,7 +764,7 @@ function yt(e, t) {
|
|
|
779
764
|
function ee(e, t) {
|
|
780
765
|
if (!e) return !1;
|
|
781
766
|
const { status: r, mode: n } = e;
|
|
782
|
-
return r ===
|
|
767
|
+
return r === we.NO_USE ? !1 : r === we.CALCULATED ? !0 : n === "runtime-infer" ? t ? zr(e, t) : !0 : !1;
|
|
783
768
|
}
|
|
784
769
|
function G(e, t) {
|
|
785
770
|
const r = (n) => {
|
|
@@ -798,7 +783,7 @@ const te = (e, t) => {
|
|
|
798
783
|
return G(n, o);
|
|
799
784
|
};
|
|
800
785
|
return Object.keys(e).reduce((n, o) => !n || r(n, o) || n === "0" ? o : n, 0);
|
|
801
|
-
},
|
|
786
|
+
}, de = (e) => !!e.loaded || typeof e.lib == "function", Kr = (e) => !!e.loading, zr = (e, t) => {
|
|
802
787
|
if (!e || !t) return !1;
|
|
803
788
|
const { usedExports: r } = e;
|
|
804
789
|
return r ? !!t.every((n) => r.includes(n)) : !1;
|
|
@@ -807,7 +792,7 @@ function Jr(e, t, r, n) {
|
|
|
807
792
|
const o = e[t][r];
|
|
808
793
|
let s = "", i = ee(n);
|
|
809
794
|
const a = function(l, c) {
|
|
810
|
-
return i ? o[l].treeShaking ? o[c].treeShaking ? !
|
|
795
|
+
return i ? o[l].treeShaking ? o[c].treeShaking ? !de(o[l].treeShaking) && G(l, c) : !1 : !0 : !de(o[l]) && G(l, c);
|
|
811
796
|
};
|
|
812
797
|
if (i) {
|
|
813
798
|
if (s = te(e[t][r], a), s) return {
|
|
@@ -821,7 +806,7 @@ function Jr(e, t, r, n) {
|
|
|
821
806
|
useTreesShaking: i
|
|
822
807
|
};
|
|
823
808
|
}
|
|
824
|
-
const x = (e) =>
|
|
809
|
+
const x = (e) => de(e) || Kr(e);
|
|
825
810
|
function Xr(e, t, r, n) {
|
|
826
811
|
const o = e[t][r];
|
|
827
812
|
let s = "", i = ee(n);
|
|
@@ -849,7 +834,7 @@ function Xr(e, t, r, n) {
|
|
|
849
834
|
function Yr(e) {
|
|
850
835
|
return e === "loaded-first" ? Xr : Jr;
|
|
851
836
|
}
|
|
852
|
-
function
|
|
837
|
+
function he(e, t, r, n) {
|
|
853
838
|
if (!e) return;
|
|
854
839
|
const { shareConfig: o, scope: s = re, strategy: i, treeShaking: a } = r, l = Array.isArray(s) ? s : [s];
|
|
855
840
|
for (const c of l) if (o && e[c] && e[c][t]) {
|
|
@@ -858,7 +843,7 @@ function de(e, t, r, n) {
|
|
|
858
843
|
if (o.singleton) {
|
|
859
844
|
if (typeof u == "string" && !X(d, u)) {
|
|
860
845
|
const g = `Version ${d} from ${d && m.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${u})`;
|
|
861
|
-
o.strictVersion ?
|
|
846
|
+
o.strictVersion ? R(g) : Oe(g);
|
|
862
847
|
}
|
|
863
848
|
return {
|
|
864
849
|
shared: m,
|
|
@@ -875,15 +860,15 @@ function de(e, t, r, n) {
|
|
|
875
860
|
};
|
|
876
861
|
const g = ee(a);
|
|
877
862
|
if (g) {
|
|
878
|
-
for (const [
|
|
879
|
-
if (ee(
|
|
863
|
+
for (const [E, _] of Object.entries(e[c][t]))
|
|
864
|
+
if (ee(_.treeShaking, a == null ? void 0 : a.usedExports) && X(E, u))
|
|
880
865
|
return {
|
|
881
|
-
shared:
|
|
866
|
+
shared: _,
|
|
882
867
|
useTreesShaking: g
|
|
883
868
|
};
|
|
884
869
|
}
|
|
885
|
-
for (const [
|
|
886
|
-
shared:
|
|
870
|
+
for (const [E, _] of Object.entries(e[c][t])) if (X(E, u)) return {
|
|
871
|
+
shared: _,
|
|
887
872
|
useTreesShaking: !1
|
|
888
873
|
};
|
|
889
874
|
}
|
|
@@ -909,7 +894,7 @@ function qe(e) {
|
|
|
909
894
|
return l.forEach((d) => {
|
|
910
895
|
c[d.version] = d;
|
|
911
896
|
}), c[te(c, function(d, h) {
|
|
912
|
-
return !
|
|
897
|
+
return !de(c[d]) && G(d, h);
|
|
913
898
|
})];
|
|
914
899
|
}, s = (r == null ? void 0 : r.resolver) ?? o, i = (l) => l !== null && typeof l == "object" && !Array.isArray(l), a = (...l) => {
|
|
915
900
|
const c = {};
|
|
@@ -926,7 +911,7 @@ function qe(e) {
|
|
|
926
911
|
const U = (e, t) => {
|
|
927
912
|
e.useIn || (e.useIn = []), ur(e.useIn, t);
|
|
928
913
|
};
|
|
929
|
-
function
|
|
914
|
+
function se(e, t) {
|
|
930
915
|
return t && e.treeShaking ? e.treeShaking : e;
|
|
931
916
|
}
|
|
932
917
|
function Zr(e, t) {
|
|
@@ -969,13 +954,13 @@ function Qr(e, t) {
|
|
|
969
954
|
for (const r of e)
|
|
970
955
|
if (t === r.name || r.alias && t === r.alias) return r;
|
|
971
956
|
}
|
|
972
|
-
const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005",
|
|
957
|
+
const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-004", St = "RUNTIME-005", Pe = "RUNTIME-006", $t = "RUNTIME-007", He = "RUNTIME-008", en = "RUNTIME-009", wt = "RUNTIME-010", Nt = "RUNTIME-011", tn = "RUNTIME-012", O = {
|
|
973
958
|
[Et]: "Failed to get remoteEntry exports.",
|
|
974
959
|
[_t]: 'The remote entry interface does not contain "init"',
|
|
975
960
|
[bt]: "Failed to get manifest.",
|
|
976
961
|
[Rt]: "Failed to locate remote.",
|
|
977
962
|
[St]: "Invalid loadShareSync function call from bundler runtime",
|
|
978
|
-
[
|
|
963
|
+
[Pe]: "Invalid loadShareSync function call from runtime",
|
|
979
964
|
[$t]: "Failed to get remote snapshot.",
|
|
980
965
|
[He]: "Failed to load script resources.",
|
|
981
966
|
[en]: "Please call createInstance first.",
|
|
@@ -986,57 +971,58 @@ const Et = "RUNTIME-001", _t = "RUNTIME-002", bt = "RUNTIME-003", Rt = "RUNTIME-
|
|
|
986
971
|
({
|
|
987
972
|
...O
|
|
988
973
|
});
|
|
989
|
-
const
|
|
974
|
+
const Tt = ".then(callbacks[0]).catch(callbacks[1])";
|
|
990
975
|
async function rn({ entry: e, remoteEntryExports: t }) {
|
|
991
976
|
return new Promise((r, n) => {
|
|
992
977
|
try {
|
|
993
|
-
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${
|
|
978
|
+
t ? r(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${e}")${Tt}`)([r, n]) : import(
|
|
994
979
|
/* webpackIgnore: true */
|
|
995
980
|
/* @vite-ignore */
|
|
996
981
|
e
|
|
997
982
|
).then(r).catch(n);
|
|
998
983
|
} catch (o) {
|
|
999
|
-
|
|
984
|
+
R(`Failed to load ESM entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
|
|
1000
985
|
}
|
|
1001
986
|
});
|
|
1002
987
|
}
|
|
1003
988
|
async function nn({ entry: e, remoteEntryExports: t }) {
|
|
1004
989
|
return new Promise((r, n) => {
|
|
1005
990
|
try {
|
|
1006
|
-
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${
|
|
991
|
+
t ? r(t) : typeof __system_context__ > "u" ? System.import(e).then(r).catch(n) : new Function("callbacks", `System.import("${e}")${Tt}`)([r, n]);
|
|
1007
992
|
} catch (o) {
|
|
1008
|
-
|
|
993
|
+
R(`Failed to load SystemJS entry from "${e}". ${o instanceof Error ? o.message : String(o)}`);
|
|
1009
994
|
}
|
|
1010
995
|
});
|
|
1011
996
|
}
|
|
1012
|
-
function
|
|
997
|
+
function It(e, t, r) {
|
|
1013
998
|
const { remoteEntryKey: n, entryExports: o } = Ce(e, t);
|
|
1014
|
-
return o ||
|
|
999
|
+
return o || R(Et, O, {
|
|
1015
1000
|
remoteName: e,
|
|
1016
1001
|
remoteEntryUrl: r,
|
|
1017
1002
|
remoteEntryKey: n
|
|
1018
1003
|
}), o;
|
|
1019
1004
|
}
|
|
1020
|
-
async function on({ name: e, globalName: t, entry: r,
|
|
1021
|
-
const { entryExports:
|
|
1022
|
-
if (
|
|
1023
|
-
const
|
|
1024
|
-
return or(
|
|
1005
|
+
async function on({ name: e, globalName: t, entry: r, remoteInfo: n, loaderHook: o, getEntryUrl: s }) {
|
|
1006
|
+
const { entryExports: i } = Ce(e, t);
|
|
1007
|
+
if (i) return i;
|
|
1008
|
+
const a = s ? s(r) : r;
|
|
1009
|
+
return or(a, {
|
|
1025
1010
|
attrs: {},
|
|
1026
|
-
createScriptHook: (
|
|
1027
|
-
const
|
|
1028
|
-
url:
|
|
1029
|
-
attrs:
|
|
1011
|
+
createScriptHook: (l, c) => {
|
|
1012
|
+
const u = o.lifecycle.createScript.emit({
|
|
1013
|
+
url: l,
|
|
1014
|
+
attrs: c,
|
|
1015
|
+
remoteInfo: n
|
|
1030
1016
|
});
|
|
1031
|
-
if (
|
|
1032
|
-
return
|
|
1017
|
+
if (u && (u instanceof HTMLScriptElement || "script" in u || "timeout" in u))
|
|
1018
|
+
return u;
|
|
1033
1019
|
}
|
|
1034
|
-
}).then(() =>
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1020
|
+
}).then(() => It(e, t, r), (l) => {
|
|
1021
|
+
const c = l instanceof Error ? l.message : String(l);
|
|
1022
|
+
R(He, O, {
|
|
1037
1023
|
remoteName: e,
|
|
1038
|
-
resourceUrl:
|
|
1039
|
-
},
|
|
1024
|
+
resourceUrl: a
|
|
1025
|
+
}, c);
|
|
1040
1026
|
});
|
|
1041
1027
|
}
|
|
1042
1028
|
async function sn({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntryUrl: n }) {
|
|
@@ -1058,6 +1044,7 @@ async function sn({ remoteInfo: e, remoteEntryExports: t, loaderHook: r, getEntr
|
|
|
1058
1044
|
entry: o,
|
|
1059
1045
|
globalName: s,
|
|
1060
1046
|
name: i,
|
|
1047
|
+
remoteInfo: e,
|
|
1061
1048
|
loaderHook: r,
|
|
1062
1049
|
getEntryUrl: n
|
|
1063
1050
|
});
|
|
@@ -1074,21 +1061,22 @@ async function an({ remoteInfo: e, loaderHook: t }) {
|
|
|
1074
1061
|
loaderHook: { createScriptHook: (a, l = {}) => {
|
|
1075
1062
|
const c = t.lifecycle.createScript.emit({
|
|
1076
1063
|
url: a,
|
|
1077
|
-
attrs: l
|
|
1064
|
+
attrs: l,
|
|
1065
|
+
remoteInfo: e
|
|
1078
1066
|
});
|
|
1079
1067
|
if (c && "url" in c)
|
|
1080
1068
|
return c;
|
|
1081
1069
|
} }
|
|
1082
|
-
}).then(() =>
|
|
1083
|
-
|
|
1070
|
+
}).then(() => It(o, n, r)).catch((a) => {
|
|
1071
|
+
R(`Failed to load Node.js entry for remote "${o}" from "${r}". ${a instanceof Error ? a.message : String(a)}`);
|
|
1084
1072
|
});
|
|
1085
1073
|
}
|
|
1086
|
-
function
|
|
1074
|
+
function ke(e) {
|
|
1087
1075
|
const { entry: t, name: r } = e;
|
|
1088
1076
|
return Xe(r, t);
|
|
1089
1077
|
}
|
|
1090
|
-
async function
|
|
1091
|
-
const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i =
|
|
1078
|
+
async function pe(e) {
|
|
1079
|
+
const { origin: t, remoteEntryExports: r, remoteInfo: n, getEntryUrl: o, _inErrorHandling: s = !1 } = e, i = ke(n);
|
|
1092
1080
|
if (r) return r;
|
|
1093
1081
|
if (!V[i]) {
|
|
1094
1082
|
const a = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
|
|
@@ -1105,9 +1093,9 @@ async function me(e) {
|
|
|
1105
1093
|
remoteInfo: n,
|
|
1106
1094
|
loaderHook: l
|
|
1107
1095
|
}))).catch(async (c) => {
|
|
1108
|
-
const u =
|
|
1096
|
+
const u = ke(n), d = c instanceof Error && c.message.includes("ScriptExecutionError");
|
|
1109
1097
|
if (c instanceof Error && c.message.includes(He) && !d && !s) {
|
|
1110
|
-
const h = (p) =>
|
|
1098
|
+
const h = (p) => pe({
|
|
1111
1099
|
...p,
|
|
1112
1100
|
_inErrorHandling: !0
|
|
1113
1101
|
}), f = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
@@ -1125,7 +1113,7 @@ async function me(e) {
|
|
|
1125
1113
|
}
|
|
1126
1114
|
return V[i];
|
|
1127
1115
|
}
|
|
1128
|
-
function
|
|
1116
|
+
function me(e) {
|
|
1129
1117
|
return {
|
|
1130
1118
|
...e,
|
|
1131
1119
|
entry: "entry" in e ? e.entry : "",
|
|
@@ -1195,7 +1183,6 @@ function vt(e) {
|
|
|
1195
1183
|
resourceCategory: "sync",
|
|
1196
1184
|
share: !0,
|
|
1197
1185
|
depsRemote: !0,
|
|
1198
|
-
prefetchInterface: !1,
|
|
1199
1186
|
...e
|
|
1200
1187
|
};
|
|
1201
1188
|
}
|
|
@@ -1219,7 +1206,7 @@ function At(e, t, r, n = !0) {
|
|
|
1219
1206
|
if (t.options.inBrowser) {
|
|
1220
1207
|
if (i.forEach((a) => {
|
|
1221
1208
|
const { moduleInfo: l } = a, c = t.moduleCache.get(e.name);
|
|
1222
|
-
|
|
1209
|
+
pe(c ? {
|
|
1223
1210
|
origin: t,
|
|
1224
1211
|
remoteInfo: l,
|
|
1225
1212
|
remoteEntryExports: c.remoteEntryExports
|
|
@@ -1234,7 +1221,7 @@ function At(e, t, r, n = !0) {
|
|
|
1234
1221
|
as: "style"
|
|
1235
1222
|
};
|
|
1236
1223
|
o.forEach((l) => {
|
|
1237
|
-
const { link: c, needAttach: u } =
|
|
1224
|
+
const { link: c, needAttach: u } = _e({
|
|
1238
1225
|
url: l,
|
|
1239
1226
|
cb: () => {
|
|
1240
1227
|
},
|
|
@@ -1242,7 +1229,8 @@ function At(e, t, r, n = !0) {
|
|
|
1242
1229
|
createLinkHook: (d, h) => {
|
|
1243
1230
|
const f = t.loaderHook.lifecycle.createLink.emit({
|
|
1244
1231
|
url: d,
|
|
1245
|
-
attrs: h
|
|
1232
|
+
attrs: h,
|
|
1233
|
+
remoteInfo: e
|
|
1246
1234
|
});
|
|
1247
1235
|
if (f instanceof HTMLLinkElement) return f;
|
|
1248
1236
|
}
|
|
@@ -1255,7 +1243,7 @@ function At(e, t, r, n = !0) {
|
|
|
1255
1243
|
type: "text/css"
|
|
1256
1244
|
};
|
|
1257
1245
|
o.forEach((l) => {
|
|
1258
|
-
const { link: c, needAttach: u } =
|
|
1246
|
+
const { link: c, needAttach: u } = _e({
|
|
1259
1247
|
url: l,
|
|
1260
1248
|
cb: () => {
|
|
1261
1249
|
},
|
|
@@ -1263,7 +1251,8 @@ function At(e, t, r, n = !0) {
|
|
|
1263
1251
|
createLinkHook: (d, h) => {
|
|
1264
1252
|
const f = t.loaderHook.lifecycle.createLink.emit({
|
|
1265
1253
|
url: d,
|
|
1266
|
-
attrs: h
|
|
1254
|
+
attrs: h,
|
|
1255
|
+
remoteInfo: e
|
|
1267
1256
|
});
|
|
1268
1257
|
if (f instanceof HTMLLinkElement) return f;
|
|
1269
1258
|
},
|
|
@@ -1278,7 +1267,7 @@ function At(e, t, r, n = !0) {
|
|
|
1278
1267
|
as: "script"
|
|
1279
1268
|
};
|
|
1280
1269
|
s.forEach((l) => {
|
|
1281
|
-
const { link: c, needAttach: u } =
|
|
1270
|
+
const { link: c, needAttach: u } = _e({
|
|
1282
1271
|
url: l,
|
|
1283
1272
|
cb: () => {
|
|
1284
1273
|
},
|
|
@@ -1286,7 +1275,8 @@ function At(e, t, r, n = !0) {
|
|
|
1286
1275
|
createLinkHook: (d, h) => {
|
|
1287
1276
|
const f = t.loaderHook.lifecycle.createLink.emit({
|
|
1288
1277
|
url: d,
|
|
1289
|
-
attrs: h
|
|
1278
|
+
attrs: h,
|
|
1279
|
+
remoteInfo: e
|
|
1290
1280
|
});
|
|
1291
1281
|
if (f instanceof HTMLLinkElement) return f;
|
|
1292
1282
|
}
|
|
@@ -1307,7 +1297,8 @@ function At(e, t, r, n = !0) {
|
|
|
1307
1297
|
createScriptHook: (d, h) => {
|
|
1308
1298
|
const f = t.loaderHook.lifecycle.createScript.emit({
|
|
1309
1299
|
url: d,
|
|
1310
|
-
attrs: h
|
|
1300
|
+
attrs: h,
|
|
1301
|
+
remoteInfo: e
|
|
1311
1302
|
});
|
|
1312
1303
|
if (f instanceof HTMLScriptElement) return f;
|
|
1313
1304
|
},
|
|
@@ -1342,7 +1333,7 @@ var Pt = class {
|
|
|
1342
1333
|
}
|
|
1343
1334
|
async getEntry() {
|
|
1344
1335
|
if (this.remoteEntryExports) return this.remoteEntryExports;
|
|
1345
|
-
const e = await
|
|
1336
|
+
const e = await pe({
|
|
1346
1337
|
origin: this.host,
|
|
1347
1338
|
remoteInfo: this.remoteInfo,
|
|
1348
1339
|
remoteEntryExports: this.remoteEntryExports
|
|
@@ -1363,7 +1354,7 @@ var Pt = class {
|
|
|
1363
1354
|
remoteInfo: this.remoteInfo,
|
|
1364
1355
|
origin: this.host
|
|
1365
1356
|
});
|
|
1366
|
-
typeof (n == null ? void 0 : n.init) > "u" &&
|
|
1357
|
+
typeof (n == null ? void 0 : n.init) > "u" && R(_t, O, {
|
|
1367
1358
|
hostName: this.host.name,
|
|
1368
1359
|
remoteName: this.remoteInfo.name,
|
|
1369
1360
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
@@ -1455,10 +1446,10 @@ function kt(e, t) {
|
|
|
1455
1446
|
}
|
|
1456
1447
|
var W = class extends v {
|
|
1457
1448
|
constructor(e) {
|
|
1458
|
-
super(), this.onerror =
|
|
1449
|
+
super(), this.onerror = R, this.type = e;
|
|
1459
1450
|
}
|
|
1460
1451
|
emit(e) {
|
|
1461
|
-
Me(e) ||
|
|
1452
|
+
Me(e) || R(`The data for the "${this.type}" hook should be an object.`);
|
|
1462
1453
|
for (const t of this.listeners) try {
|
|
1463
1454
|
const r = t(e);
|
|
1464
1455
|
if (kt(e, r)) e = r;
|
|
@@ -1473,10 +1464,10 @@ var W = class extends v {
|
|
|
1473
1464
|
}
|
|
1474
1465
|
}, D = class extends v {
|
|
1475
1466
|
constructor(e) {
|
|
1476
|
-
super(), this.onerror =
|
|
1467
|
+
super(), this.onerror = R, this.type = e;
|
|
1477
1468
|
}
|
|
1478
1469
|
emit(e) {
|
|
1479
|
-
Me(e) ||
|
|
1470
|
+
Me(e) || R(`The response data for the "${this.type}" hook must be an object.`);
|
|
1480
1471
|
const t = Array.from(this.listeners);
|
|
1481
1472
|
if (t.length > 0) {
|
|
1482
1473
|
let r = 0;
|
|
@@ -1517,8 +1508,8 @@ var W = class extends v {
|
|
|
1517
1508
|
};
|
|
1518
1509
|
function Ot(e, t) {
|
|
1519
1510
|
const r = ct(t);
|
|
1520
|
-
r.url ||
|
|
1521
|
-
let n =
|
|
1511
|
+
r.url || R(Nt, O, { remoteName: e.name });
|
|
1512
|
+
let n = Te(t, r.url);
|
|
1522
1513
|
!F && !n.startsWith("http") && (n = `https:${n}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = n, e.version = t.version, e.buildVersion = t.buildVersion;
|
|
1523
1514
|
}
|
|
1524
1515
|
function pn() {
|
|
@@ -1586,77 +1577,77 @@ function Lt(e, t, r, n, o = {}, s) {
|
|
|
1586
1577
|
}
|
|
1587
1578
|
}
|
|
1588
1579
|
}
|
|
1589
|
-
const
|
|
1580
|
+
const $e = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1590
1581
|
function yn(e, t, r, n, o) {
|
|
1591
1582
|
const s = [], i = [], a = [], l = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: d } = t, { depsRemote: h } = d;
|
|
1592
1583
|
if (Lt(n, r, (p, m, g) => {
|
|
1593
|
-
var
|
|
1594
|
-
let
|
|
1595
|
-
if (g)
|
|
1584
|
+
var $;
|
|
1585
|
+
let E;
|
|
1586
|
+
if (g) E = d;
|
|
1596
1587
|
else if (Array.isArray(h)) {
|
|
1597
|
-
const
|
|
1598
|
-
if (!
|
|
1599
|
-
|
|
1600
|
-
} else if (h === !0)
|
|
1588
|
+
const w = h.find((I) => I.nameOrAlias === m.name || I.nameOrAlias === m.alias);
|
|
1589
|
+
if (!w) return;
|
|
1590
|
+
E = vt(w);
|
|
1591
|
+
} else if (h === !0) E = d;
|
|
1601
1592
|
else return;
|
|
1602
|
-
const
|
|
1603
|
-
|
|
1593
|
+
const _ = Te(p, ct(p).url);
|
|
1594
|
+
_ && a.push({
|
|
1604
1595
|
name: m.name,
|
|
1605
1596
|
moduleInfo: {
|
|
1606
1597
|
name: m.name,
|
|
1607
|
-
entry:
|
|
1598
|
+
entry: _,
|
|
1608
1599
|
type: "remoteEntryType" in p ? p.remoteEntryType : "global",
|
|
1609
1600
|
entryGlobalName: "globalName" in p ? p.globalName : m.name,
|
|
1610
1601
|
shareScope: "",
|
|
1611
1602
|
version: "version" in p ? p.version : void 0
|
|
1612
1603
|
},
|
|
1613
|
-
url:
|
|
1604
|
+
url: _
|
|
1614
1605
|
});
|
|
1615
|
-
let
|
|
1616
|
-
const
|
|
1617
|
-
|
|
1618
|
-
function
|
|
1619
|
-
const
|
|
1620
|
-
return
|
|
1606
|
+
let y = "modules" in p ? p.modules : [];
|
|
1607
|
+
const b = hn(E.exposes);
|
|
1608
|
+
b.length && "modules" in p && (y = ($ = p == null ? void 0 : p.modules) == null ? void 0 : $.reduce((w, I) => ((b == null ? void 0 : b.indexOf(I.moduleName)) !== -1 && w.push(I), w), []));
|
|
1609
|
+
function S(w) {
|
|
1610
|
+
const I = w.map((L) => Te(p, L));
|
|
1611
|
+
return E.filter ? I.filter(E.filter) : I;
|
|
1621
1612
|
}
|
|
1622
|
-
if (
|
|
1623
|
-
const
|
|
1624
|
-
for (let
|
|
1625
|
-
const L =
|
|
1613
|
+
if (y) {
|
|
1614
|
+
const w = y.length;
|
|
1615
|
+
for (let I = 0; I < w; I++) {
|
|
1616
|
+
const L = y[I], ye = `${m.name}/${L.moduleName}`;
|
|
1626
1617
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1627
1618
|
id: L.moduleName === "." ? m.name : ye,
|
|
1628
1619
|
name: m.name,
|
|
1629
1620
|
remoteSnapshot: p,
|
|
1630
|
-
preloadConfig:
|
|
1621
|
+
preloadConfig: E,
|
|
1631
1622
|
remote: m,
|
|
1632
1623
|
origin: e
|
|
1633
|
-
}), !Er(ye) && (
|
|
1624
|
+
}), !Er(ye) && (E.resourceCategory === "all" ? (s.push(...S(L.assets.css.async)), s.push(...S(L.assets.css.sync)), i.push(...S(L.assets.js.async)), i.push(...S(L.assets.js.sync))) : E.resourceCategory === "sync" && (s.push(...S(L.assets.css.sync)), i.push(...S(L.assets.js.sync))), _r(ye));
|
|
1634
1625
|
}
|
|
1635
1626
|
}
|
|
1636
1627
|
}, !0, {}, o), o.shared && o.shared.length > 0) {
|
|
1637
1628
|
const p = (m, g) => {
|
|
1638
|
-
const { shared:
|
|
1639
|
-
|
|
1640
|
-
l.add(
|
|
1641
|
-
}), g.assets.css.sync.forEach((
|
|
1642
|
-
c.add(
|
|
1629
|
+
const { shared: E } = he(e.shareScopeMap, g.sharedName, m, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
1630
|
+
E && typeof E.lib == "function" && (g.assets.js.sync.forEach((_) => {
|
|
1631
|
+
l.add(_);
|
|
1632
|
+
}), g.assets.css.sync.forEach((_) => {
|
|
1633
|
+
c.add(_);
|
|
1643
1634
|
}));
|
|
1644
1635
|
};
|
|
1645
1636
|
o.shared.forEach((m) => {
|
|
1646
|
-
var
|
|
1647
|
-
const g = (
|
|
1637
|
+
var _;
|
|
1638
|
+
const g = (_ = u.shared) == null ? void 0 : _[m.sharedName];
|
|
1648
1639
|
if (!g) return;
|
|
1649
|
-
const
|
|
1650
|
-
|
|
1651
|
-
p(
|
|
1640
|
+
const E = m.version ? g.find((y) => y.version === m.version) : g;
|
|
1641
|
+
E && at(E).forEach((y) => {
|
|
1642
|
+
p(y, m);
|
|
1652
1643
|
});
|
|
1653
1644
|
});
|
|
1654
1645
|
}
|
|
1655
|
-
const f = i.filter((p) => !l.has(p) &&
|
|
1646
|
+
const f = i.filter((p) => !l.has(p) && !$e("script", p));
|
|
1656
1647
|
return {
|
|
1657
|
-
cssAssets: s.filter((p) => !c.has(p) &&
|
|
1648
|
+
cssAssets: s.filter((p) => !c.has(p) && !$e("link", p)),
|
|
1658
1649
|
jsAssetsWithoutEntry: f,
|
|
1659
|
-
entryAssets: a.filter((p) =>
|
|
1650
|
+
entryAssets: a.filter((p) => !$e("script", p.url))
|
|
1660
1651
|
};
|
|
1661
1652
|
}
|
|
1662
1653
|
const gn = function() {
|
|
@@ -1687,21 +1678,21 @@ const gn = function() {
|
|
|
1687
1678
|
};
|
|
1688
1679
|
};
|
|
1689
1680
|
function Mt(e, t) {
|
|
1690
|
-
const r =
|
|
1681
|
+
const r = le({
|
|
1691
1682
|
name: t.name,
|
|
1692
1683
|
version: t.options.version
|
|
1693
1684
|
}), n = r && "remotesInfo" in r && r.remotesInfo && q(r.remotesInfo, e.name).value;
|
|
1694
1685
|
return n && n.matchedVersion ? {
|
|
1695
1686
|
hostGlobalSnapshot: r,
|
|
1696
1687
|
globalSnapshot: Ge(),
|
|
1697
|
-
remoteSnapshot:
|
|
1688
|
+
remoteSnapshot: le({
|
|
1698
1689
|
name: e.name,
|
|
1699
1690
|
version: n.matchedVersion
|
|
1700
1691
|
})
|
|
1701
1692
|
} : {
|
|
1702
1693
|
hostGlobalSnapshot: void 0,
|
|
1703
1694
|
globalSnapshot: Ge(),
|
|
1704
|
-
remoteSnapshot:
|
|
1695
|
+
remoteSnapshot: le({
|
|
1705
1696
|
name: e.name,
|
|
1706
1697
|
version: "version" in e ? e.version : void 0
|
|
1707
1698
|
})
|
|
@@ -1722,7 +1713,7 @@ var En = class {
|
|
|
1722
1713
|
options: n,
|
|
1723
1714
|
moduleInfo: e
|
|
1724
1715
|
});
|
|
1725
|
-
let o =
|
|
1716
|
+
let o = le({
|
|
1726
1717
|
name: this.HostInstance.options.name,
|
|
1727
1718
|
version: this.HostInstance.options.version
|
|
1728
1719
|
});
|
|
@@ -1765,7 +1756,7 @@ var En = class {
|
|
|
1765
1756
|
from: "global"
|
|
1766
1757
|
});
|
|
1767
1758
|
u = p, d = f;
|
|
1768
|
-
} else
|
|
1759
|
+
} else R($t, O, {
|
|
1769
1760
|
remoteName: e.name,
|
|
1770
1761
|
remoteVersion: e.version,
|
|
1771
1762
|
hostName: this.HostInstance.options.name,
|
|
@@ -1790,7 +1781,7 @@ var En = class {
|
|
|
1790
1781
|
let s = this.manifestCache.get(e);
|
|
1791
1782
|
if (s) return s;
|
|
1792
1783
|
try {
|
|
1793
|
-
let i = await this.loaderHook.lifecycle.fetch.emit(e, {});
|
|
1784
|
+
let i = await this.loaderHook.lifecycle.fetch.emit(e, {}, me(t));
|
|
1794
1785
|
(!i || !(i instanceof Response)) && (i = await fetch(e, {})), s = await i.json();
|
|
1795
1786
|
} catch (i) {
|
|
1796
1787
|
s = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
@@ -1799,7 +1790,7 @@ var En = class {
|
|
|
1799
1790
|
from: "runtime",
|
|
1800
1791
|
lifecycle: "afterResolve",
|
|
1801
1792
|
origin: this.HostInstance
|
|
1802
|
-
}), s || (delete this.manifestLoading[e],
|
|
1793
|
+
}), s || (delete this.manifestLoading[e], R(bt, O, {
|
|
1803
1794
|
manifestUrl: e,
|
|
1804
1795
|
moduleName: t.name,
|
|
1805
1796
|
hostName: this.HostInstance.options.name
|
|
@@ -1875,9 +1866,9 @@ var En = class {
|
|
|
1875
1866
|
origin: r
|
|
1876
1867
|
});
|
|
1877
1868
|
P(o, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
|
|
1878
|
-
const { shared: s, useTreesShaking: i } =
|
|
1869
|
+
const { shared: s, useTreesShaking: i } = he(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
1879
1870
|
if (s) {
|
|
1880
|
-
const a =
|
|
1871
|
+
const a = se(s, i);
|
|
1881
1872
|
if (a.lib)
|
|
1882
1873
|
return U(a, r.options.name), a.lib;
|
|
1883
1874
|
if (a.loading && !a.loaded) {
|
|
@@ -1900,12 +1891,12 @@ var En = class {
|
|
|
1900
1891
|
}
|
|
1901
1892
|
} else {
|
|
1902
1893
|
if (t != null && t.customShareInfo) return !1;
|
|
1903
|
-
const a = ee(o.treeShaking), l =
|
|
1894
|
+
const a = ee(o.treeShaking), l = se(o, a), u = (async () => {
|
|
1904
1895
|
const d = await l.get();
|
|
1905
1896
|
l.lib = d, l.loaded = !0, U(l, r.options.name);
|
|
1906
|
-
const { shared: h, useTreesShaking: f } =
|
|
1897
|
+
const { shared: h, useTreesShaking: f } = he(this.shareScopeMap, e, o, this.hooks.lifecycle.resolveShare) || {};
|
|
1907
1898
|
if (h) {
|
|
1908
|
-
const p =
|
|
1899
|
+
const p = se(h, f);
|
|
1909
1900
|
p.lib = d, p.loaded = !0, h.from = o.from;
|
|
1910
1901
|
}
|
|
1911
1902
|
return d;
|
|
@@ -1940,11 +1931,11 @@ var En = class {
|
|
|
1940
1931
|
const a = this.shareScopeMap, l = r.options.name;
|
|
1941
1932
|
a[e] || (a[e] = {});
|
|
1942
1933
|
const c = a[e], u = (h, f) => {
|
|
1943
|
-
var
|
|
1934
|
+
var y;
|
|
1944
1935
|
const { version: p, eager: m } = f;
|
|
1945
1936
|
c[h] = c[h] || {};
|
|
1946
|
-
const g = c[h],
|
|
1947
|
-
(!
|
|
1937
|
+
const g = c[h], E = g[p] && se(g[p]), _ = !!(E && ("eager" in E && E.eager || "shareConfig" in E && ((y = E.shareConfig) != null && y.eager)));
|
|
1938
|
+
(!E || E.strategy !== "loaded-first" && !E.loaded && (!m != !_ ? m : l > g[p].from)) && (g[p] = f);
|
|
1948
1939
|
}, d = async (h) => {
|
|
1949
1940
|
const { module: f } = await r.remoteHandler.getRemoteModuleAndOptions({ id: h });
|
|
1950
1941
|
let p;
|
|
@@ -1979,7 +1970,7 @@ var En = class {
|
|
|
1979
1970
|
n != null && n.scope && n.scope.forEach((i) => {
|
|
1980
1971
|
this.initializeSharing(i, { strategy: n.strategy });
|
|
1981
1972
|
});
|
|
1982
|
-
const { shared: o, useTreesShaking: s } =
|
|
1973
|
+
const { shared: o, useTreesShaking: s } = he(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare) || {};
|
|
1983
1974
|
if (o) {
|
|
1984
1975
|
if (typeof o.lib == "function")
|
|
1985
1976
|
return U(o, r.options.name), o.loaded || (o.loaded = !0, o.from === r.options.name && (n.loaded = !0)), o.lib;
|
|
@@ -1999,7 +1990,7 @@ var En = class {
|
|
|
1999
1990
|
return n.loaded || (n.loaded = !0), n.lib;
|
|
2000
1991
|
if (n.get) {
|
|
2001
1992
|
const i = n.get();
|
|
2002
|
-
return i instanceof Promise &&
|
|
1993
|
+
return i instanceof Promise && R((t == null ? void 0 : t.from) === "build" ? St : Pe, O, {
|
|
2003
1994
|
hostName: r.options.name,
|
|
2004
1995
|
sharedPkgName: e
|
|
2005
1996
|
}, void 0, z(r.options)), n.lib = i, this.setShared({
|
|
@@ -2010,7 +2001,7 @@ var En = class {
|
|
|
2010
2001
|
shared: n
|
|
2011
2002
|
}), n.lib;
|
|
2012
2003
|
}
|
|
2013
|
-
|
|
2004
|
+
R(Pe, O, {
|
|
2014
2005
|
hostName: r.options.name,
|
|
2015
2006
|
sharedPkgName: e
|
|
2016
2007
|
}, void 0, z(r.options));
|
|
@@ -2027,8 +2018,8 @@ var En = class {
|
|
|
2027
2018
|
}
|
|
2028
2019
|
setShared({ pkgName: e, shared: t, from: r, lib: n, loading: o, loaded: s, get: i, treeShaking: a }) {
|
|
2029
2020
|
const { version: l, scope: c = "default", ...u } = t, d = Array.isArray(c) ? c : [c], h = (f) => {
|
|
2030
|
-
const p = (g,
|
|
2031
|
-
|
|
2021
|
+
const p = (g, E, _) => {
|
|
2022
|
+
_ && !g[E] && (g[E] = _);
|
|
2032
2023
|
}, m = a ? f.treeShaking : f;
|
|
2033
2024
|
p(m, "loaded", s), p(m, "loading", o), p(m, "get", i);
|
|
2034
2025
|
};
|
|
@@ -2122,7 +2113,7 @@ var En = class {
|
|
|
2122
2113
|
});
|
|
2123
2114
|
const r = fn(t.options.remotes, e);
|
|
2124
2115
|
await Promise.all(r.map(async (n) => {
|
|
2125
|
-
const { remote: o } = n, s =
|
|
2116
|
+
const { remote: o } = n, s = me(o), { globalSnapshot: i, remoteSnapshot: a } = await t.snapshotHandler.loadRemoteSnapshotInfo({ moduleInfo: o }), l = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2126
2117
|
origin: t,
|
|
2127
2118
|
preloadOptions: n,
|
|
2128
2119
|
remote: o,
|
|
@@ -2159,11 +2150,11 @@ var En = class {
|
|
|
2159
2150
|
}), !n) throw f;
|
|
2160
2151
|
}
|
|
2161
2152
|
const { id: o } = n, s = Zr(t.options.remotes, o);
|
|
2162
|
-
s ||
|
|
2153
|
+
s || R(Rt, O, {
|
|
2163
2154
|
hostName: t.options.name,
|
|
2164
2155
|
requestId: o
|
|
2165
2156
|
}, void 0, z(t.options));
|
|
2166
|
-
const { remote: i } = s, a =
|
|
2157
|
+
const { remote: i } = s, a = me(i), l = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2167
2158
|
id: o,
|
|
2168
2159
|
...s,
|
|
2169
2160
|
options: t.options,
|
|
@@ -2219,43 +2210,43 @@ var En = class {
|
|
|
2219
2210
|
const s = r.moduleCache.get(e.name);
|
|
2220
2211
|
if (s) {
|
|
2221
2212
|
const i = s.remoteInfo, a = i.entryGlobalName;
|
|
2222
|
-
|
|
2223
|
-
const l =
|
|
2213
|
+
N[a] && ((t = Object.getOwnPropertyDescriptor(N, a)) != null && t.configurable ? delete N[a] : N[a] = void 0);
|
|
2214
|
+
const l = ke(s.remoteInfo);
|
|
2224
2215
|
V[l] && delete V[l], r.snapshotHandler.manifestCache.delete(i.entry);
|
|
2225
2216
|
let c = i.buildVersion ? Xe(i.name, i.buildVersion) : i.name;
|
|
2226
|
-
const u =
|
|
2217
|
+
const u = N.__FEDERATION__.__INSTANCES__.findIndex((h) => i.buildVersion ? h.options.id === c : h.name === c);
|
|
2227
2218
|
if (u !== -1) {
|
|
2228
|
-
const h =
|
|
2219
|
+
const h = N.__FEDERATION__.__INSTANCES__[u];
|
|
2229
2220
|
c = h.options.id || c;
|
|
2230
2221
|
const f = gt();
|
|
2231
2222
|
let p = !0;
|
|
2232
2223
|
const m = [];
|
|
2233
2224
|
Object.keys(f).forEach((g) => {
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
const
|
|
2237
|
-
|
|
2238
|
-
const
|
|
2239
|
-
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2225
|
+
const E = f[g];
|
|
2226
|
+
E && Object.keys(E).forEach((_) => {
|
|
2227
|
+
const y = E[_];
|
|
2228
|
+
y && Object.keys(y).forEach((b) => {
|
|
2229
|
+
const S = y[b];
|
|
2230
|
+
S && Object.keys(S).forEach(($) => {
|
|
2231
|
+
const w = S[$];
|
|
2232
|
+
w && typeof w == "object" && w.from === i.name && (w.loaded || w.loading ? (w.useIn = w.useIn.filter((I) => I !== i.name), w.useIn.length ? p = !1 : m.push([
|
|
2242
2233
|
g,
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2234
|
+
_,
|
|
2235
|
+
b,
|
|
2236
|
+
$
|
|
2246
2237
|
])) : m.push([
|
|
2247
2238
|
g,
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2239
|
+
_,
|
|
2240
|
+
b,
|
|
2241
|
+
$
|
|
2251
2242
|
]));
|
|
2252
2243
|
});
|
|
2253
2244
|
});
|
|
2254
2245
|
});
|
|
2255
|
-
}), p && (h.shareScopeMap = {}, delete f[c]), m.forEach(([g,
|
|
2256
|
-
var
|
|
2257
|
-
(
|
|
2258
|
-
}),
|
|
2246
|
+
}), p && (h.shareScopeMap = {}, delete f[c]), m.forEach(([g, E, _, y]) => {
|
|
2247
|
+
var b, S, $;
|
|
2248
|
+
($ = (S = (b = f[g]) == null ? void 0 : b[E]) == null ? void 0 : S[_]) == null || delete $[y];
|
|
2249
|
+
}), N.__FEDERATION__.__INSTANCES__.splice(u, 1);
|
|
2259
2250
|
}
|
|
2260
2251
|
const { hostGlobalSnapshot: d } = Mt(e, r);
|
|
2261
2252
|
if (d) {
|
|
@@ -2265,7 +2256,7 @@ var En = class {
|
|
|
2265
2256
|
r.moduleCache.delete(e.name);
|
|
2266
2257
|
}
|
|
2267
2258
|
} catch (r) {
|
|
2268
|
-
|
|
2259
|
+
Ae.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
|
|
2269
2260
|
}
|
|
2270
2261
|
}
|
|
2271
2262
|
};
|
|
@@ -2277,7 +2268,7 @@ var Sn = class {
|
|
|
2277
2268
|
init: new v(),
|
|
2278
2269
|
beforeInitContainer: new D("beforeInitContainer"),
|
|
2279
2270
|
initContainer: new D("initContainer")
|
|
2280
|
-
}), this.version = "2.
|
|
2271
|
+
}), this.version = "2.4.0", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new j({
|
|
2281
2272
|
getModuleInfo: new v(),
|
|
2282
2273
|
createScript: new v(),
|
|
2283
2274
|
createLink: new v(),
|
|
@@ -2301,7 +2292,7 @@ var Sn = class {
|
|
|
2301
2292
|
this.name = e.name, this.options = r, this.snapshotHandler = new En(this), this.sharedHandler = new _n(this), this.remoteHandler = new bn(this), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2302
2293
|
}
|
|
2303
2294
|
initOptions(e) {
|
|
2304
|
-
e.name && e.name !== this.options.name &&
|
|
2295
|
+
e.name && e.name !== this.options.name && R(st(wt, O)), this.registerPlugins(e.plugins);
|
|
2305
2296
|
const t = this.formatOptions(this.options, e);
|
|
2306
2297
|
return this.options = t, t;
|
|
2307
2298
|
}
|
|
@@ -2315,7 +2306,7 @@ var Sn = class {
|
|
|
2315
2306
|
return this.sharedHandler.initializeSharing(e, t);
|
|
2316
2307
|
}
|
|
2317
2308
|
initRawContainer(e, t, r) {
|
|
2318
|
-
const n =
|
|
2309
|
+
const n = me({
|
|
2319
2310
|
name: e,
|
|
2320
2311
|
entry: t
|
|
2321
2312
|
}), o = new Pt({
|
|
@@ -2348,7 +2339,8 @@ var Sn = class {
|
|
|
2348
2339
|
...t,
|
|
2349
2340
|
plugins: a,
|
|
2350
2341
|
remotes: s,
|
|
2351
|
-
shared: i
|
|
2342
|
+
shared: i,
|
|
2343
|
+
id: n.id || e.id
|
|
2352
2344
|
};
|
|
2353
2345
|
return this.hooks.lifecycle.init.emit({
|
|
2354
2346
|
origin: this,
|
|
@@ -2376,6 +2368,7 @@ function Ct() {
|
|
|
2376
2368
|
pr(Sn);
|
|
2377
2369
|
function Dt(e, t) {
|
|
2378
2370
|
const r = (n) => {
|
|
2371
|
+
if (!n.startsWith("/")) return n;
|
|
2379
2372
|
const o = n.length > 1 && n.endsWith("/"), s = `${t}/${n}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
2380
2373
|
return o ? `${s}/` : s;
|
|
2381
2374
|
};
|
|
@@ -2405,20 +2398,23 @@ function Nn(e) {
|
|
|
2405
2398
|
(f, p) => f.path.split("/").filter((m) => m).length - p.path.split("/").filter((m) => m).length
|
|
2406
2399
|
), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
2407
2400
|
s.forEach((f) => {
|
|
2408
|
-
i.
|
|
2401
|
+
const p = i.get(f.path) || [];
|
|
2402
|
+
p.push(f), i.set(f.path, p);
|
|
2409
2403
|
});
|
|
2410
2404
|
const l = (f, p) => `${f}/${p}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", c = (f, p = "") => {
|
|
2411
2405
|
if (!f.children || f.children.length === 0)
|
|
2412
2406
|
return f;
|
|
2413
2407
|
for (let m = 0; m < f.children.length; m++) {
|
|
2414
|
-
const g = f.children[m],
|
|
2415
|
-
|
|
2408
|
+
const g = f.children[m], E = l(p, g.path), y = (i.get(E) || []).find(
|
|
2409
|
+
(b) => !a.has(b) && b !== f && (g.name == null || b.name === g.name)
|
|
2410
|
+
);
|
|
2411
|
+
if (y) {
|
|
2416
2412
|
const b = {
|
|
2417
|
-
...
|
|
2413
|
+
...y,
|
|
2418
2414
|
path: g.path
|
|
2419
2415
|
// Keep the original relative path from static route
|
|
2420
2416
|
};
|
|
2421
|
-
f.children[m] = b, a.add(
|
|
2417
|
+
f.children[m] = b, a.add(y), c(b, E);
|
|
2422
2418
|
}
|
|
2423
2419
|
}
|
|
2424
2420
|
return f;
|
|
@@ -2430,12 +2426,12 @@ function Nn(e) {
|
|
|
2430
2426
|
a.add(f), u.push(p);
|
|
2431
2427
|
}
|
|
2432
2428
|
let d, h;
|
|
2433
|
-
return n ? d =
|
|
2429
|
+
return n ? d = ie.createMemoryHistory(r) : o ? (d = ie.createWebHashHistory(), r && (u = Dt(u, r), h = wn(r))) : d = ie.createWebHistory(r), { history: d, routes: u, patchRouter: h };
|
|
2434
2430
|
}
|
|
2435
2431
|
function kn(e) {
|
|
2436
2432
|
const t = /* @__PURE__ */ new Map(), r = Ct();
|
|
2437
2433
|
return () => ({
|
|
2438
|
-
__APP_VERSION__: "2.
|
|
2434
|
+
__APP_VERSION__: "2.4.0",
|
|
2439
2435
|
async render(n) {
|
|
2440
2436
|
var p, m, g;
|
|
2441
2437
|
C.debug("createBridgeComponent render Info", n);
|
|
@@ -2457,20 +2453,20 @@ function kn(e) {
|
|
|
2457
2453
|
...h
|
|
2458
2454
|
});
|
|
2459
2455
|
if (f != null && f.router) {
|
|
2460
|
-
const { history:
|
|
2456
|
+
const { history: E, routes: _, patchRouter: y } = Nn({
|
|
2461
2457
|
router: f.router,
|
|
2462
2458
|
basename: n.basename,
|
|
2463
2459
|
memoryRoute: n.memoryRoute,
|
|
2464
2460
|
hashRoute: n.hashRoute
|
|
2465
|
-
}),
|
|
2461
|
+
}), b = ie.createRouter({
|
|
2466
2462
|
...f.router.options,
|
|
2467
|
-
history:
|
|
2468
|
-
routes:
|
|
2463
|
+
history: E,
|
|
2464
|
+
routes: _
|
|
2469
2465
|
});
|
|
2470
|
-
|
|
2466
|
+
y && y(b), f.afterRouterCreate && f.afterRouterCreate(b), C.debug("createBridgeComponent render router info>>>", {
|
|
2471
2467
|
moduleName: o,
|
|
2472
|
-
router:
|
|
2473
|
-
}), a && await
|
|
2468
|
+
router: b
|
|
2469
|
+
}), a && await b.push(a.entryPath), u.use(b);
|
|
2474
2470
|
}
|
|
2475
2471
|
u.mount(s);
|
|
2476
2472
|
},
|
|
@@ -2481,11 +2477,11 @@ function kn(e) {
|
|
|
2481
2477
|
}
|
|
2482
2478
|
});
|
|
2483
2479
|
}
|
|
2484
|
-
function
|
|
2480
|
+
function Tn() {
|
|
2485
2481
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
2486
2482
|
window.dispatchEvent(e);
|
|
2487
2483
|
}
|
|
2488
|
-
const
|
|
2484
|
+
const In = /* @__PURE__ */ Ht({
|
|
2489
2485
|
name: "RemoteApp",
|
|
2490
2486
|
props: {
|
|
2491
2487
|
moduleName: String,
|
|
@@ -2519,7 +2515,7 @@ const Tn = /* @__PURE__ */ Ht({
|
|
|
2519
2515
|
c !== o.path && a(), n.value !== "" && n.value !== c && (C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
2520
2516
|
...e,
|
|
2521
2517
|
pathname: o.path
|
|
2522
|
-
}),
|
|
2518
|
+
}), Tn()), n.value = c;
|
|
2523
2519
|
});
|
|
2524
2520
|
return Ut(() => {
|
|
2525
2521
|
a();
|
|
@@ -2537,7 +2533,7 @@ const Tn = /* @__PURE__ */ Ht({
|
|
|
2537
2533
|
});
|
|
2538
2534
|
function vn(e) {
|
|
2539
2535
|
return jt({
|
|
2540
|
-
__APP_VERSION__: "2.
|
|
2536
|
+
__APP_VERSION__: "2.4.0",
|
|
2541
2537
|
...e.asyncComponentOptions,
|
|
2542
2538
|
//@ts-ignore
|
|
2543
2539
|
loader: async () => {
|
|
@@ -2561,7 +2557,7 @@ function vn(e) {
|
|
|
2561
2557
|
), o in s && typeof a == "function")
|
|
2562
2558
|
return {
|
|
2563
2559
|
render() {
|
|
2564
|
-
return qt(
|
|
2560
|
+
return qt(In, {
|
|
2565
2561
|
moduleName: i,
|
|
2566
2562
|
providerInfo: a,
|
|
2567
2563
|
basename: r,
|