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