@module-federation/bridge-vue3 0.0.0-next-20250708134245 → 0.0.0-next-20250709032753
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 +6 -8
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +0 -10
- package/dist/index.js +882 -883
- package/package.json +4 -4
- package/src/create.ts +6 -24
- package/src/index.ts +1 -1
- package/src/remoteApp.tsx +5 -8
package/dist/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import * as VueRouter from "vue-router";
|
|
|
4
4
|
import { useRoute } from "vue-router";
|
|
5
5
|
function _extends$2() {
|
|
6
6
|
return _extends$2 = Object.assign || function(t) {
|
|
7
|
-
for (var
|
|
8
|
-
var r = arguments[
|
|
7
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
8
|
+
var r = arguments[o];
|
|
9
9
|
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
@@ -16,8 +16,8 @@ function isBrowserEnv() {
|
|
|
16
16
|
return typeof window < "u" && typeof window.document < "u";
|
|
17
17
|
}
|
|
18
18
|
function isReactNativeEnv() {
|
|
19
|
-
var
|
|
20
|
-
return typeof navigator < "u" && ((
|
|
19
|
+
var n;
|
|
20
|
+
return typeof navigator < "u" && ((n = navigator) == null ? void 0 : n.product) === "ReactNative";
|
|
21
21
|
}
|
|
22
22
|
function isBrowserDebug() {
|
|
23
23
|
try {
|
|
@@ -31,25 +31,25 @@ function isBrowserDebug() {
|
|
|
31
31
|
function isDebugMode() {
|
|
32
32
|
return typeof process < "u" && process.env && process.env.FEDERATION_DEBUG ? !!process.env.FEDERATION_DEBUG : typeof FEDERATION_DEBUG < "u" && FEDERATION_DEBUG ? !0 : isBrowserDebug();
|
|
33
33
|
}
|
|
34
|
-
const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...
|
|
35
|
-
return
|
|
36
|
-
}, getResourceUrl = (
|
|
37
|
-
if ("getPublicPath" in
|
|
38
|
-
let
|
|
39
|
-
return
|
|
40
|
-
} else return "publicPath" in
|
|
41
|
-
}, warn$1 = (
|
|
42
|
-
console.warn(`${LOG_CATEGORY$1}: ${
|
|
34
|
+
const LOG_CATEGORY$1 = "[ Federation Runtime ]", composeKeyWithSeparator = function(...n) {
|
|
35
|
+
return n.length ? n.reduce((t, o) => o ? t ? `${t}${SEPARATOR}${o}` : o : t, "") : "";
|
|
36
|
+
}, getResourceUrl = (n, t) => {
|
|
37
|
+
if ("getPublicPath" in n) {
|
|
38
|
+
let o;
|
|
39
|
+
return n.getPublicPath.startsWith("function") ? o = new Function("return " + n.getPublicPath)()() : o = new Function(n.getPublicPath)(), `${o}${t}`;
|
|
40
|
+
} else return "publicPath" in n ? !isBrowserEnv() && !isReactNativeEnv() && "ssrPublicPath" in n ? `${n.ssrPublicPath}${t}` : `${n.publicPath}${t}` : (console.warn("Cannot get resource URL. If in debug mode, please ignore.", n, t), "");
|
|
41
|
+
}, warn$1 = (n) => {
|
|
42
|
+
console.warn(`${LOG_CATEGORY$1}: ${n}`);
|
|
43
43
|
};
|
|
44
|
-
function safeToString(
|
|
44
|
+
function safeToString(n) {
|
|
45
45
|
try {
|
|
46
|
-
return JSON.stringify(
|
|
46
|
+
return JSON.stringify(n, null, 2);
|
|
47
47
|
} catch {
|
|
48
48
|
return "";
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
const simpleJoinRemoteEntry = (
|
|
52
|
-
if (!
|
|
51
|
+
const simpleJoinRemoteEntry = (n, t) => {
|
|
52
|
+
if (!n)
|
|
53
53
|
return t;
|
|
54
54
|
const r = ((s) => {
|
|
55
55
|
if (s === ".")
|
|
@@ -57,37 +57,37 @@ const simpleJoinRemoteEntry = (o, t) => {
|
|
|
57
57
|
if (s.startsWith("./"))
|
|
58
58
|
return s.replace("./", "");
|
|
59
59
|
if (s.startsWith("/")) {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
60
|
+
const a = s.slice(1);
|
|
61
|
+
return a.endsWith("/") ? a.slice(0, -1) : a;
|
|
62
62
|
}
|
|
63
63
|
return s;
|
|
64
|
-
})(
|
|
64
|
+
})(n);
|
|
65
65
|
return r ? r.endsWith("/") ? `${r}${t}` : `${r}/${t}` : t;
|
|
66
66
|
};
|
|
67
|
-
function inferAutoPublicPath(
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
function generateSnapshotFromManifest(
|
|
71
|
-
var
|
|
72
|
-
const { remotes: s = {}, overrides:
|
|
73
|
-
let
|
|
74
|
-
const c = () => "publicPath" in
|
|
67
|
+
function inferAutoPublicPath(n) {
|
|
68
|
+
return n.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
69
|
+
}
|
|
70
|
+
function generateSnapshotFromManifest(n, t = {}) {
|
|
71
|
+
var o, r;
|
|
72
|
+
const { remotes: s = {}, overrides: a = {}, version: l } = t;
|
|
73
|
+
let i;
|
|
74
|
+
const c = () => "publicPath" in n.metaData ? n.metaData.publicPath === "auto" && l ? inferAutoPublicPath(l) : n.metaData.publicPath : n.metaData.getPublicPath, u = Object.keys(a);
|
|
75
75
|
let p = {};
|
|
76
76
|
if (!Object.keys(s).length) {
|
|
77
77
|
var d;
|
|
78
|
-
p = ((d =
|
|
78
|
+
p = ((d = n.remotes) == null ? void 0 : d.reduce((R, A) => {
|
|
79
79
|
let T;
|
|
80
80
|
const $ = A.federationContainerName;
|
|
81
|
-
return u.includes($) ? T =
|
|
81
|
+
return u.includes($) ? T = a[$] : "version" in A ? T = A.version : T = A.entry, R[$] = {
|
|
82
82
|
matchedVersion: T
|
|
83
83
|
}, R;
|
|
84
84
|
}, {})) || {};
|
|
85
85
|
}
|
|
86
86
|
Object.keys(s).forEach((R) => p[R] = {
|
|
87
87
|
// overrides will override dependencies
|
|
88
|
-
matchedVersion: u.includes(R) ?
|
|
88
|
+
matchedVersion: u.includes(R) ? a[R] : s[R]
|
|
89
89
|
});
|
|
90
|
-
const { remoteEntry: { path: m, name: y, type: g }, types: E, buildInfo: { buildVersion: _ }, globalName: b, ssrRemoteEntry: v } =
|
|
90
|
+
const { remoteEntry: { path: m, name: y, type: g }, types: E, buildInfo: { buildVersion: _ }, globalName: b, ssrRemoteEntry: v } = n.metaData, { exposes: I } = n;
|
|
91
91
|
let S = {
|
|
92
92
|
version: l || "",
|
|
93
93
|
buildVersion: _,
|
|
@@ -98,7 +98,7 @@ function generateSnapshotFromManifest(o, t = {}) {
|
|
|
98
98
|
remoteTypesZip: E.zip || "",
|
|
99
99
|
remoteTypesAPI: E.api || "",
|
|
100
100
|
remotesInfo: p,
|
|
101
|
-
shared:
|
|
101
|
+
shared: n == null ? void 0 : n.shared.map((R) => ({
|
|
102
102
|
assets: R.assets,
|
|
103
103
|
sharedName: R.name,
|
|
104
104
|
version: R.version
|
|
@@ -109,32 +109,32 @@ function generateSnapshotFromManifest(o, t = {}) {
|
|
|
109
109
|
assets: R.assets
|
|
110
110
|
}))
|
|
111
111
|
};
|
|
112
|
-
if ((
|
|
113
|
-
const R =
|
|
112
|
+
if ((o = n.metaData) != null && o.prefetchInterface) {
|
|
113
|
+
const R = n.metaData.prefetchInterface;
|
|
114
114
|
S = _extends$2({}, S, {
|
|
115
115
|
prefetchInterface: R
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
if ((r =
|
|
119
|
-
const { path: R, name: A, type: T } =
|
|
118
|
+
if ((r = n.metaData) != null && r.prefetchEntry) {
|
|
119
|
+
const { path: R, name: A, type: T } = n.metaData.prefetchEntry;
|
|
120
120
|
S = _extends$2({}, S, {
|
|
121
121
|
prefetchEntry: simpleJoinRemoteEntry(R, A),
|
|
122
122
|
prefetchEntryType: T
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
|
-
if ("publicPath" in
|
|
125
|
+
if ("publicPath" in n.metaData ? i = _extends$2({}, S, {
|
|
126
126
|
publicPath: c(),
|
|
127
|
-
ssrPublicPath:
|
|
128
|
-
}) :
|
|
127
|
+
ssrPublicPath: n.metaData.ssrPublicPath
|
|
128
|
+
}) : i = _extends$2({}, S, {
|
|
129
129
|
getPublicPath: c()
|
|
130
130
|
}), v) {
|
|
131
131
|
const R = simpleJoinRemoteEntry(v.path, v.name);
|
|
132
|
-
|
|
132
|
+
i.ssrRemoteEntry = R, i.ssrRemoteEntryType = v.type || "commonjs-module";
|
|
133
133
|
}
|
|
134
|
-
return
|
|
134
|
+
return i;
|
|
135
135
|
}
|
|
136
|
-
function isManifestProvider(
|
|
137
|
-
return !!("remoteEntry" in
|
|
136
|
+
function isManifestProvider(n) {
|
|
137
|
+
return !!("remoteEntry" in n && n.remoteEntry.includes(MANIFEST_EXT));
|
|
138
138
|
}
|
|
139
139
|
let Logger = class {
|
|
140
140
|
setPrefix(t) {
|
|
@@ -165,49 +165,49 @@ let Logger = class {
|
|
|
165
165
|
this.prefix = t;
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
function createLogger(
|
|
169
|
-
return new Logger(
|
|
168
|
+
function createLogger(n) {
|
|
169
|
+
return new Logger(n);
|
|
170
170
|
}
|
|
171
|
-
async function safeWrapper(
|
|
171
|
+
async function safeWrapper(n, t) {
|
|
172
172
|
try {
|
|
173
|
-
return await
|
|
174
|
-
} catch (
|
|
175
|
-
warn$1(
|
|
173
|
+
return await n();
|
|
174
|
+
} catch (o) {
|
|
175
|
+
warn$1(o);
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
function isStaticResourcesEqual(
|
|
180
|
-
const
|
|
179
|
+
function isStaticResourcesEqual(n, t) {
|
|
180
|
+
const o = /^(https?:)?\/\//i, r = n.replace(o, "").replace(/\/$/, ""), s = t.replace(o, "").replace(/\/$/, "");
|
|
181
181
|
return r === s;
|
|
182
182
|
}
|
|
183
|
-
function createScript(
|
|
184
|
-
let t = null,
|
|
185
|
-
const
|
|
186
|
-
for (let
|
|
187
|
-
const c = i
|
|
188
|
-
if (u && isStaticResourcesEqual(u,
|
|
189
|
-
t = c,
|
|
183
|
+
function createScript(n) {
|
|
184
|
+
let t = null, o = !0, r = 2e4, s;
|
|
185
|
+
const a = document.getElementsByTagName("script");
|
|
186
|
+
for (let i = 0; i < a.length; i++) {
|
|
187
|
+
const c = a[i], u = c.getAttribute("src");
|
|
188
|
+
if (u && isStaticResourcesEqual(u, n.url)) {
|
|
189
|
+
t = c, o = !1;
|
|
190
190
|
break;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
if (!t) {
|
|
194
|
-
const
|
|
195
|
-
t = document.createElement("script"), t.type = (
|
|
194
|
+
const i = n.attrs;
|
|
195
|
+
t = document.createElement("script"), t.type = (i == null ? void 0 : i.type) === "module" ? "module" : "text/javascript";
|
|
196
196
|
let c;
|
|
197
|
-
|
|
198
|
-
t && (u === "async" || u === "defer" ? t[u] =
|
|
197
|
+
n.createScriptHook && (c = n.createScriptHook(n.url, n.attrs), c instanceof HTMLScriptElement ? t = c : typeof c == "object" && ("script" in c && c.script && (t = c.script), "timeout" in c && c.timeout && (r = c.timeout))), t.src || (t.src = n.url), i && !c && Object.keys(i).forEach((u) => {
|
|
198
|
+
t && (u === "async" || u === "defer" ? t[u] = i[u] : t.getAttribute(u) || t.setAttribute(u, i[u]));
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
const l = async (
|
|
201
|
+
const l = async (i, c) => {
|
|
202
202
|
clearTimeout(s);
|
|
203
203
|
const u = () => {
|
|
204
|
-
(c == null ? void 0 : c.type) === "error" ?
|
|
204
|
+
(c == null ? void 0 : c.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(c)) : n != null && n.cb && (n == null || n.cb());
|
|
205
205
|
};
|
|
206
206
|
if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
|
|
207
|
-
const { needDeleteScript: p = !0 } =
|
|
207
|
+
const { needDeleteScript: p = !0 } = n;
|
|
208
208
|
p && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
209
|
-
}),
|
|
210
|
-
const p =
|
|
209
|
+
}), i && typeof i == "function")) {
|
|
210
|
+
const p = i(c);
|
|
211
211
|
if (p instanceof Promise) {
|
|
212
212
|
const d = await p;
|
|
213
213
|
return u(), d;
|
|
@@ -217,90 +217,90 @@ function createScript(o) {
|
|
|
217
217
|
u();
|
|
218
218
|
};
|
|
219
219
|
return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), s = setTimeout(() => {
|
|
220
|
-
l(null, new Error(`Remote script "${
|
|
220
|
+
l(null, new Error(`Remote script "${n.url}" time-outed.`));
|
|
221
221
|
}, r), {
|
|
222
222
|
script: t,
|
|
223
|
-
needAttach:
|
|
223
|
+
needAttach: o
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function createLink(
|
|
227
|
-
let t = null,
|
|
226
|
+
function createLink(n) {
|
|
227
|
+
let t = null, o = !0;
|
|
228
228
|
const r = document.getElementsByTagName("link");
|
|
229
|
-
for (let
|
|
230
|
-
const l = r[
|
|
231
|
-
if (
|
|
232
|
-
t = l,
|
|
229
|
+
for (let a = 0; a < r.length; a++) {
|
|
230
|
+
const l = r[a], i = l.getAttribute("href"), c = l.getAttribute("rel");
|
|
231
|
+
if (i && isStaticResourcesEqual(i, n.url) && c === n.attrs.rel) {
|
|
232
|
+
t = l, o = !1;
|
|
233
233
|
break;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
if (!t) {
|
|
237
|
-
t = document.createElement("link"), t.setAttribute("href",
|
|
238
|
-
let
|
|
239
|
-
const l =
|
|
240
|
-
|
|
241
|
-
t && !t.getAttribute(
|
|
237
|
+
t = document.createElement("link"), t.setAttribute("href", n.url);
|
|
238
|
+
let a;
|
|
239
|
+
const l = n.attrs;
|
|
240
|
+
n.createLinkHook && (a = n.createLinkHook(n.url, l), a instanceof HTMLLinkElement && (t = a)), l && !a && Object.keys(l).forEach((i) => {
|
|
241
|
+
t && !t.getAttribute(i) && t.setAttribute(i, l[i]);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
const s = (
|
|
245
|
-
const
|
|
246
|
-
(l == null ? void 0 : l.type) === "error" ?
|
|
244
|
+
const s = (a, l) => {
|
|
245
|
+
const i = () => {
|
|
246
|
+
(l == null ? void 0 : l.type) === "error" ? n != null && n.onErrorCallback && (n == null || n.onErrorCallback(l)) : n != null && n.cb && (n == null || n.cb());
|
|
247
247
|
};
|
|
248
248
|
if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
|
|
249
|
-
const { needDeleteLink: c = !0 } =
|
|
249
|
+
const { needDeleteLink: c = !0 } = n;
|
|
250
250
|
c && t != null && t.parentNode && t.parentNode.removeChild(t);
|
|
251
|
-
}),
|
|
252
|
-
const c =
|
|
253
|
-
return
|
|
251
|
+
}), a)) {
|
|
252
|
+
const c = a(l);
|
|
253
|
+
return i(), c;
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
i();
|
|
256
256
|
};
|
|
257
257
|
return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
|
|
258
258
|
link: t,
|
|
259
|
-
needAttach:
|
|
259
|
+
needAttach: o
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
function loadScript(
|
|
263
|
-
const { attrs:
|
|
264
|
-
return new Promise((s,
|
|
265
|
-
const { script: l, needAttach:
|
|
266
|
-
url:
|
|
262
|
+
function loadScript(n, t) {
|
|
263
|
+
const { attrs: o = {}, createScriptHook: r } = t;
|
|
264
|
+
return new Promise((s, a) => {
|
|
265
|
+
const { script: l, needAttach: i } = createScript({
|
|
266
|
+
url: n,
|
|
267
267
|
cb: s,
|
|
268
|
-
onErrorCallback:
|
|
268
|
+
onErrorCallback: a,
|
|
269
269
|
attrs: _extends$2({
|
|
270
270
|
fetchpriority: "high"
|
|
271
|
-
},
|
|
271
|
+
}, o),
|
|
272
272
|
createScriptHook: r,
|
|
273
273
|
needDeleteScript: !0
|
|
274
274
|
});
|
|
275
|
-
|
|
275
|
+
i && document.head.appendChild(l);
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
|
-
function importNodeModule(
|
|
279
|
-
if (!
|
|
278
|
+
function importNodeModule(n) {
|
|
279
|
+
if (!n)
|
|
280
280
|
throw new Error("import specifier is required");
|
|
281
|
-
return new Function("name", "return import(name)")(
|
|
282
|
-
throw console.error(`Error importing module ${
|
|
281
|
+
return new Function("name", "return import(name)")(n).then((o) => o).catch((o) => {
|
|
282
|
+
throw console.error(`Error importing module ${n}:`, o), o;
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
285
|
const loadNodeFetch = async () => {
|
|
286
|
-
const
|
|
287
|
-
return
|
|
288
|
-
}, lazyLoaderHookFetch = async (
|
|
289
|
-
const s = await ((
|
|
290
|
-
return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(
|
|
286
|
+
const n = await importNodeModule("node-fetch");
|
|
287
|
+
return n.default || n;
|
|
288
|
+
}, lazyLoaderHookFetch = async (n, t, o) => {
|
|
289
|
+
const s = await ((a, l) => o.lifecycle.fetch.emit(a, l))(n, t || {});
|
|
290
|
+
return !s || !(s instanceof Response) ? (typeof fetch > "u" ? await loadNodeFetch() : fetch)(n, t || {}) : s;
|
|
291
291
|
}, createScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (url, cb, attrs, loaderHook) => {
|
|
292
292
|
if (loaderHook != null && loaderHook.createScriptHook) {
|
|
293
|
-
const
|
|
294
|
-
|
|
293
|
+
const n = loaderHook.createScriptHook(url);
|
|
294
|
+
n && typeof n == "object" && "url" in n && (url = n.url);
|
|
295
295
|
}
|
|
296
296
|
let urlObj;
|
|
297
297
|
try {
|
|
298
298
|
urlObj = new URL(url);
|
|
299
|
-
} catch (
|
|
300
|
-
console.error("Error constructing URL:",
|
|
299
|
+
} catch (n) {
|
|
300
|
+
console.error("Error constructing URL:", n), cb(new Error(`Invalid URL: ${n}`));
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
const getFetch = async () => loaderHook != null && loaderHook.fetch ? (
|
|
303
|
+
const getFetch = async () => loaderHook != null && loaderHook.fetch ? (n, t) => lazyLoaderHookFetch(n, t, loaderHook) : typeof fetch > "u" ? loadNodeFetch() : fetch, handleScriptFetch = async (f, urlObj) => {
|
|
304
304
|
try {
|
|
305
305
|
var _vm_constants;
|
|
306
306
|
const res = await f(urlObj.href), data = await res.text(), [path, vm] = await Promise.all([
|
|
@@ -321,88 +321,88 @@ const loadNodeFetch = async () => {
|
|
|
321
321
|
script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
|
|
322
322
|
const exportedInterface = scriptContext.module.exports || scriptContext.exports;
|
|
323
323
|
if (attrs && exportedInterface && attrs.globalName) {
|
|
324
|
-
const
|
|
325
|
-
cb(void 0,
|
|
324
|
+
const n = exportedInterface[attrs.globalName] || exportedInterface;
|
|
325
|
+
cb(void 0, n);
|
|
326
326
|
return;
|
|
327
327
|
}
|
|
328
328
|
cb(void 0, exportedInterface);
|
|
329
|
-
} catch (
|
|
330
|
-
cb(
|
|
329
|
+
} catch (n) {
|
|
330
|
+
cb(n instanceof Error ? n : new Error(`Script execution error: ${n}`));
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
|
-
getFetch().then(async (
|
|
333
|
+
getFetch().then(async (n) => {
|
|
334
334
|
if ((attrs == null ? void 0 : attrs.type) === "esm" || (attrs == null ? void 0 : attrs.type) === "module")
|
|
335
335
|
return loadModule(urlObj.href, {
|
|
336
|
-
fetch:
|
|
336
|
+
fetch: n,
|
|
337
337
|
vm: await importNodeModule("vm")
|
|
338
338
|
}).then(async (t) => {
|
|
339
339
|
await t.evaluate(), cb(void 0, t.namespace);
|
|
340
340
|
}).catch((t) => {
|
|
341
341
|
cb(t instanceof Error ? t : new Error(`Script execution error: ${t}`));
|
|
342
342
|
});
|
|
343
|
-
handleScriptFetch(
|
|
344
|
-
}).catch((
|
|
345
|
-
cb(
|
|
343
|
+
handleScriptFetch(n, urlObj);
|
|
344
|
+
}).catch((n) => {
|
|
345
|
+
cb(n);
|
|
346
346
|
});
|
|
347
|
-
} : (
|
|
347
|
+
} : (n, t, o, r) => {
|
|
348
348
|
t(new Error("createScriptNode is disabled in non-Node.js environment"));
|
|
349
|
-
}, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (
|
|
350
|
-
createScriptNode(
|
|
349
|
+
}, loadScriptNode = typeof ENV_TARGET > "u" || ENV_TARGET !== "web" ? (n, t) => new Promise((o, r) => {
|
|
350
|
+
createScriptNode(n, (s, a) => {
|
|
351
351
|
if (s)
|
|
352
352
|
r(s);
|
|
353
353
|
else {
|
|
354
|
-
var l,
|
|
355
|
-
const c = (t == null || (l = t.attrs) == null ? void 0 : l.globalName) || `__FEDERATION_${t == null || (
|
|
356
|
-
|
|
354
|
+
var l, i;
|
|
355
|
+
const c = (t == null || (l = t.attrs) == null ? void 0 : l.globalName) || `__FEDERATION_${t == null || (i = t.attrs) == null ? void 0 : i.name}:custom__`, u = globalThis[c] = a;
|
|
356
|
+
o(u);
|
|
357
357
|
}
|
|
358
358
|
}, t.attrs, t.loaderHook);
|
|
359
|
-
}) : (
|
|
359
|
+
}) : (n, t) => {
|
|
360
360
|
throw new Error("loadScriptNode is disabled in non-Node.js environment");
|
|
361
361
|
};
|
|
362
|
-
async function loadModule(
|
|
363
|
-
const { fetch:
|
|
362
|
+
async function loadModule(n, t) {
|
|
363
|
+
const { fetch: o, vm: r } = t, a = await (await o(n)).text(), l = new r.SourceTextModule(a, {
|
|
364
364
|
// @ts-ignore
|
|
365
|
-
importModuleDynamically: async (
|
|
366
|
-
const u = new URL(
|
|
365
|
+
importModuleDynamically: async (i, c) => {
|
|
366
|
+
const u = new URL(i, n).href;
|
|
367
367
|
return loadModule(u, t);
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
|
-
return await l.link(async (
|
|
371
|
-
const c = new URL(
|
|
370
|
+
return await l.link(async (i) => {
|
|
371
|
+
const c = new URL(i, n).href;
|
|
372
372
|
return await loadModule(c, t);
|
|
373
373
|
}), l;
|
|
374
374
|
}
|
|
375
375
|
const LoggerInstance = createLogger("[ Module Federation Bridge Vue3 ]");
|
|
376
376
|
function _extends$1() {
|
|
377
377
|
return _extends$1 = Object.assign || function(t) {
|
|
378
|
-
for (var
|
|
379
|
-
var r = arguments[
|
|
378
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
379
|
+
var r = arguments[o];
|
|
380
380
|
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
|
|
381
381
|
}
|
|
382
382
|
return t;
|
|
383
383
|
}, _extends$1.apply(this, arguments);
|
|
384
384
|
}
|
|
385
|
-
function _object_without_properties_loose(
|
|
386
|
-
if (
|
|
387
|
-
var
|
|
388
|
-
for (
|
|
389
|
-
s = r[
|
|
390
|
-
return
|
|
385
|
+
function _object_without_properties_loose(n, t) {
|
|
386
|
+
if (n == null) return {};
|
|
387
|
+
var o = {}, r = Object.keys(n), s, a;
|
|
388
|
+
for (a = 0; a < r.length; a++)
|
|
389
|
+
s = r[a], !(t.indexOf(s) >= 0) && (o[s] = n[s]);
|
|
390
|
+
return o;
|
|
391
391
|
}
|
|
392
|
-
const 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", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", BUILD_002 = "BUILD-002", getDocsUrl = (
|
|
392
|
+
const 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", TYPE_001 = "TYPE-001", BUILD_001 = "BUILD-001", BUILD_002 = "BUILD-002", getDocsUrl = (n) => `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${n.split("-")[0].toLowerCase()}/${n}`, getShortErrorMsg = (n, t, o, r) => {
|
|
393
393
|
const s = [
|
|
394
394
|
`${[
|
|
395
|
-
t[
|
|
396
|
-
]} #${
|
|
395
|
+
t[n]
|
|
396
|
+
]} #${n}`
|
|
397
397
|
];
|
|
398
|
-
return
|
|
398
|
+
return o && s.push(`args: ${JSON.stringify(o)}`), s.push(getDocsUrl(n)), r && s.push(`Original Error Message:
|
|
399
399
|
${r}`), s.join(`
|
|
400
400
|
`);
|
|
401
401
|
};
|
|
402
402
|
function _extends() {
|
|
403
403
|
return _extends = Object.assign || function(t) {
|
|
404
|
-
for (var
|
|
405
|
-
var r = arguments[
|
|
404
|
+
for (var o = 1; o < arguments.length; o++) {
|
|
405
|
+
var r = arguments[o];
|
|
406
406
|
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
|
|
407
407
|
}
|
|
408
408
|
return t;
|
|
@@ -425,58 +425,58 @@ const runtimeDescMap = {
|
|
|
425
425
|
};
|
|
426
426
|
_extends({}, runtimeDescMap, typeDescMap, buildDescMap);
|
|
427
427
|
const LOG_CATEGORY = "[ Federation Runtime ]", logger = createLogger(LOG_CATEGORY);
|
|
428
|
-
function assert(
|
|
429
|
-
|
|
428
|
+
function assert(n, t) {
|
|
429
|
+
n || error(t);
|
|
430
430
|
}
|
|
431
|
-
function error(
|
|
432
|
-
throw
|
|
431
|
+
function error(n) {
|
|
432
|
+
throw n instanceof Error ? (n.message = `${LOG_CATEGORY}: ${n.message}`, n) : new Error(`${LOG_CATEGORY}: ${n}`);
|
|
433
433
|
}
|
|
434
|
-
function warn(
|
|
435
|
-
|
|
434
|
+
function warn(n) {
|
|
435
|
+
n instanceof Error && (n.message = `${LOG_CATEGORY}: ${n.message}`), logger.warn(n);
|
|
436
436
|
}
|
|
437
|
-
function addUniqueItem(
|
|
438
|
-
return
|
|
437
|
+
function addUniqueItem(n, t) {
|
|
438
|
+
return n.findIndex((o) => o === t) === -1 && n.push(t), n;
|
|
439
439
|
}
|
|
440
|
-
function getFMId(
|
|
441
|
-
return "version" in
|
|
440
|
+
function getFMId(n) {
|
|
441
|
+
return "version" in n && n.version ? `${n.name}:${n.version}` : "entry" in n && n.entry ? `${n.name}:${n.entry}` : `${n.name}`;
|
|
442
442
|
}
|
|
443
|
-
function isRemoteInfoWithEntry(
|
|
444
|
-
return typeof
|
|
443
|
+
function isRemoteInfoWithEntry(n) {
|
|
444
|
+
return typeof n.entry < "u";
|
|
445
445
|
}
|
|
446
|
-
function isPureRemoteEntry(
|
|
447
|
-
return !
|
|
446
|
+
function isPureRemoteEntry(n) {
|
|
447
|
+
return !n.entry.includes(".json");
|
|
448
448
|
}
|
|
449
|
-
function isObject(
|
|
450
|
-
return
|
|
449
|
+
function isObject(n) {
|
|
450
|
+
return n && typeof n == "object";
|
|
451
451
|
}
|
|
452
452
|
const objectToString = Object.prototype.toString;
|
|
453
|
-
function isPlainObject(
|
|
454
|
-
return objectToString.call(
|
|
453
|
+
function isPlainObject(n) {
|
|
454
|
+
return objectToString.call(n) === "[object Object]";
|
|
455
455
|
}
|
|
456
|
-
function arrayOptions(
|
|
457
|
-
return Array.isArray(
|
|
458
|
-
|
|
456
|
+
function arrayOptions(n) {
|
|
457
|
+
return Array.isArray(n) ? n : [
|
|
458
|
+
n
|
|
459
459
|
];
|
|
460
460
|
}
|
|
461
|
-
function getRemoteEntryInfoFromSnapshot(
|
|
461
|
+
function getRemoteEntryInfoFromSnapshot(n) {
|
|
462
462
|
const t = {
|
|
463
463
|
url: "",
|
|
464
464
|
type: "global",
|
|
465
465
|
globalName: ""
|
|
466
466
|
};
|
|
467
|
-
return isBrowserEnv() || isReactNativeEnv() ? "remoteEntry" in
|
|
468
|
-
url:
|
|
469
|
-
type:
|
|
470
|
-
globalName:
|
|
471
|
-
} : t : "ssrRemoteEntry" in
|
|
472
|
-
url:
|
|
473
|
-
type:
|
|
474
|
-
globalName:
|
|
467
|
+
return isBrowserEnv() || isReactNativeEnv() ? "remoteEntry" in n ? {
|
|
468
|
+
url: n.remoteEntry,
|
|
469
|
+
type: n.remoteEntryType,
|
|
470
|
+
globalName: n.globalName
|
|
471
|
+
} : t : "ssrRemoteEntry" in n ? {
|
|
472
|
+
url: n.ssrRemoteEntry || t.url,
|
|
473
|
+
type: n.ssrRemoteEntryType || t.type,
|
|
474
|
+
globalName: n.globalName
|
|
475
475
|
} : t;
|
|
476
476
|
}
|
|
477
|
-
const processModuleAlias = (
|
|
478
|
-
let
|
|
479
|
-
return
|
|
477
|
+
const processModuleAlias = (n, t) => {
|
|
478
|
+
let o;
|
|
479
|
+
return n.endsWith("/") ? o = n.slice(0, -1) : o = n, t.startsWith(".") && (t = t.slice(1)), o = o + t, o;
|
|
480
480
|
}, CurrentGlobal = typeof globalThis == "object" ? globalThis : window, nativeGlobal = (() => {
|
|
481
481
|
try {
|
|
482
482
|
return document.defaultView;
|
|
@@ -484,61 +484,61 @@ const processModuleAlias = (o, t) => {
|
|
|
484
484
|
return CurrentGlobal;
|
|
485
485
|
}
|
|
486
486
|
})(), Global = nativeGlobal;
|
|
487
|
-
function definePropertyGlobalVal(
|
|
488
|
-
Object.defineProperty(
|
|
489
|
-
value:
|
|
487
|
+
function definePropertyGlobalVal(n, t, o) {
|
|
488
|
+
Object.defineProperty(n, t, {
|
|
489
|
+
value: o,
|
|
490
490
|
configurable: !1,
|
|
491
491
|
writable: !0
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
|
-
function includeOwnProperty(
|
|
495
|
-
return Object.hasOwnProperty.call(
|
|
494
|
+
function includeOwnProperty(n, t) {
|
|
495
|
+
return Object.hasOwnProperty.call(n, t);
|
|
496
496
|
}
|
|
497
497
|
includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__") || definePropertyGlobalVal(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__", {});
|
|
498
498
|
const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
|
|
499
|
-
function setGlobalDefaultVal(
|
|
500
|
-
var t,
|
|
501
|
-
includeOwnProperty(
|
|
499
|
+
function setGlobalDefaultVal(n) {
|
|
500
|
+
var t, o, r, s, a, l;
|
|
501
|
+
includeOwnProperty(n, "__VMOK__") && !includeOwnProperty(n, "__FEDERATION__") && definePropertyGlobalVal(n, "__FEDERATION__", n.__VMOK__), includeOwnProperty(n, "__FEDERATION__") || (definePropertyGlobalVal(n, "__FEDERATION__", {
|
|
502
502
|
__GLOBAL_PLUGIN__: [],
|
|
503
503
|
__INSTANCES__: [],
|
|
504
504
|
moduleInfo: {},
|
|
505
505
|
__SHARE__: {},
|
|
506
506
|
__MANIFEST_LOADING__: {},
|
|
507
507
|
__PRELOADED_MAP__: /* @__PURE__ */ new Map()
|
|
508
|
-
}), definePropertyGlobalVal(
|
|
509
|
-
var
|
|
510
|
-
(
|
|
508
|
+
}), definePropertyGlobalVal(n, "__VMOK__", n.__FEDERATION__));
|
|
509
|
+
var i;
|
|
510
|
+
(i = (t = n.__FEDERATION__).__GLOBAL_PLUGIN__) != null || (t.__GLOBAL_PLUGIN__ = []);
|
|
511
511
|
var c;
|
|
512
|
-
(c = (
|
|
512
|
+
(c = (o = n.__FEDERATION__).__INSTANCES__) != null || (o.__INSTANCES__ = []);
|
|
513
513
|
var u;
|
|
514
|
-
(u = (r =
|
|
514
|
+
(u = (r = n.__FEDERATION__).moduleInfo) != null || (r.moduleInfo = {});
|
|
515
515
|
var p;
|
|
516
|
-
(p = (s =
|
|
516
|
+
(p = (s = n.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
|
|
517
517
|
var d;
|
|
518
|
-
(d = (
|
|
518
|
+
(d = (a = n.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
|
|
519
519
|
var m;
|
|
520
|
-
(m = (l =
|
|
520
|
+
(m = (l = n.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
|
|
521
521
|
}
|
|
522
522
|
setGlobalDefaultVal(CurrentGlobal);
|
|
523
523
|
setGlobalDefaultVal(nativeGlobal);
|
|
524
|
-
function setGlobalFederationConstructor(
|
|
525
|
-
t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ =
|
|
524
|
+
function setGlobalFederationConstructor(n, t = isDebugMode()) {
|
|
525
|
+
t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = n, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.16.0");
|
|
526
526
|
}
|
|
527
|
-
function getInfoWithoutType(
|
|
527
|
+
function getInfoWithoutType(n, t) {
|
|
528
528
|
if (typeof t == "string") {
|
|
529
|
-
if (
|
|
529
|
+
if (n[t])
|
|
530
530
|
return {
|
|
531
|
-
value:
|
|
531
|
+
value: n[t],
|
|
532
532
|
key: t
|
|
533
533
|
};
|
|
534
534
|
{
|
|
535
|
-
const r = Object.keys(
|
|
535
|
+
const r = Object.keys(n);
|
|
536
536
|
for (const s of r) {
|
|
537
|
-
const [
|
|
537
|
+
const [a, l] = s.split(":"), i = `${a}:${t}`, c = n[i];
|
|
538
538
|
if (c)
|
|
539
539
|
return {
|
|
540
540
|
value: c,
|
|
541
|
-
key:
|
|
541
|
+
key: i
|
|
542
542
|
};
|
|
543
543
|
}
|
|
544
544
|
return {
|
|
@@ -549,121 +549,121 @@ function getInfoWithoutType(o, t) {
|
|
|
549
549
|
} else
|
|
550
550
|
throw new Error("key must be string");
|
|
551
551
|
}
|
|
552
|
-
const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (
|
|
553
|
-
const
|
|
554
|
-
if (r && !r.version && "version" in
|
|
552
|
+
const getGlobalSnapshot = () => nativeGlobal.__FEDERATION__.moduleInfo, getTargetSnapshotInfoByModuleInfo = (n, t) => {
|
|
553
|
+
const o = getFMId(n), r = getInfoWithoutType(t, o).value;
|
|
554
|
+
if (r && !r.version && "version" in n && n.version && (r.version = n.version), r)
|
|
555
555
|
return r;
|
|
556
|
-
if ("version" in
|
|
557
|
-
const { version: s } =
|
|
556
|
+
if ("version" in n && n.version) {
|
|
557
|
+
const { version: s } = n, a = _object_without_properties_loose(n, [
|
|
558
558
|
"version"
|
|
559
|
-
]), l = getFMId(
|
|
560
|
-
if ((
|
|
561
|
-
return
|
|
562
|
-
}
|
|
563
|
-
}, getGlobalSnapshotInfoByModuleInfo = (
|
|
564
|
-
const
|
|
565
|
-
return nativeGlobal.__FEDERATION__.moduleInfo[
|
|
566
|
-
}, addGlobalSnapshot = (
|
|
567
|
-
const t = Object.keys(
|
|
568
|
-
for (const
|
|
569
|
-
delete nativeGlobal.__FEDERATION__.moduleInfo[
|
|
570
|
-
}), getRemoteEntryExports = (
|
|
571
|
-
const
|
|
559
|
+
]), l = getFMId(a), i = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, l).value;
|
|
560
|
+
if ((i == null ? void 0 : i.version) === s)
|
|
561
|
+
return i;
|
|
562
|
+
}
|
|
563
|
+
}, getGlobalSnapshotInfoByModuleInfo = (n) => getTargetSnapshotInfoByModuleInfo(n, nativeGlobal.__FEDERATION__.moduleInfo), setGlobalSnapshotInfoByModuleInfo = (n, t) => {
|
|
564
|
+
const o = getFMId(n);
|
|
565
|
+
return nativeGlobal.__FEDERATION__.moduleInfo[o] = t, nativeGlobal.__FEDERATION__.moduleInfo;
|
|
566
|
+
}, addGlobalSnapshot = (n) => (nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, n), () => {
|
|
567
|
+
const t = Object.keys(n);
|
|
568
|
+
for (const o of t)
|
|
569
|
+
delete nativeGlobal.__FEDERATION__.moduleInfo[o];
|
|
570
|
+
}), getRemoteEntryExports = (n, t) => {
|
|
571
|
+
const o = t || `__FEDERATION_${n}:custom__`, r = CurrentGlobal[o];
|
|
572
572
|
return {
|
|
573
|
-
remoteEntryKey:
|
|
573
|
+
remoteEntryKey: o,
|
|
574
574
|
entryExports: r
|
|
575
575
|
};
|
|
576
|
-
}, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (
|
|
577
|
-
function parseRegex(
|
|
578
|
-
return new RegExp(
|
|
576
|
+
}, getGlobalHostPlugins = () => nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__, getPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.get(n), setPreloaded = (n) => CurrentGlobal.__FEDERATION__.__PRELOADED_MAP__.set(n, !0), DEFAULT_REMOTE_TYPE = "global", DEFAULT_SCOPE = "default", buildIdentifier = "[0-9A-Za-z-]+", build = `(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`, numericIdentifier = "0|[1-9]\\d*", numericIdentifierLoose = "[0-9]+", nonNumericIdentifier = "\\d*[a-zA-Z-][a-zA-Z0-9-]*", preReleaseIdentifierLoose = `(?:${numericIdentifierLoose}|${nonNumericIdentifier})`, preReleaseLoose = `(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`, preReleaseIdentifier = `(?:${numericIdentifier}|${nonNumericIdentifier})`, preRelease = `(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`, xRangeIdentifier = `${numericIdentifier}|x|X|\\*`, xRangePlain = `[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`, hyphenRange = `^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`, mainVersionLoose = `(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`, loosePlain = `[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`, gtlt = "((?:<|>)?=?)", comparatorTrim = `(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`, loneTilde = "(?:~>?)", tildeTrim = `(\\s*)${loneTilde}\\s+`, loneCaret = "(?:\\^)", caretTrim = `(\\s*)${loneCaret}\\s+`, star = "(<|>)?=?\\s*\\*", caret = `^${loneCaret}${xRangePlain}$`, mainVersion = `(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`, fullPlain = `v?${mainVersion}${preRelease}?${build}?`, tilde = `^${loneTilde}${xRangePlain}$`, xRange = `^${gtlt}\\s*${xRangePlain}$`, comparator = `^${gtlt}\\s*(${fullPlain})$|^$`, gte0 = "^\\s*>=\\s*0.0.0\\s*$";
|
|
577
|
+
function parseRegex(n) {
|
|
578
|
+
return new RegExp(n);
|
|
579
579
|
}
|
|
580
|
-
function isXVersion(
|
|
581
|
-
return !
|
|
580
|
+
function isXVersion(n) {
|
|
581
|
+
return !n || n.toLowerCase() === "x" || n === "*";
|
|
582
582
|
}
|
|
583
|
-
function pipe(...
|
|
584
|
-
return (t) =>
|
|
583
|
+
function pipe(...n) {
|
|
584
|
+
return (t) => n.reduce((o, r) => r(o), t);
|
|
585
585
|
}
|
|
586
|
-
function extractComparator(
|
|
587
|
-
return
|
|
586
|
+
function extractComparator(n) {
|
|
587
|
+
return n.match(parseRegex(comparator));
|
|
588
588
|
}
|
|
589
|
-
function combineVersion(
|
|
590
|
-
const s = `${
|
|
589
|
+
function combineVersion(n, t, o, r) {
|
|
590
|
+
const s = `${n}.${t}.${o}`;
|
|
591
591
|
return r ? `${s}-${r}` : s;
|
|
592
592
|
}
|
|
593
|
-
function parseHyphen(
|
|
594
|
-
return
|
|
593
|
+
function parseHyphen(n) {
|
|
594
|
+
return n.replace(parseRegex(hyphenRange), (t, o, r, s, a, l, i, c, u, p, d, m) => (isXVersion(r) ? o = "" : isXVersion(s) ? o = `>=${r}.0.0` : isXVersion(a) ? o = `>=${r}.${s}.0` : o = `>=${o}`, isXVersion(u) ? c = "" : isXVersion(p) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(d) ? c = `<${u}.${Number(p) + 1}.0-0` : m ? c = `<=${u}.${p}.${d}-${m}` : c = `<=${c}`, `${o} ${c}`.trim()));
|
|
595
595
|
}
|
|
596
|
-
function parseComparatorTrim(
|
|
597
|
-
return
|
|
596
|
+
function parseComparatorTrim(n) {
|
|
597
|
+
return n.replace(parseRegex(comparatorTrim), "$1$2$3");
|
|
598
598
|
}
|
|
599
|
-
function parseTildeTrim(
|
|
600
|
-
return
|
|
599
|
+
function parseTildeTrim(n) {
|
|
600
|
+
return n.replace(parseRegex(tildeTrim), "$1~");
|
|
601
601
|
}
|
|
602
|
-
function parseCaretTrim(
|
|
603
|
-
return
|
|
602
|
+
function parseCaretTrim(n) {
|
|
603
|
+
return n.replace(parseRegex(caretTrim), "$1^");
|
|
604
604
|
}
|
|
605
|
-
function parseCarets(
|
|
606
|
-
return
|
|
605
|
+
function parseCarets(n) {
|
|
606
|
+
return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(caret), (o, r, s, a, l) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? r === "0" ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.0 <${Number(r) + 1}.0.0-0` : l ? r === "0" ? s === "0" ? `>=${r}.${s}.${a}-${l} <${r}.${s}.${Number(a) + 1}-0` : `>=${r}.${s}.${a}-${l} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a}-${l} <${Number(r) + 1}.0.0-0` : r === "0" ? s === "0" ? `>=${r}.${s}.${a} <${r}.${s}.${Number(a) + 1}-0` : `>=${r}.${s}.${a} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a} <${Number(r) + 1}.0.0-0`)).join(" ");
|
|
607
607
|
}
|
|
608
|
-
function parseTildes(
|
|
609
|
-
return
|
|
608
|
+
function parseTildes(n) {
|
|
609
|
+
return n.trim().split(/\s+/).map((t) => t.replace(parseRegex(tilde), (o, r, s, a, l) => isXVersion(r) ? "" : isXVersion(s) ? `>=${r}.0.0 <${Number(r) + 1}.0.0-0` : isXVersion(a) ? `>=${r}.${s}.0 <${r}.${Number(s) + 1}.0-0` : l ? `>=${r}.${s}.${a}-${l} <${r}.${Number(s) + 1}.0-0` : `>=${r}.${s}.${a} <${r}.${Number(s) + 1}.0-0`)).join(" ");
|
|
610
610
|
}
|
|
611
|
-
function parseXRanges(
|
|
612
|
-
return
|
|
613
|
-
const c = isXVersion(s), u = c || isXVersion(
|
|
614
|
-
return r === "=" && p && (r = ""),
|
|
611
|
+
function parseXRanges(n) {
|
|
612
|
+
return n.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (o, r, s, a, l, i) => {
|
|
613
|
+
const c = isXVersion(s), u = c || isXVersion(a), p = u || isXVersion(l);
|
|
614
|
+
return r === "=" && p && (r = ""), i = "", c ? r === ">" || r === "<" ? "<0.0.0-0" : "*" : r && p ? (u && (a = 0), l = 0, r === ">" ? (r = ">=", u ? (s = Number(s) + 1, a = 0, l = 0) : (a = Number(a) + 1, l = 0)) : r === "<=" && (r = "<", u ? s = Number(s) + 1 : a = Number(a) + 1), r === "<" && (i = "-0"), `${r + s}.${a}.${l}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : p ? `>=${s}.${a}.0${i} <${s}.${Number(a) + 1}.0-0` : o;
|
|
615
615
|
})).join(" ");
|
|
616
616
|
}
|
|
617
|
-
function parseStar(
|
|
618
|
-
return
|
|
617
|
+
function parseStar(n) {
|
|
618
|
+
return n.trim().replace(parseRegex(star), "");
|
|
619
619
|
}
|
|
620
|
-
function parseGTE0(
|
|
621
|
-
return
|
|
620
|
+
function parseGTE0(n) {
|
|
621
|
+
return n.trim().replace(parseRegex(gte0), "");
|
|
622
622
|
}
|
|
623
|
-
function compareAtom(
|
|
624
|
-
return
|
|
623
|
+
function compareAtom(n, t) {
|
|
624
|
+
return n = Number(n) || n, t = Number(t) || t, n > t ? 1 : n === t ? 0 : -1;
|
|
625
625
|
}
|
|
626
|
-
function comparePreRelease(
|
|
627
|
-
const { preRelease:
|
|
628
|
-
if (
|
|
626
|
+
function comparePreRelease(n, t) {
|
|
627
|
+
const { preRelease: o } = n, { preRelease: r } = t;
|
|
628
|
+
if (o === void 0 && r)
|
|
629
629
|
return 1;
|
|
630
|
-
if (
|
|
630
|
+
if (o && r === void 0)
|
|
631
631
|
return -1;
|
|
632
|
-
if (
|
|
632
|
+
if (o === void 0 && r === void 0)
|
|
633
633
|
return 0;
|
|
634
|
-
for (let s = 0,
|
|
635
|
-
const l =
|
|
636
|
-
if (l !==
|
|
637
|
-
return l === void 0 &&
|
|
634
|
+
for (let s = 0, a = o.length; s <= a; s++) {
|
|
635
|
+
const l = o[s], i = r[s];
|
|
636
|
+
if (l !== i)
|
|
637
|
+
return l === void 0 && i === void 0 ? 0 : l ? i ? compareAtom(l, i) : -1 : 1;
|
|
638
638
|
}
|
|
639
639
|
return 0;
|
|
640
640
|
}
|
|
641
|
-
function compareVersion(
|
|
642
|
-
return compareAtom(
|
|
641
|
+
function compareVersion(n, t) {
|
|
642
|
+
return compareAtom(n.major, t.major) || compareAtom(n.minor, t.minor) || compareAtom(n.patch, t.patch) || comparePreRelease(n, t);
|
|
643
643
|
}
|
|
644
|
-
function eq(
|
|
645
|
-
return
|
|
644
|
+
function eq(n, t) {
|
|
645
|
+
return n.version === t.version;
|
|
646
646
|
}
|
|
647
|
-
function compare(
|
|
648
|
-
switch (
|
|
647
|
+
function compare(n, t) {
|
|
648
|
+
switch (n.operator) {
|
|
649
649
|
case "":
|
|
650
650
|
case "=":
|
|
651
|
-
return eq(
|
|
651
|
+
return eq(n, t);
|
|
652
652
|
case ">":
|
|
653
|
-
return compareVersion(
|
|
653
|
+
return compareVersion(n, t) < 0;
|
|
654
654
|
case ">=":
|
|
655
|
-
return eq(
|
|
655
|
+
return eq(n, t) || compareVersion(n, t) < 0;
|
|
656
656
|
case "<":
|
|
657
|
-
return compareVersion(
|
|
657
|
+
return compareVersion(n, t) > 0;
|
|
658
658
|
case "<=":
|
|
659
|
-
return eq(
|
|
659
|
+
return eq(n, t) || compareVersion(n, t) > 0;
|
|
660
660
|
case void 0:
|
|
661
661
|
return !0;
|
|
662
662
|
default:
|
|
663
663
|
return !1;
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
function parseComparatorString(
|
|
666
|
+
function parseComparatorString(n) {
|
|
667
667
|
return pipe(
|
|
668
668
|
// handle caret
|
|
669
669
|
// ^ --> * (any, kinda silly)
|
|
@@ -683,9 +683,9 @@ function parseComparatorString(o) {
|
|
|
683
683
|
parseTildes,
|
|
684
684
|
parseXRanges,
|
|
685
685
|
parseStar
|
|
686
|
-
)(
|
|
686
|
+
)(n);
|
|
687
687
|
}
|
|
688
|
-
function parseRange(
|
|
688
|
+
function parseRange(n) {
|
|
689
689
|
return pipe(
|
|
690
690
|
// handle hyphenRange
|
|
691
691
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
|
@@ -699,21 +699,21 @@ function parseRange(o) {
|
|
|
699
699
|
// handle trim caret
|
|
700
700
|
// `^ 1.2.3` => `^1.2.3`
|
|
701
701
|
parseCaretTrim
|
|
702
|
-
)(
|
|
702
|
+
)(n.trim()).split(/\s+/).join(" ");
|
|
703
703
|
}
|
|
704
|
-
function satisfy(
|
|
705
|
-
if (!o)
|
|
706
|
-
return !1;
|
|
707
|
-
const n = extractComparator(o);
|
|
704
|
+
function satisfy(n, t) {
|
|
708
705
|
if (!n)
|
|
709
706
|
return !1;
|
|
710
|
-
const
|
|
707
|
+
const o = extractComparator(n);
|
|
708
|
+
if (!o)
|
|
709
|
+
return !1;
|
|
710
|
+
const [, r, , s, a, l, i] = o, c = {
|
|
711
711
|
operator: r,
|
|
712
|
-
version: combineVersion(s,
|
|
712
|
+
version: combineVersion(s, a, l, i),
|
|
713
713
|
major: s,
|
|
714
|
-
minor:
|
|
714
|
+
minor: a,
|
|
715
715
|
patch: l,
|
|
716
|
-
preRelease:
|
|
716
|
+
preRelease: i == null ? void 0 : i.split(".")
|
|
717
717
|
}, u = t.split("||");
|
|
718
718
|
for (const p of u) {
|
|
719
719
|
const d = p.trim();
|
|
@@ -758,108 +758,108 @@ function satisfy(o, t) {
|
|
|
758
758
|
}
|
|
759
759
|
return !1;
|
|
760
760
|
}
|
|
761
|
-
function formatShare(
|
|
761
|
+
function formatShare(n, t, o, r) {
|
|
762
762
|
let s;
|
|
763
|
-
"get" in
|
|
764
|
-
throw new Error(`Can not get shared '${
|
|
763
|
+
"get" in n ? s = n.get : "lib" in n ? s = () => Promise.resolve(n.lib) : s = () => Promise.resolve(() => {
|
|
764
|
+
throw new Error(`Can not get shared '${o}'!`);
|
|
765
765
|
});
|
|
766
|
-
var
|
|
766
|
+
var a, l, i;
|
|
767
767
|
return _extends$1({
|
|
768
768
|
deps: [],
|
|
769
769
|
useIn: [],
|
|
770
770
|
from: t,
|
|
771
771
|
loading: null
|
|
772
|
-
},
|
|
772
|
+
}, n, {
|
|
773
773
|
shareConfig: _extends$1({
|
|
774
|
-
requiredVersion: `^${
|
|
774
|
+
requiredVersion: `^${n.version}`,
|
|
775
775
|
singleton: !1,
|
|
776
776
|
eager: !1,
|
|
777
777
|
strictVersion: !1
|
|
778
|
-
},
|
|
778
|
+
}, n.shareConfig),
|
|
779
779
|
get: s,
|
|
780
|
-
loaded:
|
|
781
|
-
version: (
|
|
782
|
-
scope: Array.isArray(
|
|
783
|
-
(l =
|
|
780
|
+
loaded: n != null && n.loaded || "lib" in n ? !0 : void 0,
|
|
781
|
+
version: (a = n.version) != null ? a : "0",
|
|
782
|
+
scope: Array.isArray(n.scope) ? n.scope : [
|
|
783
|
+
(l = n.scope) != null ? l : "default"
|
|
784
784
|
],
|
|
785
|
-
strategy: ((
|
|
785
|
+
strategy: ((i = n.strategy) != null ? i : r) || "version-first"
|
|
786
786
|
});
|
|
787
787
|
}
|
|
788
|
-
function formatShareConfigs(
|
|
789
|
-
const
|
|
790
|
-
const c = arrayOptions(
|
|
791
|
-
return l[
|
|
792
|
-
l[
|
|
788
|
+
function formatShareConfigs(n, t) {
|
|
789
|
+
const o = t.shared || {}, r = t.name, s = Object.keys(o).reduce((l, i) => {
|
|
790
|
+
const c = arrayOptions(o[i]);
|
|
791
|
+
return l[i] = l[i] || [], c.forEach((u) => {
|
|
792
|
+
l[i].push(formatShare(u, r, i, t.shareStrategy));
|
|
793
793
|
}), l;
|
|
794
|
-
}, {}),
|
|
794
|
+
}, {}), a = _extends$1({}, n.shared);
|
|
795
795
|
return Object.keys(s).forEach((l) => {
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}) :
|
|
796
|
+
a[l] ? s[l].forEach((i) => {
|
|
797
|
+
a[l].find((u) => u.version === i.version) || a[l].push(i);
|
|
798
|
+
}) : a[l] = s[l];
|
|
799
799
|
}), {
|
|
800
|
-
shared:
|
|
800
|
+
shared: a,
|
|
801
801
|
shareInfos: s
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
-
function versionLt(
|
|
805
|
-
const
|
|
804
|
+
function versionLt(n, t) {
|
|
805
|
+
const o = (r) => {
|
|
806
806
|
if (!Number.isNaN(Number(r))) {
|
|
807
|
-
const
|
|
807
|
+
const a = r.split(".");
|
|
808
808
|
let l = r;
|
|
809
|
-
for (let
|
|
809
|
+
for (let i = 0; i < 3 - a.length; i++)
|
|
810
810
|
l += ".0";
|
|
811
811
|
return l;
|
|
812
812
|
}
|
|
813
813
|
return r;
|
|
814
814
|
};
|
|
815
|
-
return !!satisfy(n
|
|
815
|
+
return !!satisfy(o(n), `<=${o(t)}`);
|
|
816
816
|
}
|
|
817
|
-
const findVersion = (
|
|
818
|
-
const
|
|
817
|
+
const findVersion = (n, t) => {
|
|
818
|
+
const o = t || function(r, s) {
|
|
819
819
|
return versionLt(r, s);
|
|
820
820
|
};
|
|
821
|
-
return Object.keys(
|
|
822
|
-
}, isLoaded = (
|
|
823
|
-
function findSingletonVersionOrderByVersion(
|
|
824
|
-
const r =
|
|
825
|
-
return !isLoaded(r[
|
|
821
|
+
return Object.keys(n).reduce((r, s) => !r || o(r, s) || r === "0" ? s : r, 0);
|
|
822
|
+
}, isLoaded = (n) => !!n.loaded || typeof n.lib == "function", isLoading = (n) => !!n.loading;
|
|
823
|
+
function findSingletonVersionOrderByVersion(n, t, o) {
|
|
824
|
+
const r = n[t][o], s = function(a, l) {
|
|
825
|
+
return !isLoaded(r[a]) && versionLt(a, l);
|
|
826
826
|
};
|
|
827
|
-
return findVersion(
|
|
827
|
+
return findVersion(n[t][o], s);
|
|
828
828
|
}
|
|
829
|
-
function findSingletonVersionOrderByLoaded(
|
|
830
|
-
const r =
|
|
831
|
-
const
|
|
832
|
-
return
|
|
829
|
+
function findSingletonVersionOrderByLoaded(n, t, o) {
|
|
830
|
+
const r = n[t][o], s = function(a, l) {
|
|
831
|
+
const i = (c) => isLoaded(c) || isLoading(c);
|
|
832
|
+
return i(r[l]) ? i(r[a]) ? !!versionLt(a, l) : !0 : i(r[a]) ? !1 : versionLt(a, l);
|
|
833
833
|
};
|
|
834
|
-
return findVersion(
|
|
834
|
+
return findVersion(n[t][o], s);
|
|
835
835
|
}
|
|
836
|
-
function getFindShareFunction(
|
|
837
|
-
return
|
|
836
|
+
function getFindShareFunction(n) {
|
|
837
|
+
return n === "loaded-first" ? findSingletonVersionOrderByLoaded : findSingletonVersionOrderByVersion;
|
|
838
838
|
}
|
|
839
|
-
function getRegisteredShare(
|
|
840
|
-
if (!
|
|
839
|
+
function getRegisteredShare(n, t, o, r) {
|
|
840
|
+
if (!n)
|
|
841
841
|
return;
|
|
842
|
-
const { shareConfig: s, scope:
|
|
843
|
-
|
|
842
|
+
const { shareConfig: s, scope: a = DEFAULT_SCOPE, strategy: l } = o, i = Array.isArray(a) ? a : [
|
|
843
|
+
a
|
|
844
844
|
];
|
|
845
|
-
for (const c of
|
|
846
|
-
if (s &&
|
|
847
|
-
const { requiredVersion: u } = s, d = getFindShareFunction(l)(
|
|
845
|
+
for (const c of i)
|
|
846
|
+
if (s && n[c] && n[c][t]) {
|
|
847
|
+
const { requiredVersion: u } = s, d = getFindShareFunction(l)(n, c, t), m = () => {
|
|
848
848
|
if (s.singleton) {
|
|
849
849
|
if (typeof u == "string" && !satisfy(d, u)) {
|
|
850
|
-
const E = `Version ${d} from ${d &&
|
|
850
|
+
const E = `Version ${d} from ${d && n[c][t][d].from} of shared singleton module ${t} does not satisfy the requirement of ${o.from} which needs ${u})`;
|
|
851
851
|
s.strictVersion ? error(E) : warn(E);
|
|
852
852
|
}
|
|
853
|
-
return
|
|
853
|
+
return n[c][t][d];
|
|
854
854
|
} else {
|
|
855
855
|
if (u === !1 || u === "*" || satisfy(d, u))
|
|
856
|
-
return
|
|
857
|
-
for (const [E, _] of Object.entries(
|
|
856
|
+
return n[c][t][d];
|
|
857
|
+
for (const [E, _] of Object.entries(n[c][t]))
|
|
858
858
|
if (satisfy(E, u))
|
|
859
859
|
return _;
|
|
860
860
|
}
|
|
861
861
|
}, y = {
|
|
862
|
-
shareScopeMap:
|
|
862
|
+
shareScopeMap: n,
|
|
863
863
|
scope: c,
|
|
864
864
|
pkgName: t,
|
|
865
865
|
version: d,
|
|
@@ -872,12 +872,12 @@ function getRegisteredShare(o, t, n, r) {
|
|
|
872
872
|
function getGlobalShareScope() {
|
|
873
873
|
return Global.__FEDERATION__.__SHARE__;
|
|
874
874
|
}
|
|
875
|
-
function getTargetSharedOptions(
|
|
876
|
-
const { pkgName: t, extraOptions:
|
|
877
|
-
if (!
|
|
875
|
+
function getTargetSharedOptions(n) {
|
|
876
|
+
const { pkgName: t, extraOptions: o, shareInfos: r } = n, s = (i) => {
|
|
877
|
+
if (!i)
|
|
878
878
|
return;
|
|
879
879
|
const c = {};
|
|
880
|
-
|
|
880
|
+
i.forEach((d) => {
|
|
881
881
|
c[d.version] = d;
|
|
882
882
|
});
|
|
883
883
|
const p = findVersion(c, function(d, m) {
|
|
@@ -885,95 +885,88 @@ function getTargetSharedOptions(o) {
|
|
|
885
885
|
});
|
|
886
886
|
return c[p];
|
|
887
887
|
};
|
|
888
|
-
var
|
|
889
|
-
const l = (
|
|
890
|
-
return Object.assign({}, l(r[t]),
|
|
888
|
+
var a;
|
|
889
|
+
const l = (a = o == null ? void 0 : o.resolver) != null ? a : s;
|
|
890
|
+
return Object.assign({}, l(r[t]), o == null ? void 0 : o.customShareInfo);
|
|
891
891
|
}
|
|
892
892
|
function getBuilderId() {
|
|
893
893
|
return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
|
|
894
894
|
}
|
|
895
|
-
function matchRemoteWithNameAndExpose(
|
|
896
|
-
for (const
|
|
897
|
-
const r = t.startsWith(
|
|
898
|
-
let s = t.replace(
|
|
895
|
+
function matchRemoteWithNameAndExpose(n, t) {
|
|
896
|
+
for (const o of n) {
|
|
897
|
+
const r = t.startsWith(o.name);
|
|
898
|
+
let s = t.replace(o.name, "");
|
|
899
899
|
if (r) {
|
|
900
900
|
if (s.startsWith("/")) {
|
|
901
|
-
const
|
|
901
|
+
const i = o.name;
|
|
902
902
|
return s = `.${s}`, {
|
|
903
|
-
pkgNameOrAlias:
|
|
903
|
+
pkgNameOrAlias: i,
|
|
904
904
|
expose: s,
|
|
905
|
-
remote:
|
|
905
|
+
remote: o
|
|
906
906
|
};
|
|
907
907
|
} else if (s === "")
|
|
908
908
|
return {
|
|
909
|
-
pkgNameOrAlias:
|
|
909
|
+
pkgNameOrAlias: o.name,
|
|
910
910
|
expose: ".",
|
|
911
|
-
remote:
|
|
911
|
+
remote: o
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
const
|
|
915
|
-
let l =
|
|
916
|
-
if (
|
|
914
|
+
const a = o.alias && t.startsWith(o.alias);
|
|
915
|
+
let l = o.alias && t.replace(o.alias, "");
|
|
916
|
+
if (o.alias && a) {
|
|
917
917
|
if (l && l.startsWith("/")) {
|
|
918
|
-
const
|
|
918
|
+
const i = o.alias;
|
|
919
919
|
return l = `.${l}`, {
|
|
920
|
-
pkgNameOrAlias:
|
|
920
|
+
pkgNameOrAlias: i,
|
|
921
921
|
expose: l,
|
|
922
|
-
remote:
|
|
922
|
+
remote: o
|
|
923
923
|
};
|
|
924
924
|
} else if (l === "")
|
|
925
925
|
return {
|
|
926
|
-
pkgNameOrAlias:
|
|
926
|
+
pkgNameOrAlias: o.alias,
|
|
927
927
|
expose: ".",
|
|
928
|
-
remote:
|
|
928
|
+
remote: o
|
|
929
929
|
};
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
|
-
function matchRemote(
|
|
934
|
-
for (const
|
|
935
|
-
if (t ===
|
|
936
|
-
return
|
|
933
|
+
function matchRemote(n, t) {
|
|
934
|
+
for (const o of n)
|
|
935
|
+
if (t === o.name || o.alias && t === o.alias)
|
|
936
|
+
return o;
|
|
937
937
|
}
|
|
938
|
-
function registerPlugins(
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
t.
|
|
944
|
-
|
|
945
|
-
t.bridgeHook
|
|
946
|
-
];
|
|
947
|
-
return n.length > 0 && n.forEach((s) => {
|
|
948
|
-
o != null && o.find((i) => i.name !== s.name) && o.push(s);
|
|
949
|
-
}), o && o.length > 0 && o.forEach((s) => {
|
|
950
|
-
r.forEach((i) => {
|
|
951
|
-
i.applyPlugin(s, t);
|
|
938
|
+
function registerPlugins(n, t) {
|
|
939
|
+
const o = getGlobalHostPlugins();
|
|
940
|
+
return o.length > 0 && o.forEach((r) => {
|
|
941
|
+
n != null && n.find((s) => s.name !== r.name) && n.push(r);
|
|
942
|
+
}), n && n.length > 0 && n.forEach((r) => {
|
|
943
|
+
t.forEach((s) => {
|
|
944
|
+
s.applyPlugin(r);
|
|
952
945
|
});
|
|
953
|
-
}),
|
|
946
|
+
}), n;
|
|
954
947
|
}
|
|
955
948
|
const importCallback = ".then(callbacks[0]).catch(callbacks[1])";
|
|
956
|
-
async function loadEsmEntry({ entry:
|
|
957
|
-
return new Promise((
|
|
949
|
+
async function loadEsmEntry({ entry: n, remoteEntryExports: t }) {
|
|
950
|
+
return new Promise((o, r) => {
|
|
958
951
|
try {
|
|
959
|
-
t ?
|
|
960
|
-
|
|
952
|
+
t ? o(t) : typeof FEDERATION_ALLOW_NEW_FUNCTION < "u" ? new Function("callbacks", `import("${n}")${importCallback}`)([
|
|
953
|
+
o,
|
|
961
954
|
r
|
|
962
955
|
]) : import(
|
|
963
956
|
/* webpackIgnore: true */
|
|
964
957
|
/* @vite-ignore */
|
|
965
|
-
|
|
966
|
-
).then(
|
|
958
|
+
n
|
|
959
|
+
).then(o).catch(r);
|
|
967
960
|
} catch (s) {
|
|
968
961
|
r(s);
|
|
969
962
|
}
|
|
970
963
|
});
|
|
971
964
|
}
|
|
972
|
-
async function loadSystemJsEntry({ entry:
|
|
973
|
-
return new Promise((
|
|
965
|
+
async function loadSystemJsEntry({ entry: n, remoteEntryExports: t }) {
|
|
966
|
+
return new Promise((o, r) => {
|
|
974
967
|
try {
|
|
975
|
-
t ?
|
|
976
|
-
|
|
968
|
+
t ? o(t) : typeof __system_context__ > "u" ? System.import(n).then(o).catch(r) : new Function("callbacks", `System.import("${n}")${importCallback}`)([
|
|
969
|
+
o,
|
|
977
970
|
r
|
|
978
971
|
]);
|
|
979
972
|
} catch (s) {
|
|
@@ -981,35 +974,35 @@ async function loadSystemJsEntry({ entry: o, remoteEntryExports: t }) {
|
|
|
981
974
|
}
|
|
982
975
|
});
|
|
983
976
|
}
|
|
984
|
-
function handleRemoteEntryLoaded(
|
|
985
|
-
const { remoteEntryKey: r, entryExports: s } = getRemoteEntryExports(
|
|
977
|
+
function handleRemoteEntryLoaded(n, t, o) {
|
|
978
|
+
const { remoteEntryKey: r, entryExports: s } = getRemoteEntryExports(n, t);
|
|
986
979
|
return assert(s, getShortErrorMsg(RUNTIME_001, runtimeDescMap, {
|
|
987
|
-
remoteName:
|
|
988
|
-
remoteEntryUrl:
|
|
980
|
+
remoteName: n,
|
|
981
|
+
remoteEntryUrl: o,
|
|
989
982
|
remoteEntryKey: r
|
|
990
983
|
})), s;
|
|
991
984
|
}
|
|
992
|
-
async function loadEntryScript({ name:
|
|
993
|
-
const { entryExports: s } = getRemoteEntryExports(
|
|
994
|
-
return s || loadScript(
|
|
985
|
+
async function loadEntryScript({ name: n, globalName: t, entry: o, loaderHook: r }) {
|
|
986
|
+
const { entryExports: s } = getRemoteEntryExports(n, t);
|
|
987
|
+
return s || loadScript(o, {
|
|
995
988
|
attrs: {},
|
|
996
|
-
createScriptHook: (
|
|
997
|
-
const
|
|
998
|
-
url:
|
|
989
|
+
createScriptHook: (a, l) => {
|
|
990
|
+
const i = r.lifecycle.createScript.emit({
|
|
991
|
+
url: a,
|
|
999
992
|
attrs: l
|
|
1000
993
|
});
|
|
1001
|
-
if (
|
|
1002
|
-
return
|
|
994
|
+
if (i && (i instanceof HTMLScriptElement || "script" in i || "timeout" in i))
|
|
995
|
+
return i;
|
|
1003
996
|
}
|
|
1004
|
-
}).then(() => handleRemoteEntryLoaded(
|
|
997
|
+
}).then(() => handleRemoteEntryLoaded(n, t, o)).catch((a) => {
|
|
1005
998
|
throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
|
|
1006
|
-
remoteName:
|
|
1007
|
-
resourceUrl:
|
|
1008
|
-
})),
|
|
999
|
+
remoteName: n,
|
|
1000
|
+
resourceUrl: o
|
|
1001
|
+
})), a;
|
|
1009
1002
|
});
|
|
1010
1003
|
}
|
|
1011
|
-
async function loadEntryDom({ remoteInfo:
|
|
1012
|
-
const { entry: r, entryGlobalName: s, name:
|
|
1004
|
+
async function loadEntryDom({ remoteInfo: n, remoteEntryExports: t, loaderHook: o }) {
|
|
1005
|
+
const { entry: r, entryGlobalName: s, name: a, type: l } = n;
|
|
1013
1006
|
switch (l) {
|
|
1014
1007
|
case "esm":
|
|
1015
1008
|
case "module":
|
|
@@ -1026,197 +1019,66 @@ async function loadEntryDom({ remoteInfo: o, remoteEntryExports: t, loaderHook:
|
|
|
1026
1019
|
return loadEntryScript({
|
|
1027
1020
|
entry: r,
|
|
1028
1021
|
globalName: s,
|
|
1029
|
-
name:
|
|
1030
|
-
loaderHook:
|
|
1022
|
+
name: a,
|
|
1023
|
+
loaderHook: o
|
|
1031
1024
|
});
|
|
1032
1025
|
}
|
|
1033
1026
|
}
|
|
1034
|
-
async function loadEntryNode({ remoteInfo:
|
|
1035
|
-
const { entry:
|
|
1036
|
-
return l || loadScriptNode(
|
|
1027
|
+
async function loadEntryNode({ remoteInfo: n, loaderHook: t }) {
|
|
1028
|
+
const { entry: o, entryGlobalName: r, name: s, type: a } = n, { entryExports: l } = getRemoteEntryExports(s, r);
|
|
1029
|
+
return l || loadScriptNode(o, {
|
|
1037
1030
|
attrs: {
|
|
1038
1031
|
name: s,
|
|
1039
1032
|
globalName: r,
|
|
1040
|
-
type:
|
|
1033
|
+
type: a
|
|
1041
1034
|
},
|
|
1042
1035
|
loaderHook: {
|
|
1043
|
-
createScriptHook: (
|
|
1036
|
+
createScriptHook: (i, c = {}) => {
|
|
1044
1037
|
const u = t.lifecycle.createScript.emit({
|
|
1045
|
-
url:
|
|
1038
|
+
url: i,
|
|
1046
1039
|
attrs: c
|
|
1047
1040
|
});
|
|
1048
1041
|
if (u && "url" in u)
|
|
1049
1042
|
return u;
|
|
1050
1043
|
}
|
|
1051
1044
|
}
|
|
1052
|
-
}).then(() => handleRemoteEntryLoaded(s, r,
|
|
1053
|
-
throw
|
|
1045
|
+
}).then(() => handleRemoteEntryLoaded(s, r, o)).catch((i) => {
|
|
1046
|
+
throw i;
|
|
1054
1047
|
});
|
|
1055
1048
|
}
|
|
1056
|
-
function getRemoteEntryUniqueKey(
|
|
1057
|
-
const { entry: t, name:
|
|
1058
|
-
return composeKeyWithSeparator(
|
|
1049
|
+
function getRemoteEntryUniqueKey(n) {
|
|
1050
|
+
const { entry: t, name: o } = n;
|
|
1051
|
+
return composeKeyWithSeparator(o, t);
|
|
1059
1052
|
}
|
|
1060
|
-
async function getRemoteEntry({ origin:
|
|
1061
|
-
const r = getRemoteEntryUniqueKey(
|
|
1053
|
+
async function getRemoteEntry({ origin: n, remoteEntryExports: t, remoteInfo: o }) {
|
|
1054
|
+
const r = getRemoteEntryUniqueKey(o);
|
|
1062
1055
|
if (t)
|
|
1063
1056
|
return t;
|
|
1064
1057
|
if (!globalLoading[r]) {
|
|
1065
|
-
const s =
|
|
1058
|
+
const s = n.remoteHandler.hooks.lifecycle.loadEntry, a = n.loaderHook;
|
|
1066
1059
|
globalLoading[r] = s.emit({
|
|
1067
|
-
loaderHook:
|
|
1068
|
-
remoteInfo:
|
|
1060
|
+
loaderHook: a,
|
|
1061
|
+
remoteInfo: o,
|
|
1069
1062
|
remoteEntryExports: t
|
|
1070
1063
|
}).then((l) => l || ((typeof ENV_TARGET < "u" ? ENV_TARGET === "web" : isBrowserEnv()) ? loadEntryDom({
|
|
1071
|
-
remoteInfo:
|
|
1064
|
+
remoteInfo: o,
|
|
1072
1065
|
remoteEntryExports: t,
|
|
1073
|
-
loaderHook:
|
|
1066
|
+
loaderHook: a
|
|
1074
1067
|
}) : loadEntryNode({
|
|
1075
|
-
remoteInfo:
|
|
1076
|
-
loaderHook:
|
|
1068
|
+
remoteInfo: o,
|
|
1069
|
+
loaderHook: a
|
|
1077
1070
|
})));
|
|
1078
1071
|
}
|
|
1079
1072
|
return globalLoading[r];
|
|
1080
1073
|
}
|
|
1081
|
-
function getRemoteInfo(
|
|
1082
|
-
return _extends$1({},
|
|
1083
|
-
entry: "entry" in
|
|
1084
|
-
type:
|
|
1085
|
-
entryGlobalName:
|
|
1086
|
-
shareScope:
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
function defaultPreloadArgs(o) {
|
|
1090
|
-
return _extends$1({
|
|
1091
|
-
resourceCategory: "sync",
|
|
1092
|
-
share: !0,
|
|
1093
|
-
depsRemote: !0,
|
|
1094
|
-
prefetchInterface: !1
|
|
1095
|
-
}, o);
|
|
1096
|
-
}
|
|
1097
|
-
function formatPreloadArgs(o, t) {
|
|
1098
|
-
return t.map((n) => {
|
|
1099
|
-
const r = matchRemote(o, n.nameOrAlias);
|
|
1100
|
-
return assert(r, `Unable to preload ${n.nameOrAlias} as it is not included in ${!r && safeToString({
|
|
1101
|
-
remoteInfo: r,
|
|
1102
|
-
remotes: o
|
|
1103
|
-
})}`), {
|
|
1104
|
-
remote: r,
|
|
1105
|
-
preloadConfig: defaultPreloadArgs(n)
|
|
1106
|
-
};
|
|
1074
|
+
function getRemoteInfo(n) {
|
|
1075
|
+
return _extends$1({}, n, {
|
|
1076
|
+
entry: "entry" in n ? n.entry : "",
|
|
1077
|
+
type: n.type || DEFAULT_REMOTE_TYPE,
|
|
1078
|
+
entryGlobalName: n.entryGlobalName || n.name,
|
|
1079
|
+
shareScope: n.shareScope || DEFAULT_SCOPE
|
|
1107
1080
|
});
|
|
1108
1081
|
}
|
|
1109
|
-
function normalizePreloadExposes(o) {
|
|
1110
|
-
return o ? o.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1111
|
-
}
|
|
1112
|
-
function preloadAssets(o, t, n, r = !0) {
|
|
1113
|
-
const { cssAssets: s, jsAssetsWithoutEntry: i, entryAssets: l } = n;
|
|
1114
|
-
if (t.options.inBrowser) {
|
|
1115
|
-
if (l.forEach((a) => {
|
|
1116
|
-
const { moduleInfo: c } = a, u = t.moduleCache.get(o.name);
|
|
1117
|
-
getRemoteEntry(u ? {
|
|
1118
|
-
origin: t,
|
|
1119
|
-
remoteInfo: c,
|
|
1120
|
-
remoteEntryExports: u.remoteEntryExports
|
|
1121
|
-
} : {
|
|
1122
|
-
origin: t,
|
|
1123
|
-
remoteInfo: c,
|
|
1124
|
-
remoteEntryExports: void 0
|
|
1125
|
-
});
|
|
1126
|
-
}), r) {
|
|
1127
|
-
const a = {
|
|
1128
|
-
rel: "preload",
|
|
1129
|
-
as: "style"
|
|
1130
|
-
};
|
|
1131
|
-
s.forEach((c) => {
|
|
1132
|
-
const { link: u, needAttach: p } = createLink({
|
|
1133
|
-
url: c,
|
|
1134
|
-
cb: () => {
|
|
1135
|
-
},
|
|
1136
|
-
attrs: a,
|
|
1137
|
-
createLinkHook: (d, m) => {
|
|
1138
|
-
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1139
|
-
url: d,
|
|
1140
|
-
attrs: m
|
|
1141
|
-
});
|
|
1142
|
-
if (y instanceof HTMLLinkElement)
|
|
1143
|
-
return y;
|
|
1144
|
-
}
|
|
1145
|
-
});
|
|
1146
|
-
p && document.head.appendChild(u);
|
|
1147
|
-
});
|
|
1148
|
-
} else {
|
|
1149
|
-
const a = {
|
|
1150
|
-
rel: "stylesheet",
|
|
1151
|
-
type: "text/css"
|
|
1152
|
-
};
|
|
1153
|
-
s.forEach((c) => {
|
|
1154
|
-
const { link: u, needAttach: p } = createLink({
|
|
1155
|
-
url: c,
|
|
1156
|
-
cb: () => {
|
|
1157
|
-
},
|
|
1158
|
-
attrs: a,
|
|
1159
|
-
createLinkHook: (d, m) => {
|
|
1160
|
-
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1161
|
-
url: d,
|
|
1162
|
-
attrs: m
|
|
1163
|
-
});
|
|
1164
|
-
if (y instanceof HTMLLinkElement)
|
|
1165
|
-
return y;
|
|
1166
|
-
},
|
|
1167
|
-
needDeleteLink: !1
|
|
1168
|
-
});
|
|
1169
|
-
p && document.head.appendChild(u);
|
|
1170
|
-
});
|
|
1171
|
-
}
|
|
1172
|
-
if (r) {
|
|
1173
|
-
const a = {
|
|
1174
|
-
rel: "preload",
|
|
1175
|
-
as: "script"
|
|
1176
|
-
};
|
|
1177
|
-
i.forEach((c) => {
|
|
1178
|
-
const { link: u, needAttach: p } = createLink({
|
|
1179
|
-
url: c,
|
|
1180
|
-
cb: () => {
|
|
1181
|
-
},
|
|
1182
|
-
attrs: a,
|
|
1183
|
-
createLinkHook: (d, m) => {
|
|
1184
|
-
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1185
|
-
url: d,
|
|
1186
|
-
attrs: m
|
|
1187
|
-
});
|
|
1188
|
-
if (y instanceof HTMLLinkElement)
|
|
1189
|
-
return y;
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
p && document.head.appendChild(u);
|
|
1193
|
-
});
|
|
1194
|
-
} else {
|
|
1195
|
-
const a = {
|
|
1196
|
-
fetchpriority: "high",
|
|
1197
|
-
type: (o == null ? void 0 : o.type) === "module" ? "module" : "text/javascript"
|
|
1198
|
-
};
|
|
1199
|
-
i.forEach((c) => {
|
|
1200
|
-
const { script: u, needAttach: p } = createScript({
|
|
1201
|
-
url: c,
|
|
1202
|
-
cb: () => {
|
|
1203
|
-
},
|
|
1204
|
-
attrs: a,
|
|
1205
|
-
createScriptHook: (d, m) => {
|
|
1206
|
-
const y = t.loaderHook.lifecycle.createScript.emit({
|
|
1207
|
-
url: d,
|
|
1208
|
-
attrs: m
|
|
1209
|
-
});
|
|
1210
|
-
if (y instanceof HTMLScriptElement)
|
|
1211
|
-
return y;
|
|
1212
|
-
},
|
|
1213
|
-
needDeleteScript: !0
|
|
1214
|
-
});
|
|
1215
|
-
p && document.head.appendChild(u);
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1220
1082
|
let Module = class {
|
|
1221
1083
|
async getEntry() {
|
|
1222
1084
|
if (this.remoteEntryExports)
|
|
@@ -1243,8 +1105,8 @@ let Module = class {
|
|
|
1243
1105
|
${safeToString(this.remoteInfo)}`), this.remoteEntryExports = t, this.remoteEntryExports;
|
|
1244
1106
|
}
|
|
1245
1107
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
1246
|
-
async get(t,
|
|
1247
|
-
const { loadFactory:
|
|
1108
|
+
async get(t, o, r, s) {
|
|
1109
|
+
const { loadFactory: a = !0 } = r || {
|
|
1248
1110
|
loadFactory: !0
|
|
1249
1111
|
}, l = await this.getEntry();
|
|
1250
1112
|
if (!this.inited) {
|
|
@@ -1283,32 +1145,32 @@ let Module = class {
|
|
|
1283
1145
|
}));
|
|
1284
1146
|
}
|
|
1285
1147
|
this.lib = l, this.inited = !0;
|
|
1286
|
-
let
|
|
1287
|
-
|
|
1148
|
+
let i;
|
|
1149
|
+
i = await this.host.loaderHook.lifecycle.getModuleFactory.emit({
|
|
1288
1150
|
remoteEntryExports: l,
|
|
1289
|
-
expose:
|
|
1151
|
+
expose: o,
|
|
1290
1152
|
moduleInfo: this.remoteInfo
|
|
1291
|
-
}),
|
|
1292
|
-
const c = processModuleAlias(this.remoteInfo.name,
|
|
1293
|
-
return
|
|
1153
|
+
}), i || (i = await l.get(o)), assert(i, `${getFMId(this.remoteInfo)} remote don't export ${o}.`);
|
|
1154
|
+
const c = processModuleAlias(this.remoteInfo.name, o), u = this.wraperFactory(i, c);
|
|
1155
|
+
return a ? await u() : u;
|
|
1294
1156
|
}
|
|
1295
|
-
wraperFactory(t,
|
|
1296
|
-
function r(s,
|
|
1157
|
+
wraperFactory(t, o) {
|
|
1158
|
+
function r(s, a) {
|
|
1297
1159
|
s && typeof s == "object" && Object.isExtensible(s) && !Object.getOwnPropertyDescriptor(s, Symbol.for("mf_module_id")) && Object.defineProperty(s, Symbol.for("mf_module_id"), {
|
|
1298
|
-
value:
|
|
1160
|
+
value: a,
|
|
1299
1161
|
enumerable: !1
|
|
1300
1162
|
});
|
|
1301
1163
|
}
|
|
1302
1164
|
return t instanceof Promise ? async () => {
|
|
1303
1165
|
const s = await t();
|
|
1304
|
-
return r(s,
|
|
1166
|
+
return r(s, o), s;
|
|
1305
1167
|
} : () => {
|
|
1306
1168
|
const s = t();
|
|
1307
|
-
return r(s,
|
|
1169
|
+
return r(s, o), s;
|
|
1308
1170
|
};
|
|
1309
1171
|
}
|
|
1310
|
-
constructor({ remoteInfo: t, host:
|
|
1311
|
-
this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host =
|
|
1172
|
+
constructor({ remoteInfo: t, host: o }) {
|
|
1173
|
+
this.inited = !1, this.lib = void 0, this.remoteInfo = t, this.host = o;
|
|
1312
1174
|
}
|
|
1313
1175
|
};
|
|
1314
1176
|
class SyncHook {
|
|
@@ -1316,16 +1178,16 @@ class SyncHook {
|
|
|
1316
1178
|
typeof t == "function" && this.listeners.add(t);
|
|
1317
1179
|
}
|
|
1318
1180
|
once(t) {
|
|
1319
|
-
const
|
|
1181
|
+
const o = this;
|
|
1320
1182
|
this.on(function r(...s) {
|
|
1321
|
-
return
|
|
1183
|
+
return o.remove(r), t.apply(null, s);
|
|
1322
1184
|
});
|
|
1323
1185
|
}
|
|
1324
1186
|
emit(...t) {
|
|
1325
|
-
let
|
|
1187
|
+
let o;
|
|
1326
1188
|
return this.listeners.size > 0 && this.listeners.forEach((r) => {
|
|
1327
|
-
|
|
1328
|
-
}),
|
|
1189
|
+
o = r(...t);
|
|
1190
|
+
}), o;
|
|
1329
1191
|
}
|
|
1330
1192
|
remove(t) {
|
|
1331
1193
|
this.listeners.delete(t);
|
|
@@ -1339,22 +1201,22 @@ class SyncHook {
|
|
|
1339
1201
|
}
|
|
1340
1202
|
class AsyncHook extends SyncHook {
|
|
1341
1203
|
emit(...t) {
|
|
1342
|
-
let
|
|
1204
|
+
let o;
|
|
1343
1205
|
const r = Array.from(this.listeners);
|
|
1344
1206
|
if (r.length > 0) {
|
|
1345
1207
|
let s = 0;
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1208
|
+
const a = (l) => l === !1 ? !1 : s < r.length ? Promise.resolve(r[s++].apply(null, t)).then(a) : l;
|
|
1209
|
+
o = a();
|
|
1348
1210
|
}
|
|
1349
|
-
return Promise.resolve(
|
|
1211
|
+
return Promise.resolve(o);
|
|
1350
1212
|
}
|
|
1351
1213
|
}
|
|
1352
|
-
function checkReturnData(
|
|
1214
|
+
function checkReturnData(n, t) {
|
|
1353
1215
|
if (!isObject(t))
|
|
1354
1216
|
return !1;
|
|
1355
|
-
if (
|
|
1356
|
-
for (const
|
|
1357
|
-
if (!(
|
|
1217
|
+
if (n !== t) {
|
|
1218
|
+
for (const o in n)
|
|
1219
|
+
if (!(o in t))
|
|
1358
1220
|
return !1;
|
|
1359
1221
|
}
|
|
1360
1222
|
return !0;
|
|
@@ -1362,9 +1224,9 @@ function checkReturnData(o, t) {
|
|
|
1362
1224
|
class SyncWaterfallHook extends SyncHook {
|
|
1363
1225
|
emit(t) {
|
|
1364
1226
|
isObject(t) || error(`The data for the "${this.type}" hook should be an object.`);
|
|
1365
|
-
for (const
|
|
1227
|
+
for (const o of this.listeners)
|
|
1366
1228
|
try {
|
|
1367
|
-
const r =
|
|
1229
|
+
const r = o(t);
|
|
1368
1230
|
if (checkReturnData(t, r))
|
|
1369
1231
|
t = r;
|
|
1370
1232
|
else {
|
|
@@ -1383,22 +1245,22 @@ class SyncWaterfallHook extends SyncHook {
|
|
|
1383
1245
|
class AsyncWaterfallHook extends SyncHook {
|
|
1384
1246
|
emit(t) {
|
|
1385
1247
|
isObject(t) || error(`The response data for the "${this.type}" hook must be an object.`);
|
|
1386
|
-
const
|
|
1387
|
-
if (
|
|
1248
|
+
const o = Array.from(this.listeners);
|
|
1249
|
+
if (o.length > 0) {
|
|
1388
1250
|
let r = 0;
|
|
1389
|
-
const s = (l) => (warn(l), this.onerror(l), t),
|
|
1251
|
+
const s = (l) => (warn(l), this.onerror(l), t), a = (l) => {
|
|
1390
1252
|
if (checkReturnData(t, l)) {
|
|
1391
|
-
if (t = l, r <
|
|
1253
|
+
if (t = l, r < o.length)
|
|
1392
1254
|
try {
|
|
1393
|
-
return Promise.resolve(
|
|
1394
|
-
} catch (
|
|
1395
|
-
return s(
|
|
1255
|
+
return Promise.resolve(o[r++](t)).then(a, s);
|
|
1256
|
+
} catch (i) {
|
|
1257
|
+
return s(i);
|
|
1396
1258
|
}
|
|
1397
1259
|
} else
|
|
1398
1260
|
this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);
|
|
1399
1261
|
return t;
|
|
1400
1262
|
};
|
|
1401
|
-
return Promise.resolve(
|
|
1263
|
+
return Promise.resolve(a(t));
|
|
1402
1264
|
}
|
|
1403
1265
|
return Promise.resolve(t);
|
|
1404
1266
|
}
|
|
@@ -1407,46 +1269,185 @@ class AsyncWaterfallHook extends SyncHook {
|
|
|
1407
1269
|
}
|
|
1408
1270
|
}
|
|
1409
1271
|
class PluginSystem {
|
|
1410
|
-
applyPlugin(t
|
|
1272
|
+
applyPlugin(t) {
|
|
1411
1273
|
assert(isPlainObject(t), "Plugin configuration is invalid.");
|
|
1412
|
-
const
|
|
1413
|
-
assert(
|
|
1414
|
-
const
|
|
1415
|
-
|
|
1274
|
+
const o = t.name;
|
|
1275
|
+
assert(o, "A name must be provided by the plugin."), this.registerPlugins[o] || (this.registerPlugins[o] = t, Object.keys(this.lifecycle).forEach((r) => {
|
|
1276
|
+
const s = t[r];
|
|
1277
|
+
s && this.lifecycle[r].on(s);
|
|
1416
1278
|
}));
|
|
1417
1279
|
}
|
|
1418
1280
|
removePlugin(t) {
|
|
1419
1281
|
assert(t, "A name is required.");
|
|
1420
|
-
const
|
|
1421
|
-
assert(
|
|
1422
|
-
r !== "name" && this.lifecycle[r].remove(
|
|
1282
|
+
const o = this.registerPlugins[t];
|
|
1283
|
+
assert(o, `The plugin "${t}" is not registered.`), Object.keys(o).forEach((r) => {
|
|
1284
|
+
r !== "name" && this.lifecycle[r].remove(o[r]);
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
1288
|
+
inherit({ lifecycle: t, registerPlugins: o }) {
|
|
1289
|
+
Object.keys(t).forEach((r) => {
|
|
1290
|
+
assert(!this.lifecycle[r], `The hook "${r}" has a conflict and cannot be inherited.`), this.lifecycle[r] = t[r];
|
|
1291
|
+
}), Object.keys(o).forEach((r) => {
|
|
1292
|
+
assert(!this.registerPlugins[r], `The plugin "${r}" has a conflict and cannot be inherited.`), this.applyPlugin(o[r]);
|
|
1423
1293
|
});
|
|
1424
1294
|
}
|
|
1425
1295
|
constructor(t) {
|
|
1426
1296
|
this.registerPlugins = {}, this.lifecycle = t, this.lifecycleKeys = Object.keys(t);
|
|
1427
1297
|
}
|
|
1428
1298
|
}
|
|
1429
|
-
function
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1299
|
+
function defaultPreloadArgs(n) {
|
|
1300
|
+
return _extends$1({
|
|
1301
|
+
resourceCategory: "sync",
|
|
1302
|
+
share: !0,
|
|
1303
|
+
depsRemote: !0,
|
|
1304
|
+
prefetchInterface: !1
|
|
1305
|
+
}, n);
|
|
1306
|
+
}
|
|
1307
|
+
function formatPreloadArgs(n, t) {
|
|
1308
|
+
return t.map((o) => {
|
|
1309
|
+
const r = matchRemote(n, o.nameOrAlias);
|
|
1310
|
+
return assert(r, `Unable to preload ${o.nameOrAlias} as it is not included in ${!r && safeToString({
|
|
1311
|
+
remoteInfo: r,
|
|
1312
|
+
remotes: n
|
|
1313
|
+
})}`), {
|
|
1314
|
+
remote: r,
|
|
1315
|
+
preloadConfig: defaultPreloadArgs(o)
|
|
1316
|
+
};
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1319
|
+
function normalizePreloadExposes(n) {
|
|
1320
|
+
return n ? n.map((t) => t === "." ? t : t.startsWith("./") ? t.replace("./", "") : t) : [];
|
|
1321
|
+
}
|
|
1322
|
+
function preloadAssets(n, t, o, r = !0) {
|
|
1323
|
+
const { cssAssets: s, jsAssetsWithoutEntry: a, entryAssets: l } = o;
|
|
1324
|
+
if (t.options.inBrowser) {
|
|
1325
|
+
if (l.forEach((i) => {
|
|
1326
|
+
const { moduleInfo: c } = i, u = t.moduleCache.get(n.name);
|
|
1327
|
+
getRemoteEntry(u ? {
|
|
1328
|
+
origin: t,
|
|
1329
|
+
remoteInfo: c,
|
|
1330
|
+
remoteEntryExports: u.remoteEntryExports
|
|
1331
|
+
} : {
|
|
1332
|
+
origin: t,
|
|
1333
|
+
remoteInfo: c,
|
|
1334
|
+
remoteEntryExports: void 0
|
|
1335
|
+
});
|
|
1336
|
+
}), r) {
|
|
1337
|
+
const i = {
|
|
1338
|
+
rel: "preload",
|
|
1339
|
+
as: "style"
|
|
1340
|
+
};
|
|
1341
|
+
s.forEach((c) => {
|
|
1342
|
+
const { link: u, needAttach: p } = createLink({
|
|
1343
|
+
url: c,
|
|
1344
|
+
cb: () => {
|
|
1345
|
+
},
|
|
1346
|
+
attrs: i,
|
|
1347
|
+
createLinkHook: (d, m) => {
|
|
1348
|
+
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1349
|
+
url: d,
|
|
1350
|
+
attrs: m
|
|
1351
|
+
});
|
|
1352
|
+
if (y instanceof HTMLLinkElement)
|
|
1353
|
+
return y;
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
p && document.head.appendChild(u);
|
|
1357
|
+
});
|
|
1358
|
+
} else {
|
|
1359
|
+
const i = {
|
|
1360
|
+
rel: "stylesheet",
|
|
1361
|
+
type: "text/css"
|
|
1362
|
+
};
|
|
1363
|
+
s.forEach((c) => {
|
|
1364
|
+
const { link: u, needAttach: p } = createLink({
|
|
1365
|
+
url: c,
|
|
1366
|
+
cb: () => {
|
|
1367
|
+
},
|
|
1368
|
+
attrs: i,
|
|
1369
|
+
createLinkHook: (d, m) => {
|
|
1370
|
+
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1371
|
+
url: d,
|
|
1372
|
+
attrs: m
|
|
1373
|
+
});
|
|
1374
|
+
if (y instanceof HTMLLinkElement)
|
|
1375
|
+
return y;
|
|
1376
|
+
},
|
|
1377
|
+
needDeleteLink: !1
|
|
1378
|
+
});
|
|
1379
|
+
p && document.head.appendChild(u);
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
if (r) {
|
|
1383
|
+
const i = {
|
|
1384
|
+
rel: "preload",
|
|
1385
|
+
as: "script"
|
|
1386
|
+
};
|
|
1387
|
+
a.forEach((c) => {
|
|
1388
|
+
const { link: u, needAttach: p } = createLink({
|
|
1389
|
+
url: c,
|
|
1390
|
+
cb: () => {
|
|
1391
|
+
},
|
|
1392
|
+
attrs: i,
|
|
1393
|
+
createLinkHook: (d, m) => {
|
|
1394
|
+
const y = t.loaderHook.lifecycle.createLink.emit({
|
|
1395
|
+
url: d,
|
|
1396
|
+
attrs: m
|
|
1397
|
+
});
|
|
1398
|
+
if (y instanceof HTMLLinkElement)
|
|
1399
|
+
return y;
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1402
|
+
p && document.head.appendChild(u);
|
|
1403
|
+
});
|
|
1404
|
+
} else {
|
|
1405
|
+
const i = {
|
|
1406
|
+
fetchpriority: "high",
|
|
1407
|
+
type: (n == null ? void 0 : n.type) === "module" ? "module" : "text/javascript"
|
|
1408
|
+
};
|
|
1409
|
+
a.forEach((c) => {
|
|
1410
|
+
const { script: u, needAttach: p } = createScript({
|
|
1411
|
+
url: c,
|
|
1412
|
+
cb: () => {
|
|
1413
|
+
},
|
|
1414
|
+
attrs: i,
|
|
1415
|
+
createScriptHook: (d, m) => {
|
|
1416
|
+
const y = t.loaderHook.lifecycle.createScript.emit({
|
|
1417
|
+
url: d,
|
|
1418
|
+
attrs: m
|
|
1419
|
+
});
|
|
1420
|
+
if (y instanceof HTMLScriptElement)
|
|
1421
|
+
return y;
|
|
1422
|
+
},
|
|
1423
|
+
needDeleteScript: !0
|
|
1424
|
+
});
|
|
1425
|
+
p && document.head.appendChild(u);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
function assignRemoteInfo(n, t) {
|
|
1431
|
+
const o = getRemoteEntryInfoFromSnapshot(t);
|
|
1432
|
+
o.url || error(`The attribute remoteEntry of ${n.name} must not be undefined.`);
|
|
1433
|
+
let r = getResourceUrl(t, o.url);
|
|
1434
|
+
!isBrowserEnv() && !r.startsWith("http") && (r = `https:${r}`), n.type = o.type, n.entryGlobalName = o.globalName, n.entry = r, n.version = t.version, n.buildVersion = t.buildVersion;
|
|
1434
1435
|
}
|
|
1435
1436
|
function snapshotPlugin() {
|
|
1436
1437
|
return {
|
|
1437
1438
|
name: "snapshot-plugin",
|
|
1438
|
-
async afterResolve(
|
|
1439
|
-
const { remote: t, pkgNameOrAlias:
|
|
1439
|
+
async afterResolve(n) {
|
|
1440
|
+
const { remote: t, pkgNameOrAlias: o, expose: r, origin: s, remoteInfo: a, id: l } = n;
|
|
1440
1441
|
if (!isRemoteInfoWithEntry(t) || !isPureRemoteEntry(t)) {
|
|
1441
|
-
const { remoteSnapshot:
|
|
1442
|
+
const { remoteSnapshot: i, globalSnapshot: c } = await s.snapshotHandler.loadRemoteSnapshotInfo({
|
|
1442
1443
|
moduleInfo: t,
|
|
1443
1444
|
id: l
|
|
1444
1445
|
});
|
|
1445
|
-
assignRemoteInfo(
|
|
1446
|
+
assignRemoteInfo(a, i);
|
|
1446
1447
|
const u = {
|
|
1447
1448
|
remote: t,
|
|
1448
1449
|
preloadConfig: {
|
|
1449
|
-
nameOrAlias:
|
|
1450
|
+
nameOrAlias: o,
|
|
1450
1451
|
exposes: [
|
|
1451
1452
|
r
|
|
1452
1453
|
],
|
|
@@ -1457,21 +1458,21 @@ function snapshotPlugin() {
|
|
|
1457
1458
|
}, p = await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({
|
|
1458
1459
|
origin: s,
|
|
1459
1460
|
preloadOptions: u,
|
|
1460
|
-
remoteInfo:
|
|
1461
|
+
remoteInfo: a,
|
|
1461
1462
|
remote: t,
|
|
1462
|
-
remoteSnapshot:
|
|
1463
|
+
remoteSnapshot: i,
|
|
1463
1464
|
globalSnapshot: c
|
|
1464
1465
|
});
|
|
1465
|
-
return p && preloadAssets(
|
|
1466
|
-
remoteSnapshot:
|
|
1466
|
+
return p && preloadAssets(a, s, p, !1), _extends$1({}, n, {
|
|
1467
|
+
remoteSnapshot: i
|
|
1467
1468
|
});
|
|
1468
1469
|
}
|
|
1469
|
-
return
|
|
1470
|
+
return n;
|
|
1470
1471
|
}
|
|
1471
1472
|
};
|
|
1472
1473
|
}
|
|
1473
|
-
function splitId(
|
|
1474
|
-
const t =
|
|
1474
|
+
function splitId(n) {
|
|
1475
|
+
const t = n.split(":");
|
|
1475
1476
|
return t.length === 1 ? {
|
|
1476
1477
|
name: t[0],
|
|
1477
1478
|
version: void 0
|
|
@@ -1483,26 +1484,26 @@ function splitId(o) {
|
|
|
1483
1484
|
version: t[2]
|
|
1484
1485
|
};
|
|
1485
1486
|
}
|
|
1486
|
-
function traverseModuleInfo(
|
|
1487
|
-
const l = getFMId(t), { value:
|
|
1488
|
-
if (c && !isManifestProvider(c) && (
|
|
1487
|
+
function traverseModuleInfo(n, t, o, r, s = {}, a) {
|
|
1488
|
+
const l = getFMId(t), { value: i } = getInfoWithoutType(n, l), c = a || i;
|
|
1489
|
+
if (c && !isManifestProvider(c) && (o(c, t, r), c.remotesInfo)) {
|
|
1489
1490
|
const u = Object.keys(c.remotesInfo);
|
|
1490
1491
|
for (const p of u) {
|
|
1491
1492
|
if (s[p])
|
|
1492
1493
|
continue;
|
|
1493
1494
|
s[p] = !0;
|
|
1494
1495
|
const d = splitId(p), m = c.remotesInfo[p];
|
|
1495
|
-
traverseModuleInfo(
|
|
1496
|
+
traverseModuleInfo(n, {
|
|
1496
1497
|
name: d.name,
|
|
1497
1498
|
version: m.matchedVersion
|
|
1498
|
-
},
|
|
1499
|
+
}, o, !1, s, void 0);
|
|
1499
1500
|
}
|
|
1500
1501
|
}
|
|
1501
1502
|
}
|
|
1502
|
-
const isExisted = (
|
|
1503
|
-
function generatePreloadAssets(
|
|
1504
|
-
const
|
|
1505
|
-
if (traverseModuleInfo(r,
|
|
1503
|
+
const isExisted = (n, t) => document.querySelector(`${n}[${n === "link" ? "href" : "src"}="${t}"]`);
|
|
1504
|
+
function generatePreloadAssets(n, t, o, r, s) {
|
|
1505
|
+
const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: p } = n, { preloadConfig: d } = t, { depsRemote: m } = d;
|
|
1506
|
+
if (traverseModuleInfo(r, o, (_, b, v) => {
|
|
1506
1507
|
let I;
|
|
1507
1508
|
if (v)
|
|
1508
1509
|
I = d;
|
|
@@ -1516,7 +1517,7 @@ function generatePreloadAssets(o, t, n, r, s) {
|
|
|
1516
1517
|
else
|
|
1517
1518
|
return;
|
|
1518
1519
|
const S = getResourceUrl(_, getRemoteEntryInfoFromSnapshot(_).url);
|
|
1519
|
-
S &&
|
|
1520
|
+
S && i.push({
|
|
1520
1521
|
name: b.name,
|
|
1521
1522
|
moduleInfo: {
|
|
1522
1523
|
name: b.name,
|
|
@@ -1542,19 +1543,19 @@ function generatePreloadAssets(o, t, n, r, s) {
|
|
|
1542
1543
|
const w = R.length;
|
|
1543
1544
|
for (let N = 0; N < w; N++) {
|
|
1544
1545
|
const O = R[N], P = `${b.name}/${O.moduleName}`;
|
|
1545
|
-
|
|
1546
|
+
n.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
|
|
1546
1547
|
id: O.moduleName === "." ? b.name : P,
|
|
1547
1548
|
name: b.name,
|
|
1548
1549
|
remoteSnapshot: _,
|
|
1549
1550
|
preloadConfig: I,
|
|
1550
1551
|
remote: b,
|
|
1551
|
-
origin:
|
|
1552
|
-
}), !getPreloaded(P) && (I.resourceCategory === "all" ? (
|
|
1552
|
+
origin: n
|
|
1553
|
+
}), !getPreloaded(P) && (I.resourceCategory === "all" ? (a.push(...$(O.assets.css.async)), a.push(...$(O.assets.css.sync)), l.push(...$(O.assets.js.async)), l.push(...$(O.assets.js.sync))) : (I.resourceCategory = "sync") && (a.push(...$(O.assets.css.sync)), l.push(...$(O.assets.js.sync))), setPreloaded(P));
|
|
1553
1554
|
}
|
|
1554
1555
|
}
|
|
1555
1556
|
}, !0, {}, s), s.shared) {
|
|
1556
1557
|
const _ = (b, v) => {
|
|
1557
|
-
const I = getRegisteredShare(
|
|
1558
|
+
const I = getRegisteredShare(n.shareScopeMap, v.sharedName, b, n.sharedHandler.hooks.lifecycle.resolveShare);
|
|
1558
1559
|
I && typeof I.lib == "function" && (v.assets.js.sync.forEach((S) => {
|
|
1559
1560
|
c.add(S);
|
|
1560
1561
|
}), v.assets.css.sync.forEach((S) => {
|
|
@@ -1576,16 +1577,16 @@ function generatePreloadAssets(o, t, n, r, s) {
|
|
|
1576
1577
|
}
|
|
1577
1578
|
const g = l.filter((_) => !c.has(_) && !isExisted("script", _));
|
|
1578
1579
|
return {
|
|
1579
|
-
cssAssets:
|
|
1580
|
+
cssAssets: a.filter((_) => !u.has(_) && !isExisted("link", _)),
|
|
1580
1581
|
jsAssetsWithoutEntry: g,
|
|
1581
|
-
entryAssets:
|
|
1582
|
+
entryAssets: i.filter((_) => !isExisted("script", _.url))
|
|
1582
1583
|
};
|
|
1583
1584
|
}
|
|
1584
1585
|
const generatePreloadAssetsPlugin = function() {
|
|
1585
1586
|
return {
|
|
1586
1587
|
name: "generate-preload-assets-plugin",
|
|
1587
|
-
async generatePreloadAssets(
|
|
1588
|
-
const { origin: t, preloadOptions:
|
|
1588
|
+
async generatePreloadAssets(n) {
|
|
1589
|
+
const { origin: t, preloadOptions: o, remoteInfo: r, remote: s, globalSnapshot: a, remoteSnapshot: l } = n;
|
|
1589
1590
|
return isBrowserEnv() ? isRemoteInfoWithEntry(s) && isPureRemoteEntry(s) ? {
|
|
1590
1591
|
cssAssets: [],
|
|
1591
1592
|
jsAssetsWithoutEntry: [],
|
|
@@ -1602,7 +1603,7 @@ const generatePreloadAssetsPlugin = function() {
|
|
|
1602
1603
|
}
|
|
1603
1604
|
}
|
|
1604
1605
|
]
|
|
1605
|
-
} : (assignRemoteInfo(r, l), generatePreloadAssets(t,
|
|
1606
|
+
} : (assignRemoteInfo(r, l), generatePreloadAssets(t, o, r, a, l)) : {
|
|
1606
1607
|
cssAssets: [],
|
|
1607
1608
|
jsAssetsWithoutEntry: [],
|
|
1608
1609
|
entryAssets: []
|
|
@@ -1610,55 +1611,55 @@ const generatePreloadAssetsPlugin = function() {
|
|
|
1610
1611
|
}
|
|
1611
1612
|
};
|
|
1612
1613
|
};
|
|
1613
|
-
function getGlobalRemoteInfo(
|
|
1614
|
-
const
|
|
1614
|
+
function getGlobalRemoteInfo(n, t) {
|
|
1615
|
+
const o = getGlobalSnapshotInfoByModuleInfo({
|
|
1615
1616
|
name: t.name,
|
|
1616
1617
|
version: t.options.version
|
|
1617
|
-
}), r =
|
|
1618
|
+
}), r = o && "remotesInfo" in o && o.remotesInfo && getInfoWithoutType(o.remotesInfo, n.name).value;
|
|
1618
1619
|
return r && r.matchedVersion ? {
|
|
1619
|
-
hostGlobalSnapshot:
|
|
1620
|
+
hostGlobalSnapshot: o,
|
|
1620
1621
|
globalSnapshot: getGlobalSnapshot(),
|
|
1621
1622
|
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
1622
|
-
name:
|
|
1623
|
+
name: n.name,
|
|
1623
1624
|
version: r.matchedVersion
|
|
1624
1625
|
})
|
|
1625
1626
|
} : {
|
|
1626
1627
|
hostGlobalSnapshot: void 0,
|
|
1627
1628
|
globalSnapshot: getGlobalSnapshot(),
|
|
1628
1629
|
remoteSnapshot: getGlobalSnapshotInfoByModuleInfo({
|
|
1629
|
-
name:
|
|
1630
|
-
version: "version" in
|
|
1630
|
+
name: n.name,
|
|
1631
|
+
version: "version" in n ? n.version : void 0
|
|
1631
1632
|
})
|
|
1632
1633
|
};
|
|
1633
1634
|
}
|
|
1634
1635
|
class SnapshotHandler {
|
|
1635
1636
|
// eslint-disable-next-line max-lines-per-function
|
|
1636
|
-
async loadRemoteSnapshotInfo({ moduleInfo: t, id:
|
|
1637
|
+
async loadRemoteSnapshotInfo({ moduleInfo: t, id: o, expose: r }) {
|
|
1637
1638
|
const { options: s } = this.HostInstance;
|
|
1638
1639
|
await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({
|
|
1639
1640
|
options: s,
|
|
1640
1641
|
moduleInfo: t
|
|
1641
1642
|
});
|
|
1642
|
-
let
|
|
1643
|
+
let a = getGlobalSnapshotInfoByModuleInfo({
|
|
1643
1644
|
name: this.HostInstance.options.name,
|
|
1644
1645
|
version: this.HostInstance.options.version
|
|
1645
1646
|
});
|
|
1646
|
-
|
|
1647
|
+
a || (a = {
|
|
1647
1648
|
version: this.HostInstance.options.version || "",
|
|
1648
1649
|
remoteEntry: "",
|
|
1649
1650
|
remotesInfo: {}
|
|
1650
1651
|
}, addGlobalSnapshot({
|
|
1651
|
-
[this.HostInstance.options.name]:
|
|
1652
|
-
})),
|
|
1652
|
+
[this.HostInstance.options.name]: a
|
|
1653
|
+
})), a && "remotesInfo" in a && !getInfoWithoutType(a.remotesInfo, t.name).value && ("version" in t || "entry" in t) && (a.remotesInfo = _extends$1({}, a == null ? void 0 : a.remotesInfo, {
|
|
1653
1654
|
[t.name]: {
|
|
1654
1655
|
matchedVersion: "version" in t ? t.version : t.entry
|
|
1655
1656
|
}
|
|
1656
1657
|
}));
|
|
1657
|
-
const { hostGlobalSnapshot: l, remoteSnapshot:
|
|
1658
|
+
const { hostGlobalSnapshot: l, remoteSnapshot: i, globalSnapshot: c } = this.getGlobalRemoteInfo(t), { remoteSnapshot: u, globalSnapshot: p } = await this.hooks.lifecycle.loadSnapshot.emit({
|
|
1658
1659
|
options: s,
|
|
1659
1660
|
moduleInfo: t,
|
|
1660
1661
|
hostGlobalSnapshot: l,
|
|
1661
|
-
remoteSnapshot:
|
|
1662
|
+
remoteSnapshot: i,
|
|
1662
1663
|
globalSnapshot: c
|
|
1663
1664
|
});
|
|
1664
1665
|
let d, m;
|
|
@@ -1694,7 +1695,7 @@ class SnapshotHandler {
|
|
|
1694
1695
|
globalSnapshot: JSON.stringify(p)
|
|
1695
1696
|
}));
|
|
1696
1697
|
return await this.hooks.lifecycle.afterLoadSnapshot.emit({
|
|
1697
|
-
id:
|
|
1698
|
+
id: o,
|
|
1698
1699
|
host: this.HostInstance,
|
|
1699
1700
|
options: s,
|
|
1700
1701
|
moduleInfo: t,
|
|
@@ -1707,42 +1708,42 @@ class SnapshotHandler {
|
|
|
1707
1708
|
getGlobalRemoteInfo(t) {
|
|
1708
1709
|
return getGlobalRemoteInfo(t, this.HostInstance);
|
|
1709
1710
|
}
|
|
1710
|
-
async getManifestJson(t,
|
|
1711
|
+
async getManifestJson(t, o, r) {
|
|
1711
1712
|
const s = async () => {
|
|
1712
1713
|
let l = this.manifestCache.get(t);
|
|
1713
1714
|
if (l)
|
|
1714
1715
|
return l;
|
|
1715
1716
|
try {
|
|
1716
|
-
let
|
|
1717
|
-
(!
|
|
1718
|
-
} catch (
|
|
1717
|
+
let i = await this.loaderHook.lifecycle.fetch.emit(t, {});
|
|
1718
|
+
(!i || !(i instanceof Response)) && (i = await fetch(t, {})), l = await i.json();
|
|
1719
|
+
} catch (i) {
|
|
1719
1720
|
l = await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
|
|
1720
1721
|
id: t,
|
|
1721
|
-
error:
|
|
1722
|
+
error: i,
|
|
1722
1723
|
from: "runtime",
|
|
1723
1724
|
lifecycle: "afterResolve",
|
|
1724
1725
|
origin: this.HostInstance
|
|
1725
1726
|
}), l || (delete this.manifestLoading[t], error(getShortErrorMsg(RUNTIME_003, runtimeDescMap, {
|
|
1726
1727
|
manifestUrl: t,
|
|
1727
|
-
moduleName:
|
|
1728
|
+
moduleName: o.name,
|
|
1728
1729
|
hostName: this.HostInstance.options.name
|
|
1729
|
-
}, `${
|
|
1730
|
+
}, `${i}`)));
|
|
1730
1731
|
}
|
|
1731
1732
|
return assert(l.metaData && l.exposes && l.shared, `${t} is not a federation manifest`), this.manifestCache.set(t, l), l;
|
|
1732
|
-
},
|
|
1733
|
-
const l = await s(),
|
|
1733
|
+
}, a = async () => {
|
|
1734
|
+
const l = await s(), i = generateSnapshotFromManifest(l, {
|
|
1734
1735
|
version: t
|
|
1735
1736
|
}), { remoteSnapshot: c } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
|
|
1736
1737
|
options: this.HostInstance.options,
|
|
1737
|
-
moduleInfo:
|
|
1738
|
+
moduleInfo: o,
|
|
1738
1739
|
manifestJson: l,
|
|
1739
|
-
remoteSnapshot:
|
|
1740
|
+
remoteSnapshot: i,
|
|
1740
1741
|
manifestUrl: t,
|
|
1741
1742
|
from: "manifest"
|
|
1742
1743
|
});
|
|
1743
1744
|
return c;
|
|
1744
1745
|
};
|
|
1745
|
-
return this.manifestLoading[t] || (this.manifestLoading[t] =
|
|
1746
|
+
return this.manifestLoading[t] || (this.manifestLoading[t] = a().then((l) => l)), this.manifestLoading[t];
|
|
1746
1747
|
}
|
|
1747
1748
|
constructor(t) {
|
|
1748
1749
|
this.loadingHostSnapshot = null, this.manifestCache = /* @__PURE__ */ new Map(), this.hooks = new PluginSystem({
|
|
@@ -1755,8 +1756,8 @@ class SnapshotHandler {
|
|
|
1755
1756
|
}
|
|
1756
1757
|
class SharedHandler {
|
|
1757
1758
|
// register shared in shareScopeMap
|
|
1758
|
-
registerShared(t,
|
|
1759
|
-
const { shareInfos: r, shared: s } = formatShareConfigs(t,
|
|
1759
|
+
registerShared(t, o) {
|
|
1760
|
+
const { shareInfos: r, shared: s } = formatShareConfigs(t, o);
|
|
1760
1761
|
return Object.keys(r).forEach((l) => {
|
|
1761
1762
|
r[l].forEach((c) => {
|
|
1762
1763
|
!getRegisteredShare(this.shareScopeMap, l, c, this.hooks.lifecycle.resolveShare) && c && c.lib && this.setShared({
|
|
@@ -1765,7 +1766,7 @@ class SharedHandler {
|
|
|
1765
1766
|
get: c.get,
|
|
1766
1767
|
loaded: !0,
|
|
1767
1768
|
shared: c,
|
|
1768
|
-
from:
|
|
1769
|
+
from: o.name
|
|
1769
1770
|
});
|
|
1770
1771
|
});
|
|
1771
1772
|
}), {
|
|
@@ -1773,10 +1774,10 @@ class SharedHandler {
|
|
|
1773
1774
|
shared: s
|
|
1774
1775
|
};
|
|
1775
1776
|
}
|
|
1776
|
-
async loadShare(t,
|
|
1777
|
+
async loadShare(t, o) {
|
|
1777
1778
|
const { host: r } = this, s = getTargetSharedOptions({
|
|
1778
1779
|
pkgName: t,
|
|
1779
|
-
extraOptions:
|
|
1780
|
+
extraOptions: o,
|
|
1780
1781
|
shareInfos: r.options.shared
|
|
1781
1782
|
});
|
|
1782
1783
|
s != null && s.scope && await Promise.all(s.scope.map(async (u) => {
|
|
@@ -1784,24 +1785,24 @@ class SharedHandler {
|
|
|
1784
1785
|
strategy: s.strategy
|
|
1785
1786
|
}));
|
|
1786
1787
|
}));
|
|
1787
|
-
const
|
|
1788
|
+
const a = await this.hooks.lifecycle.beforeLoadShare.emit({
|
|
1788
1789
|
pkgName: t,
|
|
1789
1790
|
shareInfo: s,
|
|
1790
1791
|
shared: r.options.shared,
|
|
1791
1792
|
origin: r
|
|
1792
|
-
}), { shareInfo: l } =
|
|
1793
|
+
}), { shareInfo: l } = a;
|
|
1793
1794
|
assert(l, `Cannot find ${t} Share in the ${r.options.name}. Please ensure that the ${t} Share parameters have been injected`);
|
|
1794
|
-
const
|
|
1795
|
+
const i = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare), c = (u) => {
|
|
1795
1796
|
u.useIn || (u.useIn = []), addUniqueItem(u.useIn, r.options.name);
|
|
1796
1797
|
};
|
|
1797
|
-
if (
|
|
1798
|
-
return c(
|
|
1799
|
-
if (
|
|
1800
|
-
const u = await
|
|
1801
|
-
return
|
|
1802
|
-
} else if (
|
|
1798
|
+
if (i && i.lib)
|
|
1799
|
+
return c(i), i.lib;
|
|
1800
|
+
if (i && i.loading && !i.loaded) {
|
|
1801
|
+
const u = await i.loading;
|
|
1802
|
+
return i.loaded = !0, i.lib || (i.lib = u), c(i), u;
|
|
1803
|
+
} else if (i) {
|
|
1803
1804
|
const p = (async () => {
|
|
1804
|
-
const d = await
|
|
1805
|
+
const d = await i.get();
|
|
1805
1806
|
l.lib = d, l.loaded = !0, c(l);
|
|
1806
1807
|
const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
|
|
1807
1808
|
return m && (m.lib = d, m.loaded = !0), d;
|
|
@@ -1809,13 +1810,13 @@ class SharedHandler {
|
|
|
1809
1810
|
return this.setShared({
|
|
1810
1811
|
pkgName: t,
|
|
1811
1812
|
loaded: !1,
|
|
1812
|
-
shared:
|
|
1813
|
+
shared: i,
|
|
1813
1814
|
from: r.options.name,
|
|
1814
1815
|
lib: null,
|
|
1815
1816
|
loading: p
|
|
1816
1817
|
}), p;
|
|
1817
1818
|
} else {
|
|
1818
|
-
if (
|
|
1819
|
+
if (o != null && o.customShareInfo)
|
|
1819
1820
|
return !1;
|
|
1820
1821
|
const p = (async () => {
|
|
1821
1822
|
const d = await l.get();
|
|
@@ -1839,17 +1840,17 @@ class SharedHandler {
|
|
|
1839
1840
|
* If the share scope does not exist, it creates one.
|
|
1840
1841
|
*/
|
|
1841
1842
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
1842
|
-
initializeSharing(t = DEFAULT_SCOPE,
|
|
1843
|
-
const { host: r } = this, s =
|
|
1844
|
-
let l =
|
|
1845
|
-
const
|
|
1843
|
+
initializeSharing(t = DEFAULT_SCOPE, o) {
|
|
1844
|
+
const { host: r } = this, s = o == null ? void 0 : o.from, a = o == null ? void 0 : o.strategy;
|
|
1845
|
+
let l = o == null ? void 0 : o.initScope;
|
|
1846
|
+
const i = [];
|
|
1846
1847
|
if (s !== "build") {
|
|
1847
1848
|
const { initTokens: g } = this;
|
|
1848
1849
|
l || (l = []);
|
|
1849
1850
|
let E = g[t];
|
|
1850
1851
|
if (E || (E = g[t] = {
|
|
1851
1852
|
from: this.host.name
|
|
1852
|
-
}), l.indexOf(E) >= 0) return
|
|
1853
|
+
}), l.indexOf(E) >= 0) return i;
|
|
1853
1854
|
l.push(E);
|
|
1854
1855
|
}
|
|
1855
1856
|
const c = this.shareScopeMap, u = r.options.name;
|
|
@@ -1884,55 +1885,55 @@ class SharedHandler {
|
|
|
1884
1885
|
r.options.shared[g].forEach((_) => {
|
|
1885
1886
|
_.scope.includes(t) && d(g, _);
|
|
1886
1887
|
});
|
|
1887
|
-
}), (r.options.shareStrategy === "version-first" ||
|
|
1888
|
-
g.shareScope === t &&
|
|
1889
|
-
}),
|
|
1888
|
+
}), (r.options.shareStrategy === "version-first" || a === "version-first") && r.options.remotes.forEach((g) => {
|
|
1889
|
+
g.shareScope === t && i.push(y(g.name));
|
|
1890
|
+
}), i;
|
|
1890
1891
|
}
|
|
1891
1892
|
// The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
|
|
1892
1893
|
// 1. If the loaded shared already exists globally, then it will be reused
|
|
1893
1894
|
// 2. If lib exists in local shared, it will be used directly
|
|
1894
1895
|
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
1895
|
-
loadShareSync(t,
|
|
1896
|
+
loadShareSync(t, o) {
|
|
1896
1897
|
const { host: r } = this, s = getTargetSharedOptions({
|
|
1897
1898
|
pkgName: t,
|
|
1898
|
-
extraOptions:
|
|
1899
|
+
extraOptions: o,
|
|
1899
1900
|
shareInfos: r.options.shared
|
|
1900
1901
|
});
|
|
1901
|
-
s != null && s.scope && s.scope.forEach((
|
|
1902
|
-
this.initializeSharing(
|
|
1902
|
+
s != null && s.scope && s.scope.forEach((i) => {
|
|
1903
|
+
this.initializeSharing(i, {
|
|
1903
1904
|
strategy: s.strategy
|
|
1904
1905
|
});
|
|
1905
1906
|
});
|
|
1906
|
-
const
|
|
1907
|
-
|
|
1907
|
+
const a = getRegisteredShare(this.shareScopeMap, t, s, this.hooks.lifecycle.resolveShare), l = (i) => {
|
|
1908
|
+
i.useIn || (i.useIn = []), addUniqueItem(i.useIn, r.options.name);
|
|
1908
1909
|
};
|
|
1909
|
-
if (
|
|
1910
|
-
if (typeof
|
|
1911
|
-
return l(
|
|
1912
|
-
if (typeof
|
|
1913
|
-
const
|
|
1914
|
-
if (!(
|
|
1915
|
-
return l(
|
|
1910
|
+
if (a) {
|
|
1911
|
+
if (typeof a.lib == "function")
|
|
1912
|
+
return l(a), a.loaded || (a.loaded = !0, a.from === r.options.name && (s.loaded = !0)), a.lib;
|
|
1913
|
+
if (typeof a.get == "function") {
|
|
1914
|
+
const i = a.get();
|
|
1915
|
+
if (!(i instanceof Promise))
|
|
1916
|
+
return l(a), this.setShared({
|
|
1916
1917
|
pkgName: t,
|
|
1917
1918
|
loaded: !0,
|
|
1918
1919
|
from: r.options.name,
|
|
1919
|
-
lib:
|
|
1920
|
-
shared:
|
|
1921
|
-
}),
|
|
1920
|
+
lib: i,
|
|
1921
|
+
shared: a
|
|
1922
|
+
}), i;
|
|
1922
1923
|
}
|
|
1923
1924
|
}
|
|
1924
1925
|
if (s.lib)
|
|
1925
1926
|
return s.loaded || (s.loaded = !0), s.lib;
|
|
1926
1927
|
if (s.get) {
|
|
1927
|
-
const
|
|
1928
|
-
if (
|
|
1929
|
-
const c = (
|
|
1928
|
+
const i = s.get();
|
|
1929
|
+
if (i instanceof Promise) {
|
|
1930
|
+
const c = (o == null ? void 0 : o.from) === "build" ? RUNTIME_005 : RUNTIME_006;
|
|
1930
1931
|
throw new Error(getShortErrorMsg(c, runtimeDescMap, {
|
|
1931
1932
|
hostName: r.options.name,
|
|
1932
1933
|
sharedPkgName: t
|
|
1933
1934
|
}));
|
|
1934
1935
|
}
|
|
1935
|
-
return s.lib =
|
|
1936
|
+
return s.lib = i, this.setShared({
|
|
1936
1937
|
pkgName: t,
|
|
1937
1938
|
loaded: !0,
|
|
1938
1939
|
from: r.options.name,
|
|
@@ -1945,18 +1946,18 @@ class SharedHandler {
|
|
|
1945
1946
|
sharedPkgName: t
|
|
1946
1947
|
}));
|
|
1947
1948
|
}
|
|
1948
|
-
initShareScopeMap(t,
|
|
1949
|
+
initShareScopeMap(t, o, r = {}) {
|
|
1949
1950
|
const { host: s } = this;
|
|
1950
|
-
this.shareScopeMap[t] =
|
|
1951
|
-
shareScope:
|
|
1951
|
+
this.shareScopeMap[t] = o, this.hooks.lifecycle.initContainerShareScopeMap.emit({
|
|
1952
|
+
shareScope: o,
|
|
1952
1953
|
options: s.options,
|
|
1953
1954
|
origin: s,
|
|
1954
1955
|
scopeName: t,
|
|
1955
1956
|
hostShareScopeMap: r.hostShareScopeMap
|
|
1956
1957
|
});
|
|
1957
1958
|
}
|
|
1958
|
-
setShared({ pkgName: t, shared:
|
|
1959
|
-
const { version: c, scope: u = "default" } =
|
|
1959
|
+
setShared({ pkgName: t, shared: o, from: r, lib: s, loading: a, loaded: l, get: i }) {
|
|
1960
|
+
const { version: c, scope: u = "default" } = o, p = _object_without_properties_loose(o, [
|
|
1960
1961
|
"version",
|
|
1961
1962
|
"scope"
|
|
1962
1963
|
]);
|
|
@@ -1972,17 +1973,17 @@ class SharedHandler {
|
|
|
1972
1973
|
}, p, {
|
|
1973
1974
|
lib: s,
|
|
1974
1975
|
loaded: l,
|
|
1975
|
-
loading:
|
|
1976
|
-
}),
|
|
1976
|
+
loading: a
|
|
1977
|
+
}), i && (this.shareScopeMap[m][t][c].get = i);
|
|
1977
1978
|
return;
|
|
1978
1979
|
}
|
|
1979
1980
|
const y = this.shareScopeMap[m][t][c];
|
|
1980
|
-
|
|
1981
|
+
a && !y.loading && (y.loading = a);
|
|
1981
1982
|
});
|
|
1982
1983
|
}
|
|
1983
1984
|
_setGlobalShareScopeMap(t) {
|
|
1984
|
-
const
|
|
1985
|
-
r && !
|
|
1985
|
+
const o = getGlobalShareScope(), r = t.id || t.name;
|
|
1986
|
+
r && !o[r] && (o[r] = this.shareScopeMap);
|
|
1986
1987
|
}
|
|
1987
1988
|
constructor(t) {
|
|
1988
1989
|
this.hooks = new PluginSystem({
|
|
@@ -1997,27 +1998,27 @@ class SharedHandler {
|
|
|
1997
1998
|
}
|
|
1998
1999
|
}
|
|
1999
2000
|
class RemoteHandler {
|
|
2000
|
-
formatAndRegisterRemote(t,
|
|
2001
|
-
return (
|
|
2001
|
+
formatAndRegisterRemote(t, o) {
|
|
2002
|
+
return (o.remotes || []).reduce((s, a) => (this.registerRemote(a, s, {
|
|
2002
2003
|
force: !1
|
|
2003
2004
|
}), s), t.remotes);
|
|
2004
2005
|
}
|
|
2005
|
-
setIdToRemoteMap(t,
|
|
2006
|
-
const { remote: r, expose: s } =
|
|
2006
|
+
setIdToRemoteMap(t, o) {
|
|
2007
|
+
const { remote: r, expose: s } = o, { name: a, alias: l } = r;
|
|
2007
2008
|
if (this.idToRemoteMap[t] = {
|
|
2008
2009
|
name: r.name,
|
|
2009
2010
|
expose: s
|
|
2010
|
-
}, l && t.startsWith(
|
|
2011
|
-
const
|
|
2012
|
-
this.idToRemoteMap[
|
|
2011
|
+
}, l && t.startsWith(a)) {
|
|
2012
|
+
const i = t.replace(a, l);
|
|
2013
|
+
this.idToRemoteMap[i] = {
|
|
2013
2014
|
name: r.name,
|
|
2014
2015
|
expose: s
|
|
2015
2016
|
};
|
|
2016
2017
|
return;
|
|
2017
2018
|
}
|
|
2018
2019
|
if (l && t.startsWith(l)) {
|
|
2019
|
-
const
|
|
2020
|
-
this.idToRemoteMap[
|
|
2020
|
+
const i = t.replace(l, a);
|
|
2021
|
+
this.idToRemoteMap[i] = {
|
|
2021
2022
|
name: r.name,
|
|
2022
2023
|
expose: s
|
|
2023
2024
|
};
|
|
@@ -2025,14 +2026,14 @@ class RemoteHandler {
|
|
|
2025
2026
|
}
|
|
2026
2027
|
// eslint-disable-next-line max-lines-per-function
|
|
2027
2028
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2028
|
-
async loadRemote(t,
|
|
2029
|
+
async loadRemote(t, o) {
|
|
2029
2030
|
const { host: r } = this;
|
|
2030
2031
|
try {
|
|
2031
|
-
const { loadFactory: s = !0 } =
|
|
2032
|
+
const { loadFactory: s = !0 } = o || {
|
|
2032
2033
|
loadFactory: !0
|
|
2033
|
-
}, { module:
|
|
2034
|
+
}, { module: a, moduleOptions: l, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
|
|
2034
2035
|
id: t
|
|
2035
|
-
}), { pkgNameOrAlias: c, remote: u, expose: p, id: d, remoteSnapshot: m } =
|
|
2036
|
+
}), { pkgNameOrAlias: c, remote: u, expose: p, id: d, remoteSnapshot: m } = i, y = await a.get(d, p, o, m), g = await this.hooks.lifecycle.onLoad.emit({
|
|
2036
2037
|
id: d,
|
|
2037
2038
|
pkgNameOrAlias: c,
|
|
2038
2039
|
expose: p,
|
|
@@ -2040,17 +2041,17 @@ class RemoteHandler {
|
|
|
2040
2041
|
exposeModuleFactory: s ? void 0 : y,
|
|
2041
2042
|
remote: u,
|
|
2042
2043
|
options: l,
|
|
2043
|
-
moduleInstance:
|
|
2044
|
+
moduleInstance: a,
|
|
2044
2045
|
origin: r
|
|
2045
2046
|
});
|
|
2046
|
-
return this.setIdToRemoteMap(t,
|
|
2047
|
+
return this.setIdToRemoteMap(t, i), typeof g == "function" ? g : y;
|
|
2047
2048
|
} catch (s) {
|
|
2048
|
-
const { from:
|
|
2049
|
+
const { from: a = "runtime" } = o || {
|
|
2049
2050
|
from: "runtime"
|
|
2050
2051
|
}, l = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2051
2052
|
id: t,
|
|
2052
2053
|
error: s,
|
|
2053
|
-
from:
|
|
2054
|
+
from: a,
|
|
2054
2055
|
lifecycle: "onLoad",
|
|
2055
2056
|
origin: r
|
|
2056
2057
|
});
|
|
@@ -2061,87 +2062,87 @@ class RemoteHandler {
|
|
|
2061
2062
|
}
|
|
2062
2063
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2063
2064
|
async preloadRemote(t) {
|
|
2064
|
-
const { host:
|
|
2065
|
+
const { host: o } = this;
|
|
2065
2066
|
await this.hooks.lifecycle.beforePreloadRemote.emit({
|
|
2066
2067
|
preloadOps: t,
|
|
2067
|
-
options:
|
|
2068
|
-
origin:
|
|
2068
|
+
options: o.options,
|
|
2069
|
+
origin: o
|
|
2069
2070
|
});
|
|
2070
|
-
const r = formatPreloadArgs(
|
|
2071
|
+
const r = formatPreloadArgs(o.options.remotes, t);
|
|
2071
2072
|
await Promise.all(r.map(async (s) => {
|
|
2072
|
-
const { remote:
|
|
2073
|
-
moduleInfo:
|
|
2073
|
+
const { remote: a } = s, l = getRemoteInfo(a), { globalSnapshot: i, remoteSnapshot: c } = await o.snapshotHandler.loadRemoteSnapshotInfo({
|
|
2074
|
+
moduleInfo: a
|
|
2074
2075
|
}), u = await this.hooks.lifecycle.generatePreloadAssets.emit({
|
|
2075
|
-
origin:
|
|
2076
|
+
origin: o,
|
|
2076
2077
|
preloadOptions: s,
|
|
2077
|
-
remote:
|
|
2078
|
+
remote: a,
|
|
2078
2079
|
remoteInfo: l,
|
|
2079
|
-
globalSnapshot:
|
|
2080
|
+
globalSnapshot: i,
|
|
2080
2081
|
remoteSnapshot: c
|
|
2081
2082
|
});
|
|
2082
|
-
u && preloadAssets(l,
|
|
2083
|
+
u && preloadAssets(l, o, u);
|
|
2083
2084
|
}));
|
|
2084
2085
|
}
|
|
2085
|
-
registerRemotes(t,
|
|
2086
|
+
registerRemotes(t, o) {
|
|
2086
2087
|
const { host: r } = this;
|
|
2087
2088
|
t.forEach((s) => {
|
|
2088
2089
|
this.registerRemote(s, r.options.remotes, {
|
|
2089
|
-
force:
|
|
2090
|
+
force: o == null ? void 0 : o.force
|
|
2090
2091
|
});
|
|
2091
2092
|
});
|
|
2092
2093
|
}
|
|
2093
2094
|
async getRemoteModuleAndOptions(t) {
|
|
2094
|
-
const { host:
|
|
2095
|
+
const { host: o } = this, { id: r } = t;
|
|
2095
2096
|
let s;
|
|
2096
2097
|
try {
|
|
2097
2098
|
s = await this.hooks.lifecycle.beforeRequest.emit({
|
|
2098
2099
|
id: r,
|
|
2099
|
-
options:
|
|
2100
|
-
origin:
|
|
2100
|
+
options: o.options,
|
|
2101
|
+
origin: o
|
|
2101
2102
|
});
|
|
2102
2103
|
} catch (g) {
|
|
2103
2104
|
if (s = await this.hooks.lifecycle.errorLoadRemote.emit({
|
|
2104
2105
|
id: r,
|
|
2105
|
-
options:
|
|
2106
|
-
origin:
|
|
2106
|
+
options: o.options,
|
|
2107
|
+
origin: o,
|
|
2107
2108
|
from: "runtime",
|
|
2108
2109
|
error: g,
|
|
2109
2110
|
lifecycle: "beforeRequest"
|
|
2110
2111
|
}), !s)
|
|
2111
2112
|
throw g;
|
|
2112
2113
|
}
|
|
2113
|
-
const { id:
|
|
2114
|
+
const { id: a } = s, l = matchRemoteWithNameAndExpose(o.options.remotes, a);
|
|
2114
2115
|
assert(l, getShortErrorMsg(RUNTIME_004, runtimeDescMap, {
|
|
2115
|
-
hostName:
|
|
2116
|
-
requestId:
|
|
2116
|
+
hostName: o.options.name,
|
|
2117
|
+
requestId: a
|
|
2117
2118
|
}));
|
|
2118
|
-
const { remote:
|
|
2119
|
-
id:
|
|
2119
|
+
const { remote: i } = l, c = getRemoteInfo(i), u = await o.sharedHandler.hooks.lifecycle.afterResolve.emit(_extends$1({
|
|
2120
|
+
id: a
|
|
2120
2121
|
}, l, {
|
|
2121
|
-
options:
|
|
2122
|
-
origin:
|
|
2122
|
+
options: o.options,
|
|
2123
|
+
origin: o,
|
|
2123
2124
|
remoteInfo: c
|
|
2124
2125
|
})), { remote: p, expose: d } = u;
|
|
2125
|
-
assert(p && d, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${
|
|
2126
|
-
let m =
|
|
2126
|
+
assert(p && d, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
|
|
2127
|
+
let m = o.moduleCache.get(p.name);
|
|
2127
2128
|
const y = {
|
|
2128
|
-
host:
|
|
2129
|
+
host: o,
|
|
2129
2130
|
remoteInfo: c
|
|
2130
2131
|
};
|
|
2131
|
-
return m || (m = new Module(y),
|
|
2132
|
+
return m || (m = new Module(y), o.moduleCache.set(p.name, m)), {
|
|
2132
2133
|
module: m,
|
|
2133
2134
|
moduleOptions: y,
|
|
2134
2135
|
remoteMatchInfo: u
|
|
2135
2136
|
};
|
|
2136
2137
|
}
|
|
2137
|
-
registerRemote(t,
|
|
2138
|
-
const { host: s } = this,
|
|
2138
|
+
registerRemote(t, o, r) {
|
|
2139
|
+
const { host: s } = this, a = () => {
|
|
2139
2140
|
if (t.alias) {
|
|
2140
|
-
const
|
|
2141
|
+
const i = o.find((c) => {
|
|
2141
2142
|
var u;
|
|
2142
2143
|
return t.alias && (c.name.startsWith(t.alias) || ((u = c.alias) == null ? void 0 : u.startsWith(t.alias)));
|
|
2143
2144
|
});
|
|
2144
|
-
assert(!
|
|
2145
|
+
assert(!i, `The alias ${t.alias} of remote ${t.name} is not allowed to be the prefix of ${i && i.name} name or alias`);
|
|
2145
2146
|
}
|
|
2146
2147
|
"entry" in t && isBrowserEnv() && !t.entry.startsWith("http") && (t.entry = new URL(t.entry, window.location.origin).href), t.shareScope || (t.shareScope = DEFAULT_SCOPE), t.type || (t.type = DEFAULT_REMOTE_TYPE);
|
|
2147
2148
|
};
|
|
@@ -2149,38 +2150,38 @@ class RemoteHandler {
|
|
|
2149
2150
|
remote: t,
|
|
2150
2151
|
origin: s
|
|
2151
2152
|
});
|
|
2152
|
-
const l =
|
|
2153
|
+
const l = o.find((i) => i.name === t.name);
|
|
2153
2154
|
if (!l)
|
|
2154
|
-
|
|
2155
|
+
a(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
|
|
2155
2156
|
remote: t,
|
|
2156
2157
|
origin: s
|
|
2157
2158
|
});
|
|
2158
2159
|
else {
|
|
2159
|
-
const
|
|
2160
|
+
const i = [
|
|
2160
2161
|
`The remote "${t.name}" is already registered.`,
|
|
2161
2162
|
"Please note that overriding it may cause unexpected errors."
|
|
2162
2163
|
];
|
|
2163
|
-
r != null && r.force && (this.removeRemote(l),
|
|
2164
|
+
r != null && r.force && (this.removeRemote(l), a(), o.push(t), this.hooks.lifecycle.registerRemote.emit({
|
|
2164
2165
|
remote: t,
|
|
2165
2166
|
origin: s
|
|
2166
|
-
}), warn$1(
|
|
2167
|
+
}), warn$1(i.join(" ")));
|
|
2167
2168
|
}
|
|
2168
2169
|
}
|
|
2169
2170
|
removeRemote(t) {
|
|
2170
2171
|
try {
|
|
2171
|
-
const { host: r } = this, { name: s } = t,
|
|
2172
|
-
|
|
2172
|
+
const { host: r } = this, { name: s } = t, a = r.options.remotes.findIndex((i) => i.name === s);
|
|
2173
|
+
a !== -1 && r.options.remotes.splice(a, 1);
|
|
2173
2174
|
const l = r.moduleCache.get(t.name);
|
|
2174
2175
|
if (l) {
|
|
2175
|
-
const
|
|
2176
|
+
const i = l.remoteInfo, c = i.entryGlobalName;
|
|
2176
2177
|
if (CurrentGlobal[c]) {
|
|
2177
|
-
var
|
|
2178
|
-
(
|
|
2178
|
+
var o;
|
|
2179
|
+
(o = Object.getOwnPropertyDescriptor(CurrentGlobal, c)) != null && o.configurable ? delete CurrentGlobal[c] : CurrentGlobal[c] = void 0;
|
|
2179
2180
|
}
|
|
2180
2181
|
const u = getRemoteEntryUniqueKey(l.remoteInfo);
|
|
2181
|
-
globalLoading[u] && delete globalLoading[u], r.snapshotHandler.manifestCache.delete(
|
|
2182
|
-
let p =
|
|
2183
|
-
const d = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) =>
|
|
2182
|
+
globalLoading[u] && delete globalLoading[u], r.snapshotHandler.manifestCache.delete(i.entry);
|
|
2183
|
+
let p = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
|
|
2184
|
+
const d = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === p : y.name === p);
|
|
2184
2185
|
if (d !== -1) {
|
|
2185
2186
|
const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[d];
|
|
2186
2187
|
p = y.options.id || p;
|
|
@@ -2195,7 +2196,7 @@ class RemoteHandler {
|
|
|
2195
2196
|
const A = S[R];
|
|
2196
2197
|
A && Object.keys(A).forEach((T) => {
|
|
2197
2198
|
const $ = A[T];
|
|
2198
|
-
$ && typeof $ == "object" && $.from ===
|
|
2199
|
+
$ && typeof $ == "object" && $.from === i.name && ($.loaded || $.loading ? ($.useIn = $.useIn.filter((w) => w !== i.name), $.useIn.length ? E = !1 : _.push([
|
|
2199
2200
|
b,
|
|
2200
2201
|
I,
|
|
2201
2202
|
R,
|
|
@@ -2245,60 +2246,60 @@ const USE_SNAPSHOT = typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN == "boolean"
|
|
|
2245
2246
|
class FederationHost {
|
|
2246
2247
|
initOptions(t) {
|
|
2247
2248
|
this.registerPlugins(t.plugins);
|
|
2248
|
-
const
|
|
2249
|
-
return this.options =
|
|
2249
|
+
const o = this.formatOptions(this.options, t);
|
|
2250
|
+
return this.options = o, o;
|
|
2250
2251
|
}
|
|
2251
|
-
async loadShare(t,
|
|
2252
|
-
return this.sharedHandler.loadShare(t,
|
|
2252
|
+
async loadShare(t, o) {
|
|
2253
|
+
return this.sharedHandler.loadShare(t, o);
|
|
2253
2254
|
}
|
|
2254
2255
|
// The lib function will only be available if the shared set by eager or runtime init is set or the shared is successfully loaded.
|
|
2255
2256
|
// 1. If the loaded shared already exists globally, then it will be reused
|
|
2256
2257
|
// 2. If lib exists in local shared, it will be used directly
|
|
2257
2258
|
// 3. If the local get returns something other than Promise, then it will be used directly
|
|
2258
|
-
loadShareSync(t,
|
|
2259
|
-
return this.sharedHandler.loadShareSync(t,
|
|
2259
|
+
loadShareSync(t, o) {
|
|
2260
|
+
return this.sharedHandler.loadShareSync(t, o);
|
|
2260
2261
|
}
|
|
2261
|
-
initializeSharing(t = DEFAULT_SCOPE,
|
|
2262
|
-
return this.sharedHandler.initializeSharing(t,
|
|
2262
|
+
initializeSharing(t = DEFAULT_SCOPE, o) {
|
|
2263
|
+
return this.sharedHandler.initializeSharing(t, o);
|
|
2263
2264
|
}
|
|
2264
|
-
initRawContainer(t,
|
|
2265
|
+
initRawContainer(t, o, r) {
|
|
2265
2266
|
const s = getRemoteInfo({
|
|
2266
2267
|
name: t,
|
|
2267
|
-
entry:
|
|
2268
|
-
}),
|
|
2268
|
+
entry: o
|
|
2269
|
+
}), a = new Module({
|
|
2269
2270
|
host: this,
|
|
2270
2271
|
remoteInfo: s
|
|
2271
2272
|
});
|
|
2272
|
-
return
|
|
2273
|
+
return a.remoteEntryExports = r, this.moduleCache.set(t, a), a;
|
|
2273
2274
|
}
|
|
2274
2275
|
// eslint-disable-next-line max-lines-per-function
|
|
2275
2276
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2276
|
-
async loadRemote(t,
|
|
2277
|
-
return this.remoteHandler.loadRemote(t,
|
|
2277
|
+
async loadRemote(t, o) {
|
|
2278
|
+
return this.remoteHandler.loadRemote(t, o);
|
|
2278
2279
|
}
|
|
2279
2280
|
// eslint-disable-next-line @typescript-eslint/member-ordering
|
|
2280
2281
|
async preloadRemote(t) {
|
|
2281
2282
|
return this.remoteHandler.preloadRemote(t);
|
|
2282
2283
|
}
|
|
2283
|
-
initShareScopeMap(t,
|
|
2284
|
-
this.sharedHandler.initShareScopeMap(t,
|
|
2284
|
+
initShareScopeMap(t, o, r = {}) {
|
|
2285
|
+
this.sharedHandler.initShareScopeMap(t, o, r);
|
|
2285
2286
|
}
|
|
2286
|
-
formatOptions(t,
|
|
2287
|
-
const { shared: r } = formatShareConfigs(t,
|
|
2287
|
+
formatOptions(t, o) {
|
|
2288
|
+
const { shared: r } = formatShareConfigs(t, o), { userOptions: s, options: a } = this.hooks.lifecycle.beforeInit.emit({
|
|
2288
2289
|
origin: this,
|
|
2289
|
-
userOptions:
|
|
2290
|
+
userOptions: o,
|
|
2290
2291
|
options: t,
|
|
2291
2292
|
shareInfo: r
|
|
2292
|
-
}), l = this.remoteHandler.formatAndRegisterRemote(
|
|
2293
|
-
...
|
|
2293
|
+
}), l = this.remoteHandler.formatAndRegisterRemote(a, s), { shared: i } = this.sharedHandler.registerShared(a, s), c = [
|
|
2294
|
+
...a.plugins
|
|
2294
2295
|
];
|
|
2295
2296
|
s.plugins && s.plugins.forEach((p) => {
|
|
2296
2297
|
c.includes(p) || c.push(p);
|
|
2297
2298
|
});
|
|
2298
|
-
const u = _extends$1({}, t,
|
|
2299
|
+
const u = _extends$1({}, t, o, {
|
|
2299
2300
|
plugins: c,
|
|
2300
2301
|
remotes: l,
|
|
2301
|
-
shared:
|
|
2302
|
+
shared: i
|
|
2302
2303
|
});
|
|
2303
2304
|
return this.hooks.lifecycle.init.emit({
|
|
2304
2305
|
origin: this,
|
|
@@ -2306,11 +2307,18 @@ class FederationHost {
|
|
|
2306
2307
|
}), u;
|
|
2307
2308
|
}
|
|
2308
2309
|
registerPlugins(t) {
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2310
|
+
const o = registerPlugins(t, [
|
|
2311
|
+
this.hooks,
|
|
2312
|
+
this.remoteHandler.hooks,
|
|
2313
|
+
this.sharedHandler.hooks,
|
|
2314
|
+
this.snapshotHandler.hooks,
|
|
2315
|
+
this.loaderHook,
|
|
2316
|
+
this.bridgeHook
|
|
2317
|
+
]);
|
|
2318
|
+
this.options.plugins = this.options.plugins.reduce((r, s) => (s && r && !r.find((a) => a.name === s.name) && r.push(s), r), o || []);
|
|
2311
2319
|
}
|
|
2312
|
-
registerRemotes(t,
|
|
2313
|
-
return this.remoteHandler.registerRemotes(t,
|
|
2320
|
+
registerRemotes(t, o) {
|
|
2321
|
+
return this.remoteHandler.registerRemotes(t, o);
|
|
2314
2322
|
}
|
|
2315
2323
|
constructor(t) {
|
|
2316
2324
|
this.hooks = new PluginSystem({
|
|
@@ -2334,13 +2342,13 @@ class FederationHost {
|
|
|
2334
2342
|
beforeBridgeDestroy: new SyncHook(),
|
|
2335
2343
|
afterBridgeDestroy: new SyncHook()
|
|
2336
2344
|
});
|
|
2337
|
-
const
|
|
2345
|
+
const o = USE_SNAPSHOT ? [
|
|
2338
2346
|
snapshotPlugin(),
|
|
2339
2347
|
generatePreloadAssetsPlugin()
|
|
2340
2348
|
] : [], r = {
|
|
2341
2349
|
id: getBuilderId(),
|
|
2342
2350
|
name: t.name,
|
|
2343
|
-
plugins:
|
|
2351
|
+
plugins: o,
|
|
2344
2352
|
remotes: [],
|
|
2345
2353
|
shared: {},
|
|
2346
2354
|
inBrowser: isBrowserEnv()
|
|
@@ -2356,8 +2364,8 @@ function getInstance() {
|
|
|
2356
2364
|
return FederationInstance;
|
|
2357
2365
|
}
|
|
2358
2366
|
setGlobalFederationConstructor(FederationHost);
|
|
2359
|
-
function createBridgeComponent(
|
|
2360
|
-
const t = /* @__PURE__ */ new Map(),
|
|
2367
|
+
function createBridgeComponent(n) {
|
|
2368
|
+
const t = /* @__PURE__ */ new Map(), o = getInstance();
|
|
2361
2369
|
return () => ({
|
|
2362
2370
|
__APP_VERSION__: "0.16.0",
|
|
2363
2371
|
async render(r) {
|
|
@@ -2365,17 +2373,17 @@ function createBridgeComponent(o) {
|
|
|
2365
2373
|
LoggerInstance.debug("createBridgeComponent render Info", r);
|
|
2366
2374
|
const {
|
|
2367
2375
|
moduleName: s,
|
|
2368
|
-
dom:
|
|
2376
|
+
dom: a,
|
|
2369
2377
|
basename: l,
|
|
2370
|
-
memoryRoute:
|
|
2378
|
+
memoryRoute: i,
|
|
2371
2379
|
hashRoute: c,
|
|
2372
2380
|
...u
|
|
2373
|
-
} = r, p = Vue.createApp(
|
|
2374
|
-
t.set(
|
|
2375
|
-
const d = await ((_ = (E = (g =
|
|
2381
|
+
} = r, p = Vue.createApp(n.rootComponent, u);
|
|
2382
|
+
t.set(a, p);
|
|
2383
|
+
const d = await ((_ = (E = (g = o == null ? void 0 : o.bridgeHook) == null ? void 0 : g.lifecycle) == null ? void 0 : E.beforeBridgeRender) == null ? void 0 : _.emit(r)), m = d && typeof d == "object" && (d != null && d.extraProps) ? d == null ? void 0 : d.extraProps : {}, y = n.appOptions({
|
|
2376
2384
|
app: p,
|
|
2377
2385
|
basename: l,
|
|
2378
|
-
memoryRoute:
|
|
2386
|
+
memoryRoute: i,
|
|
2379
2387
|
hashRoute: c,
|
|
2380
2388
|
...u,
|
|
2381
2389
|
...m
|
|
@@ -2394,9 +2402,9 @@ function createBridgeComponent(o) {
|
|
|
2394
2402
|
LoggerInstance.debug("createBridgeComponent render router info>>>", {
|
|
2395
2403
|
moduleName: s,
|
|
2396
2404
|
router: I
|
|
2397
|
-
}),
|
|
2405
|
+
}), i && await I.push(i.entryPath), p.use(I);
|
|
2398
2406
|
}
|
|
2399
|
-
p.mount(
|
|
2407
|
+
p.mount(a);
|
|
2400
2408
|
},
|
|
2401
2409
|
destroy(r) {
|
|
2402
2410
|
LoggerInstance.debug("createBridgeComponent destroy Info", r);
|
|
@@ -2406,8 +2414,8 @@ function createBridgeComponent(o) {
|
|
|
2406
2414
|
});
|
|
2407
2415
|
}
|
|
2408
2416
|
function e() {
|
|
2409
|
-
const
|
|
2410
|
-
window.dispatchEvent(
|
|
2417
|
+
const n = new PopStateEvent("popstate", { state: window.history.state });
|
|
2418
|
+
window.dispatchEvent(n);
|
|
2411
2419
|
}
|
|
2412
2420
|
const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
2413
2421
|
name: "RemoteApp",
|
|
@@ -2420,76 +2428,73 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
|
|
|
2420
2428
|
rootAttrs: Object
|
|
2421
2429
|
},
|
|
2422
2430
|
inheritAttrs: !1,
|
|
2423
|
-
setup(
|
|
2424
|
-
const t = ref(null),
|
|
2431
|
+
setup(n) {
|
|
2432
|
+
const t = ref(null), o = ref(null), r = ref(""), s = useRoute(), a = getInstance(), l = useAttrs(), i = async () => {
|
|
2425
2433
|
var m, y, g, E;
|
|
2426
|
-
const u = (m =
|
|
2427
|
-
|
|
2434
|
+
const u = (m = n.providerInfo) == null ? void 0 : m.call(n);
|
|
2435
|
+
o.value = u;
|
|
2428
2436
|
let p = {
|
|
2429
2437
|
...l,
|
|
2430
|
-
moduleName:
|
|
2438
|
+
moduleName: n.moduleName,
|
|
2431
2439
|
dom: t.value,
|
|
2432
|
-
basename:
|
|
2433
|
-
memoryRoute:
|
|
2434
|
-
hashRoute:
|
|
2440
|
+
basename: n.basename,
|
|
2441
|
+
memoryRoute: n.memoryRoute,
|
|
2442
|
+
hashRoute: n.hashRoute
|
|
2435
2443
|
};
|
|
2436
|
-
LoggerInstance.debug("
|
|
2437
|
-
const d = await ((E = (g = (y =
|
|
2444
|
+
LoggerInstance.debug("createRemoteComponent LazyComponent render >>>", p);
|
|
2445
|
+
const d = await ((E = (g = (y = a == null ? void 0 : a.bridgeHook) == null ? void 0 : y.lifecycle) == null ? void 0 : g.beforeBridgeRender) == null ? void 0 : E.emit(p)) || {};
|
|
2438
2446
|
p = {
|
|
2439
2447
|
...p,
|
|
2440
2448
|
...d.extraProps
|
|
2441
2449
|
}, u.render(p);
|
|
2442
2450
|
}, c = watch(() => s == null ? void 0 : s.path, (u) => {
|
|
2443
|
-
u !== s.path &&
|
|
2444
|
-
...
|
|
2451
|
+
u !== s.path && i(), r.value !== "" && r.value !== u && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
|
|
2452
|
+
...n,
|
|
2445
2453
|
pathname: s.path
|
|
2446
2454
|
}), e()), r.value = u;
|
|
2447
2455
|
});
|
|
2448
2456
|
return onMounted(() => {
|
|
2449
|
-
|
|
2457
|
+
i();
|
|
2450
2458
|
}), onBeforeUnmount(() => {
|
|
2451
2459
|
var u;
|
|
2452
|
-
LoggerInstance.debug("
|
|
2453
|
-
...
|
|
2454
|
-
}), c(), (u =
|
|
2460
|
+
LoggerInstance.debug("createRemoteComponent LazyComponent destroy >>>", {
|
|
2461
|
+
...n
|
|
2462
|
+
}), c(), (u = o.value) == null || u.destroy({
|
|
2455
2463
|
dom: t.value
|
|
2456
2464
|
});
|
|
2457
|
-
}), () => createVNode("div", mergeProps(
|
|
2465
|
+
}), () => createVNode("div", mergeProps(n.rootAttrs || {}, {
|
|
2458
2466
|
ref: t
|
|
2459
2467
|
}), null);
|
|
2460
2468
|
}
|
|
2461
2469
|
});
|
|
2462
|
-
function
|
|
2470
|
+
function createRemoteComponent(n) {
|
|
2463
2471
|
return defineAsyncComponent({
|
|
2464
2472
|
__APP_VERSION__: "0.16.0",
|
|
2465
|
-
...
|
|
2473
|
+
...n.asyncComponentOptions,
|
|
2466
2474
|
//@ts-ignore
|
|
2467
2475
|
loader: async () => {
|
|
2468
2476
|
var c, u;
|
|
2469
2477
|
const t = useRoute();
|
|
2470
|
-
let
|
|
2478
|
+
let o = "/";
|
|
2471
2479
|
const r = (u = (c = t == null ? void 0 : t.matched) == null ? void 0 : c[0]) == null ? void 0 : u.path;
|
|
2472
|
-
r && (r.endsWith("/:pathMatch(.*)*") ?
|
|
2473
|
-
const s = (
|
|
2474
|
-
LoggerInstance.debug(
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
}
|
|
2480
|
-
);
|
|
2481
|
-
const i = await o.loader(), l = i && i[Symbol.for("mf_module_id")], a = i[s];
|
|
2480
|
+
r && (r.endsWith("/:pathMatch(.*)*") ? o = r.replace("/:pathMatch(.*)*", "") : o = t.matched[0].path);
|
|
2481
|
+
const s = (n == null ? void 0 : n.export) || "default";
|
|
2482
|
+
LoggerInstance.debug("createRemoteComponent LazyComponent create >>>", {
|
|
2483
|
+
basename: o,
|
|
2484
|
+
info: n
|
|
2485
|
+
});
|
|
2486
|
+
const a = await n.loader(), l = a && a[Symbol.for("mf_module_id")], i = a[s];
|
|
2482
2487
|
if (LoggerInstance.debug(
|
|
2483
|
-
"
|
|
2484
|
-
{ moduleName: l, module:
|
|
2485
|
-
), s in
|
|
2488
|
+
"createRemoteComponent LazyComponent loadRemote info >>>",
|
|
2489
|
+
{ moduleName: l, module: a, exportName: s, basename: o, route: t }
|
|
2490
|
+
), s in a && typeof i == "function")
|
|
2486
2491
|
return {
|
|
2487
2492
|
render() {
|
|
2488
2493
|
return h(RemoteApp, {
|
|
2489
2494
|
moduleName: l,
|
|
2490
|
-
providerInfo:
|
|
2491
|
-
basename:
|
|
2492
|
-
rootAttrs:
|
|
2495
|
+
providerInfo: i,
|
|
2496
|
+
basename: o,
|
|
2497
|
+
rootAttrs: n.rootAttrs
|
|
2493
2498
|
});
|
|
2494
2499
|
}
|
|
2495
2500
|
};
|
|
@@ -2497,13 +2502,7 @@ function createRemoteAppComponent(o) {
|
|
|
2497
2502
|
}
|
|
2498
2503
|
});
|
|
2499
2504
|
}
|
|
2500
|
-
function createRemoteComponent(o) {
|
|
2501
|
-
return LoggerInstance.warn(
|
|
2502
|
-
"createRemoteAppComponent is deprecated, please use createRemoteAppComponent instead!"
|
|
2503
|
-
), createRemoteAppComponent(o);
|
|
2504
|
-
}
|
|
2505
2505
|
export {
|
|
2506
2506
|
createBridgeComponent,
|
|
2507
|
-
createRemoteAppComponent,
|
|
2508
2507
|
createRemoteComponent
|
|
2509
2508
|
};
|