@module-federation/bridge-vue3 2.9.0 → 2.9.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 +5 -5
- package/dist/index.js +223 -221
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -6,9 +6,9 @@ const Er = ".json", gr = "FEDERATION_DEBUG", Rr = ":";
|
|
|
6
6
|
let Pe = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e[e.UNKNOWN = 1] = "UNKNOWN", e[e.CALCULATED = 2] = "CALCULATED", e[e.NO_USE = 0] = "NO_USE", e;
|
|
8
8
|
}({});
|
|
9
|
-
const
|
|
9
|
+
const B = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
10
10
|
function st() {
|
|
11
|
-
return
|
|
11
|
+
return B;
|
|
12
12
|
}
|
|
13
13
|
function it() {
|
|
14
14
|
return typeof navigator < "u" && (navigator == null ? void 0 : navigator.product) === "ReactNative";
|
|
@@ -70,21 +70,21 @@ function wr(e, t = {}) {
|
|
|
70
70
|
const b = _.federationContainerName;
|
|
71
71
|
return a.includes(b) ? S = o[b] : "version" in _ ? S = _.version : S = _.entry, E[b] = { matchedVersion: S }, E;
|
|
72
72
|
}, {})) || {}), Object.keys(r).forEach((E) => c[E] = { matchedVersion: a.includes(E) ? o[E] : r[E] });
|
|
73
|
-
const { remoteEntry: { path: l, name: u, type: f }, types:
|
|
73
|
+
const { remoteEntry: { path: l, name: u, type: f }, types: h = {
|
|
74
74
|
path: "",
|
|
75
75
|
name: "",
|
|
76
76
|
zip: "",
|
|
77
77
|
api: ""
|
|
78
|
-
}, buildInfo: { buildVersion: m }, globalName:
|
|
78
|
+
}, buildInfo: { buildVersion: m }, globalName: d, ssrRemoteEntry: p } = e.metaData, { exposes: y } = e;
|
|
79
79
|
let g = {
|
|
80
80
|
version: n || "",
|
|
81
81
|
buildVersion: m,
|
|
82
|
-
globalName:
|
|
82
|
+
globalName: d,
|
|
83
83
|
remoteEntry: $e(l, u),
|
|
84
84
|
remoteEntryType: f,
|
|
85
|
-
remoteTypes: $e(
|
|
86
|
-
remoteTypesZip:
|
|
87
|
-
remoteTypesAPI:
|
|
85
|
+
remoteTypes: $e(h.path, h.name),
|
|
86
|
+
remoteTypesZip: h.zip || "",
|
|
87
|
+
remoteTypesAPI: h.api || "",
|
|
88
88
|
remotesInfo: c,
|
|
89
89
|
shared: e == null ? void 0 : e.shared.map((E) => ({
|
|
90
90
|
assets: E.assets,
|
|
@@ -261,20 +261,20 @@ function mt(e) {
|
|
|
261
261
|
clearTimeout(n), a && window.removeEventListener("error", a);
|
|
262
262
|
const f = () => {
|
|
263
263
|
if ((u == null ? void 0 : u.type) === "error") {
|
|
264
|
-
const
|
|
265
|
-
|
|
264
|
+
const h = /* @__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.)`);
|
|
265
|
+
h.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(h));
|
|
266
266
|
} else i ? e != null && e.onErrorCallback && (e == null || e.onErrorCallback(i)) : e != null && e.cb && (e == null || e.cb());
|
|
267
267
|
};
|
|
268
268
|
if (t && (t.onerror = null, t.onload = null, dt(() => {
|
|
269
|
-
const { needDeleteScript:
|
|
270
|
-
|
|
269
|
+
const { needDeleteScript: h = !0 } = e;
|
|
270
|
+
h && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
271
271
|
}), l && typeof l == "function")) {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const m = await
|
|
272
|
+
const h = l(u);
|
|
273
|
+
if (h instanceof Promise) {
|
|
274
|
+
const m = await h;
|
|
275
275
|
return f(), m;
|
|
276
276
|
}
|
|
277
|
-
return f(),
|
|
277
|
+
return f(), h;
|
|
278
278
|
}
|
|
279
279
|
f();
|
|
280
280
|
};
|
|
@@ -358,7 +358,7 @@ function Ar(e, t) {
|
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
const ue = /* @__PURE__ */ new Map();
|
|
361
|
-
function
|
|
361
|
+
function G(e) {
|
|
362
362
|
if (!e) throw new Error("import specifier is required");
|
|
363
363
|
if (ue.has(e)) return ue.get(e);
|
|
364
364
|
const t = new Function("name", "return import(name)")(e).then((r) => r).catch((r) => {
|
|
@@ -384,17 +384,17 @@ const Mr = async (e, t, r) => {
|
|
|
384
384
|
const s = async () => o != null && o.fetch ? (a, c) => Mr(a, c, o) : fetch, i = async (a, c) => {
|
|
385
385
|
var l;
|
|
386
386
|
try {
|
|
387
|
-
const f = await (await a(c.href)).text(), [
|
|
387
|
+
const f = await (await a(c.href)).text(), [h, m] = await Promise.all([G("path"), G("vm")]), d = {
|
|
388
388
|
exports: {},
|
|
389
389
|
module: { exports: {} }
|
|
390
|
-
}, p = c.pathname.split("/").slice(0, -1).join("/"), y =
|
|
390
|
+
}, p = c.pathname.split("/").slice(0, -1).join("/"), y = h.basename(c.pathname), g = new m.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
391
391
|
})`, {
|
|
392
392
|
filename: y,
|
|
393
|
-
importModuleDynamically: ((l = m.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ??
|
|
393
|
+
importModuleDynamically: ((l = m.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? G
|
|
394
394
|
});
|
|
395
395
|
let R;
|
|
396
|
-
R = (await
|
|
397
|
-
const E =
|
|
396
|
+
R = (await G("node:module")).createRequire(c.protocol === "file:" || c.protocol === "node:" ? c.href : h.join(process.cwd(), "__mf_require_base__.js")), g.runInThisContext()(d.exports, d.module, R, p, y);
|
|
397
|
+
const E = d.module.exports || d.exports;
|
|
398
398
|
if (r && E && r.globalName) {
|
|
399
399
|
t(void 0, E[r.globalName] || E);
|
|
400
400
|
return;
|
|
@@ -407,7 +407,7 @@ const Mr = async (e, t, r) => {
|
|
|
407
407
|
s().then(async (a) => {
|
|
408
408
|
if ((r == null ? void 0 : r.type) === "esm" || (r == null ? void 0 : r.type) === "module") return Et(n.href, {
|
|
409
409
|
fetch: a,
|
|
410
|
-
vm: await
|
|
410
|
+
vm: await G("vm")
|
|
411
411
|
}).then(async (c) => {
|
|
412
412
|
await c.evaluate(), t(void 0, c.namespace);
|
|
413
413
|
}).catch((c) => {
|
|
@@ -440,7 +440,7 @@ function Or(e, t) {
|
|
|
440
440
|
return new URL(`__module_federation_remote__${Lr(e)}`, r).href;
|
|
441
441
|
}
|
|
442
442
|
async function Cr(e) {
|
|
443
|
-
return e.startsWith("node:") ? !0 : yt(e) ? (await
|
|
443
|
+
return e.startsWith("node:") ? !0 : yt(e) ? (await G("node:module")).builtinModules.includes(e) : !1;
|
|
444
444
|
}
|
|
445
445
|
function Dr(e) {
|
|
446
446
|
const t = e && (typeof e == "object" || typeof e == "function") ? e : { default: e }, r = { ...t };
|
|
@@ -457,7 +457,7 @@ async function Hr(e, t, r) {
|
|
|
457
457
|
}
|
|
458
458
|
async function Fr(e, t) {
|
|
459
459
|
const r = `node-builtin:${e}`;
|
|
460
|
-
return X.has(r) ? X.get(r) : Hr(r, await
|
|
460
|
+
return X.has(r) ? X.get(r) : Hr(r, await G(e), t);
|
|
461
461
|
}
|
|
462
462
|
async function Ve(e, t, r) {
|
|
463
463
|
if (await Cr(e)) return Fr(e, r.vm);
|
|
@@ -474,7 +474,7 @@ async function Et(e, t) {
|
|
|
474
474
|
if (X.has(e)) return X.get(e);
|
|
475
475
|
const { fetch: r, vm: o } = t;
|
|
476
476
|
if (!pt(e)) throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);
|
|
477
|
-
const n = await (await r(e)).text(), s = (await
|
|
477
|
+
const n = await (await r(e)).text(), s = (await G("node:url")).pathToFileURL(process.cwd()).href, i = new o.SourceTextModule(n, {
|
|
478
478
|
identifier: e,
|
|
479
479
|
initializeImportMeta: (a) => {
|
|
480
480
|
a.url = Or(e, s);
|
|
@@ -534,7 +534,7 @@ function bt(e) {
|
|
|
534
534
|
type: "global",
|
|
535
535
|
globalName: ""
|
|
536
536
|
};
|
|
537
|
-
return
|
|
537
|
+
return B || it() || !("ssrRemoteEntry" in e) ? "remoteEntry" in e ? {
|
|
538
538
|
url: e.remoteEntry,
|
|
539
539
|
type: e.remoteEntryType,
|
|
540
540
|
globalName: e.globalName
|
|
@@ -565,7 +565,7 @@ function Ee(e, t) {
|
|
|
565
565
|
return Object.hasOwnProperty.call(e, t);
|
|
566
566
|
}
|
|
567
567
|
Ee(T, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ye(T, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
568
|
-
const
|
|
568
|
+
const x = T.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
569
569
|
function wt(e) {
|
|
570
570
|
var t, r, o, n, s, i, a;
|
|
571
571
|
Ee(e, "__VMOK__") && !Ee(e, "__FEDERATION__") && ye(e, "__FEDERATION__", e.__VMOK__), Ee(e, "__FEDERATION__") || (ye(e, "__FEDERATION__", {
|
|
@@ -581,7 +581,7 @@ function wt(e) {
|
|
|
581
581
|
wt(T);
|
|
582
582
|
wt(L);
|
|
583
583
|
function qr(e, t = ke()) {
|
|
584
|
-
t && (T.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.9.
|
|
584
|
+
t && (T.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = e, T.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.9.2");
|
|
585
585
|
}
|
|
586
586
|
function V(e, t) {
|
|
587
587
|
if (typeof t == "string") {
|
|
@@ -651,7 +651,7 @@ function Ye(e, t, r, o) {
|
|
|
651
651
|
return o ? `${n}-${o}` : n;
|
|
652
652
|
}
|
|
653
653
|
function mo(e) {
|
|
654
|
-
return e.replace(O(to), (t, r, o, n, s, i, a, c, l, u, f,
|
|
654
|
+
return e.replace(O(to), (t, r, o, n, s, i, a, c, l, u, f, h) => (A(o) ? r = "" : A(n) ? r = `>=${o}.0.0` : A(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, A(l) ? c = "" : A(u) ? c = `<${Number(l) + 1}.0.0-0` : A(f) ? c = `<${l}.${Number(u) + 1}.0-0` : h ? c = `<=${l}.${u}.${f}-${h}` : c = `<=${c}`, `${r} ${c}`.trim()));
|
|
655
655
|
}
|
|
656
656
|
function po(e) {
|
|
657
657
|
return e.replace(O(oo), "$1$2$3");
|
|
@@ -742,14 +742,14 @@ function oe(e, t) {
|
|
|
742
742
|
const f = u.trim();
|
|
743
743
|
if (!f || f === "*" || f === "x") return !0;
|
|
744
744
|
try {
|
|
745
|
-
const
|
|
746
|
-
if (!
|
|
747
|
-
const m =
|
|
745
|
+
const h = vo(f);
|
|
746
|
+
if (!h.trim()) return !0;
|
|
747
|
+
const m = h.split(" ").map((y) => $o(y)).join(" ");
|
|
748
748
|
if (!m.trim()) return !0;
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
749
|
+
const d = m.split(/\s+/).map((y) => bo(y)).filter(Boolean);
|
|
750
|
+
if (d.length === 0) continue;
|
|
751
751
|
let p = !0;
|
|
752
|
-
for (const y of
|
|
752
|
+
for (const y of d) {
|
|
753
753
|
const g = Xe(y);
|
|
754
754
|
if (!g) {
|
|
755
755
|
p = !1;
|
|
@@ -769,8 +769,8 @@ function oe(e, t) {
|
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
if (p) return !0;
|
|
772
|
-
} catch (
|
|
773
|
-
console.error(`[semver] Error processing range part "${f}":`,
|
|
772
|
+
} catch (h) {
|
|
773
|
+
console.error(`[semver] Error processing range part "${f}":`, h);
|
|
774
774
|
continue;
|
|
775
775
|
}
|
|
776
776
|
}
|
|
@@ -901,11 +901,11 @@ function Se(e, t, r, o, n) {
|
|
|
901
901
|
if (!e) return;
|
|
902
902
|
const { shareConfig: s, scope: i = le, strategy: a, treeShaking: c } = r, l = Array.isArray(i) ? i : [i];
|
|
903
903
|
for (const u of l) if (s && e[u] && e[u][t]) {
|
|
904
|
-
const { requiredVersion: f } = s, { version:
|
|
905
|
-
const y = e[u][t][
|
|
904
|
+
const { requiredVersion: f } = s, { version: h, useTreesShaking: m } = ko(a)(e, u, t, c), d = () => {
|
|
905
|
+
const y = e[u][t][h];
|
|
906
906
|
if (s.singleton) {
|
|
907
|
-
if (typeof f == "string" && !oe(
|
|
908
|
-
const g = `Version ${
|
|
907
|
+
if (typeof f == "string" && !oe(h, f)) {
|
|
908
|
+
const g = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
|
|
909
909
|
s.strictVersion ? I(g) : se(g);
|
|
910
910
|
}
|
|
911
911
|
return {
|
|
@@ -917,7 +917,7 @@ function Se(e, t, r, o, n) {
|
|
|
917
917
|
shared: y,
|
|
918
918
|
useTreesShaking: m
|
|
919
919
|
};
|
|
920
|
-
if (oe(
|
|
920
|
+
if (oe(h, f)) return {
|
|
921
921
|
shared: y,
|
|
922
922
|
useTreesShaking: m
|
|
923
923
|
};
|
|
@@ -939,10 +939,10 @@ function Se(e, t, r, o, n) {
|
|
|
939
939
|
shareScopeMap: e,
|
|
940
940
|
scope: u,
|
|
941
941
|
pkgName: t,
|
|
942
|
-
version:
|
|
942
|
+
version: h,
|
|
943
943
|
GlobalFederation: we.__FEDERATION__,
|
|
944
944
|
shareInfo: r,
|
|
945
|
-
resolver:
|
|
945
|
+
resolver: d,
|
|
946
946
|
loadContext: n
|
|
947
947
|
};
|
|
948
948
|
return (o.emit(p) || p).resolver();
|
|
@@ -957,16 +957,16 @@ function Qe(e) {
|
|
|
957
957
|
const l = {};
|
|
958
958
|
return c.forEach((f) => {
|
|
959
959
|
l[f.version] = f;
|
|
960
|
-
}), l[ce(l, function(f,
|
|
961
|
-
return !be(l[f]) && j(f,
|
|
960
|
+
}), l[ce(l, function(f, h) {
|
|
961
|
+
return !be(l[f]) && j(f, h);
|
|
962
962
|
})];
|
|
963
963
|
}, s = (r == null ? void 0 : r.resolver) ?? n, i = (c) => c !== null && typeof c == "object" && !Array.isArray(c), a = (...c) => {
|
|
964
964
|
const l = {};
|
|
965
965
|
for (const u of c)
|
|
966
966
|
if (u)
|
|
967
|
-
for (const [f,
|
|
967
|
+
for (const [f, h] of Object.entries(u)) {
|
|
968
968
|
const m = l[f];
|
|
969
|
-
i(m) && i(
|
|
969
|
+
i(m) && i(h) ? l[f] = a(m, h) : h !== void 0 && (l[f] = h);
|
|
970
970
|
}
|
|
971
971
|
return l;
|
|
972
972
|
};
|
|
@@ -1183,15 +1183,14 @@ async function We(e) {
|
|
|
1183
1183
|
resourceContext: s,
|
|
1184
1184
|
cached: !0
|
|
1185
1185
|
}), r;
|
|
1186
|
-
if (!
|
|
1187
|
-
const l = t.remoteHandler.hooks.lifecycle.loadEntry, u = t.loaderHook
|
|
1188
|
-
B[a] = l.emit({
|
|
1186
|
+
if (!x[a]) {
|
|
1187
|
+
const l = t.remoteHandler.hooks.lifecycle.loadEntry, u = t.loaderHook, f = l.emit({
|
|
1189
1188
|
origin: t,
|
|
1190
1189
|
loaderHook: u,
|
|
1191
1190
|
remoteInfo: o,
|
|
1192
1191
|
remoteEntryExports: r,
|
|
1193
1192
|
resourceContext: s
|
|
1194
|
-
}).then((
|
|
1193
|
+
}).then((h) => h || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : B) ? Uo({
|
|
1195
1194
|
remoteInfo: o,
|
|
1196
1195
|
remoteEntryExports: r,
|
|
1197
1196
|
loaderHook: u,
|
|
@@ -1201,44 +1200,47 @@ async function We(e) {
|
|
|
1201
1200
|
remoteInfo: o,
|
|
1202
1201
|
loaderHook: u,
|
|
1203
1202
|
resourceContext: s
|
|
1204
|
-
}))).then(async (
|
|
1203
|
+
}))).then(async (h) => (await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1205
1204
|
origin: t,
|
|
1206
1205
|
remoteInfo: o,
|
|
1207
|
-
remoteEntryExports:
|
|
1206
|
+
remoteEntryExports: h,
|
|
1208
1207
|
resourceContext: s
|
|
1209
|
-
}),
|
|
1210
|
-
const
|
|
1211
|
-
if (
|
|
1212
|
-
const
|
|
1213
|
-
...
|
|
1208
|
+
}), h)).catch(async (h) => {
|
|
1209
|
+
const m = h instanceof Error && h.message.includes("ScriptExecutionError");
|
|
1210
|
+
if (h instanceof Error && h.message.includes(Ie) && !m && !i) {
|
|
1211
|
+
const d = (y) => We({
|
|
1212
|
+
...y,
|
|
1214
1213
|
_inErrorHandling: !0
|
|
1215
|
-
}),
|
|
1216
|
-
getRemoteEntry:
|
|
1214
|
+
}), p = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
1215
|
+
getRemoteEntry: d,
|
|
1217
1216
|
origin: t,
|
|
1218
1217
|
remoteInfo: o,
|
|
1219
1218
|
remoteEntryExports: r,
|
|
1220
|
-
globalLoading:
|
|
1219
|
+
globalLoading: x,
|
|
1221
1220
|
uniqueKey: a
|
|
1222
1221
|
});
|
|
1223
|
-
if (
|
|
1222
|
+
if (p)
|
|
1224
1223
|
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1225
1224
|
origin: t,
|
|
1226
1225
|
remoteInfo: o,
|
|
1227
|
-
remoteEntryExports:
|
|
1226
|
+
remoteEntryExports: p,
|
|
1228
1227
|
resourceContext: s,
|
|
1229
|
-
error:
|
|
1228
|
+
error: h,
|
|
1230
1229
|
recovered: !0
|
|
1231
|
-
}),
|
|
1230
|
+
}), p;
|
|
1232
1231
|
}
|
|
1233
1232
|
throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1234
1233
|
origin: t,
|
|
1235
1234
|
remoteInfo: o,
|
|
1236
1235
|
resourceContext: s,
|
|
1237
|
-
error:
|
|
1238
|
-
}),
|
|
1239
|
-
})
|
|
1236
|
+
error: h
|
|
1237
|
+
}), h;
|
|
1238
|
+
});
|
|
1239
|
+
x[a] = f, f.then(void 0, () => {
|
|
1240
|
+
x[a] === f && delete x[a];
|
|
1241
|
+
}), tt.set(f, t);
|
|
1240
1242
|
}
|
|
1241
|
-
const c =
|
|
1243
|
+
const c = x[a];
|
|
1242
1244
|
if (tt.get(c) !== t) try {
|
|
1243
1245
|
const l = await c;
|
|
1244
1246
|
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
@@ -1367,7 +1369,7 @@ function Jo(e) {
|
|
|
1367
1369
|
function je(e) {
|
|
1368
1370
|
return e instanceof Error ? e.message.includes("timed out") || e.name.includes("Timeout") : !1;
|
|
1369
1371
|
}
|
|
1370
|
-
function
|
|
1372
|
+
function U(e, t, r, o) {
|
|
1371
1373
|
return {
|
|
1372
1374
|
url: t,
|
|
1373
1375
|
status: r,
|
|
@@ -1378,11 +1380,11 @@ function G(e, t, r, o) {
|
|
|
1378
1380
|
};
|
|
1379
1381
|
}
|
|
1380
1382
|
function Ne(e, t, r, o) {
|
|
1381
|
-
return r ? Yr(t) ? Promise.resolve(
|
|
1383
|
+
return r ? Yr(t) ? Promise.resolve(U(e, t, "cached")) : (Qr(t), o()) : o();
|
|
1382
1384
|
}
|
|
1383
1385
|
async function Zo(e, t, r, o) {
|
|
1384
1386
|
const n = e.moduleCache.get(r.name), s = r.entry;
|
|
1385
|
-
if (n != null && n.remoteEntryExports) return
|
|
1387
|
+
if (n != null && n.remoteEntryExports) return U(o, s, "cached");
|
|
1386
1388
|
try {
|
|
1387
1389
|
if (!await We({
|
|
1388
1390
|
origin: e,
|
|
@@ -1393,9 +1395,9 @@ async function Zo(e, t, r, o) {
|
|
|
1393
1395
|
url: s
|
|
1394
1396
|
}
|
|
1395
1397
|
})) throw new Error(`Failed to load remoteEntry "${s}".`);
|
|
1396
|
-
return
|
|
1398
|
+
return U(o, s, "success");
|
|
1397
1399
|
} catch (i) {
|
|
1398
|
-
return
|
|
1400
|
+
return U(o, s, je(i) ? "timeout" : "error", i);
|
|
1399
1401
|
}
|
|
1400
1402
|
}
|
|
1401
1403
|
function de({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
|
|
@@ -1403,10 +1405,10 @@ function de({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1403
1405
|
const { link: a, needAttach: c } = Nr({
|
|
1404
1406
|
url: r,
|
|
1405
1407
|
cb: () => {
|
|
1406
|
-
i(
|
|
1408
|
+
i(U(n, r, c ? "success" : "cached"));
|
|
1407
1409
|
},
|
|
1408
1410
|
onErrorCallback: (l) => {
|
|
1409
|
-
i(
|
|
1411
|
+
i(U(n, r, je(l) ? "timeout" : "error", l));
|
|
1410
1412
|
},
|
|
1411
1413
|
attrs: o,
|
|
1412
1414
|
createLinkHook: (l, u) => {
|
|
@@ -1431,10 +1433,10 @@ function Xo({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
|
1431
1433
|
const { script: i, needAttach: a } = mt({
|
|
1432
1434
|
url: r,
|
|
1433
1435
|
cb: () => {
|
|
1434
|
-
s(
|
|
1436
|
+
s(U(n, r, a ? "success" : "cached"));
|
|
1435
1437
|
},
|
|
1436
1438
|
onErrorCallback: (c) => {
|
|
1437
|
-
s(
|
|
1439
|
+
s(U(n, r, je(c) ? "timeout" : "error", c));
|
|
1438
1440
|
},
|
|
1439
1441
|
attrs: o,
|
|
1440
1442
|
createScriptHook: (c, l) => {
|
|
@@ -1466,38 +1468,38 @@ function Kt(e, t, r, o = !0, n = {
|
|
|
1466
1468
|
}, s = !0) {
|
|
1467
1469
|
const { cssAssets: i, jsAssetsWithoutEntry: a, entryAssets: c } = r, l = [];
|
|
1468
1470
|
if (t.options.inBrowser) {
|
|
1469
|
-
if (c.forEach((
|
|
1470
|
-
const { moduleInfo: m } =
|
|
1471
|
+
if (c.forEach((h) => {
|
|
1472
|
+
const { moduleInfo: m } = h;
|
|
1471
1473
|
l.push(Zo(t, e, m, me(n, "remoteEntry")));
|
|
1472
1474
|
}), o) {
|
|
1473
|
-
const
|
|
1475
|
+
const h = {
|
|
1474
1476
|
rel: "preload",
|
|
1475
1477
|
as: "style"
|
|
1476
1478
|
};
|
|
1477
1479
|
i.forEach((m) => {
|
|
1478
|
-
const
|
|
1479
|
-
l.push(Ne(
|
|
1480
|
+
const d = me(n, "css");
|
|
1481
|
+
l.push(Ne(d, m, s, () => de({
|
|
1480
1482
|
host: t,
|
|
1481
1483
|
remoteInfo: e,
|
|
1482
1484
|
url: m,
|
|
1483
|
-
attrs:
|
|
1484
|
-
context:
|
|
1485
|
+
attrs: h,
|
|
1486
|
+
context: d
|
|
1485
1487
|
})));
|
|
1486
1488
|
});
|
|
1487
1489
|
} else {
|
|
1488
|
-
const
|
|
1490
|
+
const h = {
|
|
1489
1491
|
rel: "stylesheet",
|
|
1490
1492
|
type: "text/css"
|
|
1491
1493
|
};
|
|
1492
1494
|
i.forEach((m) => {
|
|
1493
|
-
const
|
|
1494
|
-
l.push(Ne(
|
|
1495
|
+
const d = me(n, "css");
|
|
1496
|
+
l.push(Ne(d, m, s, () => de({
|
|
1495
1497
|
host: t,
|
|
1496
1498
|
remoteInfo: e,
|
|
1497
1499
|
url: m,
|
|
1498
|
-
attrs:
|
|
1500
|
+
attrs: h,
|
|
1499
1501
|
needDeleteLink: !1,
|
|
1500
|
-
context:
|
|
1502
|
+
context: d
|
|
1501
1503
|
})));
|
|
1502
1504
|
});
|
|
1503
1505
|
}
|
|
@@ -1511,12 +1513,12 @@ function Kt(e, t, r, o = !0, n = {
|
|
|
1511
1513
|
}) : jt(e.type) && (u = de, f = {
|
|
1512
1514
|
rel: "modulepreload",
|
|
1513
1515
|
fetchpriority: "high"
|
|
1514
|
-
}), a.forEach((
|
|
1516
|
+
}), a.forEach((h) => {
|
|
1515
1517
|
const m = me(n, "js");
|
|
1516
|
-
l.push(Ne(m,
|
|
1518
|
+
l.push(Ne(m, h, s, () => u({
|
|
1517
1519
|
host: t,
|
|
1518
1520
|
remoteInfo: e,
|
|
1519
|
-
url:
|
|
1521
|
+
url: h,
|
|
1520
1522
|
attrs: f,
|
|
1521
1523
|
context: m
|
|
1522
1524
|
})));
|
|
@@ -1881,7 +1883,7 @@ function Zt(e, t) {
|
|
|
1881
1883
|
const r = bt(t);
|
|
1882
1884
|
r.url || I(xt, M, { remoteName: e.name });
|
|
1883
1885
|
let o = Le(t, r.url);
|
|
1884
|
-
!
|
|
1886
|
+
!B && !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;
|
|
1885
1887
|
}
|
|
1886
1888
|
function tn() {
|
|
1887
1889
|
return {
|
|
@@ -1912,7 +1914,7 @@ function tn() {
|
|
|
1912
1914
|
const f = {
|
|
1913
1915
|
remote: t,
|
|
1914
1916
|
preloadConfig: u
|
|
1915
|
-
},
|
|
1917
|
+
}, h = await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1916
1918
|
origin: n,
|
|
1917
1919
|
preloadOptions: f,
|
|
1918
1920
|
remoteInfo: s,
|
|
@@ -1920,7 +1922,7 @@ function tn() {
|
|
|
1920
1922
|
remoteSnapshot: a,
|
|
1921
1923
|
globalSnapshot: c
|
|
1922
1924
|
});
|
|
1923
|
-
|
|
1925
|
+
h && Kt(s, n, h, !1, {
|
|
1924
1926
|
initiator: "loadRemote",
|
|
1925
1927
|
id: i
|
|
1926
1928
|
}, u.recordPreloadedAssets).catch(() => {
|
|
@@ -1965,35 +1967,35 @@ function Xt(e, t, r, o, n = {}, s) {
|
|
|
1965
1967
|
}
|
|
1966
1968
|
const Ae = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1967
1969
|
function on(e, t, r, o, n) {
|
|
1968
|
-
const s = [], i = [], a = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote:
|
|
1969
|
-
if (Xt(o, r, (
|
|
1970
|
+
const s = [], i = [], a = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: h } = f;
|
|
1971
|
+
if (Xt(o, r, (d, p, y) => {
|
|
1970
1972
|
var b;
|
|
1971
1973
|
let g;
|
|
1972
1974
|
if (y) g = f;
|
|
1973
|
-
else if (Array.isArray(
|
|
1974
|
-
const $ =
|
|
1975
|
+
else if (Array.isArray(h)) {
|
|
1976
|
+
const $ = h.find((w) => w.nameOrAlias === p.name || w.nameOrAlias === p.alias);
|
|
1975
1977
|
if (!$) return;
|
|
1976
1978
|
g = zt($);
|
|
1977
|
-
} else if (
|
|
1979
|
+
} else if (h === !0) g = f;
|
|
1978
1980
|
else return;
|
|
1979
|
-
const R = Le(
|
|
1981
|
+
const R = Le(d, bt(d).url);
|
|
1980
1982
|
R && a.push({
|
|
1981
1983
|
name: p.name,
|
|
1982
1984
|
moduleInfo: {
|
|
1983
1985
|
name: p.name,
|
|
1984
1986
|
entry: R,
|
|
1985
|
-
type: "remoteEntryType" in
|
|
1986
|
-
entryGlobalName: "globalName" in
|
|
1987
|
+
type: "remoteEntryType" in d ? d.remoteEntryType : "global",
|
|
1988
|
+
entryGlobalName: "globalName" in d ? d.globalName : p.name,
|
|
1987
1989
|
shareScope: "",
|
|
1988
|
-
version: "version" in
|
|
1990
|
+
version: "version" in d ? d.version : void 0
|
|
1989
1991
|
},
|
|
1990
1992
|
url: R
|
|
1991
1993
|
});
|
|
1992
|
-
let E = "modules" in
|
|
1994
|
+
let E = "modules" in d ? d.modules : [];
|
|
1993
1995
|
const _ = Jo(g.exposes);
|
|
1994
|
-
_.length && "modules" in
|
|
1996
|
+
_.length && "modules" in d && (E = (b = d == null ? void 0 : d.modules) == null ? void 0 : b.reduce(($, w) => ((_ == null ? void 0 : _.indexOf(w.moduleName)) !== -1 && $.push(w), $), []));
|
|
1995
1997
|
function S($) {
|
|
1996
|
-
const w = $.map((P) => Le(
|
|
1998
|
+
const w = $.map((P) => Le(d, P));
|
|
1997
1999
|
return g.filter ? w.filter(g.filter) : w;
|
|
1998
2000
|
}
|
|
1999
2001
|
if (E) {
|
|
@@ -2003,7 +2005,7 @@ function on(e, t, r, o, n) {
|
|
|
2003
2005
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
2004
2006
|
id: P.moduleName === "." ? p.name : q,
|
|
2005
2007
|
name: p.name,
|
|
2006
|
-
remoteSnapshot:
|
|
2008
|
+
remoteSnapshot: d,
|
|
2007
2009
|
preloadConfig: g,
|
|
2008
2010
|
remote: p,
|
|
2009
2011
|
origin: e
|
|
@@ -2011,7 +2013,7 @@ function on(e, t, r, o, n) {
|
|
|
2011
2013
|
}
|
|
2012
2014
|
}
|
|
2013
2015
|
}, !0, {}, n), n.shared && n.shared.length > 0) {
|
|
2014
|
-
const
|
|
2016
|
+
const d = (p, y) => {
|
|
2015
2017
|
const { shared: g } = Se(e.shareScopeMap, y.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
2016
2018
|
g && typeof g.lib == "function" && (y.assets.js.sync.forEach((R) => {
|
|
2017
2019
|
c.add(R);
|
|
@@ -2025,15 +2027,15 @@ function on(e, t, r, o, n) {
|
|
|
2025
2027
|
if (!y) return;
|
|
2026
2028
|
const g = p.version ? y.find((E) => E.version === p.version) : y;
|
|
2027
2029
|
g && St(g).forEach((E) => {
|
|
2028
|
-
|
|
2030
|
+
d(E, p);
|
|
2029
2031
|
});
|
|
2030
2032
|
});
|
|
2031
2033
|
}
|
|
2032
|
-
const m = i.filter((
|
|
2034
|
+
const m = i.filter((d) => !c.has(d) && !Ae("script", d));
|
|
2033
2035
|
return {
|
|
2034
|
-
cssAssets: s.filter((
|
|
2036
|
+
cssAssets: s.filter((d) => !l.has(d) && !Ae("link", d)),
|
|
2035
2037
|
jsAssetsWithoutEntry: m,
|
|
2036
|
-
entryAssets: a.filter((
|
|
2038
|
+
entryAssets: a.filter((d) => !Ae("script", d.url))
|
|
2037
2039
|
};
|
|
2038
2040
|
}
|
|
2039
2041
|
const nn = function() {
|
|
@@ -2041,7 +2043,7 @@ const nn = function() {
|
|
|
2041
2043
|
name: "generate-preload-assets-plugin",
|
|
2042
2044
|
async generatePreloadAssets(e) {
|
|
2043
2045
|
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: i } = e;
|
|
2044
|
-
return
|
|
2046
|
+
return B ? He(n) && Rt(n) ? {
|
|
2045
2047
|
cssAssets: [],
|
|
2046
2048
|
jsAssetsWithoutEntry: [],
|
|
2047
2049
|
entryAssets: [{
|
|
@@ -2123,29 +2125,29 @@ var sn = class {
|
|
|
2123
2125
|
});
|
|
2124
2126
|
let u, f;
|
|
2125
2127
|
if (c) if (ut(c)) {
|
|
2126
|
-
const
|
|
2128
|
+
const h = B ? c.remoteEntry : c.ssrRemoteEntry || c.remoteEntry || "", m = await this.loadManifestSnapshot(h, e, {}, {
|
|
2127
2129
|
initiator: r,
|
|
2128
2130
|
id: t || e.name
|
|
2129
|
-
}),
|
|
2131
|
+
}), d = ze({
|
|
2130
2132
|
...e,
|
|
2131
|
-
entry:
|
|
2133
|
+
entry: h
|
|
2132
2134
|
}, m);
|
|
2133
|
-
u = m, f =
|
|
2135
|
+
u = m, f = d;
|
|
2134
2136
|
} else {
|
|
2135
|
-
const { remoteSnapshot:
|
|
2137
|
+
const { remoteSnapshot: h } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2136
2138
|
options: this.HostInstance.options,
|
|
2137
2139
|
moduleInfo: e,
|
|
2138
2140
|
remoteSnapshot: c,
|
|
2139
2141
|
from: "global"
|
|
2140
2142
|
});
|
|
2141
|
-
u =
|
|
2143
|
+
u = h, f = l;
|
|
2142
2144
|
}
|
|
2143
2145
|
else if (He(e)) {
|
|
2144
|
-
const
|
|
2146
|
+
const h = await this.loadManifestSnapshot(e.entry, e, {}, {
|
|
2145
2147
|
initiator: r,
|
|
2146
2148
|
id: t || e.name
|
|
2147
|
-
}), m = ze(e,
|
|
2148
|
-
u =
|
|
2149
|
+
}), m = ze(e, h);
|
|
2150
|
+
u = h, f = m;
|
|
2149
2151
|
} else I(Ht, M, {
|
|
2150
2152
|
remoteName: e.name,
|
|
2151
2153
|
remoteVersion: e.version,
|
|
@@ -2187,16 +2189,16 @@ var sn = class {
|
|
|
2187
2189
|
});
|
|
2188
2190
|
let a, c, l = !1;
|
|
2189
2191
|
try {
|
|
2190
|
-
let
|
|
2192
|
+
let h = await this.loaderHook.lifecycle.fetch.emit(e, {}, s, o ? {
|
|
2191
2193
|
...o,
|
|
2192
2194
|
url: e,
|
|
2193
2195
|
resourceType: "manifest"
|
|
2194
2196
|
} : void 0);
|
|
2195
|
-
(!
|
|
2196
|
-
} catch (
|
|
2197
|
-
c =
|
|
2197
|
+
(!h || !(h instanceof Response)) && (h = await fetch(e, {})), a = h, i = await h.json();
|
|
2198
|
+
} catch (h) {
|
|
2199
|
+
c = h, i = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2198
2200
|
id: e,
|
|
2199
|
-
error:
|
|
2201
|
+
error: h,
|
|
2200
2202
|
from: "runtime",
|
|
2201
2203
|
lifecycle: "afterResolve",
|
|
2202
2204
|
remote: s,
|
|
@@ -2206,13 +2208,13 @@ var sn = class {
|
|
|
2206
2208
|
moduleInfo: t,
|
|
2207
2209
|
resourceOptions: o,
|
|
2208
2210
|
response: a,
|
|
2209
|
-
error:
|
|
2211
|
+
error: h,
|
|
2210
2212
|
origin: this.HostInstance
|
|
2211
2213
|
}), I(Ot, M, {
|
|
2212
2214
|
manifestUrl: e,
|
|
2213
2215
|
moduleName: t.name,
|
|
2214
2216
|
hostName: this.HostInstance.options.name
|
|
2215
|
-
}, `${
|
|
2217
|
+
}, `${h}`, D(this.HostInstance.options))), l = !0;
|
|
2216
2218
|
}
|
|
2217
2219
|
const u = [
|
|
2218
2220
|
!i.metaData && "metaData",
|
|
@@ -2394,9 +2396,9 @@ var sn = class {
|
|
|
2394
2396
|
loadContext: o
|
|
2395
2397
|
}), f;
|
|
2396
2398
|
} else {
|
|
2397
|
-
const
|
|
2398
|
-
const
|
|
2399
|
-
return J(u, r.options.name), u.loaded = !0, u.lib =
|
|
2399
|
+
const h = (async () => {
|
|
2400
|
+
const d = await u.get();
|
|
2401
|
+
return J(u, r.options.name), u.loaded = !0, u.lib = d, d;
|
|
2400
2402
|
})();
|
|
2401
2403
|
this.setShared({
|
|
2402
2404
|
pkgName: e,
|
|
@@ -2404,10 +2406,10 @@ var sn = class {
|
|
|
2404
2406
|
shared: c,
|
|
2405
2407
|
from: r.options.name,
|
|
2406
2408
|
lib: null,
|
|
2407
|
-
loading:
|
|
2409
|
+
loading: h,
|
|
2408
2410
|
treeShaking: l ? u : void 0
|
|
2409
2411
|
});
|
|
2410
|
-
const m = await
|
|
2412
|
+
const m = await h;
|
|
2411
2413
|
return this.emitAfterLoadShare({
|
|
2412
2414
|
lifecycle: "loadShare",
|
|
2413
2415
|
pkgName: e,
|
|
@@ -2444,14 +2446,14 @@ var sn = class {
|
|
|
2444
2446
|
loading: m,
|
|
2445
2447
|
treeShaking: u ? f : void 0
|
|
2446
2448
|
});
|
|
2447
|
-
const
|
|
2449
|
+
const d = await m;
|
|
2448
2450
|
return this.emitAfterLoadShare({
|
|
2449
2451
|
lifecycle: "loadShare",
|
|
2450
2452
|
pkgName: e,
|
|
2451
2453
|
shareInfo: a,
|
|
2452
2454
|
selectedShared: a,
|
|
2453
2455
|
loadContext: o
|
|
2454
|
-
}),
|
|
2456
|
+
}), d;
|
|
2455
2457
|
}
|
|
2456
2458
|
} catch (i) {
|
|
2457
2459
|
throw this.emitErrorLoadShare({
|
|
@@ -2474,32 +2476,32 @@ var sn = class {
|
|
|
2474
2476
|
let i = t == null ? void 0 : t.initScope;
|
|
2475
2477
|
const a = [];
|
|
2476
2478
|
if (o !== "build") {
|
|
2477
|
-
const { initTokens:
|
|
2479
|
+
const { initTokens: d } = this;
|
|
2478
2480
|
i || (i = []);
|
|
2479
|
-
let p =
|
|
2480
|
-
if (p || (p =
|
|
2481
|
+
let p = d[e];
|
|
2482
|
+
if (p || (p = d[e] = { from: this.host.name }), i.indexOf(p) >= 0) return a;
|
|
2481
2483
|
i.push(p);
|
|
2482
2484
|
}
|
|
2483
2485
|
const c = this.shareScopeMap, l = r.options.name;
|
|
2484
2486
|
c[e] || (c[e] = {});
|
|
2485
|
-
const u = c[e], f = (
|
|
2487
|
+
const u = c[e], f = (d, p) => {
|
|
2486
2488
|
var b;
|
|
2487
2489
|
const { version: y, eager: g } = p;
|
|
2488
|
-
u[
|
|
2489
|
-
const R = u[
|
|
2490
|
-
(!_ || _.strategy !== "loaded-first" && !_.loaded && (!g != !S ? g : l > R[y].from)) && (R[y] = p), this.emitAfterRegisterShare(
|
|
2490
|
+
u[d] = u[d] || {};
|
|
2491
|
+
const R = u[d], E = R[y], _ = E && he(E), S = !!(_ && ("eager" in _ && _.eager || "shareConfig" in _ && ((b = _.shareConfig) != null && b.eager)));
|
|
2492
|
+
(!_ || _.strategy !== "loaded-first" && !_.loaded && (!g != !S ? g : l > R[y].from)) && (R[y] = p), this.emitAfterRegisterShare(d, {
|
|
2491
2493
|
scope: e,
|
|
2492
2494
|
shared: p,
|
|
2493
2495
|
previousShared: E,
|
|
2494
2496
|
registeredShared: R[y],
|
|
2495
2497
|
trigger: s
|
|
2496
2498
|
});
|
|
2497
|
-
},
|
|
2498
|
-
const { module: p } = await r.remoteHandler.getRemoteModuleAndOptions({ id:
|
|
2499
|
+
}, h = async (d) => {
|
|
2500
|
+
const { module: p } = await r.remoteHandler.getRemoteModuleAndOptions({ id: d });
|
|
2499
2501
|
let y;
|
|
2500
2502
|
const g = {
|
|
2501
2503
|
initiator: "loadShare",
|
|
2502
|
-
id:
|
|
2504
|
+
id: d,
|
|
2503
2505
|
resourceType: "remoteEntry",
|
|
2504
2506
|
url: p.remoteInfo.entry
|
|
2505
2507
|
};
|
|
@@ -2507,7 +2509,7 @@ var sn = class {
|
|
|
2507
2509
|
y = await p.getEntry(void 0, g);
|
|
2508
2510
|
} catch (R) {
|
|
2509
2511
|
if (y = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2510
|
-
id:
|
|
2512
|
+
id: d,
|
|
2511
2513
|
error: R,
|
|
2512
2514
|
from: "runtime",
|
|
2513
2515
|
lifecycle: "beforeLoadShare",
|
|
@@ -2518,12 +2520,12 @@ var sn = class {
|
|
|
2518
2520
|
y != null && y.init && !p.initing && (p.remoteEntryExports = y, await p.init(void 0, void 0, i, void 0, g));
|
|
2519
2521
|
}
|
|
2520
2522
|
};
|
|
2521
|
-
return Object.keys(r.options.shared).forEach((
|
|
2522
|
-
r.options.shared[
|
|
2523
|
-
p.scope.includes(e) && f(
|
|
2523
|
+
return Object.keys(r.options.shared).forEach((d) => {
|
|
2524
|
+
r.options.shared[d].forEach((p) => {
|
|
2525
|
+
p.scope.includes(e) && f(d, p);
|
|
2524
2526
|
});
|
|
2525
|
-
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((
|
|
2526
|
-
|
|
2527
|
+
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((d) => {
|
|
2528
|
+
d.shareScope === e && a.push(h(d.name));
|
|
2527
2529
|
}), a;
|
|
2528
2530
|
}
|
|
2529
2531
|
loadShareSync(e, t) {
|
|
@@ -2620,11 +2622,11 @@ var sn = class {
|
|
|
2620
2622
|
});
|
|
2621
2623
|
}
|
|
2622
2624
|
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: a }) {
|
|
2623
|
-
const { version: c, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l],
|
|
2624
|
-
const
|
|
2625
|
+
const { version: c, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], h = (m) => {
|
|
2626
|
+
const d = (y, g, R) => {
|
|
2625
2627
|
R && !y[g] && (y[g] = R);
|
|
2626
2628
|
}, p = a ? m.treeShaking : m;
|
|
2627
|
-
|
|
2629
|
+
d(p, "loaded", s), d(p, "loading", n), d(p, "get", i), d(p, "lib", o);
|
|
2628
2630
|
};
|
|
2629
2631
|
f.forEach((m) => {
|
|
2630
2632
|
this.shareScopeMap[m] || (this.shareScopeMap[m] = {}), this.shareScopeMap[m][e] || (this.shareScopeMap[m][e] = {}), this.shareScopeMap[m][e][c] || (this.shareScopeMap[m][e][c] = {
|
|
@@ -2633,8 +2635,8 @@ var sn = class {
|
|
|
2633
2635
|
...u,
|
|
2634
2636
|
lib: o
|
|
2635
2637
|
});
|
|
2636
|
-
const
|
|
2637
|
-
d
|
|
2638
|
+
const d = this.shareScopeMap[m][e][c];
|
|
2639
|
+
h(d), r && d.from !== r && (d.from = r);
|
|
2638
2640
|
});
|
|
2639
2641
|
}
|
|
2640
2642
|
_setGlobalShareScopeMap(e) {
|
|
@@ -2708,12 +2710,12 @@ var sn = class {
|
|
|
2708
2710
|
const { host: r } = this, o = et(r.options.remotes, e);
|
|
2709
2711
|
let n = e, s = o == null ? void 0 : o.expose, i = o ? Z(o.remote) : void 0, a;
|
|
2710
2712
|
try {
|
|
2711
|
-
const { loadFactory: c = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias:
|
|
2712
|
-
n = p, s =
|
|
2713
|
-
const g = await l.get(p,
|
|
2713
|
+
const { loadFactory: c = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: h, remote: m, expose: d, id: p, remoteSnapshot: y } = f;
|
|
2714
|
+
n = p, s = d, i = Z(m);
|
|
2715
|
+
const g = await l.get(p, d, t, y), R = await this.hooks.lifecycle.onLoad.emit({
|
|
2714
2716
|
id: p,
|
|
2715
|
-
pkgNameOrAlias:
|
|
2716
|
-
expose:
|
|
2717
|
+
pkgNameOrAlias: h,
|
|
2718
|
+
expose: d,
|
|
2717
2719
|
exposeModule: c ? g : void 0,
|
|
2718
2720
|
exposeModuleFactory: c ? void 0 : g,
|
|
2719
2721
|
remote: m,
|
|
@@ -2798,9 +2800,9 @@ var sn = class {
|
|
|
2798
2800
|
};
|
|
2799
2801
|
let s;
|
|
2800
2802
|
await Promise.all(o.flatMap(n).map(async (a) => {
|
|
2801
|
-
const { ops: c, id: l } = a, { remote: u, preloadConfig: f } = c,
|
|
2803
|
+
const { ops: c, id: l } = a, { remote: u, preloadConfig: f } = c, h = Z(u);
|
|
2802
2804
|
try {
|
|
2803
|
-
const { globalSnapshot: m, remoteSnapshot:
|
|
2805
|
+
const { globalSnapshot: m, remoteSnapshot: d } = await t.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2804
2806
|
moduleInfo: u,
|
|
2805
2807
|
id: l,
|
|
2806
2808
|
initiator: "preloadRemote"
|
|
@@ -2808,18 +2810,18 @@ var sn = class {
|
|
|
2808
2810
|
origin: t,
|
|
2809
2811
|
preloadOptions: c,
|
|
2810
2812
|
remote: u,
|
|
2811
|
-
remoteInfo:
|
|
2813
|
+
remoteInfo: h,
|
|
2812
2814
|
globalSnapshot: m,
|
|
2813
|
-
remoteSnapshot:
|
|
2815
|
+
remoteSnapshot: d
|
|
2814
2816
|
});
|
|
2815
2817
|
if (!p) return;
|
|
2816
|
-
const y = await Kt(
|
|
2818
|
+
const y = await Kt(h, t, p, !0, {
|
|
2817
2819
|
initiator: "preloadRemote",
|
|
2818
2820
|
id: l
|
|
2819
2821
|
}, f.recordPreloadedAssets);
|
|
2820
2822
|
r.push({
|
|
2821
2823
|
remote: u,
|
|
2822
|
-
remoteInfo:
|
|
2824
|
+
remoteInfo: h,
|
|
2823
2825
|
preloadConfig: f,
|
|
2824
2826
|
id: l,
|
|
2825
2827
|
results: y
|
|
@@ -2827,13 +2829,13 @@ var sn = class {
|
|
|
2827
2829
|
} catch (m) {
|
|
2828
2830
|
r.push({
|
|
2829
2831
|
remote: u,
|
|
2830
|
-
remoteInfo:
|
|
2832
|
+
remoteInfo: h,
|
|
2831
2833
|
preloadConfig: f,
|
|
2832
2834
|
id: l,
|
|
2833
2835
|
results: [{
|
|
2834
|
-
url:
|
|
2836
|
+
url: h.entry,
|
|
2835
2837
|
status: "error",
|
|
2836
|
-
resourceType: /\.json(?:$|[?#])/i.test(
|
|
2838
|
+
resourceType: /\.json(?:$|[?#])/i.test(h.entry) ? "manifest" : "remoteEntry",
|
|
2837
2839
|
initiator: "preloadRemote",
|
|
2838
2840
|
id: l,
|
|
2839
2841
|
error: m
|
|
@@ -2919,13 +2921,13 @@ var sn = class {
|
|
|
2919
2921
|
}), { remote: l, expose: u } = c;
|
|
2920
2922
|
k(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
|
|
2921
2923
|
let f = t.moduleCache.get(l.name);
|
|
2922
|
-
const
|
|
2924
|
+
const h = {
|
|
2923
2925
|
host: t,
|
|
2924
2926
|
remoteInfo: a
|
|
2925
2927
|
};
|
|
2926
|
-
return f || (f = new rt(
|
|
2928
|
+
return f || (f = new rt(h), t.moduleCache.set(l.name, f)), {
|
|
2927
2929
|
module: f,
|
|
2928
|
-
moduleOptions:
|
|
2930
|
+
moduleOptions: h,
|
|
2929
2931
|
remoteMatchInfo: c
|
|
2930
2932
|
};
|
|
2931
2933
|
}
|
|
@@ -2938,7 +2940,7 @@ var sn = class {
|
|
|
2938
2940
|
});
|
|
2939
2941
|
k(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2940
2942
|
}
|
|
2941
|
-
"entry" in e &&
|
|
2943
|
+
"entry" in e && B && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = le), e.type || (e.type = At);
|
|
2942
2944
|
};
|
|
2943
2945
|
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2944
2946
|
remote: e,
|
|
@@ -2975,17 +2977,17 @@ var sn = class {
|
|
|
2975
2977
|
const c = a.remoteInfo, l = c.entryGlobalName;
|
|
2976
2978
|
T[l] && ((t = Object.getOwnPropertyDescriptor(T, l)) != null && t.configurable ? delete T[l] : T[l] = void 0);
|
|
2977
2979
|
const u = qt(a.remoteInfo);
|
|
2978
|
-
|
|
2980
|
+
x[u] && delete x[u];
|
|
2979
2981
|
let f = c.buildVersion ? at(c.name, c.buildVersion) : c.name;
|
|
2980
|
-
const
|
|
2981
|
-
if (
|
|
2982
|
-
const m = T.__FEDERATION__.__INSTANCES__[
|
|
2982
|
+
const h = T.__FEDERATION__.__INSTANCES__.findIndex((m) => c.buildVersion ? m.options.id === f : m.name === f);
|
|
2983
|
+
if (h !== -1) {
|
|
2984
|
+
const m = T.__FEDERATION__.__INSTANCES__[h];
|
|
2983
2985
|
f = m.options.id || f;
|
|
2984
|
-
const
|
|
2986
|
+
const d = Pt();
|
|
2985
2987
|
let p = !0;
|
|
2986
2988
|
const y = [];
|
|
2987
|
-
Object.keys(
|
|
2988
|
-
const R =
|
|
2989
|
+
Object.keys(d).forEach((g) => {
|
|
2990
|
+
const R = d[g];
|
|
2989
2991
|
R && Object.keys(R).forEach((E) => {
|
|
2990
2992
|
const _ = R[E];
|
|
2991
2993
|
_ && Object.keys(_).forEach((S) => {
|
|
@@ -3006,10 +3008,10 @@ var sn = class {
|
|
|
3006
3008
|
});
|
|
3007
3009
|
});
|
|
3008
3010
|
});
|
|
3009
|
-
}), p && (m.shareScopeMap = {}, delete
|
|
3011
|
+
}), p && (m.shareScopeMap = {}, delete d[f]), y.forEach(([g, R, E, _]) => {
|
|
3010
3012
|
var S, b, $;
|
|
3011
|
-
($ = (b = (S =
|
|
3012
|
-
}), T.__FEDERATION__.__INSTANCES__.splice(
|
|
3013
|
+
($ = (b = (S = d[g]) == null ? void 0 : S[R]) == null ? void 0 : b[E]) == null || delete $[_];
|
|
3014
|
+
}), T.__FEDERATION__.__INSTANCES__.splice(h, 1);
|
|
3013
3015
|
}
|
|
3014
3016
|
r.moduleCache.delete(e.name);
|
|
3015
3017
|
}
|
|
@@ -3026,7 +3028,7 @@ var hn = class {
|
|
|
3026
3028
|
init: new N(),
|
|
3027
3029
|
beforeInitContainer: new F("beforeInitContainer"),
|
|
3028
3030
|
initContainer: new F("initContainer")
|
|
3029
|
-
}), this.version = "2.9.
|
|
3031
|
+
}), this.version = "2.9.2", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new H({
|
|
3030
3032
|
getModuleInfo: new N(),
|
|
3031
3033
|
createScript: new N(),
|
|
3032
3034
|
createLink: new N(),
|
|
@@ -3053,7 +3055,7 @@ var hn = class {
|
|
|
3053
3055
|
plugins: t,
|
|
3054
3056
|
remotes: [],
|
|
3055
3057
|
shared: {},
|
|
3056
|
-
inBrowser:
|
|
3058
|
+
inBrowser: B
|
|
3057
3059
|
};
|
|
3058
3060
|
this.name = e.name, this.options = r, this.snapshotHandler = Me ? new sn(this) : new an(), this.sharedHandler = ot ? new cn(this) : new ln(), this.remoteHandler = Me ? new un(this) : new en(), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
3059
3061
|
}
|
|
@@ -3153,17 +3155,17 @@ function mn(e) {
|
|
|
3153
3155
|
}
|
|
3154
3156
|
function pn(e) {
|
|
3155
3157
|
const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
|
|
3156
|
-
(m,
|
|
3158
|
+
(m, d) => m.path.split("/").filter((p) => p).length - d.path.split("/").filter((p) => p).length
|
|
3157
3159
|
), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
3158
3160
|
s.forEach((m) => {
|
|
3159
|
-
const
|
|
3160
|
-
|
|
3161
|
+
const d = i.get(m.path) || [];
|
|
3162
|
+
d.push(m), i.set(m.path, d);
|
|
3161
3163
|
});
|
|
3162
|
-
const c = (m,
|
|
3164
|
+
const c = (m, d) => `${m}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (m, d = "") => {
|
|
3163
3165
|
if (!m.children || m.children.length === 0)
|
|
3164
3166
|
return m;
|
|
3165
3167
|
for (let p = 0; p < m.children.length; p++) {
|
|
3166
|
-
const y = m.children[p], g = c(
|
|
3168
|
+
const y = m.children[p], g = c(d, y.path), E = (i.get(g) || []).find(
|
|
3167
3169
|
(_) => !a.has(_) && _ !== m && (y.name == null || _.name === y.name)
|
|
3168
3170
|
);
|
|
3169
3171
|
if (E) {
|
|
@@ -3180,16 +3182,16 @@ function pn(e) {
|
|
|
3180
3182
|
let u = [];
|
|
3181
3183
|
for (const m of s)
|
|
3182
3184
|
if (!a.has(m)) {
|
|
3183
|
-
const
|
|
3184
|
-
a.add(m), u.push(
|
|
3185
|
+
const d = l(m, m.path);
|
|
3186
|
+
a.add(m), u.push(d);
|
|
3185
3187
|
}
|
|
3186
|
-
let f,
|
|
3187
|
-
return o ? f = pe.createMemoryHistory(r) : n ? (f = pe.createWebHashHistory(), r && (u = er(u, r),
|
|
3188
|
+
let f, h;
|
|
3189
|
+
return o ? f = pe.createMemoryHistory(r) : n ? (f = pe.createWebHashHistory(), r && (u = er(u, r), h = mn(r))) : f = pe.createWebHistory(r), { history: f, routes: u, patchRouter: h };
|
|
3188
3190
|
}
|
|
3189
3191
|
function Sn(e) {
|
|
3190
3192
|
const t = /* @__PURE__ */ new Map(), r = Qt();
|
|
3191
3193
|
return () => ({
|
|
3192
|
-
__APP_VERSION__: "2.9.
|
|
3194
|
+
__APP_VERSION__: "2.9.2",
|
|
3193
3195
|
async render(o) {
|
|
3194
3196
|
var p, y, g, R, E, _, S, b, $;
|
|
3195
3197
|
C.debug("createBridgeComponent render Info", o);
|
|
@@ -3207,10 +3209,10 @@ function Sn(e) {
|
|
|
3207
3209
|
reason: "direct"
|
|
3208
3210
|
}, f = nr.createApp(e.rootComponent, l);
|
|
3209
3211
|
t.set(s, f);
|
|
3210
|
-
const
|
|
3212
|
+
const h = await ((g = (y = (p = r == null ? void 0 : r.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : g.emit(
|
|
3211
3213
|
o,
|
|
3212
3214
|
u
|
|
3213
|
-
)), m =
|
|
3215
|
+
)), m = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
|
|
3214
3216
|
app: f,
|
|
3215
3217
|
basename: i,
|
|
3216
3218
|
memoryRoute: a,
|
|
@@ -3218,18 +3220,18 @@ function Sn(e) {
|
|
|
3218
3220
|
...l,
|
|
3219
3221
|
...m
|
|
3220
3222
|
});
|
|
3221
|
-
if (
|
|
3223
|
+
if (d != null && d.router) {
|
|
3222
3224
|
const { history: w, routes: P, patchRouter: q } = pn({
|
|
3223
|
-
router:
|
|
3225
|
+
router: d.router,
|
|
3224
3226
|
basename: o.basename,
|
|
3225
3227
|
memoryRoute: o.memoryRoute,
|
|
3226
3228
|
hashRoute: o.hashRoute
|
|
3227
3229
|
}), ee = pe.createRouter({
|
|
3228
|
-
...
|
|
3230
|
+
...d.router.options,
|
|
3229
3231
|
history: w,
|
|
3230
3232
|
routes: P
|
|
3231
3233
|
});
|
|
3232
|
-
if (q && q(ee),
|
|
3234
|
+
if (q && q(ee), d.afterRouterCreate && d.afterRouterCreate(ee), C.debug("createBridgeComponent render router info>>>", {
|
|
3233
3235
|
moduleName: n,
|
|
3234
3236
|
router: ee
|
|
3235
3237
|
}), a) {
|
|
@@ -3299,8 +3301,8 @@ const En = /* @__PURE__ */ sr({
|
|
|
3299
3301
|
var R, E, _, S, b, $, w;
|
|
3300
3302
|
if (!t.value || n.value)
|
|
3301
3303
|
return;
|
|
3302
|
-
const
|
|
3303
|
-
r.value =
|
|
3304
|
+
const d = (R = e.providerInfo) == null ? void 0 : R.call(e);
|
|
3305
|
+
r.value = d;
|
|
3304
3306
|
let p = {
|
|
3305
3307
|
...l,
|
|
3306
3308
|
moduleName: e.moduleName,
|
|
@@ -3318,13 +3320,13 @@ const En = /* @__PURE__ */ sr({
|
|
|
3318
3320
|
p = {
|
|
3319
3321
|
...p,
|
|
3320
3322
|
...g.extraProps
|
|
3321
|
-
},
|
|
3323
|
+
}, d.render(p), n.value = !0, (w = ($ = (b = c == null ? void 0 : c.bridgeHook) == null ? void 0 : b.lifecycle) == null ? void 0 : $.afterBridgeRender) == null || w.emit(p, {
|
|
3322
3324
|
context: y
|
|
3323
3325
|
});
|
|
3324
|
-
},
|
|
3326
|
+
}, h = () => {
|
|
3325
3327
|
var g, R, E, _, S, b;
|
|
3326
|
-
const
|
|
3327
|
-
if (!
|
|
3328
|
+
const d = r.value;
|
|
3329
|
+
if (!d || !n.value)
|
|
3328
3330
|
return;
|
|
3329
3331
|
C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
|
|
3330
3332
|
...e
|
|
@@ -3334,15 +3336,15 @@ const En = /* @__PURE__ */ sr({
|
|
|
3334
3336
|
framework: "vue",
|
|
3335
3337
|
operation: "destroy"
|
|
3336
3338
|
};
|
|
3337
|
-
(E = (R = (g = c == null ? void 0 : c.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : R.beforeBridgeDestroy) == null || E.emit(p, y),
|
|
3339
|
+
(E = (R = (g = c == null ? void 0 : c.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : R.beforeBridgeDestroy) == null || E.emit(p, y), d.destroy({
|
|
3338
3340
|
dom: t.value,
|
|
3339
3341
|
moduleName: e.moduleName
|
|
3340
3342
|
}), r.value = null, n.value = !1, (b = (S = (_ = c == null ? void 0 : c.bridgeHook) == null ? void 0 : _.lifecycle) == null ? void 0 : S.afterBridgeDestroy) == null || b.emit(p, {
|
|
3341
3343
|
context: y
|
|
3342
3344
|
});
|
|
3343
|
-
}, m = ar(() => a == null ? void 0 : a.path, (
|
|
3345
|
+
}, m = ar(() => a == null ? void 0 : a.path, (d) => {
|
|
3344
3346
|
var p, y, g;
|
|
3345
|
-
if (s.value && o.value !== "" && o.value !==
|
|
3347
|
+
if (s.value && o.value !== "" && o.value !== d) {
|
|
3346
3348
|
C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
3347
3349
|
...e,
|
|
3348
3350
|
pathname: a.path
|
|
@@ -3351,7 +3353,7 @@ const En = /* @__PURE__ */ sr({
|
|
|
3351
3353
|
action: "host-to-remote",
|
|
3352
3354
|
mechanism: "popstate",
|
|
3353
3355
|
from: o.value,
|
|
3354
|
-
to:
|
|
3356
|
+
to: d,
|
|
3355
3357
|
basename: e.basename
|
|
3356
3358
|
}, E = {
|
|
3357
3359
|
side: "consumer",
|
|
@@ -3364,16 +3366,16 @@ const En = /* @__PURE__ */ sr({
|
|
|
3364
3366
|
context: E
|
|
3365
3367
|
});
|
|
3366
3368
|
}
|
|
3367
|
-
o.value =
|
|
3369
|
+
o.value = d;
|
|
3368
3370
|
});
|
|
3369
3371
|
return cr(() => {
|
|
3370
3372
|
s.value = !0, f();
|
|
3371
3373
|
}), lr(async () => {
|
|
3372
3374
|
s.value = !0, i.value && (i.value = !1, await ur(), f());
|
|
3373
3375
|
}), fr(() => {
|
|
3374
|
-
s.value = !1, i.value = !0,
|
|
3376
|
+
s.value = !1, i.value = !0, h();
|
|
3375
3377
|
}), hr(() => {
|
|
3376
|
-
m(),
|
|
3378
|
+
m(), h();
|
|
3377
3379
|
}), () => dr("div", mr(e.rootAttrs || {}, {
|
|
3378
3380
|
ref: t
|
|
3379
3381
|
}), null);
|
|
@@ -3382,7 +3384,7 @@ const En = /* @__PURE__ */ sr({
|
|
|
3382
3384
|
function gn(e) {
|
|
3383
3385
|
return pr({
|
|
3384
3386
|
// @ts-ignore
|
|
3385
|
-
__APP_VERSION__: "2.9.
|
|
3387
|
+
__APP_VERSION__: "2.9.2",
|
|
3386
3388
|
...e.asyncComponentOptions,
|
|
3387
3389
|
//@ts-ignore
|
|
3388
3390
|
loader: async () => {
|