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