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