@module-federation/bridge-vue3 2.8.2 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.js +1491 -1257
- 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 B = typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : typeof window < "u" && typeof window.document < "u";
|
|
10
|
+
function st() {
|
|
11
|
+
return B;
|
|
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 Ie = (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
|
|
67
|
-
let
|
|
68
|
-
Object.keys(r).length || (
|
|
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
69
|
let S;
|
|
70
|
-
const
|
|
71
|
-
return
|
|
72
|
-
}, {})) || {}), Object.keys(r).forEach((
|
|
73
|
-
const { remoteEntry: { path: l, name: u, type: f }, types:
|
|
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: h = {
|
|
74
74
|
path: "",
|
|
75
75
|
name: "",
|
|
76
76
|
zip: "",
|
|
77
77
|
api: ""
|
|
78
|
-
}, buildInfo: { buildVersion:
|
|
79
|
-
let
|
|
78
|
+
}, buildInfo: { buildVersion: m }, globalName: d, ssrRemoteEntry: p } = e.metaData, { exposes: y } = e;
|
|
79
|
+
let g = {
|
|
80
80
|
version: n || "",
|
|
81
|
-
buildVersion:
|
|
81
|
+
buildVersion: m,
|
|
82
82
|
globalName: d,
|
|
83
|
-
remoteEntry:
|
|
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(h.path, h.name),
|
|
86
|
+
remoteTypesZip: h.zip || "",
|
|
87
|
+
remoteTypesAPI: h.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
|
-
...
|
|
103
|
-
publicPath:
|
|
102
|
+
...g,
|
|
103
|
+
publicPath: i()
|
|
104
104
|
}, typeof e.metaData.ssrPublicPath == "string" && (s.ssrPublicPath = e.metaData.ssrPublicPath)) : s = {
|
|
105
|
-
...
|
|
106
|
-
getPublicPath:
|
|
105
|
+
...g,
|
|
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"];
|
|
@@ -170,17 +170,17 @@ var lt = class {
|
|
|
170
170
|
return ["debug", "log"];
|
|
171
171
|
}
|
|
172
172
|
})();
|
|
173
|
-
for (const
|
|
174
|
-
const
|
|
175
|
-
if (typeof
|
|
176
|
-
|
|
173
|
+
for (const i of s) {
|
|
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
|
-
for (const
|
|
181
|
-
const
|
|
182
|
-
if (typeof
|
|
183
|
-
|
|
180
|
+
for (const i of s) {
|
|
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
|
}
|
|
@@ -249,37 +249,37 @@ function ht(e) {
|
|
|
249
249
|
t && (f === "async" || f === "defer" ? t[f] = l[f] : t.getAttribute(f) || t.setAttribute(f, l[f]));
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
|
-
let
|
|
253
|
-
const
|
|
254
|
-
if (l.filename &&
|
|
252
|
+
let i = null;
|
|
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
|
-
u.name = "ScriptExecutionError",
|
|
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
|
-
|
|
266
|
-
} else
|
|
264
|
+
const h = /* @__PURE__ */ new Error(u != null && u.isTimeout ? `ScriptNetworkError: Script "${e.url}" timed out.` : `ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
|
|
265
|
+
h.name = "ScriptNetworkError", e != null && e.onErrorCallback && (e == null || e.onErrorCallback(h));
|
|
266
|
+
} 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: h = !0 } = e;
|
|
270
|
+
h && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
271
271
|
}), l && typeof l == "function")) {
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
275
|
-
return f(),
|
|
272
|
+
const h = l(u);
|
|
273
|
+
if (h instanceof Promise) {
|
|
274
|
+
const m = await h;
|
|
275
|
+
return f(), m;
|
|
276
276
|
}
|
|
277
|
-
return f(),
|
|
277
|
+
return f(), h;
|
|
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,25 +313,25 @@ function Sr(e) {
|
|
|
313
313
|
link: t,
|
|
314
314
|
needAttach: r
|
|
315
315
|
};
|
|
316
|
-
const
|
|
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();
|
|
332
332
|
};
|
|
333
|
-
return t.onerror =
|
|
334
|
-
|
|
333
|
+
return t.onerror = i.bind(null, t.onerror), t.onload = i.bind(null, t.onload), n = setTimeout(() => {
|
|
334
|
+
i(null, {
|
|
335
335
|
type: "error",
|
|
336
336
|
isTimeout: !0
|
|
337
337
|
});
|
|
@@ -340,10 +340,10 @@ function Sr(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:
|
|
346
|
+
const { script: i, needAttach: a } = mt({
|
|
347
347
|
url: e,
|
|
348
348
|
cb: n,
|
|
349
349
|
onErrorCallback: s,
|
|
@@ -354,187 +354,187 @@ function br(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
|
|
361
|
-
function
|
|
360
|
+
const ue = /* @__PURE__ */ new Map();
|
|
361
|
+
function G(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
|
|
370
|
-
const n = await ((s,
|
|
369
|
+
const Mr = async (e, t, r) => {
|
|
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(), [h, m] = await Promise.all([G("path"), G("vm")]), d = {
|
|
388
388
|
exports: {},
|
|
389
389
|
module: { exports: {} }
|
|
390
|
-
}, p =
|
|
390
|
+
}, p = c.pathname.split("/").slice(0, -1).join("/"), y = h.basename(c.pathname), g = new m.Script(`(function(exports, module, require, __dirname, __filename) {${f}
|
|
391
391
|
})`, {
|
|
392
|
-
filename:
|
|
393
|
-
importModuleDynamically: ((l =
|
|
392
|
+
filename: y,
|
|
393
|
+
importModuleDynamically: ((l = m.constants) == null ? void 0 : l.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? G
|
|
394
394
|
});
|
|
395
395
|
let R;
|
|
396
|
-
R = (await
|
|
397
|
-
const
|
|
398
|
-
if (r &&
|
|
399
|
-
t(void 0,
|
|
396
|
+
R = (await G("node:module")).createRequire(c.protocol === "file:" || c.protocol === "node:" ? c.href : h.join(process.cwd(), "__mf_require_base__.js")), g.runInThisContext()(d.exports, d.module, R, p, y);
|
|
397
|
+
const E = d.module.exports || d.exports;
|
|
398
|
+
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:
|
|
410
|
-
vm: await
|
|
411
|
-
}).then(async (
|
|
412
|
-
await
|
|
413
|
-
}).catch((
|
|
414
|
-
t(
|
|
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
|
+
vm: await G("vm")
|
|
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
|
-
a
|
|
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
|
|
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
|
|
435
|
-
const t = new URL(e), r = encodeURIComponent(t.protocol.slice(0, -1)), o = encodeURIComponent(t.host), n = t.pathname.split("/").map((
|
|
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
|
+
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 G("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 G(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 (!
|
|
477
|
-
const n = await (await r(e)).text(), s = (await
|
|
476
|
+
if (!pt(e)) throw new Error(`Unsupported ESM module URL "${e}". Only http(s) remote modules and Node.js built-in modules are supported.`);
|
|
477
|
+
const n = await (await r(e)).text(), s = (await G("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
|
-
function
|
|
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 B || 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, a;
|
|
571
|
-
|
|
567
|
+
Ee(T, "__GLOBAL_LOADING_REMOTE_ENTRY__") || ye(T, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
568
|
+
const x = 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.1");
|
|
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,10 +592,10 @@ 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(":"),
|
|
595
|
-
if (
|
|
596
|
-
value:
|
|
597
|
-
key:
|
|
595
|
+
const [n, s] = o.split(":"), i = `${n}:${t}`, a = e[i];
|
|
596
|
+
if (a) return {
|
|
597
|
+
value: a,
|
|
598
|
+
key: i
|
|
598
599
|
};
|
|
599
600
|
}
|
|
600
601
|
return {
|
|
@@ -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
|
-
if ((
|
|
613
|
-
}
|
|
614
|
-
},
|
|
615
|
-
const r =
|
|
616
|
-
return
|
|
617
|
-
},
|
|
618
|
-
...
|
|
612
|
+
const { version: o, ...n } = e, s = ie(n), i = V(L.__FEDERATION__.moduleInfo, s).value;
|
|
613
|
+
if ((i == null ? void 0 : i.version) === o) return i;
|
|
614
|
+
}
|
|
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, h) => (A(o) ? r = "" : A(n) ? r = `>=${o}.0.0` : A(s) ? r = `>=${o}.${n}.0` : r = `>=${r}`, A(l) ? c = "" : A(u) ? c = `<${Number(l) + 1}.0.0-0` : A(f) ? c = `<${l}.${Number(u) + 1}.0-0` : h ? c = `<=${l}.${u}.${f}-${h}` : c = `<=${c}`, `${r} ${c}`.trim()));
|
|
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
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
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
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
708
|
return Te(e, t);
|
|
702
709
|
case ">":
|
|
703
|
-
return
|
|
710
|
+
return fe(e, t) < 0;
|
|
704
711
|
case ">=":
|
|
705
|
-
return Te(e, t) ||
|
|
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 Te(e, t) ||
|
|
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,
|
|
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
|
-
patch:
|
|
732
|
-
preRelease:
|
|
738
|
+
patch: i,
|
|
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
|
|
739
|
-
if (!m.trim()) return !0;
|
|
740
|
-
const h = m.split(" ").map((E) => yo(E)).join(" ");
|
|
745
|
+
const h = vo(f);
|
|
741
746
|
if (!h.trim()) return !0;
|
|
742
|
-
const
|
|
747
|
+
const m = h.split(" ").map((y) => $o(y)).join(" ");
|
|
748
|
+
if (!m.trim()) return !0;
|
|
749
|
+
const d = m.split(/\s+/).map((y) => bo(y)).filter(Boolean);
|
|
743
750
|
if (d.length === 0) continue;
|
|
744
751
|
let p = !0;
|
|
745
|
-
for (const
|
|
746
|
-
const
|
|
747
|
-
if (!
|
|
752
|
+
for (const y of d) {
|
|
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
764
|
patch: S,
|
|
758
|
-
preRelease:
|
|
759
|
-
},
|
|
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 (h) {
|
|
773
|
+
console.error(`[semver] Error processing range part "${f}":`, h);
|
|
767
774
|
continue;
|
|
768
775
|
}
|
|
769
776
|
}
|
|
770
777
|
return !1;
|
|
771
778
|
}
|
|
772
|
-
const
|
|
773
|
-
function
|
|
774
|
-
var s,
|
|
779
|
+
const le = "default", At = "global";
|
|
780
|
+
function To(e, t, r, o) {
|
|
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 && ((
|
|
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,192 +803,193 @@ 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((
|
|
806
|
-
const
|
|
807
|
-
return a
|
|
808
|
-
a
|
|
809
|
-
}),
|
|
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));
|
|
816
|
+
}), i;
|
|
810
817
|
}, {}), s = { ...e.shared };
|
|
811
|
-
return Object.keys(n).forEach((
|
|
812
|
-
s[
|
|
813
|
-
s[
|
|
814
|
-
}) : s[
|
|
818
|
+
return Object.keys(n).forEach((i) => {
|
|
819
|
+
s[i] ? n[i].forEach((a) => {
|
|
820
|
+
s[i].find((c) => c.version === a.version) || s[i].push(a);
|
|
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(".");
|
|
829
836
|
let s = o;
|
|
830
|
-
for (let
|
|
837
|
+
for (let i = 0; i < 3 - n.length; i++) s += ".0";
|
|
831
838
|
return s;
|
|
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 = "",
|
|
850
|
-
const
|
|
851
|
-
return
|
|
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
|
-
if (
|
|
854
|
-
if (s =
|
|
860
|
+
if (i) {
|
|
861
|
+
if (s = ce(e[t][r], a), s) return {
|
|
855
862
|
version: s,
|
|
856
|
-
useTreesShaking:
|
|
863
|
+
useTreesShaking: i
|
|
857
864
|
};
|
|
858
|
-
|
|
865
|
+
i = !1;
|
|
859
866
|
}
|
|
860
867
|
return {
|
|
861
|
-
version:
|
|
862
|
-
useTreesShaking:
|
|
868
|
+
version: ce(e[t][r], a),
|
|
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 = "",
|
|
869
|
-
const
|
|
870
|
-
if (
|
|
871
|
-
if (!n[
|
|
875
|
+
let s = "", i = ae(o);
|
|
876
|
+
const a = function(c, l) {
|
|
877
|
+
if (i) {
|
|
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
|
-
if (
|
|
879
|
-
if (s =
|
|
885
|
+
if (i) {
|
|
886
|
+
if (s = ce(e[t][r], a), s) return {
|
|
880
887
|
version: s,
|
|
881
|
-
useTreesShaking:
|
|
888
|
+
useTreesShaking: i
|
|
882
889
|
};
|
|
883
|
-
|
|
890
|
+
i = !1;
|
|
884
891
|
}
|
|
885
892
|
return {
|
|
886
|
-
version:
|
|
887
|
-
useTreesShaking:
|
|
893
|
+
version: ce(e[t][r], a),
|
|
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: h, useTreesShaking: m } = ko(a)(e, u, t, c), d = () => {
|
|
905
|
+
const y = e[u][t][h];
|
|
906
|
+
if (s.singleton) {
|
|
907
|
+
if (typeof f == "string" && !oe(h, f)) {
|
|
908
|
+
const g = `Version ${h} from ${h && y.from} of shared singleton module ${t} does not satisfy the requirement of ${r.from} which needs ${f})`;
|
|
909
|
+
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(h, 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: h,
|
|
943
|
+
GlobalFederation: we.__FEDERATION__,
|
|
937
944
|
shareInfo: r,
|
|
938
|
-
resolver:
|
|
945
|
+
resolver: d,
|
|
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, h) {
|
|
961
|
+
return !be(l[f]) && j(f, h);
|
|
954
962
|
})];
|
|
955
|
-
}, s = (r == null ? void 0 : r.resolver) ?? n,
|
|
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
|
-
|
|
967
|
+
for (const [f, h] of Object.entries(u)) {
|
|
968
|
+
const m = l[f];
|
|
969
|
+
i(m) && i(h) ? l[f] = a(m, h) : h !== void 0 && (l[f] = h);
|
|
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
|
};
|
|
@@ -992,16 +1000,16 @@ function Qe(e, t) {
|
|
|
992
1000
|
};
|
|
993
1001
|
}
|
|
994
1002
|
const s = r.alias && t.startsWith(r.alias);
|
|
995
|
-
let
|
|
1003
|
+
let i = r.alias && t.replace(r.alias, "");
|
|
996
1004
|
if (r.alias && s) {
|
|
997
|
-
if (
|
|
998
|
-
const
|
|
999
|
-
return
|
|
1000
|
-
pkgNameOrAlias:
|
|
1001
|
-
expose:
|
|
1005
|
+
if (i && i.startsWith("/")) {
|
|
1006
|
+
const a = r.alias;
|
|
1007
|
+
return i = `.${i}`, {
|
|
1008
|
+
pkgNameOrAlias: a,
|
|
1009
|
+
expose: i,
|
|
1002
1010
|
remote: r
|
|
1003
1011
|
};
|
|
1004
|
-
} else if (
|
|
1012
|
+
} else if (i === "") return {
|
|
1005
1013
|
pkgNameOrAlias: r.alias,
|
|
1006
1014
|
expose: ".",
|
|
1007
1015
|
remote: r
|
|
@@ -1009,231 +1017,279 @@ 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
|
|
1044
|
+
const Wt = ".then(callbacks[0]).catch(callbacks[1])", tt = /* @__PURE__ */ new WeakMap(), Do = [
|
|
1037
1045
|
"Failed to fetch dynamically imported module",
|
|
1038
1046
|
"Importing a module script failed",
|
|
1039
1047
|
"error loading dynamically imported module"
|
|
1040
1048
|
];
|
|
1041
|
-
function
|
|
1042
|
-
return e instanceof TypeError ?
|
|
1049
|
+
function Ho(e) {
|
|
1050
|
+
return e instanceof TypeError ? Do.some((t) => e.message.includes(t)) : !1;
|
|
1043
1051
|
}
|
|
1044
|
-
function
|
|
1052
|
+
function jt(e) {
|
|
1045
1053
|
return e === "esm" || e === "module";
|
|
1046
1054
|
}
|
|
1047
|
-
async function
|
|
1055
|
+
async function Fo({ entry: e, remoteEntryExports: t, name: r, getEntryUrl: o }) {
|
|
1048
1056
|
return new Promise((n, s) => {
|
|
1049
|
-
const
|
|
1050
|
-
if (
|
|
1051
|
-
const l =
|
|
1057
|
+
const i = (c) => {
|
|
1058
|
+
if (Ho(c)) {
|
|
1059
|
+
const l = c instanceof Error ? c.message : String(c);
|
|
1052
1060
|
try {
|
|
1053
|
-
|
|
1061
|
+
I(Ie, M, {
|
|
1054
1062
|
remoteName: r,
|
|
1055
|
-
resourceUrl:
|
|
1063
|
+
resourceUrl: a
|
|
1056
1064
|
}, l);
|
|
1057
1065
|
} catch (u) {
|
|
1058
1066
|
s(u);
|
|
1059
1067
|
return;
|
|
1060
1068
|
}
|
|
1061
1069
|
}
|
|
1062
|
-
s(
|
|
1063
|
-
},
|
|
1070
|
+
s(c);
|
|
1071
|
+
}, a = o ? o(e) : e;
|
|
1064
1072
|
try {
|
|
1065
|
-
t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${
|
|
1073
|
+
t ? n(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${a}")${Wt}`)([n, i]) : import(
|
|
1066
1074
|
/* webpackIgnore: true */
|
|
1067
1075
|
/* @vite-ignore */
|
|
1068
|
-
|
|
1069
|
-
).then(n).catch(
|
|
1070
|
-
} catch (
|
|
1071
|
-
|
|
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)}`);
|
|
1072
1080
|
}
|
|
1073
1081
|
});
|
|
1074
1082
|
}
|
|
1075
|
-
async function
|
|
1083
|
+
async function xo({ entry: e, remoteEntryExports: t }) {
|
|
1076
1084
|
return new Promise((r, o) => {
|
|
1077
1085
|
try {
|
|
1078
|
-
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]);
|
|
1079
1087
|
} catch (n) {
|
|
1080
|
-
|
|
1088
|
+
I(`Failed to load SystemJS entry from "${e}". ${n instanceof Error ? n.message : String(n)}`);
|
|
1081
1089
|
}
|
|
1082
1090
|
});
|
|
1083
1091
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const { remoteEntryKey: o, entryExports: n } =
|
|
1086
|
-
return n ||
|
|
1092
|
+
function Vt(e, t, r) {
|
|
1093
|
+
const { remoteEntryKey: o, entryExports: n } = xe(e, t);
|
|
1094
|
+
return n || I(kt, M, {
|
|
1087
1095
|
remoteName: e,
|
|
1088
1096
|
remoteEntryUrl: r,
|
|
1089
1097
|
remoteEntryKey: o
|
|
1090
1098
|
}), n;
|
|
1091
1099
|
}
|
|
1092
|
-
async function
|
|
1093
|
-
const { entryExports:
|
|
1094
|
-
if (
|
|
1095
|
-
const
|
|
1096
|
-
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, {
|
|
1097
1105
|
attrs: {},
|
|
1098
1106
|
createScriptHook: (l, u) => {
|
|
1099
1107
|
const f = n.lifecycle.createScript.emit({
|
|
1100
1108
|
url: l,
|
|
1101
1109
|
attrs: u,
|
|
1102
1110
|
remoteInfo: o,
|
|
1103
|
-
resourceContext:
|
|
1104
|
-
...
|
|
1111
|
+
resourceContext: i ? {
|
|
1112
|
+
...i,
|
|
1105
1113
|
url: l
|
|
1106
1114
|
} : void 0
|
|
1107
1115
|
});
|
|
1108
1116
|
if (f && (f instanceof HTMLScriptElement || "script" in f || "timeout" in f))
|
|
1109
1117
|
return f;
|
|
1110
1118
|
}
|
|
1111
|
-
}).then(() =>
|
|
1119
|
+
}).then(() => Vt(e, t, r), (l) => {
|
|
1112
1120
|
const u = l instanceof Error ? l.message : String(l);
|
|
1113
|
-
|
|
1121
|
+
I(Ie, M, {
|
|
1114
1122
|
remoteName: e,
|
|
1115
|
-
resourceUrl:
|
|
1123
|
+
resourceUrl: c
|
|
1116
1124
|
}, u);
|
|
1117
1125
|
});
|
|
1118
1126
|
}
|
|
1119
|
-
async function
|
|
1120
|
-
const { entry: s, entryGlobalName:
|
|
1121
|
-
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({
|
|
1122
1130
|
entry: s,
|
|
1123
1131
|
remoteEntryExports: t,
|
|
1124
|
-
name:
|
|
1132
|
+
name: a,
|
|
1125
1133
|
getEntryUrl: o
|
|
1126
|
-
}) :
|
|
1134
|
+
}) : c === "system" ? xo({
|
|
1127
1135
|
entry: s,
|
|
1128
1136
|
remoteEntryExports: t
|
|
1129
|
-
}) :
|
|
1137
|
+
}) : Go({
|
|
1130
1138
|
entry: s,
|
|
1131
|
-
globalName:
|
|
1132
|
-
name:
|
|
1139
|
+
globalName: i,
|
|
1140
|
+
name: a,
|
|
1133
1141
|
remoteInfo: e,
|
|
1134
1142
|
loaderHook: r,
|
|
1135
1143
|
getEntryUrl: o,
|
|
1136
1144
|
resourceContext: n
|
|
1137
1145
|
});
|
|
1138
1146
|
}
|
|
1139
|
-
async function
|
|
1140
|
-
const { entry: o, entryGlobalName: n, name: s, type:
|
|
1141
|
-
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, {
|
|
1142
1150
|
attrs: {
|
|
1143
1151
|
name: s,
|
|
1144
1152
|
globalName: n,
|
|
1145
|
-
type:
|
|
1153
|
+
type: i
|
|
1146
1154
|
},
|
|
1147
|
-
loaderHook: { createScriptHook: (
|
|
1155
|
+
loaderHook: { createScriptHook: (c, l = {}) => {
|
|
1148
1156
|
const u = t.lifecycle.createScript.emit({
|
|
1149
|
-
url:
|
|
1157
|
+
url: c,
|
|
1150
1158
|
attrs: l,
|
|
1151
1159
|
remoteInfo: e,
|
|
1152
1160
|
resourceContext: r ? {
|
|
1153
1161
|
...r,
|
|
1154
|
-
url:
|
|
1162
|
+
url: c
|
|
1155
1163
|
} : void 0
|
|
1156
1164
|
});
|
|
1157
1165
|
if (u && "url" in u)
|
|
1158
1166
|
return u;
|
|
1159
1167
|
} }
|
|
1160
|
-
}).then(() =>
|
|
1161
|
-
|
|
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)}`);
|
|
1162
1170
|
});
|
|
1163
1171
|
}
|
|
1164
|
-
function
|
|
1172
|
+
function qt(e) {
|
|
1165
1173
|
const { entry: t, name: r } = e;
|
|
1166
|
-
return
|
|
1167
|
-
}
|
|
1168
|
-
async function
|
|
1169
|
-
const { origin: t, remoteEntryExports: r, remoteInfo: o, getEntryUrl: n, resourceContext: s, _inErrorHandling:
|
|
1170
|
-
if (r)
|
|
1171
|
-
|
|
1172
|
-
const i = t.remoteHandler.hooks.lifecycle.loadEntry, l = t.loaderHook;
|
|
1173
|
-
J[c] = i.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({
|
|
1174
1180
|
origin: t,
|
|
1175
|
-
loaderHook: l,
|
|
1176
1181
|
remoteInfo: o,
|
|
1177
|
-
remoteEntryExports: r
|
|
1178
|
-
|
|
1182
|
+
remoteEntryExports: r,
|
|
1183
|
+
resourceContext: s,
|
|
1184
|
+
cached: !0
|
|
1185
|
+
}), r;
|
|
1186
|
+
if (!x[a]) {
|
|
1187
|
+
const l = t.remoteHandler.hooks.lifecycle.loadEntry, u = t.loaderHook, f = l.emit({
|
|
1188
|
+
origin: t,
|
|
1189
|
+
loaderHook: u,
|
|
1179
1190
|
remoteInfo: o,
|
|
1180
1191
|
remoteEntryExports: r,
|
|
1181
|
-
|
|
1192
|
+
resourceContext: s
|
|
1193
|
+
}).then((h) => h || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : B) ? Uo({
|
|
1194
|
+
remoteInfo: o,
|
|
1195
|
+
remoteEntryExports: r,
|
|
1196
|
+
loaderHook: u,
|
|
1182
1197
|
getEntryUrl: n,
|
|
1183
1198
|
resourceContext: s
|
|
1184
|
-
}) :
|
|
1199
|
+
}) : Bo({
|
|
1185
1200
|
remoteInfo: o,
|
|
1186
|
-
loaderHook:
|
|
1201
|
+
loaderHook: u,
|
|
1187
1202
|
resourceContext: s
|
|
1188
|
-
}))).then(async (
|
|
1203
|
+
}))).then(async (h) => (await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1189
1204
|
origin: t,
|
|
1190
1205
|
remoteInfo: o,
|
|
1191
|
-
remoteEntryExports:
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1206
|
+
remoteEntryExports: h,
|
|
1207
|
+
resourceContext: s
|
|
1208
|
+
}), h)).catch(async (h) => {
|
|
1209
|
+
const m = h instanceof Error && h.message.includes("ScriptExecutionError");
|
|
1210
|
+
if (h instanceof Error && h.message.includes(Ie) && !m && !i) {
|
|
1211
|
+
const d = (y) => We({
|
|
1212
|
+
...y,
|
|
1197
1213
|
_inErrorHandling: !0
|
|
1198
|
-
}),
|
|
1199
|
-
getRemoteEntry:
|
|
1214
|
+
}), p = await t.loaderHook.lifecycle.loadEntryError.emit({
|
|
1215
|
+
getRemoteEntry: d,
|
|
1200
1216
|
origin: t,
|
|
1201
1217
|
remoteInfo: o,
|
|
1202
1218
|
remoteEntryExports: r,
|
|
1203
|
-
globalLoading:
|
|
1204
|
-
uniqueKey:
|
|
1219
|
+
globalLoading: x,
|
|
1220
|
+
uniqueKey: a
|
|
1205
1221
|
});
|
|
1206
|
-
if (
|
|
1222
|
+
if (p)
|
|
1207
1223
|
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1208
1224
|
origin: t,
|
|
1209
1225
|
remoteInfo: o,
|
|
1210
|
-
remoteEntryExports:
|
|
1226
|
+
remoteEntryExports: p,
|
|
1227
|
+
resourceContext: s,
|
|
1228
|
+
error: h,
|
|
1211
1229
|
recovered: !0
|
|
1212
|
-
}),
|
|
1230
|
+
}), p;
|
|
1213
1231
|
}
|
|
1214
1232
|
throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1215
1233
|
origin: t,
|
|
1216
1234
|
remoteInfo: o,
|
|
1217
|
-
|
|
1218
|
-
|
|
1235
|
+
resourceContext: s,
|
|
1236
|
+
error: h
|
|
1237
|
+
}), h;
|
|
1219
1238
|
});
|
|
1239
|
+
x[a] = f, f.then(void 0, () => {
|
|
1240
|
+
x[a] === f && delete x[a];
|
|
1241
|
+
}), tt.set(f, t);
|
|
1242
|
+
}
|
|
1243
|
+
const c = x[a];
|
|
1244
|
+
if (tt.get(c) !== t) try {
|
|
1245
|
+
const l = await c;
|
|
1246
|
+
return await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1247
|
+
origin: t,
|
|
1248
|
+
remoteInfo: o,
|
|
1249
|
+
remoteEntryExports: l,
|
|
1250
|
+
resourceContext: s
|
|
1251
|
+
}), l;
|
|
1252
|
+
} catch (l) {
|
|
1253
|
+
throw await t.loaderHook.lifecycle.afterLoadEntry.emit({
|
|
1254
|
+
origin: t,
|
|
1255
|
+
remoteInfo: o,
|
|
1256
|
+
resourceContext: s,
|
|
1257
|
+
error: l
|
|
1258
|
+
}), l;
|
|
1220
1259
|
}
|
|
1221
|
-
return
|
|
1260
|
+
return c;
|
|
1222
1261
|
}
|
|
1223
|
-
function
|
|
1262
|
+
function Z(e) {
|
|
1224
1263
|
return {
|
|
1225
1264
|
...e,
|
|
1226
1265
|
entry: "entry" in e ? e.entry : "",
|
|
1227
|
-
type: e.type ||
|
|
1266
|
+
type: e.type || At,
|
|
1228
1267
|
entryGlobalName: e.entryGlobalName || e.name,
|
|
1229
|
-
shareScope: e.shareScope ||
|
|
1268
|
+
shareScope: e.shareScope || le
|
|
1230
1269
|
};
|
|
1231
1270
|
}
|
|
1232
|
-
function
|
|
1271
|
+
function Wo() {
|
|
1233
1272
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
1234
1273
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const
|
|
1274
|
+
function jo(e) {
|
|
1275
|
+
const t = /* @__PURE__ */ new Map();
|
|
1276
|
+
return [...e || [], ...Jr()].forEach((r) => {
|
|
1277
|
+
r && (k(_t(r), "Plugin configuration is invalid."), k(r.name, "A name must be provided by the plugin."), t.has(r.name) || t.set(r.name, r));
|
|
1278
|
+
}), Array.from(t.values());
|
|
1279
|
+
}
|
|
1280
|
+
function Vo(e, t) {
|
|
1281
|
+
return t === void 0 ? e : {
|
|
1282
|
+
...t,
|
|
1283
|
+
name: e.name,
|
|
1284
|
+
version: e.version
|
|
1285
|
+
};
|
|
1286
|
+
}
|
|
1287
|
+
function qo(e, t) {
|
|
1288
|
+
const r = /* @__PURE__ */ new Map();
|
|
1289
|
+
t.options.plugins.forEach((n) => {
|
|
1290
|
+
n && r.set(n.name, n);
|
|
1291
|
+
});
|
|
1292
|
+
const o = [
|
|
1237
1293
|
t.hooks,
|
|
1238
1294
|
t.remoteHandler.hooks,
|
|
1239
1295
|
t.sharedHandler.hooks,
|
|
@@ -1241,15 +1297,16 @@ function Co(e, t) {
|
|
|
1241
1297
|
t.loaderHook,
|
|
1242
1298
|
t.bridgeHook
|
|
1243
1299
|
];
|
|
1244
|
-
return
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1300
|
+
return jo(e).forEach((n) => {
|
|
1301
|
+
var i;
|
|
1302
|
+
if (r.set(n.name, n), t.hooks.registerPlugins[n.name]) return;
|
|
1303
|
+
const s = Vo(n, (i = n.apply) == null ? void 0 : i.call(n, t));
|
|
1304
|
+
o.forEach((a) => {
|
|
1305
|
+
a.applyPlugin(s);
|
|
1249
1306
|
});
|
|
1250
|
-
}),
|
|
1307
|
+
}), Array.from(r.values());
|
|
1251
1308
|
}
|
|
1252
|
-
function
|
|
1309
|
+
function zo(e) {
|
|
1253
1310
|
return {
|
|
1254
1311
|
name: e.name,
|
|
1255
1312
|
alias: e.alias,
|
|
@@ -1260,12 +1317,12 @@ function Fo(e) {
|
|
|
1260
1317
|
shareScope: e.shareScope
|
|
1261
1318
|
};
|
|
1262
1319
|
}
|
|
1263
|
-
function
|
|
1264
|
-
var r, o, n, s,
|
|
1320
|
+
function D(e) {
|
|
1321
|
+
var r, o, n, s, i, a;
|
|
1265
1322
|
const t = {};
|
|
1266
|
-
for (const [
|
|
1323
|
+
for (const [c, l] of Object.entries(e.shared)) {
|
|
1267
1324
|
const u = l[0];
|
|
1268
|
-
u && (t[
|
|
1325
|
+
u && (t[c] = {
|
|
1269
1326
|
version: u.version,
|
|
1270
1327
|
singleton: (r = u.shareConfig) == null ? void 0 : r.singleton,
|
|
1271
1328
|
requiredVersion: ((o = u.shareConfig) == null ? void 0 : o.requiredVersion) === !1 ? !1 : (n = u.shareConfig) == null ? void 0 : n.requiredVersion,
|
|
@@ -1276,42 +1333,43 @@ function F(e) {
|
|
|
1276
1333
|
return {
|
|
1277
1334
|
project: {
|
|
1278
1335
|
name: e.name,
|
|
1279
|
-
mfRole: ((
|
|
1336
|
+
mfRole: ((i = e.remotes) == null ? void 0 : i.length) > 0 ? "host" : "unknown"
|
|
1280
1337
|
},
|
|
1281
1338
|
mfConfig: {
|
|
1282
1339
|
name: e.name,
|
|
1283
|
-
remotes: ((
|
|
1340
|
+
remotes: ((a = e.remotes) == null ? void 0 : a.map(zo)) ?? [],
|
|
1284
1341
|
shared: t
|
|
1285
1342
|
}
|
|
1286
1343
|
};
|
|
1287
1344
|
}
|
|
1288
|
-
function
|
|
1345
|
+
function zt(e) {
|
|
1289
1346
|
return {
|
|
1290
1347
|
resourceCategory: "sync",
|
|
1291
1348
|
share: !0,
|
|
1292
1349
|
depsRemote: !0,
|
|
1350
|
+
recordPreloadedAssets: !0,
|
|
1293
1351
|
...e
|
|
1294
1352
|
};
|
|
1295
1353
|
}
|
|
1296
|
-
function
|
|
1354
|
+
function Ko(e, t) {
|
|
1297
1355
|
return t.map((r) => {
|
|
1298
|
-
const o =
|
|
1299
|
-
return
|
|
1356
|
+
const o = Lo(e, r.nameOrAlias);
|
|
1357
|
+
return k(o, `Unable to preload ${r.nameOrAlias} as it is not included in ${!o && lt({
|
|
1300
1358
|
remoteInfo: o,
|
|
1301
1359
|
remotes: e
|
|
1302
1360
|
})}`), {
|
|
1303
1361
|
remote: o,
|
|
1304
|
-
preloadConfig:
|
|
1362
|
+
preloadConfig: zt(r)
|
|
1305
1363
|
};
|
|
1306
1364
|
});
|
|
1307
1365
|
}
|
|
1308
|
-
function
|
|
1366
|
+
function Jo(e) {
|
|
1309
1367
|
return e ? e.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1310
1368
|
}
|
|
1311
1369
|
function je(e) {
|
|
1312
1370
|
return e instanceof Error ? e.message.includes("timed out") || e.name.includes("Timeout") : !1;
|
|
1313
1371
|
}
|
|
1314
|
-
function
|
|
1372
|
+
function U(e, t, r, o) {
|
|
1315
1373
|
return {
|
|
1316
1374
|
url: t,
|
|
1317
1375
|
status: r,
|
|
@@ -1321,11 +1379,14 @@ function j(e, t, r, o) {
|
|
|
1321
1379
|
error: o
|
|
1322
1380
|
};
|
|
1323
1381
|
}
|
|
1324
|
-
|
|
1382
|
+
function Ne(e, t, r, o) {
|
|
1383
|
+
return r ? Yr(t) ? Promise.resolve(U(e, t, "cached")) : (Qr(t), o()) : o();
|
|
1384
|
+
}
|
|
1385
|
+
async function Zo(e, t, r, o) {
|
|
1325
1386
|
const n = e.moduleCache.get(r.name), s = r.entry;
|
|
1326
|
-
if (n != null && n.remoteEntryExports) return
|
|
1387
|
+
if (n != null && n.remoteEntryExports) return U(o, s, "cached");
|
|
1327
1388
|
try {
|
|
1328
|
-
if (!await
|
|
1389
|
+
if (!await We({
|
|
1329
1390
|
origin: e,
|
|
1330
1391
|
remoteInfo: r,
|
|
1331
1392
|
remoteEntryExports: n == null ? void 0 : n.remoteEntryExports,
|
|
@@ -1334,20 +1395,20 @@ async function xo(e, t, r, o) {
|
|
|
1334
1395
|
url: s
|
|
1335
1396
|
}
|
|
1336
1397
|
})) throw new Error(`Failed to load remoteEntry "${s}".`);
|
|
1337
|
-
return
|
|
1338
|
-
} catch (
|
|
1339
|
-
return
|
|
1398
|
+
return U(o, s, "success");
|
|
1399
|
+
} catch (i) {
|
|
1400
|
+
return U(o, s, je(i) ? "timeout" : "error", i);
|
|
1340
1401
|
}
|
|
1341
1402
|
}
|
|
1342
|
-
function
|
|
1343
|
-
return new Promise((
|
|
1344
|
-
const { link:
|
|
1403
|
+
function de({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLink: s }) {
|
|
1404
|
+
return new Promise((i) => {
|
|
1405
|
+
const { link: a, needAttach: c } = Nr({
|
|
1345
1406
|
url: r,
|
|
1346
1407
|
cb: () => {
|
|
1347
|
-
|
|
1408
|
+
i(U(n, r, c ? "success" : "cached"));
|
|
1348
1409
|
},
|
|
1349
1410
|
onErrorCallback: (l) => {
|
|
1350
|
-
|
|
1411
|
+
i(U(n, r, je(l) ? "timeout" : "error", l));
|
|
1351
1412
|
},
|
|
1352
1413
|
attrs: o,
|
|
1353
1414
|
createLinkHook: (l, u) => {
|
|
@@ -1364,113 +1425,116 @@ function fe({ host: e, remoteInfo: t, url: r, attrs: o, context: n, needDeleteLi
|
|
|
1364
1425
|
},
|
|
1365
1426
|
needDeleteLink: s
|
|
1366
1427
|
});
|
|
1367
|
-
|
|
1428
|
+
c && document.head.appendChild(a);
|
|
1368
1429
|
});
|
|
1369
1430
|
}
|
|
1370
|
-
function
|
|
1431
|
+
function Xo({ host: e, remoteInfo: t, url: r, attrs: o, context: n }) {
|
|
1371
1432
|
return new Promise((s) => {
|
|
1372
|
-
const { script:
|
|
1433
|
+
const { script: i, needAttach: a } = mt({
|
|
1373
1434
|
url: r,
|
|
1374
1435
|
cb: () => {
|
|
1375
|
-
s(
|
|
1436
|
+
s(U(n, r, a ? "success" : "cached"));
|
|
1376
1437
|
},
|
|
1377
|
-
onErrorCallback: (
|
|
1378
|
-
s(
|
|
1438
|
+
onErrorCallback: (c) => {
|
|
1439
|
+
s(U(n, r, je(c) ? "timeout" : "error", c));
|
|
1379
1440
|
},
|
|
1380
1441
|
attrs: o,
|
|
1381
|
-
createScriptHook: (
|
|
1442
|
+
createScriptHook: (c, l) => {
|
|
1382
1443
|
const u = e.loaderHook.lifecycle.createScript.emit({
|
|
1383
|
-
url:
|
|
1444
|
+
url: c,
|
|
1384
1445
|
attrs: l,
|
|
1385
1446
|
remoteInfo: t,
|
|
1386
1447
|
resourceContext: {
|
|
1387
1448
|
...n,
|
|
1388
|
-
url:
|
|
1449
|
+
url: c
|
|
1389
1450
|
}
|
|
1390
1451
|
});
|
|
1391
1452
|
return u instanceof HTMLScriptElement, u;
|
|
1392
1453
|
},
|
|
1393
1454
|
needDeleteScript: !0
|
|
1394
1455
|
});
|
|
1395
|
-
|
|
1456
|
+
a && document.head.appendChild(i);
|
|
1396
1457
|
});
|
|
1397
1458
|
}
|
|
1398
|
-
function
|
|
1459
|
+
function me(e, t) {
|
|
1399
1460
|
return {
|
|
1400
1461
|
...e,
|
|
1401
1462
|
resourceType: t
|
|
1402
1463
|
};
|
|
1403
1464
|
}
|
|
1404
|
-
function
|
|
1465
|
+
function Kt(e, t, r, o = !0, n = {
|
|
1405
1466
|
initiator: "preloadRemote",
|
|
1406
1467
|
id: e.name
|
|
1407
|
-
}) {
|
|
1408
|
-
const { cssAssets:
|
|
1468
|
+
}, s = !0) {
|
|
1469
|
+
const { cssAssets: i, jsAssetsWithoutEntry: a, entryAssets: c } = r, l = [];
|
|
1409
1470
|
if (t.options.inBrowser) {
|
|
1410
|
-
if (c.forEach((
|
|
1411
|
-
const { moduleInfo: m } =
|
|
1412
|
-
|
|
1471
|
+
if (c.forEach((h) => {
|
|
1472
|
+
const { moduleInfo: m } = h;
|
|
1473
|
+
l.push(Zo(t, e, m, me(n, "remoteEntry")));
|
|
1413
1474
|
}), o) {
|
|
1414
|
-
const
|
|
1475
|
+
const h = {
|
|
1415
1476
|
rel: "preload",
|
|
1416
1477
|
as: "style"
|
|
1417
1478
|
};
|
|
1418
|
-
|
|
1419
|
-
|
|
1479
|
+
i.forEach((m) => {
|
|
1480
|
+
const d = me(n, "css");
|
|
1481
|
+
l.push(Ne(d, m, s, () => de({
|
|
1420
1482
|
host: t,
|
|
1421
1483
|
remoteInfo: e,
|
|
1422
1484
|
url: m,
|
|
1423
|
-
attrs:
|
|
1424
|
-
context:
|
|
1425
|
-
}));
|
|
1485
|
+
attrs: h,
|
|
1486
|
+
context: d
|
|
1487
|
+
})));
|
|
1426
1488
|
});
|
|
1427
1489
|
} else {
|
|
1428
|
-
const
|
|
1490
|
+
const h = {
|
|
1429
1491
|
rel: "stylesheet",
|
|
1430
1492
|
type: "text/css"
|
|
1431
1493
|
};
|
|
1432
|
-
|
|
1433
|
-
|
|
1494
|
+
i.forEach((m) => {
|
|
1495
|
+
const d = me(n, "css");
|
|
1496
|
+
l.push(Ne(d, m, s, () => de({
|
|
1434
1497
|
host: t,
|
|
1435
1498
|
remoteInfo: e,
|
|
1436
1499
|
url: m,
|
|
1437
|
-
attrs:
|
|
1500
|
+
attrs: h,
|
|
1438
1501
|
needDeleteLink: !1,
|
|
1439
|
-
context:
|
|
1440
|
-
}));
|
|
1502
|
+
context: d
|
|
1503
|
+
})));
|
|
1441
1504
|
});
|
|
1442
1505
|
}
|
|
1443
|
-
let
|
|
1506
|
+
let u = Xo, f = {
|
|
1444
1507
|
fetchpriority: "high",
|
|
1445
1508
|
type: "text/javascript"
|
|
1446
1509
|
};
|
|
1447
|
-
o ? (
|
|
1510
|
+
o ? (u = de, f = {
|
|
1448
1511
|
rel: "preload",
|
|
1449
1512
|
as: "script"
|
|
1450
|
-
}) :
|
|
1513
|
+
}) : jt(e.type) && (u = de, f = {
|
|
1451
1514
|
rel: "modulepreload",
|
|
1452
1515
|
fetchpriority: "high"
|
|
1453
|
-
}), a.forEach((
|
|
1454
|
-
|
|
1516
|
+
}), a.forEach((h) => {
|
|
1517
|
+
const m = me(n, "js");
|
|
1518
|
+
l.push(Ne(m, h, s, () => u({
|
|
1455
1519
|
host: t,
|
|
1456
1520
|
remoteInfo: e,
|
|
1457
|
-
url:
|
|
1458
|
-
attrs:
|
|
1459
|
-
context:
|
|
1460
|
-
}));
|
|
1521
|
+
url: h,
|
|
1522
|
+
attrs: f,
|
|
1523
|
+
context: m
|
|
1524
|
+
})));
|
|
1461
1525
|
});
|
|
1462
1526
|
}
|
|
1463
|
-
return Promise.all(
|
|
1527
|
+
return Promise.all(l);
|
|
1464
1528
|
}
|
|
1465
|
-
function
|
|
1529
|
+
function Yo(e) {
|
|
1466
1530
|
if (!e || !("modules" in e) || !Array.isArray(e.modules)) return;
|
|
1467
1531
|
const t = e.modules.map((r) => r.moduleName).filter(Boolean);
|
|
1468
1532
|
return t.length ? t.join(",") : void 0;
|
|
1469
1533
|
}
|
|
1470
|
-
function
|
|
1534
|
+
function Qo(e, t, r) {
|
|
1471
1535
|
const o = t, n = Array.isArray(e.shareScope) ? e.shareScope : [e.shareScope];
|
|
1472
|
-
n.length || n.push("default"), n.forEach((
|
|
1473
|
-
o[
|
|
1536
|
+
n.length || n.push("default"), n.forEach((i) => {
|
|
1537
|
+
o[i] || (o[i] = {});
|
|
1474
1538
|
});
|
|
1475
1539
|
const s = {
|
|
1476
1540
|
version: e.version || "",
|
|
@@ -1485,58 +1549,59 @@ function Bo(e, t, r) {
|
|
|
1485
1549
|
initScope: r ?? []
|
|
1486
1550
|
};
|
|
1487
1551
|
}
|
|
1488
|
-
var
|
|
1552
|
+
var rt = class {
|
|
1489
1553
|
constructor({ remoteInfo: e, host: t }) {
|
|
1490
1554
|
this.inited = !1, this.initing = !1, this.lib = void 0, this.remoteInfo = e, this.host = t;
|
|
1491
1555
|
}
|
|
1492
|
-
async getEntry(e) {
|
|
1493
|
-
|
|
1494
|
-
|
|
1556
|
+
async getEntry(e, t) {
|
|
1557
|
+
const r = t || {
|
|
1558
|
+
initiator: "loadRemote",
|
|
1559
|
+
id: Be(this.remoteInfo.name, e),
|
|
1560
|
+
resourceType: "remoteEntry",
|
|
1561
|
+
url: this.remoteInfo.entry,
|
|
1562
|
+
expose: e
|
|
1563
|
+
}, o = await We({
|
|
1495
1564
|
origin: this.host,
|
|
1496
1565
|
remoteInfo: this.remoteInfo,
|
|
1497
1566
|
remoteEntryExports: this.remoteEntryExports,
|
|
1498
|
-
resourceContext:
|
|
1499
|
-
initiator: "loadRemote",
|
|
1500
|
-
id: Ue(this.remoteInfo.name, e),
|
|
1501
|
-
resourceType: "remoteEntry"
|
|
1502
|
-
}
|
|
1567
|
+
resourceContext: r
|
|
1503
1568
|
});
|
|
1504
|
-
return
|
|
1505
|
-
${
|
|
1569
|
+
return k(o, `remoteEntryExports is undefined
|
|
1570
|
+
${lt(this.remoteInfo)}`), this.remoteEntryExports = o, this.remoteEntryExports;
|
|
1506
1571
|
}
|
|
1507
|
-
async init(e, t, r, o) {
|
|
1508
|
-
const
|
|
1572
|
+
async init(e, t, r, o, n) {
|
|
1573
|
+
const s = await this.getEntry(o, n);
|
|
1509
1574
|
if (this.inited)
|
|
1510
1575
|
return await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1511
1576
|
id: e,
|
|
1512
1577
|
remoteInfo: this.remoteInfo,
|
|
1513
1578
|
remoteSnapshot: t,
|
|
1514
|
-
remoteEntryExports:
|
|
1579
|
+
remoteEntryExports: s,
|
|
1515
1580
|
cached: !0,
|
|
1516
1581
|
origin: this.host
|
|
1517
|
-
}),
|
|
1582
|
+
}), s;
|
|
1518
1583
|
if (this.initPromise) {
|
|
1519
1584
|
try {
|
|
1520
1585
|
await this.initPromise, await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1521
1586
|
id: e,
|
|
1522
1587
|
remoteInfo: this.remoteInfo,
|
|
1523
1588
|
remoteSnapshot: t,
|
|
1524
|
-
remoteEntryExports:
|
|
1589
|
+
remoteEntryExports: s,
|
|
1525
1590
|
cached: !0,
|
|
1526
1591
|
origin: this.host
|
|
1527
1592
|
});
|
|
1528
|
-
} catch (
|
|
1593
|
+
} catch (i) {
|
|
1529
1594
|
throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1530
1595
|
id: e,
|
|
1531
1596
|
remoteInfo: this.remoteInfo,
|
|
1532
1597
|
remoteSnapshot: t,
|
|
1533
|
-
remoteEntryExports:
|
|
1534
|
-
error:
|
|
1598
|
+
remoteEntryExports: s,
|
|
1599
|
+
error: i,
|
|
1535
1600
|
cached: !0,
|
|
1536
1601
|
origin: this.host
|
|
1537
|
-
}),
|
|
1602
|
+
}), i;
|
|
1538
1603
|
}
|
|
1539
|
-
return
|
|
1604
|
+
return s;
|
|
1540
1605
|
}
|
|
1541
1606
|
this.initing = !0, this.initPromise = (async () => {
|
|
1542
1607
|
await this.host.loaderHook.lifecycle.beforeInitRemote.emit({
|
|
@@ -1545,35 +1610,35 @@ var et = class {
|
|
|
1545
1610
|
remoteSnapshot: t,
|
|
1546
1611
|
origin: this.host
|
|
1547
1612
|
});
|
|
1548
|
-
const { remoteEntryInitOptions:
|
|
1613
|
+
const { remoteEntryInitOptions: i, shareScope: a, initScope: c } = Qo(this.remoteInfo, this.host.shareScopeMap, r), l = await this.host.hooks.lifecycle.beforeInitContainer.emit({
|
|
1549
1614
|
shareScope: a,
|
|
1550
|
-
remoteEntryInitOptions:
|
|
1615
|
+
remoteEntryInitOptions: i,
|
|
1551
1616
|
initScope: c,
|
|
1552
1617
|
remoteInfo: this.remoteInfo,
|
|
1553
1618
|
origin: this.host
|
|
1554
1619
|
});
|
|
1555
|
-
typeof (
|
|
1620
|
+
typeof (s == null ? void 0 : s.init) > "u" && I(Lt, M, {
|
|
1556
1621
|
hostName: this.host.name,
|
|
1557
1622
|
remoteName: this.remoteInfo.name,
|
|
1558
1623
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1559
1624
|
remoteEntryKey: this.remoteInfo.entryGlobalName
|
|
1560
|
-
}, void 0,
|
|
1625
|
+
}, void 0, D(this.host.options));
|
|
1561
1626
|
try {
|
|
1562
|
-
await
|
|
1563
|
-
} catch (
|
|
1564
|
-
|
|
1627
|
+
await s.init(l.shareScope, l.initScope, l.remoteEntryInitOptions);
|
|
1628
|
+
} catch (u) {
|
|
1629
|
+
I(Bt, M, {
|
|
1565
1630
|
hostName: this.host.name,
|
|
1566
1631
|
remoteName: this.remoteInfo.name,
|
|
1567
1632
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1568
1633
|
remoteEntryKey: this.remoteInfo.entryGlobalName,
|
|
1569
1634
|
shareScope: this.remoteInfo.shareScope
|
|
1570
|
-
}, `${
|
|
1635
|
+
}, `${u}`, D(this.host.options));
|
|
1571
1636
|
}
|
|
1572
1637
|
await this.host.hooks.lifecycle.initContainer.emit({
|
|
1573
|
-
...
|
|
1638
|
+
...l,
|
|
1574
1639
|
id: e,
|
|
1575
1640
|
remoteSnapshot: t,
|
|
1576
|
-
remoteEntryExports:
|
|
1641
|
+
remoteEntryExports: s
|
|
1577
1642
|
}), this.inited = !0;
|
|
1578
1643
|
})();
|
|
1579
1644
|
try {
|
|
@@ -1581,22 +1646,22 @@ var et = class {
|
|
|
1581
1646
|
id: e,
|
|
1582
1647
|
remoteInfo: this.remoteInfo,
|
|
1583
1648
|
remoteSnapshot: t,
|
|
1584
|
-
remoteEntryExports:
|
|
1649
|
+
remoteEntryExports: s,
|
|
1585
1650
|
origin: this.host
|
|
1586
1651
|
});
|
|
1587
|
-
} catch (
|
|
1652
|
+
} catch (i) {
|
|
1588
1653
|
throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({
|
|
1589
1654
|
id: e,
|
|
1590
1655
|
remoteInfo: this.remoteInfo,
|
|
1591
1656
|
remoteSnapshot: t,
|
|
1592
|
-
remoteEntryExports:
|
|
1593
|
-
error:
|
|
1657
|
+
remoteEntryExports: s,
|
|
1658
|
+
error: i,
|
|
1594
1659
|
origin: this.host
|
|
1595
|
-
}),
|
|
1660
|
+
}), i;
|
|
1596
1661
|
} finally {
|
|
1597
1662
|
this.initing = !1, this.initPromise = void 0;
|
|
1598
1663
|
}
|
|
1599
|
-
return
|
|
1664
|
+
return s;
|
|
1600
1665
|
}
|
|
1601
1666
|
async get(e, t, r, o) {
|
|
1602
1667
|
const { loadFactory: n = !0 } = r || { loadFactory: !0 }, s = await this.init(e, o, void 0, t);
|
|
@@ -1607,26 +1672,26 @@ var et = class {
|
|
|
1607
1672
|
remoteEntryExports: s,
|
|
1608
1673
|
origin: this.host
|
|
1609
1674
|
});
|
|
1610
|
-
let
|
|
1675
|
+
let i;
|
|
1611
1676
|
try {
|
|
1612
1677
|
const l = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1613
1678
|
remoteEntryExports: s,
|
|
1614
1679
|
expose: t,
|
|
1615
1680
|
moduleInfo: this.remoteInfo
|
|
1616
1681
|
});
|
|
1617
|
-
|
|
1682
|
+
i = typeof l == "function" ? l : void 0, i || (i = await s.get(t)), i || I(Ut, M, {
|
|
1618
1683
|
hostName: this.host.name,
|
|
1619
1684
|
remoteName: this.remoteInfo.name,
|
|
1620
1685
|
remoteEntryUrl: this.remoteInfo.entry,
|
|
1621
1686
|
expose: t,
|
|
1622
1687
|
requestId: e,
|
|
1623
|
-
availableExposes:
|
|
1624
|
-
}, void 0,
|
|
1688
|
+
availableExposes: Yo(o)
|
|
1689
|
+
}, void 0, D(this.host.options)), await this.host.loaderHook.lifecycle.afterGetExpose.emit({
|
|
1625
1690
|
id: e,
|
|
1626
1691
|
expose: t,
|
|
1627
1692
|
moduleInfo: this.remoteInfo,
|
|
1628
1693
|
remoteEntryExports: s,
|
|
1629
|
-
moduleFactory:
|
|
1694
|
+
moduleFactory: i,
|
|
1630
1695
|
origin: this.host
|
|
1631
1696
|
});
|
|
1632
1697
|
} catch (l) {
|
|
@@ -1639,8 +1704,8 @@ var et = class {
|
|
|
1639
1704
|
origin: this.host
|
|
1640
1705
|
}), l;
|
|
1641
1706
|
}
|
|
1642
|
-
const
|
|
1643
|
-
if (!n) return
|
|
1707
|
+
const a = jr(this.remoteInfo.name, t), c = this.wraperFactory(i, a);
|
|
1708
|
+
if (!n) return c;
|
|
1644
1709
|
await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({
|
|
1645
1710
|
id: e,
|
|
1646
1711
|
expose: t,
|
|
@@ -1649,7 +1714,7 @@ var et = class {
|
|
|
1649
1714
|
origin: this.host
|
|
1650
1715
|
});
|
|
1651
1716
|
try {
|
|
1652
|
-
const l = await
|
|
1717
|
+
const l = await c();
|
|
1653
1718
|
return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({
|
|
1654
1719
|
id: e,
|
|
1655
1720
|
expose: t,
|
|
@@ -1685,23 +1750,23 @@ var et = class {
|
|
|
1685
1750
|
constructor(e) {
|
|
1686
1751
|
this.registerPlugins = {}, this.lifecycle = e, this.lifecycleKeys = Object.keys(e);
|
|
1687
1752
|
}
|
|
1688
|
-
applyPlugin(e
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
s && this.lifecycle[n].on(s);
|
|
1753
|
+
applyPlugin(e) {
|
|
1754
|
+
k(_t(e), "Plugin configuration is invalid.");
|
|
1755
|
+
const t = e.name;
|
|
1756
|
+
k(t, "A name must be provided by the plugin."), this.registerPlugins[t] || (this.registerPlugins[t] = e, this.lifecycleKeys.forEach((r) => {
|
|
1757
|
+
const o = e[r];
|
|
1758
|
+
o && this.lifecycle[r].on(o);
|
|
1695
1759
|
}));
|
|
1696
1760
|
}
|
|
1697
1761
|
removePlugin(e) {
|
|
1698
|
-
|
|
1762
|
+
k(e, "A name is required.");
|
|
1699
1763
|
const t = this.registerPlugins[e];
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1764
|
+
k(t, `The plugin "${e}" is not registered.`), this.lifecycleKeys.forEach((r) => {
|
|
1765
|
+
const o = t[r];
|
|
1766
|
+
o && this.lifecycle[r].remove(o);
|
|
1767
|
+
}), delete this.registerPlugins[e];
|
|
1703
1768
|
}
|
|
1704
|
-
},
|
|
1769
|
+
}, N = class {
|
|
1705
1770
|
constructor(e) {
|
|
1706
1771
|
this.type = "", this.listeners = /* @__PURE__ */ new Set(), e && (this.type = e);
|
|
1707
1772
|
}
|
|
@@ -1727,61 +1792,61 @@ var et = class {
|
|
|
1727
1792
|
removeAll() {
|
|
1728
1793
|
this.listeners.clear();
|
|
1729
1794
|
}
|
|
1730
|
-
},
|
|
1795
|
+
}, v = class extends N {
|
|
1731
1796
|
emit(...e) {
|
|
1732
1797
|
let t;
|
|
1733
1798
|
const r = Array.from(this.listeners);
|
|
1734
1799
|
if (r.length > 0) {
|
|
1735
1800
|
let o = 0;
|
|
1736
|
-
const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((
|
|
1801
|
+
const n = (s) => s === !1 ? !1 : o < r.length ? Promise.resolve(r[o++].apply(null, e)).then((i) => i === void 0 || e.length === 1 && i === e[0] ? n(s) : n(i)) : s;
|
|
1737
1802
|
t = n();
|
|
1738
1803
|
}
|
|
1739
1804
|
return Promise.resolve(t);
|
|
1740
1805
|
}
|
|
1741
1806
|
};
|
|
1742
|
-
function
|
|
1743
|
-
if (!
|
|
1807
|
+
function Jt(e, t) {
|
|
1808
|
+
if (!Fe(t)) return !1;
|
|
1744
1809
|
if (e !== t) {
|
|
1745
1810
|
for (const r in e) if (!(r in t)) return !1;
|
|
1746
1811
|
}
|
|
1747
1812
|
return !0;
|
|
1748
1813
|
}
|
|
1749
|
-
var
|
|
1814
|
+
var Y = class extends N {
|
|
1750
1815
|
constructor(e) {
|
|
1751
|
-
super(), this.onerror =
|
|
1816
|
+
super(), this.onerror = I, this.type = e;
|
|
1752
1817
|
}
|
|
1753
1818
|
emit(e) {
|
|
1754
|
-
|
|
1819
|
+
Fe(e) || I(`The data for the "${this.type}" hook should be an object.`);
|
|
1755
1820
|
for (const t of this.listeners) try {
|
|
1756
1821
|
const r = t(e);
|
|
1757
1822
|
if (r === void 0) continue;
|
|
1758
|
-
if (
|
|
1823
|
+
if (Jt(e, r)) e = r;
|
|
1759
1824
|
else {
|
|
1760
1825
|
this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);
|
|
1761
1826
|
break;
|
|
1762
1827
|
}
|
|
1763
1828
|
} catch (r) {
|
|
1764
|
-
|
|
1829
|
+
se(r), this.onerror(r);
|
|
1765
1830
|
}
|
|
1766
1831
|
return e;
|
|
1767
1832
|
}
|
|
1768
|
-
},
|
|
1833
|
+
}, F = class extends N {
|
|
1769
1834
|
constructor(e) {
|
|
1770
|
-
super(), this.onerror =
|
|
1835
|
+
super(), this.onerror = I, this.type = e;
|
|
1771
1836
|
}
|
|
1772
1837
|
emit(e) {
|
|
1773
|
-
|
|
1838
|
+
Fe(e) || I(`The response data for the "${this.type}" hook must be an object.`);
|
|
1774
1839
|
const t = Array.from(this.listeners);
|
|
1775
1840
|
if (t.length > 0) {
|
|
1776
1841
|
let r = 0;
|
|
1777
|
-
const o = (s) => (
|
|
1778
|
-
if (s !== void 0 &&
|
|
1842
|
+
const o = (s) => (se(s), this.onerror(s), e), n = (s) => {
|
|
1843
|
+
if (s !== void 0 && Jt(e, s)) e = s;
|
|
1779
1844
|
else if (s !== void 0)
|
|
1780
1845
|
return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`), e;
|
|
1781
1846
|
if (r < t.length) try {
|
|
1782
1847
|
return Promise.resolve(t[r++](e)).then(n, o);
|
|
1783
|
-
} catch (
|
|
1784
|
-
return o(
|
|
1848
|
+
} catch (i) {
|
|
1849
|
+
return o(i);
|
|
1785
1850
|
}
|
|
1786
1851
|
return e;
|
|
1787
1852
|
};
|
|
@@ -1790,8 +1855,8 @@ var X = class extends M {
|
|
|
1790
1855
|
return Promise.resolve(e);
|
|
1791
1856
|
}
|
|
1792
1857
|
};
|
|
1793
|
-
const
|
|
1794
|
-
var
|
|
1858
|
+
const re = "Remote loading is disabled by experiments.optimization.disableRemote.";
|
|
1859
|
+
var en = class {
|
|
1795
1860
|
constructor() {
|
|
1796
1861
|
this.hooks = new H({});
|
|
1797
1862
|
}
|
|
@@ -1799,69 +1864,80 @@ var jo = class {
|
|
|
1799
1864
|
return [];
|
|
1800
1865
|
}
|
|
1801
1866
|
loadRemote() {
|
|
1802
|
-
throw new Error(
|
|
1867
|
+
throw new Error(re);
|
|
1803
1868
|
}
|
|
1804
1869
|
preloadRemote() {
|
|
1805
|
-
throw new Error(
|
|
1870
|
+
throw new Error(re);
|
|
1806
1871
|
}
|
|
1807
1872
|
registerRemotes() {
|
|
1808
|
-
throw new Error(
|
|
1873
|
+
throw new Error(re);
|
|
1809
1874
|
}
|
|
1810
1875
|
getRemoteModuleAndOptions() {
|
|
1811
|
-
throw new Error(
|
|
1876
|
+
throw new Error(re);
|
|
1812
1877
|
}
|
|
1813
1878
|
initRawContainer() {
|
|
1814
|
-
throw new Error(
|
|
1879
|
+
throw new Error(re);
|
|
1815
1880
|
}
|
|
1816
1881
|
};
|
|
1817
|
-
function
|
|
1818
|
-
const r =
|
|
1819
|
-
r.url ||
|
|
1820
|
-
let o =
|
|
1821
|
-
!
|
|
1882
|
+
function Zt(e, t) {
|
|
1883
|
+
const r = bt(t);
|
|
1884
|
+
r.url || I(xt, M, { remoteName: e.name });
|
|
1885
|
+
let o = Le(t, r.url);
|
|
1886
|
+
!B && !o.startsWith("http") && (o = `https:${o}`), e.type = r.type, e.entryGlobalName = r.globalName, e.entry = o, e.version = t.version, e.buildVersion = t.buildVersion;
|
|
1822
1887
|
}
|
|
1823
|
-
function
|
|
1888
|
+
function tn() {
|
|
1824
1889
|
return {
|
|
1825
1890
|
name: "snapshot-plugin",
|
|
1826
1891
|
async afterResolve(e) {
|
|
1827
|
-
const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id:
|
|
1828
|
-
if (!
|
|
1829
|
-
const { remoteSnapshot:
|
|
1892
|
+
const { remote: t, pkgNameOrAlias: r, expose: o, origin: n, remoteInfo: s, id: i } = e;
|
|
1893
|
+
if (!He(t) || !Rt(t)) {
|
|
1894
|
+
const { remoteSnapshot: a, globalSnapshot: c } = await n.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1830
1895
|
moduleInfo: t,
|
|
1831
|
-
id:
|
|
1896
|
+
id: Be(t.name, o)
|
|
1832
1897
|
});
|
|
1833
|
-
|
|
1834
|
-
const l = {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
remoteInfo: s,
|
|
1847
|
-
remote: t,
|
|
1848
|
-
remoteSnapshot: c,
|
|
1849
|
-
globalSnapshot: i
|
|
1898
|
+
Zt(s, a);
|
|
1899
|
+
const l = [{
|
|
1900
|
+
nameOrAlias: r,
|
|
1901
|
+
exposes: [o],
|
|
1902
|
+
resourceCategory: "sync",
|
|
1903
|
+
share: !1,
|
|
1904
|
+
depsRemote: !1,
|
|
1905
|
+
recordPreloadedAssets: !0
|
|
1906
|
+
}];
|
|
1907
|
+
await n.remoteHandler.hooks.lifecycle.beforePreloadRemote.emit({
|
|
1908
|
+
preloadOps: l,
|
|
1909
|
+
options: n.options,
|
|
1910
|
+
origin: n
|
|
1850
1911
|
});
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1912
|
+
const [u] = l;
|
|
1913
|
+
if (u) {
|
|
1914
|
+
const f = {
|
|
1915
|
+
remote: t,
|
|
1916
|
+
preloadConfig: u
|
|
1917
|
+
}, h = await n.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1918
|
+
origin: n,
|
|
1919
|
+
preloadOptions: f,
|
|
1920
|
+
remoteInfo: s,
|
|
1921
|
+
remote: t,
|
|
1922
|
+
remoteSnapshot: a,
|
|
1923
|
+
globalSnapshot: c
|
|
1924
|
+
});
|
|
1925
|
+
h && Kt(s, n, h, !1, {
|
|
1926
|
+
initiator: "loadRemote",
|
|
1927
|
+
id: i
|
|
1928
|
+
}, u.recordPreloadedAssets).catch(() => {
|
|
1929
|
+
});
|
|
1930
|
+
}
|
|
1931
|
+
return {
|
|
1856
1932
|
...e,
|
|
1857
|
-
remoteSnapshot:
|
|
1933
|
+
remoteSnapshot: a
|
|
1858
1934
|
};
|
|
1859
1935
|
}
|
|
1860
1936
|
return e;
|
|
1861
1937
|
}
|
|
1862
1938
|
};
|
|
1863
1939
|
}
|
|
1864
|
-
function
|
|
1940
|
+
function rn(e) {
|
|
1865
1941
|
const t = e.split(":");
|
|
1866
1942
|
return t.length === 1 ? {
|
|
1867
1943
|
name: t[0],
|
|
@@ -1874,36 +1950,36 @@ function Vo(e) {
|
|
|
1874
1950
|
version: t[2]
|
|
1875
1951
|
};
|
|
1876
1952
|
}
|
|
1877
|
-
function
|
|
1878
|
-
const { value:
|
|
1879
|
-
if (
|
|
1880
|
-
const
|
|
1881
|
-
for (const l of
|
|
1953
|
+
function Xt(e, t, r, o, n = {}, s) {
|
|
1954
|
+
const { value: i } = V(e, ie(t)), a = s || i;
|
|
1955
|
+
if (a && !ut(a) && (r(a, t, o), a.remotesInfo)) {
|
|
1956
|
+
const c = Object.keys(a.remotesInfo);
|
|
1957
|
+
for (const l of c) {
|
|
1882
1958
|
if (n[l]) continue;
|
|
1883
1959
|
n[l] = !0;
|
|
1884
|
-
const u =
|
|
1885
|
-
|
|
1960
|
+
const u = rn(l), f = a.remotesInfo[l];
|
|
1961
|
+
Xt(e, {
|
|
1886
1962
|
name: u.name,
|
|
1887
1963
|
version: f.matchedVersion
|
|
1888
1964
|
}, r, !1, n, void 0);
|
|
1889
1965
|
}
|
|
1890
1966
|
}
|
|
1891
1967
|
}
|
|
1892
|
-
const
|
|
1893
|
-
function
|
|
1894
|
-
const s = [],
|
|
1895
|
-
if (
|
|
1896
|
-
var
|
|
1897
|
-
let
|
|
1898
|
-
if (
|
|
1899
|
-
else if (Array.isArray(
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
|
|
1903
|
-
} else if (
|
|
1968
|
+
const Ae = (e, t) => document.querySelector(`${e}[${e === "link" ? "href" : "src"}="${t}"]`);
|
|
1969
|
+
function on(e, t, r, o, n) {
|
|
1970
|
+
const s = [], i = [], a = [], c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), { options: u } = e, { preloadConfig: f } = t, { depsRemote: h } = f;
|
|
1971
|
+
if (Xt(o, r, (d, p, y) => {
|
|
1972
|
+
var b;
|
|
1973
|
+
let g;
|
|
1974
|
+
if (y) g = f;
|
|
1975
|
+
else if (Array.isArray(h)) {
|
|
1976
|
+
const $ = h.find((w) => w.nameOrAlias === p.name || w.nameOrAlias === p.alias);
|
|
1977
|
+
if (!$) return;
|
|
1978
|
+
g = zt($);
|
|
1979
|
+
} else if (h === !0) g = f;
|
|
1904
1980
|
else return;
|
|
1905
|
-
const R =
|
|
1906
|
-
R &&
|
|
1981
|
+
const R = Le(d, bt(d).url);
|
|
1982
|
+
R && a.push({
|
|
1907
1983
|
name: p.name,
|
|
1908
1984
|
moduleInfo: {
|
|
1909
1985
|
name: p.name,
|
|
@@ -1915,59 +1991,59 @@ function qo(e, t, r, o, n) {
|
|
|
1915
1991
|
},
|
|
1916
1992
|
url: R
|
|
1917
1993
|
});
|
|
1918
|
-
let
|
|
1919
|
-
const _ =
|
|
1920
|
-
_.length && "modules" in d && (
|
|
1921
|
-
function S(
|
|
1922
|
-
const
|
|
1923
|
-
return
|
|
1994
|
+
let E = "modules" in d ? d.modules : [];
|
|
1995
|
+
const _ = Jo(g.exposes);
|
|
1996
|
+
_.length && "modules" in d && (E = (b = d == null ? void 0 : d.modules) == null ? void 0 : b.reduce(($, w) => ((_ == null ? void 0 : _.indexOf(w.moduleName)) !== -1 && $.push(w), $), []));
|
|
1997
|
+
function S($) {
|
|
1998
|
+
const w = $.map((P) => Le(d, P));
|
|
1999
|
+
return g.filter ? w.filter(g.filter) : w;
|
|
1924
2000
|
}
|
|
1925
|
-
if (
|
|
1926
|
-
const
|
|
1927
|
-
for (let
|
|
1928
|
-
const P =
|
|
2001
|
+
if (E) {
|
|
2002
|
+
const $ = E.length;
|
|
2003
|
+
for (let w = 0; w < $; w++) {
|
|
2004
|
+
const P = E[w], q = `${p.name}/${P.moduleName}`;
|
|
1929
2005
|
e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1930
|
-
id: P.moduleName === "." ? p.name :
|
|
2006
|
+
id: P.moduleName === "." ? p.name : q,
|
|
1931
2007
|
name: p.name,
|
|
1932
2008
|
remoteSnapshot: d,
|
|
1933
|
-
preloadConfig:
|
|
2009
|
+
preloadConfig: g,
|
|
1934
2010
|
remote: p,
|
|
1935
2011
|
origin: e
|
|
1936
|
-
}), !
|
|
2012
|
+
}), !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));
|
|
1937
2013
|
}
|
|
1938
2014
|
}
|
|
1939
2015
|
}, !0, {}, n), n.shared && n.shared.length > 0) {
|
|
1940
|
-
const d = (p,
|
|
1941
|
-
const { shared:
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
}),
|
|
2016
|
+
const d = (p, y) => {
|
|
2017
|
+
const { shared: g } = Se(e.shareScopeMap, y.sharedName, p, e.sharedHandler.hooks.lifecycle.resolveShare) || {};
|
|
2018
|
+
g && typeof g.lib == "function" && (y.assets.js.sync.forEach((R) => {
|
|
2019
|
+
c.add(R);
|
|
2020
|
+
}), y.assets.css.sync.forEach((R) => {
|
|
1945
2021
|
l.add(R);
|
|
1946
2022
|
}));
|
|
1947
2023
|
};
|
|
1948
2024
|
n.shared.forEach((p) => {
|
|
1949
2025
|
var R;
|
|
1950
|
-
const
|
|
1951
|
-
if (!
|
|
1952
|
-
const
|
|
1953
|
-
|
|
1954
|
-
d(
|
|
2026
|
+
const y = (R = u.shared) == null ? void 0 : R[p.sharedName];
|
|
2027
|
+
if (!y) return;
|
|
2028
|
+
const g = p.version ? y.find((E) => E.version === p.version) : y;
|
|
2029
|
+
g && St(g).forEach((E) => {
|
|
2030
|
+
d(E, p);
|
|
1955
2031
|
});
|
|
1956
2032
|
});
|
|
1957
2033
|
}
|
|
1958
|
-
const
|
|
2034
|
+
const m = i.filter((d) => !c.has(d) && !Ae("script", d));
|
|
1959
2035
|
return {
|
|
1960
|
-
cssAssets: s.filter((d) => !l.has(d) && !
|
|
1961
|
-
jsAssetsWithoutEntry:
|
|
1962
|
-
entryAssets:
|
|
2036
|
+
cssAssets: s.filter((d) => !l.has(d) && !Ae("link", d)),
|
|
2037
|
+
jsAssetsWithoutEntry: m,
|
|
2038
|
+
entryAssets: a.filter((d) => !Ae("script", d.url))
|
|
1963
2039
|
};
|
|
1964
2040
|
}
|
|
1965
|
-
const
|
|
2041
|
+
const nn = function() {
|
|
1966
2042
|
return {
|
|
1967
2043
|
name: "generate-preload-assets-plugin",
|
|
1968
2044
|
async generatePreloadAssets(e) {
|
|
1969
|
-
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot:
|
|
1970
|
-
return
|
|
2045
|
+
const { origin: t, preloadOptions: r, remoteInfo: o, remote: n, globalSnapshot: s, remoteSnapshot: i } = e;
|
|
2046
|
+
return B ? He(n) && Rt(n) ? {
|
|
1971
2047
|
cssAssets: [],
|
|
1972
2048
|
jsAssetsWithoutEntry: [],
|
|
1973
2049
|
entryAssets: [{
|
|
@@ -1981,7 +2057,7 @@ const zo = function() {
|
|
|
1981
2057
|
shareScope: ""
|
|
1982
2058
|
}
|
|
1983
2059
|
}]
|
|
1984
|
-
} : (
|
|
2060
|
+
} : (Zt(o, i), on(t, r, o, s, i)) : {
|
|
1985
2061
|
cssAssets: [],
|
|
1986
2062
|
jsAssetsWithoutEntry: [],
|
|
1987
2063
|
entryAssets: []
|
|
@@ -1989,35 +2065,37 @@ const zo = function() {
|
|
|
1989
2065
|
}
|
|
1990
2066
|
};
|
|
1991
2067
|
};
|
|
1992
|
-
function
|
|
1993
|
-
const r =
|
|
2068
|
+
function Yt(e, t) {
|
|
2069
|
+
const r = ge({
|
|
1994
2070
|
name: t.name,
|
|
1995
2071
|
version: t.options.version
|
|
1996
|
-
}), o = r && "remotesInfo" in r && r.remotesInfo &&
|
|
2072
|
+
}), o = r && "remotesInfo" in r && r.remotesInfo && V(r.remotesInfo, e.name).value;
|
|
1997
2073
|
return o && o.matchedVersion ? {
|
|
1998
2074
|
hostGlobalSnapshot: r,
|
|
1999
|
-
globalSnapshot:
|
|
2000
|
-
remoteSnapshot:
|
|
2075
|
+
globalSnapshot: qe(),
|
|
2076
|
+
remoteSnapshot: ge({
|
|
2001
2077
|
name: e.name,
|
|
2002
2078
|
version: o.matchedVersion
|
|
2003
2079
|
})
|
|
2004
2080
|
} : {
|
|
2005
2081
|
hostGlobalSnapshot: void 0,
|
|
2006
|
-
globalSnapshot:
|
|
2007
|
-
remoteSnapshot:
|
|
2082
|
+
globalSnapshot: qe(),
|
|
2083
|
+
remoteSnapshot: ge({
|
|
2008
2084
|
name: e.name,
|
|
2009
2085
|
version: "version" in e ? e.version : void 0
|
|
2010
2086
|
})
|
|
2011
2087
|
};
|
|
2012
2088
|
}
|
|
2013
|
-
var
|
|
2089
|
+
var sn = class {
|
|
2014
2090
|
constructor(e) {
|
|
2015
2091
|
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new H({
|
|
2016
|
-
beforeLoadRemoteSnapshot: new
|
|
2017
|
-
loadSnapshot: new
|
|
2018
|
-
loadRemoteSnapshot: new
|
|
2019
|
-
afterLoadSnapshot: new
|
|
2020
|
-
|
|
2092
|
+
beforeLoadRemoteSnapshot: new v("beforeLoadRemoteSnapshot"),
|
|
2093
|
+
loadSnapshot: new F("loadGlobalSnapshot"),
|
|
2094
|
+
loadRemoteSnapshot: new F("loadRemoteSnapshot"),
|
|
2095
|
+
afterLoadSnapshot: new F("afterLoadSnapshot"),
|
|
2096
|
+
beforeLoadManifest: new v("beforeLoadManifest"),
|
|
2097
|
+
afterLoadManifest: new v("afterLoadManifest")
|
|
2098
|
+
}), this.manifestLoading = we.__FEDERATION__.__MANIFEST_LOADING__, this.HostInstance = e, this.loaderHook = e.loaderHook;
|
|
2021
2099
|
}
|
|
2022
2100
|
async loadRemoteSnapshotInfo({ moduleInfo: e, id: t, initiator: r = "loadRemote" }) {
|
|
2023
2101
|
const { options: o } = this.HostInstance;
|
|
@@ -2026,7 +2104,7 @@ var Ko = class {
|
|
|
2026
2104
|
moduleInfo: e,
|
|
2027
2105
|
origin: this.HostInstance
|
|
2028
2106
|
});
|
|
2029
|
-
let n =
|
|
2107
|
+
let n = ge({
|
|
2030
2108
|
name: this.HostInstance.options.name,
|
|
2031
2109
|
version: this.HostInstance.options.version
|
|
2032
2110
|
});
|
|
@@ -2034,48 +2112,48 @@ var Ko = class {
|
|
|
2034
2112
|
version: this.HostInstance.options.version || "",
|
|
2035
2113
|
remoteEntry: "",
|
|
2036
2114
|
remotesInfo: {}
|
|
2037
|
-
},
|
|
2115
|
+
}, Kr({ [this.HostInstance.options.name]: n })), n && "remotesInfo" in n && !V(n.remotesInfo, e.name).value && ("version" in e || "entry" in e) && (n.remotesInfo = {
|
|
2038
2116
|
...n == null ? void 0 : n.remotesInfo,
|
|
2039
2117
|
[e.name]: { matchedVersion: "version" in e ? e.version : e.entry }
|
|
2040
2118
|
});
|
|
2041
|
-
const { hostGlobalSnapshot: s, remoteSnapshot:
|
|
2119
|
+
const { hostGlobalSnapshot: s, remoteSnapshot: i, globalSnapshot: a } = this.getGlobalRemoteInfo(e), { remoteSnapshot: c, globalSnapshot: l } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
2042
2120
|
options: o,
|
|
2043
2121
|
moduleInfo: e,
|
|
2044
2122
|
hostGlobalSnapshot: s,
|
|
2045
|
-
remoteSnapshot:
|
|
2046
|
-
globalSnapshot:
|
|
2123
|
+
remoteSnapshot: i,
|
|
2124
|
+
globalSnapshot: a
|
|
2047
2125
|
});
|
|
2048
2126
|
let u, f;
|
|
2049
|
-
if (
|
|
2050
|
-
const
|
|
2127
|
+
if (c) if (ut(c)) {
|
|
2128
|
+
const h = B ? c.remoteEntry : c.ssrRemoteEntry || c.remoteEntry || "", m = await this.loadManifestSnapshot(h, e, {}, {
|
|
2051
2129
|
initiator: r,
|
|
2052
2130
|
id: t || e.name
|
|
2053
|
-
}), d =
|
|
2131
|
+
}), d = ze({
|
|
2054
2132
|
...e,
|
|
2055
|
-
entry:
|
|
2056
|
-
},
|
|
2057
|
-
u =
|
|
2133
|
+
entry: h
|
|
2134
|
+
}, m);
|
|
2135
|
+
u = m, f = d;
|
|
2058
2136
|
} else {
|
|
2059
|
-
const { remoteSnapshot:
|
|
2137
|
+
const { remoteSnapshot: h } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2060
2138
|
options: this.HostInstance.options,
|
|
2061
2139
|
moduleInfo: e,
|
|
2062
|
-
remoteSnapshot:
|
|
2140
|
+
remoteSnapshot: c,
|
|
2063
2141
|
from: "global"
|
|
2064
2142
|
});
|
|
2065
|
-
u =
|
|
2143
|
+
u = h, f = l;
|
|
2066
2144
|
}
|
|
2067
|
-
else if (
|
|
2068
|
-
const
|
|
2145
|
+
else if (He(e)) {
|
|
2146
|
+
const h = await this.loadManifestSnapshot(e.entry, e, {}, {
|
|
2069
2147
|
initiator: r,
|
|
2070
2148
|
id: t || e.name
|
|
2071
|
-
}),
|
|
2072
|
-
u =
|
|
2073
|
-
} else
|
|
2149
|
+
}), m = ze(e, h);
|
|
2150
|
+
u = h, f = m;
|
|
2151
|
+
} else I(Ht, M, {
|
|
2074
2152
|
remoteName: e.name,
|
|
2075
2153
|
remoteVersion: e.version,
|
|
2076
2154
|
hostName: this.HostInstance.options.name,
|
|
2077
2155
|
globalSnapshot: JSON.stringify(l)
|
|
2078
|
-
}, void 0,
|
|
2156
|
+
}, void 0, D(this.HostInstance.options));
|
|
2079
2157
|
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
2080
2158
|
id: t,
|
|
2081
2159
|
host: this.HostInstance,
|
|
@@ -2088,86 +2166,126 @@ var Ko = class {
|
|
|
2088
2166
|
};
|
|
2089
2167
|
}
|
|
2090
2168
|
getGlobalRemoteInfo(e) {
|
|
2091
|
-
return
|
|
2169
|
+
return Yt(e, this.HostInstance);
|
|
2092
2170
|
}
|
|
2093
2171
|
async getManifestJson(e, t, r, o) {
|
|
2094
2172
|
return (async () => {
|
|
2095
|
-
const s =
|
|
2096
|
-
let
|
|
2097
|
-
if (
|
|
2173
|
+
const s = Z(t);
|
|
2174
|
+
let i = this.manifestCache.get(e);
|
|
2175
|
+
if (i)
|
|
2176
|
+
return await this.hooks.lifecycle.afterLoadManifest.emit({
|
|
2177
|
+
manifestUrl: e,
|
|
2178
|
+
moduleInfo: t,
|
|
2179
|
+
resourceOptions: o,
|
|
2180
|
+
manifestJson: i,
|
|
2181
|
+
cached: !0,
|
|
2182
|
+
origin: this.HostInstance
|
|
2183
|
+
}), i;
|
|
2184
|
+
await this.hooks.lifecycle.beforeLoadManifest.emit({
|
|
2185
|
+
manifestUrl: e,
|
|
2186
|
+
moduleInfo: t,
|
|
2187
|
+
resourceOptions: o,
|
|
2188
|
+
origin: this.HostInstance
|
|
2189
|
+
});
|
|
2190
|
+
let a, c, l = !1;
|
|
2098
2191
|
try {
|
|
2099
|
-
let
|
|
2192
|
+
let h = await this.loaderHook.lifecycle.fetch.emit(e, {}, s, o ? {
|
|
2100
2193
|
...o,
|
|
2101
2194
|
url: e,
|
|
2102
2195
|
resourceType: "manifest"
|
|
2103
2196
|
} : void 0);
|
|
2104
|
-
(!
|
|
2105
|
-
} catch (
|
|
2106
|
-
|
|
2197
|
+
(!h || !(h instanceof Response)) && (h = await fetch(e, {})), a = h, i = await h.json();
|
|
2198
|
+
} catch (h) {
|
|
2199
|
+
c = h, i = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2107
2200
|
id: e,
|
|
2108
|
-
error:
|
|
2201
|
+
error: h,
|
|
2109
2202
|
from: "runtime",
|
|
2110
2203
|
lifecycle: "afterResolve",
|
|
2111
2204
|
remote: s,
|
|
2112
2205
|
origin: this.HostInstance
|
|
2113
|
-
}),
|
|
2206
|
+
}), i || (delete this.manifestLoading[e], await this.hooks.lifecycle.afterLoadManifest.emit({
|
|
2207
|
+
manifestUrl: e,
|
|
2208
|
+
moduleInfo: t,
|
|
2209
|
+
resourceOptions: o,
|
|
2210
|
+
response: a,
|
|
2211
|
+
error: h,
|
|
2212
|
+
origin: this.HostInstance
|
|
2213
|
+
}), I(Ot, M, {
|
|
2114
2214
|
manifestUrl: e,
|
|
2115
2215
|
moduleName: t.name,
|
|
2116
2216
|
hostName: this.HostInstance.options.name
|
|
2117
|
-
}, `${
|
|
2217
|
+
}, `${h}`, D(this.HostInstance.options))), l = !0;
|
|
2118
2218
|
}
|
|
2119
|
-
const
|
|
2120
|
-
!
|
|
2121
|
-
!
|
|
2122
|
-
!
|
|
2123
|
-
].filter(Boolean);
|
|
2124
|
-
return
|
|
2219
|
+
const u = [
|
|
2220
|
+
!i.metaData && "metaData",
|
|
2221
|
+
!i.exposes && "exposes",
|
|
2222
|
+
!i.shared && "shared"
|
|
2223
|
+
].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;
|
|
2224
|
+
return f && await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2125
2225
|
id: e,
|
|
2126
|
-
error:
|
|
2226
|
+
error: f,
|
|
2127
2227
|
from: "runtime",
|
|
2128
2228
|
lifecycle: "afterResolve",
|
|
2129
2229
|
remote: s,
|
|
2130
2230
|
origin: this.HostInstance
|
|
2131
|
-
}),
|
|
2231
|
+
}), await this.hooks.lifecycle.afterLoadManifest.emit({
|
|
2232
|
+
manifestUrl: e,
|
|
2233
|
+
moduleInfo: t,
|
|
2234
|
+
resourceOptions: o,
|
|
2235
|
+
manifestJson: i,
|
|
2236
|
+
response: a,
|
|
2237
|
+
error: f || c,
|
|
2238
|
+
recovered: f ? void 0 : l || void 0,
|
|
2239
|
+
origin: this.HostInstance
|
|
2240
|
+
}), f && I(Gt, M, {
|
|
2132
2241
|
manifestUrl: e,
|
|
2133
2242
|
moduleName: t.name,
|
|
2134
2243
|
hostName: this.HostInstance.options.name,
|
|
2135
|
-
missingFields:
|
|
2136
|
-
}, void 0,
|
|
2244
|
+
missingFields: u.join(",")
|
|
2245
|
+
}, void 0, D(this.HostInstance.options)), this.manifestCache.set(e, i), i;
|
|
2137
2246
|
})();
|
|
2138
2247
|
}
|
|
2139
2248
|
async loadManifestSnapshot(e, t, r, o) {
|
|
2140
2249
|
const n = async () => {
|
|
2141
|
-
const s = await this.getManifestJson(e, t, r, o),
|
|
2250
|
+
const s = await this.getManifestJson(e, t, r, o), i = wr(s, { version: e }), { remoteSnapshot: a } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
2142
2251
|
options: this.HostInstance.options,
|
|
2143
2252
|
moduleInfo: t,
|
|
2144
2253
|
manifestJson: s,
|
|
2145
|
-
remoteSnapshot:
|
|
2254
|
+
remoteSnapshot: i,
|
|
2146
2255
|
manifestUrl: e,
|
|
2147
2256
|
from: "manifest"
|
|
2148
2257
|
});
|
|
2149
|
-
return
|
|
2258
|
+
return a;
|
|
2150
2259
|
};
|
|
2151
2260
|
return this.manifestLoading[e] || (this.manifestLoading[e] = n().then((s) => s)), this.manifestLoading[e];
|
|
2152
2261
|
}
|
|
2153
|
-
},
|
|
2262
|
+
}, an = class {
|
|
2154
2263
|
constructor() {
|
|
2155
2264
|
this.hooks = new H({});
|
|
2156
2265
|
}
|
|
2157
|
-
},
|
|
2266
|
+
}, cn = class {
|
|
2158
2267
|
constructor(e) {
|
|
2159
2268
|
this.hooks = new H({
|
|
2160
|
-
beforeRegisterShare: new
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2269
|
+
beforeRegisterShare: new Y("beforeRegisterShare"),
|
|
2270
|
+
afterRegisterShare: new N("afterRegisterShare"),
|
|
2271
|
+
afterResolve: new F("afterResolve"),
|
|
2272
|
+
beforeLoadShare: new F("beforeLoadShare"),
|
|
2273
|
+
loadShare: new v(),
|
|
2274
|
+
afterLoadShare: new N("afterLoadShare"),
|
|
2275
|
+
errorLoadShare: new N("errorLoadShare"),
|
|
2276
|
+
resolveShare: new Y("resolveShare"),
|
|
2277
|
+
initContainerShareScopeMap: new Y("initContainerShareScopeMap")
|
|
2168
2278
|
}), this.host = e, this.shareScopeMap = {}, this.initTokens = {}, this._setGlobalShareScopeMap(e.options);
|
|
2169
2279
|
}
|
|
2170
|
-
|
|
2280
|
+
emitAfterRegisterShare(e, t) {
|
|
2281
|
+
this.hooks.lifecycle.afterRegisterShare.emit({
|
|
2282
|
+
pkgName: e,
|
|
2283
|
+
...t,
|
|
2284
|
+
shareScopeMap: this.shareScopeMap,
|
|
2285
|
+
origin: this.host
|
|
2286
|
+
});
|
|
2287
|
+
}
|
|
2288
|
+
emitAfterLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, selectedShared: o, loadContext: n }) {
|
|
2171
2289
|
try {
|
|
2172
2290
|
this.hooks.lifecycle.afterLoadShare.emit({
|
|
2173
2291
|
pkgName: t,
|
|
@@ -2176,13 +2294,14 @@ var Ko = class {
|
|
|
2176
2294
|
shared: this.host.options.shared,
|
|
2177
2295
|
shareScopeMap: this.shareScopeMap,
|
|
2178
2296
|
lifecycle: e,
|
|
2297
|
+
loadContext: n,
|
|
2179
2298
|
origin: this.host
|
|
2180
2299
|
});
|
|
2181
|
-
} catch (
|
|
2182
|
-
|
|
2300
|
+
} catch (s) {
|
|
2301
|
+
se(s);
|
|
2183
2302
|
}
|
|
2184
2303
|
}
|
|
2185
|
-
emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n }) {
|
|
2304
|
+
emitErrorLoadShare({ lifecycle: e, pkgName: t, shareInfo: r, error: o, recovered: n, loadContext: s }) {
|
|
2186
2305
|
try {
|
|
2187
2306
|
this.hooks.lifecycle.errorLoadShare.emit({
|
|
2188
2307
|
pkgName: t,
|
|
@@ -2192,29 +2311,38 @@ var Ko = class {
|
|
|
2192
2311
|
lifecycle: e,
|
|
2193
2312
|
origin: this.host,
|
|
2194
2313
|
error: o,
|
|
2195
|
-
recovered: n
|
|
2314
|
+
recovered: n,
|
|
2315
|
+
loadContext: s
|
|
2196
2316
|
});
|
|
2197
|
-
} catch (
|
|
2198
|
-
|
|
2317
|
+
} catch (i) {
|
|
2318
|
+
se(i);
|
|
2199
2319
|
}
|
|
2200
2320
|
}
|
|
2201
2321
|
registerShared(e, t) {
|
|
2202
|
-
const { newShareInfos: r, allShareInfos: o } =
|
|
2322
|
+
const { newShareInfos: r, allShareInfos: o } = Mt(e, t);
|
|
2203
2323
|
return Object.keys(r).forEach((n) => {
|
|
2204
2324
|
r[n].forEach((s) => {
|
|
2205
|
-
s.scope.forEach((
|
|
2206
|
-
var
|
|
2325
|
+
s.scope.forEach((i) => {
|
|
2326
|
+
var l, u, f;
|
|
2207
2327
|
this.hooks.lifecycle.beforeRegisterShare.emit({
|
|
2208
2328
|
origin: this.host,
|
|
2209
2329
|
pkgName: n,
|
|
2210
2330
|
shared: s
|
|
2211
|
-
})
|
|
2331
|
+
});
|
|
2332
|
+
const a = (l = this.shareScopeMap[i]) == null ? void 0 : l[n], c = a == null ? void 0 : a[s.version];
|
|
2333
|
+
a || this.setShared({
|
|
2212
2334
|
pkgName: n,
|
|
2213
2335
|
lib: s.lib,
|
|
2214
2336
|
get: s.get,
|
|
2215
2337
|
loaded: s.loaded || !!s.lib,
|
|
2216
2338
|
shared: s,
|
|
2217
2339
|
from: t.name
|
|
2340
|
+
}), this.emitAfterRegisterShare(n, {
|
|
2341
|
+
scope: i,
|
|
2342
|
+
shared: s,
|
|
2343
|
+
previousShared: c,
|
|
2344
|
+
registeredShared: (f = (u = this.shareScopeMap[i]) == null ? void 0 : u[n]) == null ? void 0 : f[s.version],
|
|
2345
|
+
trigger: "runtime"
|
|
2218
2346
|
});
|
|
2219
2347
|
});
|
|
2220
2348
|
});
|
|
@@ -2224,103 +2352,117 @@ var Ko = class {
|
|
|
2224
2352
|
};
|
|
2225
2353
|
}
|
|
2226
2354
|
async loadShare(e, t) {
|
|
2227
|
-
const { host: r } = this
|
|
2355
|
+
const { host: r } = this;
|
|
2356
|
+
let o = t == null ? void 0 : t.context;
|
|
2357
|
+
const n = Qe({
|
|
2228
2358
|
pkgName: e,
|
|
2229
2359
|
extraOptions: t,
|
|
2230
2360
|
shareInfos: r.options.shared
|
|
2231
2361
|
});
|
|
2232
|
-
let
|
|
2362
|
+
let s = n;
|
|
2233
2363
|
try {
|
|
2234
|
-
|
|
2235
|
-
await Promise.all(this.initializeSharing(
|
|
2236
|
-
|
|
2364
|
+
n != null && n.scope && await Promise.all(n.scope.map(async (u) => {
|
|
2365
|
+
await Promise.all(this.initializeSharing(u, {
|
|
2366
|
+
strategy: n.strategy,
|
|
2367
|
+
context: o
|
|
2368
|
+
}));
|
|
2369
|
+
}));
|
|
2370
|
+
const i = await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
2237
2371
|
pkgName: e,
|
|
2238
|
-
shareInfo:
|
|
2372
|
+
shareInfo: n,
|
|
2239
2373
|
shared: r.options.shared,
|
|
2240
|
-
origin: r
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2374
|
+
origin: r,
|
|
2375
|
+
loadContext: o
|
|
2376
|
+
});
|
|
2377
|
+
s = i.shareInfo, o = i.loadContext || o, k(s, `Cannot find shared "${e}" in host "${r.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);
|
|
2378
|
+
const a = s, { shared: c, useTreesShaking: l } = Se(this.shareScopeMap, e, s, this.hooks.lifecycle.resolveShare, o) || {};
|
|
2379
|
+
if (c) {
|
|
2380
|
+
const u = he(c, l);
|
|
2381
|
+
if (u.lib)
|
|
2382
|
+
return J(u, r.options.name), this.emitAfterLoadShare({
|
|
2247
2383
|
lifecycle: "loadShare",
|
|
2248
2384
|
pkgName: e,
|
|
2249
|
-
shareInfo:
|
|
2250
|
-
selectedShared:
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2385
|
+
shareInfo: a,
|
|
2386
|
+
selectedShared: c,
|
|
2387
|
+
loadContext: o
|
|
2388
|
+
}), u.lib;
|
|
2389
|
+
if (u.loading && !u.loaded) {
|
|
2390
|
+
const f = await u.loading;
|
|
2391
|
+
return u.loaded = !0, u.lib || (u.lib = f), J(u, r.options.name), this.emitAfterLoadShare({
|
|
2255
2392
|
lifecycle: "loadShare",
|
|
2256
2393
|
pkgName: e,
|
|
2257
|
-
shareInfo:
|
|
2258
|
-
selectedShared:
|
|
2259
|
-
|
|
2394
|
+
shareInfo: a,
|
|
2395
|
+
selectedShared: c,
|
|
2396
|
+
loadContext: o
|
|
2397
|
+
}), f;
|
|
2260
2398
|
} else {
|
|
2261
|
-
const
|
|
2262
|
-
const
|
|
2263
|
-
return
|
|
2399
|
+
const h = (async () => {
|
|
2400
|
+
const d = await u.get();
|
|
2401
|
+
return J(u, r.options.name), u.loaded = !0, u.lib = d, d;
|
|
2264
2402
|
})();
|
|
2265
2403
|
this.setShared({
|
|
2266
2404
|
pkgName: e,
|
|
2267
2405
|
loaded: !1,
|
|
2268
|
-
shared:
|
|
2406
|
+
shared: c,
|
|
2269
2407
|
from: r.options.name,
|
|
2270
2408
|
lib: null,
|
|
2271
|
-
loading:
|
|
2272
|
-
treeShaking:
|
|
2409
|
+
loading: h,
|
|
2410
|
+
treeShaking: l ? u : void 0
|
|
2273
2411
|
});
|
|
2274
|
-
const
|
|
2412
|
+
const m = await h;
|
|
2275
2413
|
return this.emitAfterLoadShare({
|
|
2276
2414
|
lifecycle: "loadShare",
|
|
2277
2415
|
pkgName: e,
|
|
2278
|
-
shareInfo:
|
|
2279
|
-
selectedShared:
|
|
2280
|
-
|
|
2416
|
+
shareInfo: a,
|
|
2417
|
+
selectedShared: c,
|
|
2418
|
+
loadContext: o
|
|
2419
|
+
}), m;
|
|
2281
2420
|
}
|
|
2282
2421
|
} else {
|
|
2283
2422
|
if (t != null && t.customShareInfo)
|
|
2284
2423
|
return this.emitErrorLoadShare({
|
|
2285
2424
|
lifecycle: "loadShare",
|
|
2286
2425
|
pkgName: e,
|
|
2287
|
-
shareInfo:
|
|
2288
|
-
recovered: !0
|
|
2426
|
+
shareInfo: a,
|
|
2427
|
+
recovered: !0,
|
|
2428
|
+
loadContext: o
|
|
2289
2429
|
}), !1;
|
|
2290
|
-
const
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2293
|
-
const { shared:
|
|
2294
|
-
if (
|
|
2295
|
-
const
|
|
2296
|
-
|
|
2430
|
+
const u = ae(a.treeShaking), f = he(a, u), m = (async () => {
|
|
2431
|
+
const p = await f.get();
|
|
2432
|
+
f.lib = p, f.loaded = !0, J(f, r.options.name);
|
|
2433
|
+
const { shared: y, useTreesShaking: g } = Se(this.shareScopeMap, e, a, this.hooks.lifecycle.resolveShare, o) || {};
|
|
2434
|
+
if (y) {
|
|
2435
|
+
const R = he(y, g);
|
|
2436
|
+
R.lib = p, R.loaded = !0, y.from = a.from;
|
|
2297
2437
|
}
|
|
2298
|
-
return
|
|
2438
|
+
return p;
|
|
2299
2439
|
})();
|
|
2300
2440
|
this.setShared({
|
|
2301
2441
|
pkgName: e,
|
|
2302
2442
|
loaded: !1,
|
|
2303
|
-
shared:
|
|
2443
|
+
shared: a,
|
|
2304
2444
|
from: r.options.name,
|
|
2305
2445
|
lib: null,
|
|
2306
|
-
loading:
|
|
2307
|
-
treeShaking:
|
|
2446
|
+
loading: m,
|
|
2447
|
+
treeShaking: u ? f : void 0
|
|
2308
2448
|
});
|
|
2309
|
-
const
|
|
2449
|
+
const d = await m;
|
|
2310
2450
|
return this.emitAfterLoadShare({
|
|
2311
2451
|
lifecycle: "loadShare",
|
|
2312
2452
|
pkgName: e,
|
|
2313
|
-
shareInfo:
|
|
2314
|
-
selectedShared:
|
|
2315
|
-
|
|
2453
|
+
shareInfo: a,
|
|
2454
|
+
selectedShared: a,
|
|
2455
|
+
loadContext: o
|
|
2456
|
+
}), d;
|
|
2316
2457
|
}
|
|
2317
|
-
} catch (
|
|
2458
|
+
} catch (i) {
|
|
2318
2459
|
throw this.emitErrorLoadShare({
|
|
2319
2460
|
lifecycle: "loadShare",
|
|
2320
2461
|
pkgName: e,
|
|
2321
|
-
shareInfo:
|
|
2322
|
-
error:
|
|
2323
|
-
|
|
2462
|
+
shareInfo: s,
|
|
2463
|
+
error: i,
|
|
2464
|
+
loadContext: o
|
|
2465
|
+
}), i;
|
|
2324
2466
|
}
|
|
2325
2467
|
}
|
|
2326
2468
|
/**
|
|
@@ -2328,123 +2470,145 @@ var Ko = class {
|
|
|
2328
2470
|
* It accepts one argument, the name of the share scope.
|
|
2329
2471
|
* If the share scope does not exist, it creates one.
|
|
2330
2472
|
*/
|
|
2331
|
-
initializeSharing(e =
|
|
2332
|
-
|
|
2333
|
-
|
|
2473
|
+
initializeSharing(e = le, t) {
|
|
2474
|
+
var m;
|
|
2475
|
+
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";
|
|
2476
|
+
let i = t == null ? void 0 : t.initScope;
|
|
2334
2477
|
const a = [];
|
|
2335
2478
|
if (o !== "build") {
|
|
2336
|
-
const { initTokens:
|
|
2337
|
-
|
|
2338
|
-
let
|
|
2339
|
-
if (
|
|
2340
|
-
|
|
2479
|
+
const { initTokens: d } = this;
|
|
2480
|
+
i || (i = []);
|
|
2481
|
+
let p = d[e];
|
|
2482
|
+
if (p || (p = d[e] = { from: this.host.name }), i.indexOf(p) >= 0) return a;
|
|
2483
|
+
i.push(p);
|
|
2341
2484
|
}
|
|
2342
|
-
const c = this.shareScopeMap,
|
|
2485
|
+
const c = this.shareScopeMap, l = r.options.name;
|
|
2343
2486
|
c[e] || (c[e] = {});
|
|
2344
|
-
const
|
|
2345
|
-
var
|
|
2346
|
-
const { version:
|
|
2347
|
-
|
|
2348
|
-
const
|
|
2349
|
-
(!
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2487
|
+
const u = c[e], f = (d, p) => {
|
|
2488
|
+
var b;
|
|
2489
|
+
const { version: y, eager: g } = p;
|
|
2490
|
+
u[d] = u[d] || {};
|
|
2491
|
+
const R = u[d], E = R[y], _ = E && he(E), S = !!(_ && ("eager" in _ && _.eager || "shareConfig" in _ && ((b = _.shareConfig) != null && b.eager)));
|
|
2492
|
+
(!_ || _.strategy !== "loaded-first" && !_.loaded && (!g != !S ? g : l > R[y].from)) && (R[y] = p), this.emitAfterRegisterShare(d, {
|
|
2493
|
+
scope: e,
|
|
2494
|
+
shared: p,
|
|
2495
|
+
previousShared: E,
|
|
2496
|
+
registeredShared: R[y],
|
|
2497
|
+
trigger: s
|
|
2498
|
+
});
|
|
2499
|
+
}, h = async (d) => {
|
|
2500
|
+
const { module: p } = await r.remoteHandler.getRemoteModuleAndOptions({ id: d });
|
|
2501
|
+
let y;
|
|
2502
|
+
const g = {
|
|
2503
|
+
initiator: "loadShare",
|
|
2504
|
+
id: d,
|
|
2505
|
+
resourceType: "remoteEntry",
|
|
2506
|
+
url: p.remoteInfo.entry
|
|
2507
|
+
};
|
|
2353
2508
|
try {
|
|
2354
|
-
|
|
2355
|
-
} catch (
|
|
2356
|
-
if (
|
|
2357
|
-
id:
|
|
2358
|
-
error:
|
|
2509
|
+
y = await p.getEntry(void 0, g);
|
|
2510
|
+
} catch (R) {
|
|
2511
|
+
if (y = await r.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
2512
|
+
id: d,
|
|
2513
|
+
error: R,
|
|
2359
2514
|
from: "runtime",
|
|
2360
2515
|
lifecycle: "beforeLoadShare",
|
|
2361
|
-
remote:
|
|
2516
|
+
remote: p.remoteInfo,
|
|
2362
2517
|
origin: r
|
|
2363
|
-
}), !
|
|
2518
|
+
}), !y) return;
|
|
2364
2519
|
} finally {
|
|
2365
|
-
|
|
2520
|
+
y != null && y.init && !p.initing && (p.remoteEntryExports = y, await p.init(void 0, void 0, i, void 0, g));
|
|
2366
2521
|
}
|
|
2367
2522
|
};
|
|
2368
|
-
return Object.keys(r.options.shared).forEach((
|
|
2369
|
-
r.options.shared[
|
|
2370
|
-
|
|
2523
|
+
return Object.keys(r.options.shared).forEach((d) => {
|
|
2524
|
+
r.options.shared[d].forEach((p) => {
|
|
2525
|
+
p.scope.includes(e) && f(d, p);
|
|
2371
2526
|
});
|
|
2372
|
-
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((
|
|
2373
|
-
|
|
2527
|
+
}), (r.options.shareStrategy === "version-first" || n === "version-first") && r.options.remotes.forEach((d) => {
|
|
2528
|
+
d.shareScope === e && a.push(h(d.name));
|
|
2374
2529
|
}), a;
|
|
2375
2530
|
}
|
|
2376
2531
|
loadShareSync(e, t) {
|
|
2377
|
-
const { host: r } = this, o =
|
|
2532
|
+
const { host: r } = this, o = t == null ? void 0 : t.context, n = Qe({
|
|
2378
2533
|
pkgName: e,
|
|
2379
2534
|
extraOptions: t,
|
|
2380
2535
|
shareInfos: r.options.shared
|
|
2381
2536
|
});
|
|
2382
2537
|
try {
|
|
2383
|
-
|
|
2384
|
-
this.initializeSharing(
|
|
2538
|
+
n != null && n.scope && n.scope.forEach((i) => {
|
|
2539
|
+
this.initializeSharing(i, {
|
|
2540
|
+
strategy: n.strategy,
|
|
2541
|
+
from: t == null ? void 0 : t.from,
|
|
2542
|
+
context: o
|
|
2543
|
+
});
|
|
2385
2544
|
});
|
|
2386
|
-
const { shared:
|
|
2387
|
-
if (
|
|
2388
|
-
if (typeof
|
|
2389
|
-
return
|
|
2545
|
+
const { shared: s } = Se(this.shareScopeMap, e, n, this.hooks.lifecycle.resolveShare, o) || {};
|
|
2546
|
+
if (s) {
|
|
2547
|
+
if (typeof s.lib == "function")
|
|
2548
|
+
return J(s, r.options.name), s.loaded || (s.loaded = !0, s.from === r.options.name && (n.loaded = !0)), this.emitAfterLoadShare({
|
|
2390
2549
|
lifecycle: "loadShareSync",
|
|
2391
2550
|
pkgName: e,
|
|
2392
|
-
shareInfo:
|
|
2393
|
-
selectedShared:
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2551
|
+
shareInfo: n,
|
|
2552
|
+
selectedShared: s,
|
|
2553
|
+
loadContext: o
|
|
2554
|
+
}), s.lib;
|
|
2555
|
+
if (typeof s.get == "function") {
|
|
2556
|
+
const i = s.get();
|
|
2557
|
+
if (!(i instanceof Promise))
|
|
2558
|
+
return J(s, r.options.name), this.setShared({
|
|
2399
2559
|
pkgName: e,
|
|
2400
2560
|
loaded: !0,
|
|
2401
2561
|
from: r.options.name,
|
|
2402
|
-
lib:
|
|
2403
|
-
shared:
|
|
2562
|
+
lib: i,
|
|
2563
|
+
shared: s
|
|
2404
2564
|
}), this.emitAfterLoadShare({
|
|
2405
2565
|
lifecycle: "loadShareSync",
|
|
2406
2566
|
pkgName: e,
|
|
2407
|
-
shareInfo:
|
|
2408
|
-
selectedShared:
|
|
2409
|
-
|
|
2567
|
+
shareInfo: n,
|
|
2568
|
+
selectedShared: s,
|
|
2569
|
+
loadContext: o
|
|
2570
|
+
}), i;
|
|
2410
2571
|
}
|
|
2411
2572
|
}
|
|
2412
|
-
if (
|
|
2413
|
-
return
|
|
2573
|
+
if (n.lib)
|
|
2574
|
+
return n.loaded || (n.loaded = !0), this.emitAfterLoadShare({
|
|
2414
2575
|
lifecycle: "loadShareSync",
|
|
2415
2576
|
pkgName: e,
|
|
2416
|
-
shareInfo:
|
|
2417
|
-
selectedShared:
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2577
|
+
shareInfo: n,
|
|
2578
|
+
selectedShared: n,
|
|
2579
|
+
loadContext: o
|
|
2580
|
+
}), n.lib;
|
|
2581
|
+
if (n.get) {
|
|
2582
|
+
const i = n.get();
|
|
2583
|
+
return i instanceof Promise && I((t == null ? void 0 : t.from) === "build" ? Dt : De, M, {
|
|
2422
2584
|
hostName: r.options.name,
|
|
2423
2585
|
sharedPkgName: e
|
|
2424
|
-
}, void 0,
|
|
2586
|
+
}, void 0, D(r.options)), n.lib = i, this.setShared({
|
|
2425
2587
|
pkgName: e,
|
|
2426
2588
|
loaded: !0,
|
|
2427
2589
|
from: r.options.name,
|
|
2428
|
-
lib:
|
|
2429
|
-
shared:
|
|
2590
|
+
lib: n.lib,
|
|
2591
|
+
shared: n
|
|
2430
2592
|
}), this.emitAfterLoadShare({
|
|
2431
2593
|
lifecycle: "loadShareSync",
|
|
2432
2594
|
pkgName: e,
|
|
2433
|
-
shareInfo:
|
|
2434
|
-
selectedShared:
|
|
2435
|
-
|
|
2595
|
+
shareInfo: n,
|
|
2596
|
+
selectedShared: n,
|
|
2597
|
+
loadContext: o
|
|
2598
|
+
}), n.lib;
|
|
2436
2599
|
}
|
|
2437
|
-
|
|
2600
|
+
I(De, M, {
|
|
2438
2601
|
hostName: r.options.name,
|
|
2439
2602
|
sharedPkgName: e
|
|
2440
|
-
}, void 0,
|
|
2441
|
-
} catch (
|
|
2603
|
+
}, void 0, D(r.options));
|
|
2604
|
+
} catch (s) {
|
|
2442
2605
|
throw this.emitErrorLoadShare({
|
|
2443
2606
|
lifecycle: "loadShareSync",
|
|
2444
2607
|
pkgName: e,
|
|
2445
|
-
shareInfo:
|
|
2446
|
-
error:
|
|
2447
|
-
|
|
2608
|
+
shareInfo: n,
|
|
2609
|
+
error: s,
|
|
2610
|
+
loadContext: o
|
|
2611
|
+
}), s;
|
|
2448
2612
|
}
|
|
2449
2613
|
}
|
|
2450
2614
|
initShareScopeMap(e, t, r = {}) {
|
|
@@ -2457,31 +2621,31 @@ var Ko = class {
|
|
|
2457
2621
|
hostShareScopeMap: r.hostShareScopeMap
|
|
2458
2622
|
});
|
|
2459
2623
|
}
|
|
2460
|
-
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get:
|
|
2461
|
-
const { version:
|
|
2462
|
-
const d = (
|
|
2463
|
-
R && !
|
|
2464
|
-
}, p =
|
|
2465
|
-
d(p, "loaded", s), d(p, "loading", n), d(p, "get",
|
|
2624
|
+
setShared({ pkgName: e, shared: t, from: r, lib: o, loading: n, loaded: s, get: i, treeShaking: a }) {
|
|
2625
|
+
const { version: c, scope: l = "default", ...u } = t, f = Array.isArray(l) ? l : [l], h = (m) => {
|
|
2626
|
+
const d = (y, g, R) => {
|
|
2627
|
+
R && !y[g] && (y[g] = R);
|
|
2628
|
+
}, p = a ? m.treeShaking : m;
|
|
2629
|
+
d(p, "loaded", s), d(p, "loading", n), d(p, "get", i), d(p, "lib", o);
|
|
2466
2630
|
};
|
|
2467
|
-
f.forEach((
|
|
2468
|
-
this.shareScopeMap[
|
|
2469
|
-
version:
|
|
2470
|
-
scope: [
|
|
2631
|
+
f.forEach((m) => {
|
|
2632
|
+
this.shareScopeMap[m] || (this.shareScopeMap[m] = {}), this.shareScopeMap[m][e] || (this.shareScopeMap[m][e] = {}), this.shareScopeMap[m][e][c] || (this.shareScopeMap[m][e][c] = {
|
|
2633
|
+
version: c,
|
|
2634
|
+
scope: [m],
|
|
2471
2635
|
...u,
|
|
2472
2636
|
lib: o
|
|
2473
2637
|
});
|
|
2474
|
-
const d = this.shareScopeMap[
|
|
2475
|
-
|
|
2638
|
+
const d = this.shareScopeMap[m][e][c];
|
|
2639
|
+
h(d), r && d.from !== r && (d.from = r);
|
|
2476
2640
|
});
|
|
2477
2641
|
}
|
|
2478
2642
|
_setGlobalShareScopeMap(e) {
|
|
2479
|
-
const t =
|
|
2643
|
+
const t = Pt(), r = e.id || e.name;
|
|
2480
2644
|
r && !t[r] && (t[r] = this.shareScopeMap);
|
|
2481
2645
|
}
|
|
2482
|
-
},
|
|
2646
|
+
}, ln = class {
|
|
2483
2647
|
constructor() {
|
|
2484
|
-
this.shareScopeMap = {}, this.hooks = new H({ afterResolve: new
|
|
2648
|
+
this.shareScopeMap = {}, this.hooks = new H({ afterResolve: new F("afterResolve") });
|
|
2485
2649
|
}
|
|
2486
2650
|
registerShared() {
|
|
2487
2651
|
return {
|
|
@@ -2501,21 +2665,21 @@ var Ko = class {
|
|
|
2501
2665
|
initShareScopeMap(e, t) {
|
|
2502
2666
|
this.shareScopeMap[e] = t;
|
|
2503
2667
|
}
|
|
2504
|
-
},
|
|
2668
|
+
}, un = class {
|
|
2505
2669
|
constructor(e) {
|
|
2506
2670
|
this.hooks = new H({
|
|
2507
|
-
beforeRegisterRemote: new
|
|
2508
|
-
registerRemote: new
|
|
2509
|
-
beforeRequest: new
|
|
2510
|
-
afterMatchRemote: new
|
|
2511
|
-
onLoad: new
|
|
2512
|
-
afterLoadRemote: new
|
|
2513
|
-
handlePreloadModule: new
|
|
2514
|
-
errorLoadRemote: new
|
|
2515
|
-
beforePreloadRemote: new
|
|
2516
|
-
generatePreloadAssets: new
|
|
2517
|
-
afterPreloadRemote: new
|
|
2518
|
-
loadEntry: new
|
|
2671
|
+
beforeRegisterRemote: new Y("beforeRegisterRemote"),
|
|
2672
|
+
registerRemote: new Y("registerRemote"),
|
|
2673
|
+
beforeRequest: new F("beforeRequest"),
|
|
2674
|
+
afterMatchRemote: new v("afterMatchRemote"),
|
|
2675
|
+
onLoad: new v("onLoad"),
|
|
2676
|
+
afterLoadRemote: new v("afterLoadRemote"),
|
|
2677
|
+
handlePreloadModule: new N("handlePreloadModule"),
|
|
2678
|
+
errorLoadRemote: new v("errorLoadRemote"),
|
|
2679
|
+
beforePreloadRemote: new v("beforePreloadRemote"),
|
|
2680
|
+
generatePreloadAssets: new v("generatePreloadAssets"),
|
|
2681
|
+
afterPreloadRemote: new v("afterPreloadRemote"),
|
|
2682
|
+
loadEntry: new v()
|
|
2519
2683
|
}), this.host = e, this.idToRemoteMap = {};
|
|
2520
2684
|
}
|
|
2521
2685
|
formatAndRegisterRemote(e, t) {
|
|
@@ -2527,88 +2691,88 @@ var Ko = class {
|
|
|
2527
2691
|
name: r.name,
|
|
2528
2692
|
expose: o
|
|
2529
2693
|
}, s && e.startsWith(n)) {
|
|
2530
|
-
const
|
|
2531
|
-
this.idToRemoteMap[
|
|
2694
|
+
const i = e.replace(n, s);
|
|
2695
|
+
this.idToRemoteMap[i] = {
|
|
2532
2696
|
name: r.name,
|
|
2533
2697
|
expose: o
|
|
2534
2698
|
};
|
|
2535
2699
|
return;
|
|
2536
2700
|
}
|
|
2537
2701
|
if (s && e.startsWith(s)) {
|
|
2538
|
-
const
|
|
2539
|
-
this.idToRemoteMap[
|
|
2702
|
+
const i = e.replace(s, n);
|
|
2703
|
+
this.idToRemoteMap[i] = {
|
|
2540
2704
|
name: r.name,
|
|
2541
2705
|
expose: o
|
|
2542
2706
|
};
|
|
2543
2707
|
}
|
|
2544
2708
|
}
|
|
2545
2709
|
async loadRemote(e, t) {
|
|
2546
|
-
const { host: r } = this, o =
|
|
2547
|
-
let n = e, s = o == null ? void 0 : o.expose,
|
|
2710
|
+
const { host: r } = this, o = et(r.options.remotes, e);
|
|
2711
|
+
let n = e, s = o == null ? void 0 : o.expose, i = o ? Z(o.remote) : void 0, a;
|
|
2548
2712
|
try {
|
|
2549
|
-
const { loadFactory:
|
|
2550
|
-
n = p, s = d,
|
|
2551
|
-
const
|
|
2713
|
+
const { loadFactory: c = !0 } = t || { loadFactory: !0 }, { module: l, moduleOptions: u, remoteMatchInfo: f } = await this.getRemoteModuleAndOptions({ id: e }), { pkgNameOrAlias: h, remote: m, expose: d, id: p, remoteSnapshot: y } = f;
|
|
2714
|
+
n = p, s = d, i = Z(m);
|
|
2715
|
+
const g = await l.get(p, d, t, y), R = await this.hooks.lifecycle.onLoad.emit({
|
|
2552
2716
|
id: p,
|
|
2553
|
-
pkgNameOrAlias:
|
|
2717
|
+
pkgNameOrAlias: h,
|
|
2554
2718
|
expose: d,
|
|
2555
|
-
exposeModule:
|
|
2556
|
-
exposeModuleFactory:
|
|
2557
|
-
remote:
|
|
2719
|
+
exposeModule: c ? g : void 0,
|
|
2720
|
+
exposeModuleFactory: c ? void 0 : g,
|
|
2721
|
+
remote: m,
|
|
2558
2722
|
options: u,
|
|
2559
2723
|
moduleInstance: l,
|
|
2560
2724
|
origin: r
|
|
2561
2725
|
});
|
|
2562
|
-
return this.setIdToRemoteMap(e, f),
|
|
2726
|
+
return this.setIdToRemoteMap(e, f), a = {
|
|
2563
2727
|
id: n,
|
|
2564
2728
|
expose: s,
|
|
2565
|
-
remote:
|
|
2729
|
+
remote: i,
|
|
2566
2730
|
options: t,
|
|
2567
2731
|
origin: r
|
|
2568
|
-
}, typeof R == "function" ? R :
|
|
2569
|
-
} catch (
|
|
2732
|
+
}, typeof R == "function" ? R : g;
|
|
2733
|
+
} catch (c) {
|
|
2570
2734
|
const { from: l = "runtime" } = t || { from: "runtime" };
|
|
2571
2735
|
let u;
|
|
2572
2736
|
try {
|
|
2573
2737
|
u = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2574
2738
|
id: e,
|
|
2575
|
-
error:
|
|
2739
|
+
error: c,
|
|
2576
2740
|
from: l,
|
|
2577
2741
|
lifecycle: "onLoad",
|
|
2578
2742
|
expose: s,
|
|
2579
|
-
remote:
|
|
2743
|
+
remote: i,
|
|
2580
2744
|
origin: r
|
|
2581
2745
|
});
|
|
2582
2746
|
} catch (f) {
|
|
2583
|
-
throw
|
|
2747
|
+
throw a = {
|
|
2584
2748
|
id: n,
|
|
2585
2749
|
expose: s,
|
|
2586
|
-
remote:
|
|
2750
|
+
remote: i,
|
|
2587
2751
|
options: t,
|
|
2588
2752
|
error: f,
|
|
2589
2753
|
origin: r
|
|
2590
2754
|
}, f;
|
|
2591
2755
|
}
|
|
2592
2756
|
if (!u)
|
|
2593
|
-
throw
|
|
2757
|
+
throw a = {
|
|
2594
2758
|
id: n,
|
|
2595
2759
|
expose: s,
|
|
2596
|
-
remote:
|
|
2760
|
+
remote: i,
|
|
2597
2761
|
options: t,
|
|
2598
|
-
error:
|
|
2762
|
+
error: c,
|
|
2599
2763
|
origin: r
|
|
2600
|
-
},
|
|
2601
|
-
return
|
|
2764
|
+
}, c;
|
|
2765
|
+
return a = {
|
|
2602
2766
|
id: n,
|
|
2603
2767
|
expose: s,
|
|
2604
|
-
remote:
|
|
2768
|
+
remote: i,
|
|
2605
2769
|
options: t,
|
|
2606
|
-
error:
|
|
2770
|
+
error: c,
|
|
2607
2771
|
origin: r,
|
|
2608
2772
|
recovered: !0
|
|
2609
2773
|
}, u;
|
|
2610
2774
|
} finally {
|
|
2611
|
-
|
|
2775
|
+
a && await this.hooks.lifecycle.afterLoadRemote.emit(a);
|
|
2612
2776
|
}
|
|
2613
2777
|
}
|
|
2614
2778
|
async preloadRemote(e) {
|
|
@@ -2618,71 +2782,71 @@ var Ko = class {
|
|
|
2618
2782
|
options: t.options,
|
|
2619
2783
|
origin: t
|
|
2620
2784
|
});
|
|
2621
|
-
const o =
|
|
2622
|
-
const { preloadConfig:
|
|
2785
|
+
const o = Ko(t.options.remotes, e), n = (a) => {
|
|
2786
|
+
const { preloadConfig: c, remote: l } = a, u = c.exposes || [];
|
|
2623
2787
|
return u.length ? u.map((f) => ({
|
|
2624
2788
|
ops: {
|
|
2625
|
-
...
|
|
2789
|
+
...a,
|
|
2626
2790
|
preloadConfig: {
|
|
2627
|
-
...
|
|
2791
|
+
...c,
|
|
2628
2792
|
exposes: [f]
|
|
2629
2793
|
}
|
|
2630
2794
|
},
|
|
2631
|
-
id:
|
|
2795
|
+
id: Be(l.name, f)
|
|
2632
2796
|
})) : [{
|
|
2633
|
-
ops:
|
|
2797
|
+
ops: a,
|
|
2634
2798
|
id: `${l.name}/*`
|
|
2635
2799
|
}];
|
|
2636
2800
|
};
|
|
2637
2801
|
let s;
|
|
2638
|
-
await Promise.all(o.flatMap(n).map(async (
|
|
2639
|
-
const { ops:
|
|
2802
|
+
await Promise.all(o.flatMap(n).map(async (a) => {
|
|
2803
|
+
const { ops: c, id: l } = a, { remote: u, preloadConfig: f } = c, h = Z(u);
|
|
2640
2804
|
try {
|
|
2641
|
-
const { globalSnapshot:
|
|
2805
|
+
const { globalSnapshot: m, remoteSnapshot: d } = await t.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2642
2806
|
moduleInfo: u,
|
|
2643
2807
|
id: l,
|
|
2644
2808
|
initiator: "preloadRemote"
|
|
2645
2809
|
}), p = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2646
2810
|
origin: t,
|
|
2647
|
-
preloadOptions:
|
|
2811
|
+
preloadOptions: c,
|
|
2648
2812
|
remote: u,
|
|
2649
|
-
remoteInfo:
|
|
2650
|
-
globalSnapshot:
|
|
2813
|
+
remoteInfo: h,
|
|
2814
|
+
globalSnapshot: m,
|
|
2651
2815
|
remoteSnapshot: d
|
|
2652
2816
|
});
|
|
2653
2817
|
if (!p) return;
|
|
2654
|
-
const
|
|
2818
|
+
const y = await Kt(h, t, p, !0, {
|
|
2655
2819
|
initiator: "preloadRemote",
|
|
2656
2820
|
id: l
|
|
2657
|
-
});
|
|
2821
|
+
}, f.recordPreloadedAssets);
|
|
2658
2822
|
r.push({
|
|
2659
2823
|
remote: u,
|
|
2660
|
-
remoteInfo:
|
|
2824
|
+
remoteInfo: h,
|
|
2661
2825
|
preloadConfig: f,
|
|
2662
2826
|
id: l,
|
|
2663
|
-
results:
|
|
2827
|
+
results: y
|
|
2664
2828
|
});
|
|
2665
|
-
} catch (
|
|
2829
|
+
} catch (m) {
|
|
2666
2830
|
r.push({
|
|
2667
2831
|
remote: u,
|
|
2668
|
-
remoteInfo:
|
|
2832
|
+
remoteInfo: h,
|
|
2669
2833
|
preloadConfig: f,
|
|
2670
2834
|
id: l,
|
|
2671
2835
|
results: [{
|
|
2672
|
-
url:
|
|
2836
|
+
url: h.entry,
|
|
2673
2837
|
status: "error",
|
|
2674
|
-
resourceType: /\.json(?:$|[?#])/i.test(
|
|
2838
|
+
resourceType: /\.json(?:$|[?#])/i.test(h.entry) ? "manifest" : "remoteEntry",
|
|
2675
2839
|
initiator: "preloadRemote",
|
|
2676
2840
|
id: l,
|
|
2677
|
-
error:
|
|
2841
|
+
error: m
|
|
2678
2842
|
}]
|
|
2679
2843
|
});
|
|
2680
2844
|
}
|
|
2681
2845
|
}));
|
|
2682
|
-
const
|
|
2683
|
-
if (
|
|
2846
|
+
const i = r.flatMap((a) => a.results.filter((c) => c.status === "error" || c.status === "timeout"));
|
|
2847
|
+
if (i.length > 0 && (s = /* @__PURE__ */ new Error(`preloadRemote failed to load ${i.length} resource(s).`), Object.assign(s, {
|
|
2684
2848
|
results: r,
|
|
2685
|
-
failedResults:
|
|
2849
|
+
failedResults: i
|
|
2686
2850
|
})), await this.hooks.lifecycle.afterPreloadRemote.emit({
|
|
2687
2851
|
preloadOps: e,
|
|
2688
2852
|
options: t.options,
|
|
@@ -2698,9 +2862,9 @@ var Ko = class {
|
|
|
2698
2862
|
});
|
|
2699
2863
|
}
|
|
2700
2864
|
initRawContainer(e, t, r) {
|
|
2701
|
-
const { host: o } = this, n = new
|
|
2865
|
+
const { host: o } = this, n = new rt({
|
|
2702
2866
|
host: o,
|
|
2703
|
-
remoteInfo:
|
|
2867
|
+
remoteInfo: Z({
|
|
2704
2868
|
name: e,
|
|
2705
2869
|
entry: t
|
|
2706
2870
|
})
|
|
@@ -2716,186 +2880,187 @@ var Ko = class {
|
|
|
2716
2880
|
options: t.options,
|
|
2717
2881
|
origin: t
|
|
2718
2882
|
});
|
|
2719
|
-
} catch (
|
|
2883
|
+
} catch (m) {
|
|
2720
2884
|
if (o = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2721
2885
|
id: r,
|
|
2722
2886
|
options: t.options,
|
|
2723
2887
|
origin: t,
|
|
2724
2888
|
from: "runtime",
|
|
2725
|
-
error:
|
|
2889
|
+
error: m,
|
|
2726
2890
|
lifecycle: "beforeRequest"
|
|
2727
|
-
}), !o) throw
|
|
2891
|
+
}), !o) throw m;
|
|
2728
2892
|
}
|
|
2729
|
-
const { id: n } = o, s =
|
|
2893
|
+
const { id: n } = o, s = et(t.options.remotes, n);
|
|
2730
2894
|
if (!s) try {
|
|
2731
|
-
|
|
2895
|
+
I(Ct, M, {
|
|
2732
2896
|
hostName: t.options.name,
|
|
2733
2897
|
requestId: n
|
|
2734
|
-
}, void 0,
|
|
2735
|
-
} catch (
|
|
2898
|
+
}, void 0, D(t.options));
|
|
2899
|
+
} catch (m) {
|
|
2736
2900
|
throw await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
2737
2901
|
id: n,
|
|
2738
2902
|
options: t.options,
|
|
2739
|
-
error:
|
|
2903
|
+
error: m,
|
|
2740
2904
|
origin: t
|
|
2741
|
-
}),
|
|
2905
|
+
}), m;
|
|
2742
2906
|
}
|
|
2743
|
-
const { remote:
|
|
2907
|
+
const { remote: i } = s, a = Z(i);
|
|
2744
2908
|
await this.hooks.lifecycle.afterMatchRemote.emit({
|
|
2745
2909
|
id: n,
|
|
2746
2910
|
...s,
|
|
2747
2911
|
options: t.options,
|
|
2748
|
-
remoteInfo:
|
|
2912
|
+
remoteInfo: a,
|
|
2749
2913
|
origin: t
|
|
2750
2914
|
});
|
|
2751
|
-
const
|
|
2915
|
+
const c = await t.sharedHandler.hooks.lifecycle.afterResolve.emit({
|
|
2752
2916
|
id: n,
|
|
2753
2917
|
...s,
|
|
2754
2918
|
options: t.options,
|
|
2755
2919
|
origin: t,
|
|
2756
|
-
remoteInfo:
|
|
2757
|
-
}), { remote: l, expose: u } =
|
|
2758
|
-
|
|
2920
|
+
remoteInfo: a
|
|
2921
|
+
}), { remote: l, expose: u } = c;
|
|
2922
|
+
k(l && u, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${n}.`);
|
|
2759
2923
|
let f = t.moduleCache.get(l.name);
|
|
2760
|
-
const
|
|
2924
|
+
const h = {
|
|
2761
2925
|
host: t,
|
|
2762
|
-
remoteInfo:
|
|
2926
|
+
remoteInfo: a
|
|
2763
2927
|
};
|
|
2764
|
-
return f || (f = new
|
|
2928
|
+
return f || (f = new rt(h), t.moduleCache.set(l.name, f)), {
|
|
2765
2929
|
module: f,
|
|
2766
|
-
moduleOptions:
|
|
2767
|
-
remoteMatchInfo:
|
|
2930
|
+
moduleOptions: h,
|
|
2931
|
+
remoteMatchInfo: c
|
|
2768
2932
|
};
|
|
2769
2933
|
}
|
|
2770
2934
|
registerRemote(e, t, r) {
|
|
2771
2935
|
const { host: o } = this, n = () => {
|
|
2772
2936
|
if (e.alias) {
|
|
2773
|
-
const
|
|
2774
|
-
var
|
|
2775
|
-
return e.alias && (
|
|
2937
|
+
const i = t.find((a) => {
|
|
2938
|
+
var c;
|
|
2939
|
+
return e.alias && (a.name.startsWith(e.alias) || ((c = a.alias) == null ? void 0 : c.startsWith(e.alias)));
|
|
2776
2940
|
});
|
|
2777
|
-
|
|
2941
|
+
k(!i, `The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2778
2942
|
}
|
|
2779
|
-
"entry" in e &&
|
|
2943
|
+
"entry" in e && B && typeof window < "u" && !e.entry.startsWith("http") && (e.entry = new URL(e.entry, window.location.origin).href), e.shareScope || (e.shareScope = le), e.type || (e.type = At);
|
|
2780
2944
|
};
|
|
2781
2945
|
this.hooks.lifecycle.beforeRegisterRemote.emit({
|
|
2782
2946
|
remote: e,
|
|
2783
2947
|
origin: o
|
|
2784
2948
|
});
|
|
2785
|
-
const s = t.find((
|
|
2949
|
+
const s = t.find((i) => i.name === e.name);
|
|
2786
2950
|
if (!s)
|
|
2787
2951
|
n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2788
2952
|
remote: e,
|
|
2789
2953
|
origin: o
|
|
2790
2954
|
});
|
|
2791
2955
|
else {
|
|
2792
|
-
const
|
|
2956
|
+
const i = [`The remote "${e.name}" is already registered.`, "Please note that overriding it may cause unexpected errors."];
|
|
2793
2957
|
r != null && r.force && (this.removeRemote(s), n(), t.push(e), this.hooks.lifecycle.registerRemote.emit({
|
|
2794
2958
|
remote: e,
|
|
2795
2959
|
origin: o
|
|
2796
|
-
}),
|
|
2960
|
+
}), ct(i.join(" ")));
|
|
2797
2961
|
}
|
|
2798
2962
|
}
|
|
2799
2963
|
removeRemote(e) {
|
|
2800
2964
|
var t;
|
|
2801
2965
|
try {
|
|
2802
|
-
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((
|
|
2966
|
+
const { host: r } = this, { name: o } = e, n = r.options.remotes.findIndex((c) => c.name === o);
|
|
2803
2967
|
n !== -1 && r.options.remotes.splice(n, 1);
|
|
2804
|
-
const s =
|
|
2805
|
-
delete
|
|
2806
|
-
const { hostGlobalSnapshot:
|
|
2807
|
-
if (
|
|
2808
|
-
const
|
|
2809
|
-
|
|
2968
|
+
const s = V(T.__FEDERATION__.moduleInfo, ie(e)).key;
|
|
2969
|
+
delete T.__FEDERATION__.moduleInfo[s], "entry" in e && (r.snapshotHandler.manifestCache.delete(e.entry), delete we.__FEDERATION__.__MANIFEST_LOADING__[e.entry]);
|
|
2970
|
+
const { hostGlobalSnapshot: i } = Yt(e, r);
|
|
2971
|
+
if (i) {
|
|
2972
|
+
const c = i && "remotesInfo" in i && i.remotesInfo && V(i.remotesInfo, e.name).key;
|
|
2973
|
+
c && delete i.remotesInfo[c];
|
|
2810
2974
|
}
|
|
2811
|
-
const
|
|
2812
|
-
if (
|
|
2813
|
-
const
|
|
2814
|
-
|
|
2815
|
-
const u =
|
|
2816
|
-
|
|
2817
|
-
let f =
|
|
2818
|
-
const
|
|
2819
|
-
if (
|
|
2820
|
-
const
|
|
2821
|
-
f =
|
|
2822
|
-
const d =
|
|
2975
|
+
const a = r.moduleCache.get(e.name);
|
|
2976
|
+
if (a) {
|
|
2977
|
+
const c = a.remoteInfo, l = c.entryGlobalName;
|
|
2978
|
+
T[l] && ((t = Object.getOwnPropertyDescriptor(T, l)) != null && t.configurable ? delete T[l] : T[l] = void 0);
|
|
2979
|
+
const u = qt(a.remoteInfo);
|
|
2980
|
+
x[u] && delete x[u];
|
|
2981
|
+
let f = c.buildVersion ? at(c.name, c.buildVersion) : c.name;
|
|
2982
|
+
const h = T.__FEDERATION__.__INSTANCES__.findIndex((m) => c.buildVersion ? m.options.id === f : m.name === f);
|
|
2983
|
+
if (h !== -1) {
|
|
2984
|
+
const m = T.__FEDERATION__.__INSTANCES__[h];
|
|
2985
|
+
f = m.options.id || f;
|
|
2986
|
+
const d = Pt();
|
|
2823
2987
|
let p = !0;
|
|
2824
|
-
const
|
|
2825
|
-
Object.keys(d).forEach((
|
|
2826
|
-
const R = d[
|
|
2827
|
-
R && Object.keys(R).forEach((
|
|
2828
|
-
const _ = R[
|
|
2988
|
+
const y = [];
|
|
2989
|
+
Object.keys(d).forEach((g) => {
|
|
2990
|
+
const R = d[g];
|
|
2991
|
+
R && Object.keys(R).forEach((E) => {
|
|
2992
|
+
const _ = R[E];
|
|
2829
2993
|
_ && Object.keys(_).forEach((S) => {
|
|
2830
|
-
const
|
|
2831
|
-
|
|
2832
|
-
const
|
|
2833
|
-
|
|
2834
|
-
y,
|
|
2994
|
+
const b = _[S];
|
|
2995
|
+
b && Object.keys(b).forEach(($) => {
|
|
2996
|
+
const w = b[$];
|
|
2997
|
+
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([
|
|
2835
2998
|
g,
|
|
2999
|
+
E,
|
|
2836
3000
|
S,
|
|
2837
|
-
|
|
2838
|
-
])) :
|
|
2839
|
-
y,
|
|
3001
|
+
$
|
|
3002
|
+
])) : y.push([
|
|
2840
3003
|
g,
|
|
3004
|
+
E,
|
|
2841
3005
|
S,
|
|
2842
|
-
|
|
3006
|
+
$
|
|
2843
3007
|
]));
|
|
2844
3008
|
});
|
|
2845
3009
|
});
|
|
2846
3010
|
});
|
|
2847
|
-
}), p && (
|
|
2848
|
-
var S,
|
|
2849
|
-
(
|
|
2850
|
-
}),
|
|
3011
|
+
}), p && (m.shareScopeMap = {}, delete d[f]), y.forEach(([g, R, E, _]) => {
|
|
3012
|
+
var S, b, $;
|
|
3013
|
+
($ = (b = (S = d[g]) == null ? void 0 : S[R]) == null ? void 0 : b[E]) == null || delete $[_];
|
|
3014
|
+
}), T.__FEDERATION__.__INSTANCES__.splice(h, 1);
|
|
2851
3015
|
}
|
|
2852
3016
|
r.moduleCache.delete(e.name);
|
|
2853
3017
|
}
|
|
2854
3018
|
} catch (r) {
|
|
2855
|
-
|
|
3019
|
+
Ce.error(`removeRemote failed: ${r instanceof Error ? r.message : String(r)}`);
|
|
2856
3020
|
}
|
|
2857
3021
|
}
|
|
2858
3022
|
};
|
|
2859
|
-
const
|
|
2860
|
-
var
|
|
3023
|
+
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;
|
|
3024
|
+
var hn = class {
|
|
2861
3025
|
constructor(e) {
|
|
2862
3026
|
this.hooks = new H({
|
|
2863
|
-
beforeInit: new
|
|
2864
|
-
init: new
|
|
2865
|
-
beforeInitContainer: new
|
|
2866
|
-
initContainer: new
|
|
2867
|
-
}), this.version = "2.
|
|
2868
|
-
getModuleInfo: new
|
|
2869
|
-
createScript: new
|
|
2870
|
-
createLink: new
|
|
2871
|
-
fetch: new
|
|
2872
|
-
loadEntryError: new
|
|
2873
|
-
afterLoadEntry: new
|
|
2874
|
-
beforeInitRemote: new
|
|
2875
|
-
afterInitRemote: new
|
|
2876
|
-
beforeGetExpose: new
|
|
2877
|
-
afterGetExpose: new
|
|
2878
|
-
beforeExecuteFactory: new
|
|
2879
|
-
afterExecuteFactory: new
|
|
2880
|
-
getModuleFactory: new
|
|
3027
|
+
beforeInit: new Y("beforeInit"),
|
|
3028
|
+
init: new N(),
|
|
3029
|
+
beforeInitContainer: new F("beforeInitContainer"),
|
|
3030
|
+
initContainer: new F("initContainer")
|
|
3031
|
+
}), this.version = "2.9.1", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new H({
|
|
3032
|
+
getModuleInfo: new N(),
|
|
3033
|
+
createScript: new N(),
|
|
3034
|
+
createLink: new N(),
|
|
3035
|
+
fetch: new v(),
|
|
3036
|
+
loadEntryError: new v(),
|
|
3037
|
+
afterLoadEntry: new v("afterLoadEntry"),
|
|
3038
|
+
beforeInitRemote: new v("beforeInitRemote"),
|
|
3039
|
+
afterInitRemote: new v("afterInitRemote"),
|
|
3040
|
+
beforeGetExpose: new v("beforeGetExpose"),
|
|
3041
|
+
afterGetExpose: new v("afterGetExpose"),
|
|
3042
|
+
beforeExecuteFactory: new v("beforeExecuteFactory"),
|
|
3043
|
+
afterExecuteFactory: new v("afterExecuteFactory"),
|
|
3044
|
+
getModuleFactory: new v()
|
|
2881
3045
|
}), this.bridgeHook = new H({
|
|
2882
|
-
beforeBridgeRender: new
|
|
2883
|
-
afterBridgeRender: new
|
|
2884
|
-
beforeBridgeDestroy: new
|
|
2885
|
-
afterBridgeDestroy: new
|
|
3046
|
+
beforeBridgeRender: new N(),
|
|
3047
|
+
afterBridgeRender: new N(),
|
|
3048
|
+
beforeBridgeDestroy: new N(),
|
|
3049
|
+
afterBridgeDestroy: new N(),
|
|
3050
|
+
afterBridgeRouteSync: new N()
|
|
2886
3051
|
});
|
|
2887
|
-
const t =
|
|
2888
|
-
id:
|
|
3052
|
+
const t = Me && fn ? [tn(), nn()] : [], r = {
|
|
3053
|
+
id: Wo(),
|
|
2889
3054
|
name: e.name,
|
|
2890
3055
|
plugins: t,
|
|
2891
3056
|
remotes: [],
|
|
2892
3057
|
shared: {},
|
|
2893
|
-
inBrowser:
|
|
3058
|
+
inBrowser: B
|
|
2894
3059
|
};
|
|
2895
|
-
this.name = e.name, this.options = r, this.snapshotHandler =
|
|
3060
|
+
this.name = e.name, this.options = r, this.snapshotHandler = Me ? new sn(this) : new an(), this.sharedHandler = ot ? new cn(this) : new ln(), this.remoteHandler = Me ? new un(this) : new en(), this.shareScopeMap = this.sharedHandler.shareScopeMap, this.registerPlugins([...r.plugins, ...e.plugins || []]), this.options = this.formatOptions(r, e);
|
|
2896
3061
|
}
|
|
2897
3062
|
initOptions(e) {
|
|
2898
|
-
e.name && e.name !== this.options.name &&
|
|
3063
|
+
e.name && e.name !== this.options.name && I(gt(Ft, M)), this.registerPlugins(e.plugins);
|
|
2899
3064
|
const t = this.formatOptions(this.options, e);
|
|
2900
3065
|
return this.options = t, t;
|
|
2901
3066
|
}
|
|
@@ -2905,7 +3070,7 @@ var en = class {
|
|
|
2905
3070
|
loadShareSync(e, t) {
|
|
2906
3071
|
return this.sharedHandler.loadShareSync(e, t);
|
|
2907
3072
|
}
|
|
2908
|
-
initializeSharing(e =
|
|
3073
|
+
initializeSharing(e = le, t) {
|
|
2909
3074
|
return this.sharedHandler.initializeSharing(e, t);
|
|
2910
3075
|
}
|
|
2911
3076
|
initRawContainer(e, t, r) {
|
|
@@ -2921,31 +3086,30 @@ var en = class {
|
|
|
2921
3086
|
this.sharedHandler.initShareScopeMap(e, t, r);
|
|
2922
3087
|
}
|
|
2923
3088
|
formatOptions(e, t) {
|
|
2924
|
-
const r =
|
|
3089
|
+
const r = ot ? Mt(e, t).allShareInfos : {}, { userOptions: o, options: n } = this.hooks.lifecycle.beforeInit.emit({
|
|
2925
3090
|
origin: this,
|
|
2926
3091
|
userOptions: t,
|
|
2927
3092
|
options: e,
|
|
2928
3093
|
shareInfo: r
|
|
2929
|
-
}), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos:
|
|
3094
|
+
}), s = this.remoteHandler.formatAndRegisterRemote(n, o), { allShareInfos: i } = this.sharedHandler.registerShared(n, o), a = [...n.plugins];
|
|
2930
3095
|
o.plugins && o.plugins.forEach((l) => {
|
|
2931
|
-
|
|
3096
|
+
a.includes(l) || a.push(l);
|
|
2932
3097
|
});
|
|
2933
|
-
const
|
|
3098
|
+
const c = {
|
|
2934
3099
|
...e,
|
|
2935
3100
|
...t,
|
|
2936
|
-
plugins:
|
|
3101
|
+
plugins: a,
|
|
2937
3102
|
remotes: s,
|
|
2938
|
-
shared:
|
|
3103
|
+
shared: i,
|
|
2939
3104
|
id: o.id || e.id
|
|
2940
3105
|
};
|
|
2941
3106
|
return this.hooks.lifecycle.init.emit({
|
|
2942
3107
|
origin: this,
|
|
2943
|
-
options:
|
|
2944
|
-
}),
|
|
3108
|
+
options: c
|
|
3109
|
+
}), c;
|
|
2945
3110
|
}
|
|
2946
3111
|
registerPlugins(e) {
|
|
2947
|
-
|
|
2948
|
-
this.options.plugins = this.options.plugins.reduce((r, o) => (o && r && !r.find((n) => n.name === o.name) && r.push(o), r), t || []);
|
|
3112
|
+
this.options.plugins = qo(e, this);
|
|
2949
3113
|
}
|
|
2950
3114
|
registerRemotes(e, t) {
|
|
2951
3115
|
return this.remoteHandler.registerRemotes(e, t);
|
|
@@ -2957,12 +3121,12 @@ var en = class {
|
|
|
2957
3121
|
});
|
|
2958
3122
|
}
|
|
2959
3123
|
};
|
|
2960
|
-
let
|
|
2961
|
-
function
|
|
2962
|
-
return
|
|
3124
|
+
let dn = null;
|
|
3125
|
+
function Qt(e) {
|
|
3126
|
+
return dn;
|
|
2963
3127
|
}
|
|
2964
|
-
|
|
2965
|
-
function
|
|
3128
|
+
qr(hn);
|
|
3129
|
+
function er(e, t) {
|
|
2966
3130
|
const r = (o) => {
|
|
2967
3131
|
if (!o.startsWith("/")) return o;
|
|
2968
3132
|
const n = o.length > 1 && o.endsWith("/"), s = `${t}/${o}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
@@ -2976,109 +3140,146 @@ function Zt(e, t) {
|
|
|
2976
3140
|
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 = {
|
|
2977
3141
|
...o.redirect,
|
|
2978
3142
|
path: r(o.redirect.path)
|
|
2979
|
-
}), o.children && o.children.length > 0 && (n.children =
|
|
3143
|
+
}), o.children && o.children.length > 0 && (n.children = er(
|
|
2980
3144
|
o.children,
|
|
2981
3145
|
t
|
|
2982
3146
|
)), n;
|
|
2983
3147
|
});
|
|
2984
3148
|
}
|
|
2985
|
-
function
|
|
3149
|
+
function mn(e) {
|
|
2986
3150
|
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;
|
|
2987
3151
|
return (s) => {
|
|
2988
|
-
const
|
|
2989
|
-
s.push = (l) =>
|
|
3152
|
+
const i = s.push.bind(s), a = s.replace.bind(s), c = s.resolve.bind(s);
|
|
3153
|
+
s.push = (l) => i(n(l)), s.replace = (l) => a(n(l)), s.resolve = (l, ...u) => c(n(l), ...u);
|
|
2990
3154
|
};
|
|
2991
3155
|
}
|
|
2992
|
-
function
|
|
3156
|
+
function pn(e) {
|
|
2993
3157
|
const { router: t, basename: r, memoryRoute: o, hashRoute: n } = e, s = t.getRoutes().sort(
|
|
2994
|
-
(
|
|
2995
|
-
),
|
|
2996
|
-
s.forEach((
|
|
2997
|
-
const d =
|
|
2998
|
-
d.push(
|
|
3158
|
+
(m, d) => m.path.split("/").filter((p) => p).length - d.path.split("/").filter((p) => p).length
|
|
3159
|
+
), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
|
|
3160
|
+
s.forEach((m) => {
|
|
3161
|
+
const d = i.get(m.path) || [];
|
|
3162
|
+
d.push(m), i.set(m.path, d);
|
|
2999
3163
|
});
|
|
3000
|
-
const
|
|
3001
|
-
if (!
|
|
3002
|
-
return
|
|
3003
|
-
for (let p = 0; p <
|
|
3004
|
-
const
|
|
3005
|
-
(_) => !
|
|
3164
|
+
const c = (m, d) => `${m}/${d}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/", l = (m, d = "") => {
|
|
3165
|
+
if (!m.children || m.children.length === 0)
|
|
3166
|
+
return m;
|
|
3167
|
+
for (let p = 0; p < m.children.length; p++) {
|
|
3168
|
+
const y = m.children[p], g = c(d, y.path), E = (i.get(g) || []).find(
|
|
3169
|
+
(_) => !a.has(_) && _ !== m && (y.name == null || _.name === y.name)
|
|
3006
3170
|
);
|
|
3007
|
-
if (
|
|
3171
|
+
if (E) {
|
|
3008
3172
|
const _ = {
|
|
3009
|
-
...
|
|
3010
|
-
path:
|
|
3173
|
+
...E,
|
|
3174
|
+
path: y.path
|
|
3011
3175
|
// Keep the original relative path from static route
|
|
3012
3176
|
};
|
|
3013
|
-
|
|
3177
|
+
m.children[p] = _, a.add(E), l(_, g);
|
|
3014
3178
|
}
|
|
3015
3179
|
}
|
|
3016
|
-
return
|
|
3180
|
+
return m;
|
|
3017
3181
|
};
|
|
3018
3182
|
let u = [];
|
|
3019
|
-
for (const
|
|
3020
|
-
if (!
|
|
3021
|
-
const d = l(
|
|
3022
|
-
|
|
3183
|
+
for (const m of s)
|
|
3184
|
+
if (!a.has(m)) {
|
|
3185
|
+
const d = l(m, m.path);
|
|
3186
|
+
a.add(m), u.push(d);
|
|
3023
3187
|
}
|
|
3024
|
-
let f,
|
|
3025
|
-
return o ? f =
|
|
3188
|
+
let f, h;
|
|
3189
|
+
return o ? f = pe.createMemoryHistory(r) : n ? (f = pe.createWebHashHistory(), r && (u = er(u, r), h = mn(r))) : f = pe.createWebHistory(r), { history: f, routes: u, patchRouter: h };
|
|
3026
3190
|
}
|
|
3027
|
-
function
|
|
3028
|
-
const t = /* @__PURE__ */ new Map(), r =
|
|
3191
|
+
function Sn(e) {
|
|
3192
|
+
const t = /* @__PURE__ */ new Map(), r = Qt();
|
|
3029
3193
|
return () => ({
|
|
3030
|
-
__APP_VERSION__: "2.
|
|
3194
|
+
__APP_VERSION__: "2.9.1",
|
|
3031
3195
|
async render(o) {
|
|
3032
|
-
var
|
|
3196
|
+
var p, y, g, R, E, _, S, b, $;
|
|
3033
3197
|
C.debug("createBridgeComponent render Info", o);
|
|
3034
3198
|
const {
|
|
3035
3199
|
moduleName: n,
|
|
3036
3200
|
dom: s,
|
|
3037
|
-
basename:
|
|
3038
|
-
memoryRoute:
|
|
3039
|
-
hashRoute:
|
|
3201
|
+
basename: i,
|
|
3202
|
+
memoryRoute: a,
|
|
3203
|
+
hashRoute: c,
|
|
3040
3204
|
...l
|
|
3041
|
-
} = o, u =
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3205
|
+
} = o, u = {
|
|
3206
|
+
side: "producer",
|
|
3207
|
+
framework: "vue",
|
|
3208
|
+
operation: t.has(s) ? "update" : "render",
|
|
3209
|
+
reason: "direct"
|
|
3210
|
+
}, f = nr.createApp(e.rootComponent, l);
|
|
3211
|
+
t.set(s, f);
|
|
3212
|
+
const h = await ((g = (y = (p = r == null ? void 0 : r.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : y.beforeBridgeRender) == null ? void 0 : g.emit(
|
|
3213
|
+
o,
|
|
3214
|
+
u
|
|
3215
|
+
)), m = h && typeof h == "object" && (h != null && h.extraProps) ? h == null ? void 0 : h.extraProps : {}, d = e.appOptions({
|
|
3216
|
+
app: f,
|
|
3217
|
+
basename: i,
|
|
3218
|
+
memoryRoute: a,
|
|
3219
|
+
hashRoute: c,
|
|
3048
3220
|
...l,
|
|
3049
3221
|
...m
|
|
3050
3222
|
});
|
|
3051
|
-
if (
|
|
3052
|
-
const { history:
|
|
3053
|
-
router:
|
|
3223
|
+
if (d != null && d.router) {
|
|
3224
|
+
const { history: w, routes: P, patchRouter: q } = pn({
|
|
3225
|
+
router: d.router,
|
|
3054
3226
|
basename: o.basename,
|
|
3055
3227
|
memoryRoute: o.memoryRoute,
|
|
3056
3228
|
hashRoute: o.hashRoute
|
|
3057
|
-
}),
|
|
3058
|
-
...
|
|
3059
|
-
history:
|
|
3060
|
-
routes:
|
|
3229
|
+
}), ee = pe.createRouter({
|
|
3230
|
+
...d.router.options,
|
|
3231
|
+
history: w,
|
|
3232
|
+
routes: P
|
|
3061
3233
|
});
|
|
3062
|
-
|
|
3234
|
+
if (q && q(ee), d.afterRouterCreate && d.afterRouterCreate(ee), C.debug("createBridgeComponent render router info>>>", {
|
|
3063
3235
|
moduleName: n,
|
|
3064
|
-
router:
|
|
3065
|
-
}),
|
|
3236
|
+
router: ee
|
|
3237
|
+
}), a) {
|
|
3238
|
+
const tr = {
|
|
3239
|
+
action: "memory-route-init",
|
|
3240
|
+
to: a.entryPath,
|
|
3241
|
+
basename: i
|
|
3242
|
+
}, rr = {
|
|
3243
|
+
side: "producer",
|
|
3244
|
+
framework: "vue",
|
|
3245
|
+
operation: "route-sync",
|
|
3246
|
+
moduleName: n,
|
|
3247
|
+
route: tr
|
|
3248
|
+
}, or = await ee.push(a.entryPath);
|
|
3249
|
+
(_ = (E = (R = r == null ? void 0 : r.bridgeHook) == null ? void 0 : R.lifecycle) == null ? void 0 : E.afterBridgeRouteSync) == null || _.emit({
|
|
3250
|
+
context: rr,
|
|
3251
|
+
result: or
|
|
3252
|
+
});
|
|
3253
|
+
}
|
|
3254
|
+
f.use(ee);
|
|
3066
3255
|
}
|
|
3067
|
-
|
|
3256
|
+
f.mount(s), ($ = (b = (S = r == null ? void 0 : r.bridgeHook) == null ? void 0 : S.lifecycle) == null ? void 0 : b.afterBridgeRender) == null || $.emit(o, {
|
|
3257
|
+
context: u
|
|
3258
|
+
});
|
|
3068
3259
|
},
|
|
3069
3260
|
destroy(o) {
|
|
3070
|
-
var
|
|
3261
|
+
var i, a, c, l, u, f;
|
|
3071
3262
|
C.debug("createBridgeComponent destroy Info", o);
|
|
3072
|
-
const n = t.get(o == null ? void 0 : o.dom)
|
|
3073
|
-
|
|
3263
|
+
const n = t.get(o == null ? void 0 : o.dom), s = {
|
|
3264
|
+
side: "producer",
|
|
3265
|
+
framework: "vue",
|
|
3266
|
+
operation: "destroy",
|
|
3267
|
+
reason: "direct"
|
|
3268
|
+
};
|
|
3269
|
+
(c = (a = (i = r == null ? void 0 : r.bridgeHook) == null ? void 0 : i.lifecycle) == null ? void 0 : a.beforeBridgeDestroy) == null || c.emit(
|
|
3270
|
+
o,
|
|
3271
|
+
s
|
|
3272
|
+
), 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, {
|
|
3273
|
+
context: s
|
|
3274
|
+
});
|
|
3074
3275
|
}
|
|
3075
3276
|
});
|
|
3076
3277
|
}
|
|
3077
|
-
function
|
|
3278
|
+
function yn() {
|
|
3078
3279
|
const e = new PopStateEvent("popstate", { state: window.history.state });
|
|
3079
3280
|
window.dispatchEvent(e);
|
|
3080
3281
|
}
|
|
3081
|
-
const
|
|
3282
|
+
const En = /* @__PURE__ */ sr({
|
|
3082
3283
|
name: "RemoteApp",
|
|
3083
3284
|
props: {
|
|
3084
3285
|
moduleName: String,
|
|
@@ -3090,17 +3291,17 @@ const sn = /* @__PURE__ */ Yt({
|
|
|
3090
3291
|
},
|
|
3091
3292
|
inheritAttrs: !1,
|
|
3092
3293
|
setup(e) {
|
|
3093
|
-
const t =
|
|
3294
|
+
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 = () => ({
|
|
3094
3295
|
name: e.moduleName,
|
|
3095
3296
|
dom: t.value,
|
|
3096
3297
|
basename: e.basename,
|
|
3097
3298
|
memoryRoute: e.memoryRoute,
|
|
3098
3299
|
hashRoute: e.hashRoute
|
|
3099
3300
|
}), f = async () => {
|
|
3100
|
-
var
|
|
3301
|
+
var R, E, _, S, b, $, w;
|
|
3101
3302
|
if (!t.value || n.value)
|
|
3102
3303
|
return;
|
|
3103
|
-
const d = (
|
|
3304
|
+
const d = (R = e.providerInfo) == null ? void 0 : R.call(e);
|
|
3104
3305
|
r.value = d;
|
|
3105
3306
|
let p = {
|
|
3106
3307
|
...l,
|
|
@@ -3111,53 +3312,86 @@ const sn = /* @__PURE__ */ Yt({
|
|
|
3111
3312
|
hashRoute: e.hashRoute
|
|
3112
3313
|
};
|
|
3113
3314
|
C.debug("createRemoteAppComponent LazyComponent render >>>", p);
|
|
3114
|
-
const
|
|
3315
|
+
const y = {
|
|
3316
|
+
side: "consumer",
|
|
3317
|
+
framework: "vue",
|
|
3318
|
+
operation: "render"
|
|
3319
|
+
}, 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)) || {};
|
|
3115
3320
|
p = {
|
|
3116
3321
|
...p,
|
|
3117
|
-
...
|
|
3118
|
-
}, d.render(p), n.value = !0, (w = (
|
|
3119
|
-
|
|
3120
|
-
|
|
3322
|
+
...g.extraProps
|
|
3323
|
+
}, d.render(p), n.value = !0, (w = ($ = (b = c == null ? void 0 : c.bridgeHook) == null ? void 0 : b.lifecycle) == null ? void 0 : $.afterBridgeRender) == null || w.emit(p, {
|
|
3324
|
+
context: y
|
|
3325
|
+
});
|
|
3326
|
+
}, h = () => {
|
|
3327
|
+
var g, R, E, _, S, b;
|
|
3121
3328
|
const d = r.value;
|
|
3122
3329
|
if (!d || !n.value)
|
|
3123
3330
|
return;
|
|
3124
3331
|
C.debug("createRemoteAppComponent LazyComponent destroy >>>", {
|
|
3125
3332
|
...e
|
|
3126
3333
|
});
|
|
3127
|
-
const p = u()
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
}),
|
|
3334
|
+
const p = u(), y = {
|
|
3335
|
+
side: "consumer",
|
|
3336
|
+
framework: "vue",
|
|
3337
|
+
operation: "destroy"
|
|
3338
|
+
};
|
|
3339
|
+
(E = (R = (g = c == null ? void 0 : c.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : R.beforeBridgeDestroy) == null || E.emit(p, y), d.destroy({
|
|
3340
|
+
dom: t.value,
|
|
3341
|
+
moduleName: e.moduleName
|
|
3342
|
+
}), r.value = null, n.value = !1, (b = (S = (_ = c == null ? void 0 : c.bridgeHook) == null ? void 0 : _.lifecycle) == null ? void 0 : S.afterBridgeDestroy) == null || b.emit(p, {
|
|
3343
|
+
context: y
|
|
3344
|
+
});
|
|
3345
|
+
}, m = ar(() => a == null ? void 0 : a.path, (d) => {
|
|
3346
|
+
var p, y, g;
|
|
3347
|
+
if (s.value && o.value !== "" && o.value !== d) {
|
|
3348
|
+
C.debug("createRemoteAppComponent dispatchPopstateEnv >>>", {
|
|
3349
|
+
...e,
|
|
3350
|
+
pathname: a.path
|
|
3351
|
+
});
|
|
3352
|
+
const R = {
|
|
3353
|
+
action: "host-to-remote",
|
|
3354
|
+
mechanism: "popstate",
|
|
3355
|
+
from: o.value,
|
|
3356
|
+
to: d,
|
|
3357
|
+
basename: e.basename
|
|
3358
|
+
}, E = {
|
|
3359
|
+
side: "consumer",
|
|
3360
|
+
framework: "vue",
|
|
3361
|
+
operation: "route-sync",
|
|
3362
|
+
moduleName: e.moduleName,
|
|
3363
|
+
route: R
|
|
3364
|
+
};
|
|
3365
|
+
yn(), (g = (y = (p = c == null ? void 0 : c.bridgeHook) == null ? void 0 : p.lifecycle) == null ? void 0 : y.afterBridgeRouteSync) == null || g.emit({
|
|
3366
|
+
context: E
|
|
3367
|
+
});
|
|
3368
|
+
}
|
|
3369
|
+
o.value = d;
|
|
3136
3370
|
});
|
|
3137
|
-
return
|
|
3371
|
+
return cr(() => {
|
|
3138
3372
|
s.value = !0, f();
|
|
3139
|
-
}),
|
|
3140
|
-
s.value = !0,
|
|
3141
|
-
}),
|
|
3142
|
-
s.value = !1,
|
|
3143
|
-
}),
|
|
3144
|
-
|
|
3145
|
-
}), () =>
|
|
3373
|
+
}), lr(async () => {
|
|
3374
|
+
s.value = !0, i.value && (i.value = !1, await ur(), f());
|
|
3375
|
+
}), fr(() => {
|
|
3376
|
+
s.value = !1, i.value = !0, h();
|
|
3377
|
+
}), hr(() => {
|
|
3378
|
+
m(), h();
|
|
3379
|
+
}), () => dr("div", mr(e.rootAttrs || {}, {
|
|
3146
3380
|
ref: t
|
|
3147
3381
|
}), null);
|
|
3148
3382
|
}
|
|
3149
3383
|
});
|
|
3150
|
-
function
|
|
3151
|
-
return
|
|
3384
|
+
function gn(e) {
|
|
3385
|
+
return pr({
|
|
3152
3386
|
// @ts-ignore
|
|
3153
|
-
__APP_VERSION__: "2.
|
|
3387
|
+
__APP_VERSION__: "2.9.1",
|
|
3154
3388
|
...e.asyncComponentOptions,
|
|
3155
3389
|
//@ts-ignore
|
|
3156
3390
|
loader: async () => {
|
|
3157
|
-
var
|
|
3158
|
-
const t =
|
|
3391
|
+
var c, l;
|
|
3392
|
+
const t = nt();
|
|
3159
3393
|
let r = "/";
|
|
3160
|
-
const o = (l = (
|
|
3394
|
+
const o = (l = (c = t == null ? void 0 : t.matched) == null ? void 0 : c[0]) == null ? void 0 : l.path;
|
|
3161
3395
|
o && (o.endsWith("/:pathMatch(.*)*") ? r = o.replace("/:pathMatch(.*)*", "") : r = t.matched[0].path);
|
|
3162
3396
|
const n = (e == null ? void 0 : e.export) || "default";
|
|
3163
3397
|
C.debug(
|
|
@@ -3167,16 +3401,16 @@ function an(e) {
|
|
|
3167
3401
|
info: e
|
|
3168
3402
|
}
|
|
3169
3403
|
);
|
|
3170
|
-
const s = await e.loader(),
|
|
3404
|
+
const s = await e.loader(), i = s && s[Symbol.for("mf_module_id")], a = s[n];
|
|
3171
3405
|
if (C.debug(
|
|
3172
3406
|
"createRemoteAppComponent LazyComponent loadRemote info >>>",
|
|
3173
|
-
{ moduleName:
|
|
3174
|
-
), n in s && typeof
|
|
3407
|
+
{ moduleName: i, module: s, exportName: n, basename: r, route: t }
|
|
3408
|
+
), n in s && typeof a == "function")
|
|
3175
3409
|
return {
|
|
3176
3410
|
render() {
|
|
3177
|
-
return
|
|
3178
|
-
moduleName:
|
|
3179
|
-
providerInfo:
|
|
3411
|
+
return yr(En, {
|
|
3412
|
+
moduleName: i,
|
|
3413
|
+
providerInfo: a,
|
|
3180
3414
|
basename: r,
|
|
3181
3415
|
rootAttrs: e.rootAttrs,
|
|
3182
3416
|
memoryRoute: e.memoryRoute,
|
|
@@ -3188,13 +3422,13 @@ function an(e) {
|
|
|
3188
3422
|
}
|
|
3189
3423
|
});
|
|
3190
3424
|
}
|
|
3191
|
-
function
|
|
3425
|
+
function bn(e) {
|
|
3192
3426
|
return C.warn(
|
|
3193
3427
|
"createRemoteComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
3194
|
-
),
|
|
3428
|
+
), gn(e);
|
|
3195
3429
|
}
|
|
3196
3430
|
export {
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3431
|
+
Sn as createBridgeComponent,
|
|
3432
|
+
gn as createRemoteAppComponent,
|
|
3433
|
+
bn as createRemoteComponent
|
|
3200
3434
|
};
|