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