@module-federation/bridge-vue3 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -18,13 +18,16 @@ __export(browser_exports, {
18
18
  var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, supportColor = () => {
19
19
  if (typeof supportsSubstitutions < "u")
20
20
  return supportsSubstitutions;
21
+ const r = console.log;
21
22
  try {
22
- const r = "color test", t = "color: red;", n = console.log;
23
- console.log = (...o) => {
24
- o[0] === `%c${r}` && o[1] === t && (supportsSubstitutions = !0);
25
- }, console.log(`%c${r}`, t), console.log = n;
23
+ const t = "color test", n = "color: red;";
24
+ supportsSubstitutions = !1, console.log = (...o) => {
25
+ o[0] === `%c${t}` && o[1] === n && (supportsSubstitutions = !0);
26
+ }, console.log(`%c${t}`, n);
26
27
  } catch {
27
28
  supportsSubstitutions = !1;
29
+ } finally {
30
+ console.log = r;
28
31
  }
29
32
  return supportsSubstitutions;
30
33
  }, ansiToCss = {
@@ -45,10 +48,16 @@ var browser = __toCommonJS(browser_exports), supportsSubstitutions = void 0, sup
45
48
  formatter("gray");
46
49
  function getLabel(r, t, n) {
47
50
  let o = [""];
48
- return "label" in t && (o = [n[r] || t.label || ""], o = bold(t.color ? t.color(o) : o[0])), o = o.filter(Boolean), o;
51
+ if ("label" in t)
52
+ if (o = [(r !== "log" ? n[r] : void 0) || t.label || ""], t.color) {
53
+ const a = t.color(o[0]);
54
+ Array.isArray(a) && a.length === 2 ? o = bold([a[0], a[1]]) : o = bold(a[0] || "");
55
+ } else
56
+ o = bold(o[0]);
57
+ return o = o.filter(Boolean), o;
49
58
  }
50
59
  function finalLog(r, t, n, o) {
51
- r.length ? Array.isArray(o) ? console.log(...r, ...o) : console.log(...r, t) : Array.isArray(o) ? console.log(...o) : console.log(t, ...n);
60
+ r.length ? Array.isArray(o) ? console.log(...r, ...o, ...n) : console.log(...r, t, ...n) : Array.isArray(o) ? console.log(...o) : console.log(t, ...n);
52
61
  }
53
62
  var LOG_LEVEL = {
54
63
  error: 0,
@@ -56,47 +65,57 @@ var LOG_LEVEL = {
56
65
  info: 2,
57
66
  log: 3,
58
67
  verbose: 4
59
- }, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r), createLogger$1 = (r = {}, { getLabel: t, handleError: n, finalLog: o, greet: s, LOG_TYPES: a }) => {
60
- let l = r.level || "log", i = r.labels || {}, c = (d, p, ...m) => {
61
- if (LOG_LEVEL[a[d].level] > LOG_LEVEL[l])
68
+ }, errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/, anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/, isErrorStackMessage = (r) => errorStackRegExp.test(r) || anonymousErrorStackRegExp.test(r);
69
+ function validateOptions(r) {
70
+ const t = { ...r };
71
+ if (r.labels && typeof r.labels != "object")
72
+ throw new Error("Labels must be an object");
73
+ if (r.level && typeof r.level != "string")
74
+ throw new Error("Level must be a string");
75
+ return t;
76
+ }
77
+ var createLogger$1 = (r = {}, { getLabel: t, handleError: n, finalLog: o, greet: s, LOG_TYPES: a }) => {
78
+ const l = validateOptions(r);
79
+ let i = l.level || "log", c = l.labels || {}, u = (d, m, ...y) => {
80
+ if (LOG_LEVEL[a[d].level] > LOG_LEVEL[i])
62
81
  return;
63
- if (p == null)
82
+ if (m == null)
64
83
  return console.log();
65
- let y = a[d], _ = "";
66
- const R = t(d, y, i);
67
- if (p instanceof Error)
68
- if (p.stack) {
69
- let [g, ...E] = p.stack.split(`
84
+ let _ = a[d], E = "";
85
+ const g = t(d, _, c);
86
+ if (m instanceof Error)
87
+ if (m.stack) {
88
+ let [b, ...S] = m.stack.split(`
70
89
  `);
71
- g.startsWith("Error: ") && (g = g.slice(7)), _ = `${g}
72
- ${n(E.join(`
90
+ b.startsWith("Error: ") && (b = b.slice(7)), E = `${b}
91
+ ${n(S.join(`
73
92
  `))}`;
74
93
  } else
75
- _ = p.message;
94
+ E = m.message;
76
95
  else
77
- y.level === "error" && typeof p == "string" ? _ = p.split(`
78
- `).map((E) => isErrorStackMessage(E) ? n(E) : E).join(`
79
- `) : _ = `${p}`;
80
- o(R, _, m, p);
81
- }, u = {
96
+ _.level === "error" && typeof m == "string" ? E = m.split(`
97
+ `).map((S) => isErrorStackMessage(S) ? n(S) : S).join(`
98
+ `) : E = `${m}`;
99
+ o(g, E, y, m);
100
+ }, p = {
82
101
  // greet
83
- greet: (d) => c("log", s(d))
102
+ greet: (d) => u("log", s(d))
84
103
  };
85
104
  return Object.keys(a).forEach((d) => {
86
- u[d] = (...p) => c(d, ...p);
87
- }), Object.defineProperty(u, "level", {
88
- get: () => l,
89
- set(d) {
90
- l = d;
91
- }
92
- }), Object.defineProperty(u, "labels", {
105
+ p[d] = (...m) => u(d, ...m);
106
+ }), Object.defineProperty(p, "level", {
93
107
  get: () => i,
94
108
  set(d) {
95
109
  i = d;
96
110
  }
97
- }), u.override = (d) => {
98
- Object.assign(u, d);
99
- }, u;
111
+ }), Object.defineProperty(p, "labels", {
112
+ get: () => c,
113
+ set(d) {
114
+ c = d;
115
+ }
116
+ }), p.override = (d) => {
117
+ Object.assign(p, d);
118
+ }, p;
100
119
  }, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (r) => !/[\s\n]/.test(r);
101
120
  function gradient(r) {
102
121
  if (!supportColor())
@@ -107,8 +126,8 @@ function gradient(r) {
107
126
  let s = "", a = [];
108
127
  return t.forEach((l) => {
109
128
  if (isWord(l)) {
110
- const i = n.indexOf(l) / o, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), d = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
111
- s += `%c${l}`, a.push(`color: rgb(${c},${u},${d}); font-weight: bold;`);
129
+ const i = n.indexOf(l) / o, c = Math.round(startColor[0] + (endColor[0] - startColor[0]) * i), u = Math.round(startColor[1] + (endColor[1] - startColor[1]) * i), p = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
130
+ s += `%c${l}`, a.push(`color: rgb(${c},${u},${p}); font-weight: bold;`);
112
131
  } else
113
132
  s += l;
114
133
  }), [s, ...a];
@@ -265,63 +284,63 @@ function generateSnapshotFromManifest(r, t = {}) {
265
284
  const { remotes: s = {}, overrides: a = {}, version: l } = t;
266
285
  let i;
267
286
  const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && l ? inferAutoPublicPath(l) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(a);
268
- let d = {};
287
+ let p = {};
269
288
  if (!Object.keys(s).length) {
270
- var p;
271
- d = ((p = r.remotes) == null ? void 0 : p.reduce((b, $) => {
289
+ var d;
290
+ p = ((d = r.remotes) == null ? void 0 : d.reduce((R, $) => {
272
291
  let w;
273
292
  const O = $.federationContainerName;
274
- return u.includes(O) ? w = a[O] : "version" in $ ? w = $.version : w = $.entry, b[O] = {
293
+ return u.includes(O) ? w = a[O] : "version" in $ ? w = $.version : w = $.entry, R[O] = {
275
294
  matchedVersion: w
276
- }, b;
295
+ }, R;
277
296
  }, {})) || {};
278
297
  }
279
- Object.keys(s).forEach((b) => d[b] = {
298
+ Object.keys(s).forEach((R) => p[R] = {
280
299
  // overrides will override dependencies
281
- matchedVersion: u.includes(b) ? a[b] : s[b]
300
+ matchedVersion: u.includes(R) ? a[R] : s[R]
282
301
  });
283
- const { remoteEntry: { path: m, name: y, type: _ }, types: R, buildInfo: { buildVersion: g }, globalName: E, ssrRemoteEntry: v } = r.metaData, { exposes: I } = r;
284
- let S = {
302
+ const { remoteEntry: { path: m, name: y, type: _ }, types: E, buildInfo: { buildVersion: g }, globalName: b, ssrRemoteEntry: S } = r.metaData, { exposes: v } = r;
303
+ let I = {
285
304
  version: l || "",
286
305
  buildVersion: g,
287
- globalName: E,
306
+ globalName: b,
288
307
  remoteEntry: simpleJoinRemoteEntry(m, y),
289
308
  remoteEntryType: _,
290
- remoteTypes: simpleJoinRemoteEntry(R.path, R.name),
291
- remoteTypesZip: R.zip || "",
292
- remoteTypesAPI: R.api || "",
293
- remotesInfo: d,
294
- shared: r == null ? void 0 : r.shared.map((b) => ({
295
- assets: b.assets,
296
- sharedName: b.name,
297
- version: b.version
309
+ remoteTypes: simpleJoinRemoteEntry(E.path, E.name),
310
+ remoteTypesZip: E.zip || "",
311
+ remoteTypesAPI: E.api || "",
312
+ remotesInfo: p,
313
+ shared: r == null ? void 0 : r.shared.map((R) => ({
314
+ assets: R.assets,
315
+ sharedName: R.name,
316
+ version: R.version
298
317
  })),
299
- modules: I == null ? void 0 : I.map((b) => ({
300
- moduleName: b.name,
301
- modulePath: b.path,
302
- assets: b.assets
318
+ modules: v == null ? void 0 : v.map((R) => ({
319
+ moduleName: R.name,
320
+ modulePath: R.path,
321
+ assets: R.assets
303
322
  }))
304
323
  };
305
324
  if ((n = r.metaData) != null && n.prefetchInterface) {
306
- const b = r.metaData.prefetchInterface;
307
- S = _extends$2({}, S, {
308
- prefetchInterface: b
325
+ const R = r.metaData.prefetchInterface;
326
+ I = _extends$2({}, I, {
327
+ prefetchInterface: R
309
328
  });
310
329
  }
311
330
  if ((o = r.metaData) != null && o.prefetchEntry) {
312
- const { path: b, name: $, type: w } = r.metaData.prefetchEntry;
313
- S = _extends$2({}, S, {
314
- prefetchEntry: simpleJoinRemoteEntry(b, $),
331
+ const { path: R, name: $, type: w } = r.metaData.prefetchEntry;
332
+ I = _extends$2({}, I, {
333
+ prefetchEntry: simpleJoinRemoteEntry(R, $),
315
334
  prefetchEntryType: w
316
335
  });
317
336
  }
318
- if ("publicPath" in r.metaData ? i = _extends$2({}, S, {
337
+ if ("publicPath" in r.metaData ? i = _extends$2({}, I, {
319
338
  publicPath: c()
320
- }) : i = _extends$2({}, S, {
339
+ }) : i = _extends$2({}, I, {
321
340
  getPublicPath: c()
322
- }), v) {
323
- const b = simpleJoinRemoteEntry(v.path, v.name);
324
- i.ssrRemoteEntry = b, i.ssrRemoteEntryType = v.type || "commonjs-module";
341
+ }), S) {
342
+ const R = simpleJoinRemoteEntry(S.path, S.name);
343
+ i.ssrRemoteEntry = R, i.ssrRemoteEntryType = S.type || "commonjs-module";
325
344
  }
326
345
  return i;
327
346
  }
@@ -359,21 +378,22 @@ function createScript(r) {
359
378
  });
360
379
  }
361
380
  const l = async (i, c) => {
362
- var u;
363
- if (clearTimeout(s), t && (t.onerror = null, t.onload = null, safeWrapper(() => {
364
- const { needDeleteScript: m = !0 } = r;
365
- m && t != null && t.parentNode && t.parentNode.removeChild(t);
381
+ clearTimeout(s);
382
+ const u = () => {
383
+ (c == null ? void 0 : c.type) === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(c)) : r != null && r.cb && (r == null || r.cb());
384
+ };
385
+ if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
386
+ const { needDeleteScript: p = !0 } = r;
387
+ p && t != null && t.parentNode && t.parentNode.removeChild(t);
366
388
  }), i && typeof i == "function")) {
367
- var d;
368
- const m = i(c);
369
- if (m instanceof Promise) {
370
- var p;
371
- const y = await m;
372
- return r == null || (p = r.cb) == null || p.call(r), y;
389
+ const p = i(c);
390
+ if (p instanceof Promise) {
391
+ const d = await p;
392
+ return u(), d;
373
393
  }
374
- return r == null || (d = r.cb) == null || d.call(r), m;
394
+ return u(), p;
375
395
  }
376
- r == null || (u = r.cb) == null || u.call(r);
396
+ u();
377
397
  };
378
398
  return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), s = setTimeout(() => {
379
399
  l(null, new Error(`Remote script "${r.url}" time-outed.`));
@@ -401,14 +421,17 @@ function createLink(r) {
401
421
  });
402
422
  }
403
423
  const s = (a, l) => {
424
+ const i = () => {
425
+ (l == null ? void 0 : l.type) === "error" ? r != null && r.onErrorCallback && (r == null || r.onErrorCallback(l)) : r != null && r.cb && (r == null || r.cb());
426
+ };
404
427
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
405
- const { needDeleteLink: i = !0 } = r;
406
- i && t != null && t.parentNode && t.parentNode.removeChild(t);
428
+ const { needDeleteLink: c = !0 } = r;
429
+ c && t != null && t.parentNode && t.parentNode.removeChild(t);
407
430
  }), a)) {
408
- const i = a(l);
409
- return r.cb(), i;
431
+ const c = a(l);
432
+ return i(), c;
410
433
  }
411
- r.cb();
434
+ i();
412
435
  };
413
436
  return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
414
437
  link: t,
@@ -421,6 +444,7 @@ function loadScript(r, t) {
421
444
  const { script: l, needAttach: i } = createScript({
422
445
  url: r,
423
446
  cb: s,
447
+ onErrorCallback: a,
424
448
  attrs: _extends$2({
425
449
  fetchpriority: "high"
426
450
  }, n),
@@ -546,9 +570,41 @@ function _object_without_properties_loose(r, t) {
546
570
  s = o[a], !(t.indexOf(s) >= 0) && (n[s] = r[s]);
547
571
  return n;
548
572
  }
549
- function getBuilderId() {
550
- return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
573
+ 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", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, n, o) => {
574
+ const s = [
575
+ `${[
576
+ t[r]
577
+ ]} #${r}`
578
+ ];
579
+ return n && s.push(`args: ${JSON.stringify(n)}`), s.push(getDocsUrl(r)), o && s.push(`Original Error Message:
580
+ ${o}`), s.join(`
581
+ `);
582
+ };
583
+ function _extends() {
584
+ return _extends = Object.assign || function(t) {
585
+ for (var n = 1; n < arguments.length; n++) {
586
+ var o = arguments[n];
587
+ for (var s in o)
588
+ Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
589
+ }
590
+ return t;
591
+ }, _extends.apply(this, arguments);
551
592
  }
593
+ const runtimeDescMap = {
594
+ [RUNTIME_001]: "Failed to get remoteEntry exports.",
595
+ [RUNTIME_002]: 'The remote entry interface does not contain "init"',
596
+ [RUNTIME_003]: "Failed to get manifest.",
597
+ [RUNTIME_004]: "Failed to locate remote.",
598
+ [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
599
+ [RUNTIME_006]: "Invalid loadShareSync function call from runtime",
600
+ [RUNTIME_007]: "Failed to get remote snapshot.",
601
+ [RUNTIME_008]: "Failed to load script resources."
602
+ }, typeDescMap = {
603
+ [TYPE_001]: "Failed to generate type declaration."
604
+ }, buildDescMap = {
605
+ [BUILD_001]: "Failed to find expose module."
606
+ };
607
+ _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
552
608
  const LOG_CATEGORY = "[ Federation Runtime ]", logger = createLogger(LOG_CATEGORY);
553
609
  function assert(r, t) {
554
610
  r || error(t);
@@ -637,17 +693,17 @@ function setGlobalDefaultVal(r) {
637
693
  (c = (n = r.__FEDERATION__).__INSTANCES__) != null || (n.__INSTANCES__ = []);
638
694
  var u;
639
695
  (u = (o = r.__FEDERATION__).moduleInfo) != null || (o.moduleInfo = {});
640
- var d;
641
- (d = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
642
696
  var p;
643
- (p = (a = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
697
+ (p = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
698
+ var d;
699
+ (d = (a = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
644
700
  var m;
645
701
  (m = (l = r.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
646
702
  }
647
703
  setGlobalDefaultVal(CurrentGlobal);
648
704
  setGlobalDefaultVal(nativeGlobal);
649
705
  function setGlobalFederationConstructor(r, t = isDebugMode()) {
650
- t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.8.5");
706
+ t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.15");
651
707
  }
652
708
  function getInfoWithoutType(r, t) {
653
709
  if (typeof t == "string") {
@@ -716,7 +772,7 @@ function combineVersion(r, t, n, o) {
716
772
  return o ? `${s}-${o}` : s;
717
773
  }
718
774
  function parseHyphen(r) {
719
- return r.replace(parseRegex(hyphenRange), (t, n, o, s, a, l, i, c, u, d, p, m) => (isXVersion(o) ? n = "" : isXVersion(s) ? n = `>=${o}.0.0` : isXVersion(a) ? n = `>=${o}.${s}.0` : n = `>=${n}`, isXVersion(u) ? c = "" : isXVersion(d) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(d) + 1}.0-0` : m ? c = `<=${u}.${d}.${p}-${m}` : c = `<=${c}`, `${n} ${c}`.trim()));
775
+ return r.replace(parseRegex(hyphenRange), (t, n, o, s, a, l, i, c, u, p, d, m) => (isXVersion(o) ? n = "" : isXVersion(s) ? n = `>=${o}.0.0` : isXVersion(a) ? n = `>=${o}.${s}.0` : n = `>=${n}`, 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}`, `${n} ${c}`.trim()));
720
776
  }
721
777
  function parseComparatorTrim(r) {
722
778
  return r.replace(parseRegex(comparatorTrim), "$1$2$3");
@@ -735,8 +791,8 @@ function parseTildes(r) {
735
791
  }
736
792
  function parseXRanges(r) {
737
793
  return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (n, o, s, a, l, i) => {
738
- const c = isXVersion(s), u = c || isXVersion(a), d = u || isXVersion(l);
739
- return o === "=" && d && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && d ? (u && (a = 0), l = 0, o === ">" ? (o = ">=", u ? (s = Number(s) + 1, a = 0, l = 0) : (a = Number(a) + 1, l = 0)) : o === "<=" && (o = "<", u ? s = Number(s) + 1 : a = Number(a) + 1), o === "<" && (i = "-0"), `${o + s}.${a}.${l}${i}`) : u ? `>=${s}.0.0${i} <${Number(s) + 1}.0.0-0` : d ? `>=${s}.${a}.0${i} <${s}.${Number(a) + 1}.0-0` : n;
794
+ const c = isXVersion(s), u = c || isXVersion(a), p = u || isXVersion(l);
795
+ return o === "=" && p && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && p ? (u && (a = 0), l = 0, o === ">" ? (o = ">=", u ? (s = Number(s) + 1, a = 0, l = 0) : (a = Number(a) + 1, l = 0)) : o === "<=" && (o = "<", u ? s = Number(s) + 1 : a = Number(a) + 1), o === "<" && (i = "-0"), `${o + 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` : n;
740
796
  })).join(" ");
741
797
  }
742
798
  function parseStar(r) {
@@ -832,27 +888,27 @@ function satisfy(r, t) {
832
888
  const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), a = extractComparator(r);
833
889
  if (!a)
834
890
  return !1;
835
- const [, l, , i, c, u, d] = a, p = {
891
+ const [, l, , i, c, u, p] = a, d = {
836
892
  operator: l,
837
- version: combineVersion(i, c, u, d),
893
+ version: combineVersion(i, c, u, p),
838
894
  major: i,
839
895
  minor: c,
840
896
  patch: u,
841
- preRelease: d == null ? void 0 : d.split(".")
897
+ preRelease: p == null ? void 0 : p.split(".")
842
898
  };
843
899
  for (const m of s) {
844
900
  const y = extractComparator(m);
845
901
  if (!y)
846
902
  return !1;
847
- const [, _, , R, g, E, v] = y, I = {
903
+ const [, _, , E, g, b, S] = y, v = {
848
904
  operator: _,
849
- version: combineVersion(R, g, E, v),
850
- major: R,
905
+ version: combineVersion(E, g, b, S),
906
+ major: E,
851
907
  minor: g,
852
- patch: E,
853
- preRelease: v == null ? void 0 : v.split(".")
908
+ patch: b,
909
+ preRelease: S == null ? void 0 : S.split(".")
854
910
  };
855
- if (!compare(I, p))
911
+ if (!compare(v, d))
856
912
  return !1;
857
913
  }
858
914
  return !0;
@@ -943,25 +999,25 @@ function getRegisteredShare(r, t, n, o) {
943
999
  ];
944
1000
  for (const c of i)
945
1001
  if (s && r[c] && r[c][t]) {
946
- const { requiredVersion: u } = s, p = getFindShareFunction(l)(r, c, t), m = () => {
1002
+ const { requiredVersion: u } = s, d = getFindShareFunction(l)(r, c, t), m = () => {
947
1003
  if (s.singleton) {
948
- if (typeof u == "string" && !satisfy(p, u)) {
949
- const R = `Version ${p} from ${p && r[c][t][p].from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${u})`;
950
- s.strictVersion ? error(R) : warn(R);
1004
+ if (typeof u == "string" && !satisfy(d, u)) {
1005
+ const E = `Version ${d} from ${d && r[c][t][d].from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${u})`;
1006
+ s.strictVersion ? error(E) : warn(E);
951
1007
  }
952
- return r[c][t][p];
1008
+ return r[c][t][d];
953
1009
  } else {
954
- if (u === !1 || u === "*" || satisfy(p, u))
955
- return r[c][t][p];
956
- for (const [R, g] of Object.entries(r[c][t]))
957
- if (satisfy(R, u))
1010
+ if (u === !1 || u === "*" || satisfy(d, u))
1011
+ return r[c][t][d];
1012
+ for (const [E, g] of Object.entries(r[c][t]))
1013
+ if (satisfy(E, u))
958
1014
  return g;
959
1015
  }
960
1016
  }, y = {
961
1017
  shareScopeMap: r,
962
1018
  scope: c,
963
1019
  pkgName: t,
964
- version: p,
1020
+ version: d,
965
1021
  GlobalFederation: Global.__FEDERATION__,
966
1022
  resolver: m
967
1023
  };
@@ -976,50 +1032,21 @@ function getTargetSharedOptions(r) {
976
1032
  if (!i)
977
1033
  return;
978
1034
  const c = {};
979
- i.forEach((p) => {
980
- c[p.version] = p;
1035
+ i.forEach((d) => {
1036
+ c[d.version] = d;
981
1037
  });
982
- const d = findVersion(c, function(p, m) {
983
- return !isLoaded(c[p]) && versionLt(p, m);
1038
+ const p = findVersion(c, function(d, m) {
1039
+ return !isLoaded(c[d]) && versionLt(d, m);
984
1040
  });
985
- return c[d];
1041
+ return c[p];
986
1042
  };
987
1043
  var a;
988
1044
  const l = (a = n == null ? void 0 : n.resolver) != null ? a : s;
989
1045
  return Object.assign({}, l(o[t]), n == null ? void 0 : n.customShareInfo);
990
1046
  }
991
- 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", TYPE_001 = "TYPE-001", getDocsUrl = (r) => `https://module-federation.io/guide/troubleshooting/${r.split("-")[0].toLowerCase()}/${r}`, getShortErrorMsg = (r, t, n, o) => {
992
- const s = [
993
- `${[
994
- t[r]
995
- ]} #${r}`
996
- ];
997
- return n && s.push(`args: ${JSON.stringify(n)}`), s.push(getDocsUrl(r)), o && s.push(`Original Error Message:
998
- ${o}`), s.join(`
999
- `);
1000
- };
1001
- function _extends() {
1002
- return _extends = Object.assign || function(t) {
1003
- for (var n = 1; n < arguments.length; n++) {
1004
- var o = arguments[n];
1005
- for (var s in o)
1006
- Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
1007
- }
1008
- return t;
1009
- }, _extends.apply(this, arguments);
1047
+ function getBuilderId() {
1048
+ return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1010
1049
  }
1011
- const runtimeDescMap = {
1012
- [RUNTIME_001]: "Failed to get remoteEntry exports.",
1013
- [RUNTIME_002]: 'The remote entry interface does not contain "init"',
1014
- [RUNTIME_003]: "Failed to get manifest.",
1015
- [RUNTIME_004]: "Failed to locate remote.",
1016
- [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
1017
- [RUNTIME_006]: "Invalid loadShareSync function call from runtime",
1018
- [RUNTIME_007]: "Failed to get remote snapshot."
1019
- }, typeDescMap = {
1020
- [TYPE_001]: "Failed to generate type declaration."
1021
- };
1022
- _extends({}, runtimeDescMap, typeDescMap);
1023
1050
  function matchRemoteWithNameAndExpose(r, t) {
1024
1051
  for (const n of r) {
1025
1052
  const o = t.startsWith(n.name);
@@ -1063,7 +1090,7 @@ function matchRemote(r, t) {
1063
1090
  if (t === n.name || n.alias && t === n.alias)
1064
1091
  return n;
1065
1092
  }
1066
- function registerPlugins$1(r, t) {
1093
+ function registerPlugins(r, t) {
1067
1094
  const n = getGlobalHostPlugins();
1068
1095
  return n.length > 0 && n.forEach((o) => {
1069
1096
  r != null && r.find((s) => s.name !== o.name) && r.push(o);
@@ -1121,7 +1148,10 @@ async function loadEntryScript({ name: r, globalName: t, entry: n, loaderHook: o
1121
1148
  remoteEntryKey: a
1122
1149
  })), l;
1123
1150
  }).catch((a) => {
1124
- throw a;
1151
+ throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
1152
+ remoteName: r,
1153
+ resourceUrl: n
1154
+ })), a;
1125
1155
  });
1126
1156
  }
1127
1157
  async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: n }) {
@@ -1240,20 +1270,20 @@ let Module = class {
1240
1270
  loadFactory: !0
1241
1271
  }, l = await this.getEntry();
1242
1272
  if (!this.inited) {
1243
- const p = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
1244
- p[m] || (p[m] = {});
1245
- const y = p[m], _ = [], R = {
1273
+ const d = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
1274
+ d[m] || (d[m] = {});
1275
+ const y = d[m], _ = [], E = {
1246
1276
  version: this.remoteInfo.version || ""
1247
1277
  };
1248
- Object.defineProperty(R, "shareScopeMap", {
1249
- value: p,
1278
+ Object.defineProperty(E, "shareScopeMap", {
1279
+ value: d,
1250
1280
  // remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
1251
1281
  enumerable: !1
1252
1282
  });
1253
1283
  const g = await this.host.hooks.lifecycle.beforeInitContainer.emit({
1254
1284
  shareScope: y,
1255
1285
  // @ts-ignore shareScopeMap will be set by Object.defineProperty
1256
- remoteEntryInitOptions: R,
1286
+ remoteEntryInitOptions: E,
1257
1287
  initScope: _,
1258
1288
  remoteInfo: this.remoteInfo,
1259
1289
  origin: this.host
@@ -1463,21 +1493,21 @@ function preloadAssets(r, t, n, o = !0) {
1463
1493
  as: "style"
1464
1494
  };
1465
1495
  s.forEach((c) => {
1466
- const { link: u, needAttach: d } = createLink({
1496
+ const { link: u, needAttach: p } = createLink({
1467
1497
  url: c,
1468
1498
  cb: () => {
1469
1499
  },
1470
1500
  attrs: i,
1471
- createLinkHook: (p, m) => {
1501
+ createLinkHook: (d, m) => {
1472
1502
  const y = t.loaderHook.lifecycle.createLink.emit({
1473
- url: p,
1503
+ url: d,
1474
1504
  attrs: m
1475
1505
  });
1476
1506
  if (y instanceof HTMLLinkElement)
1477
1507
  return y;
1478
1508
  }
1479
1509
  });
1480
- d && document.head.appendChild(u);
1510
+ p && document.head.appendChild(u);
1481
1511
  });
1482
1512
  } else {
1483
1513
  const i = {
@@ -1485,14 +1515,14 @@ function preloadAssets(r, t, n, o = !0) {
1485
1515
  type: "text/css"
1486
1516
  };
1487
1517
  s.forEach((c) => {
1488
- const { link: u, needAttach: d } = createLink({
1518
+ const { link: u, needAttach: p } = createLink({
1489
1519
  url: c,
1490
1520
  cb: () => {
1491
1521
  },
1492
1522
  attrs: i,
1493
- createLinkHook: (p, m) => {
1523
+ createLinkHook: (d, m) => {
1494
1524
  const y = t.loaderHook.lifecycle.createLink.emit({
1495
- url: p,
1525
+ url: d,
1496
1526
  attrs: m
1497
1527
  });
1498
1528
  if (y instanceof HTMLLinkElement)
@@ -1500,7 +1530,7 @@ function preloadAssets(r, t, n, o = !0) {
1500
1530
  },
1501
1531
  needDeleteLink: !1
1502
1532
  });
1503
- d && document.head.appendChild(u);
1533
+ p && document.head.appendChild(u);
1504
1534
  });
1505
1535
  }
1506
1536
  if (o) {
@@ -1509,21 +1539,21 @@ function preloadAssets(r, t, n, o = !0) {
1509
1539
  as: "script"
1510
1540
  };
1511
1541
  a.forEach((c) => {
1512
- const { link: u, needAttach: d } = createLink({
1542
+ const { link: u, needAttach: p } = createLink({
1513
1543
  url: c,
1514
1544
  cb: () => {
1515
1545
  },
1516
1546
  attrs: i,
1517
- createLinkHook: (p, m) => {
1547
+ createLinkHook: (d, m) => {
1518
1548
  const y = t.loaderHook.lifecycle.createLink.emit({
1519
- url: p,
1549
+ url: d,
1520
1550
  attrs: m
1521
1551
  });
1522
1552
  if (y instanceof HTMLLinkElement)
1523
1553
  return y;
1524
1554
  }
1525
1555
  });
1526
- d && document.head.appendChild(u);
1556
+ p && document.head.appendChild(u);
1527
1557
  });
1528
1558
  } else {
1529
1559
  const i = {
@@ -1531,14 +1561,14 @@ function preloadAssets(r, t, n, o = !0) {
1531
1561
  type: (r == null ? void 0 : r.type) === "module" ? "module" : "text/javascript"
1532
1562
  };
1533
1563
  a.forEach((c) => {
1534
- const { script: u, needAttach: d } = createScript({
1564
+ const { script: u, needAttach: p } = createScript({
1535
1565
  url: c,
1536
1566
  cb: () => {
1537
1567
  },
1538
1568
  attrs: i,
1539
- createScriptHook: (p, m) => {
1569
+ createScriptHook: (d, m) => {
1540
1570
  const y = t.loaderHook.lifecycle.createScript.emit({
1541
- url: p,
1571
+ url: d,
1542
1572
  attrs: m
1543
1573
  });
1544
1574
  if (y instanceof HTMLScriptElement)
@@ -1546,7 +1576,7 @@ function preloadAssets(r, t, n, o = !0) {
1546
1576
  },
1547
1577
  needDeleteScript: !0
1548
1578
  });
1549
- d && document.head.appendChild(u);
1579
+ p && document.head.appendChild(u);
1550
1580
  });
1551
1581
  }
1552
1582
  }
@@ -1609,89 +1639,89 @@ function traverseModuleInfo(r, t, n, o, s = {}, a) {
1609
1639
  const l = getFMId(t), { value: i } = getInfoWithoutType(r, l), c = a || i;
1610
1640
  if (c && !isManifestProvider(c) && (n(c, t, o), c.remotesInfo)) {
1611
1641
  const u = Object.keys(c.remotesInfo);
1612
- for (const d of u) {
1613
- if (s[d])
1642
+ for (const p of u) {
1643
+ if (s[p])
1614
1644
  continue;
1615
- s[d] = !0;
1616
- const p = splitId(d), m = c.remotesInfo[d];
1645
+ s[p] = !0;
1646
+ const d = splitId(p), m = c.remotesInfo[p];
1617
1647
  traverseModuleInfo(r, {
1618
- name: p.name,
1648
+ name: d.name,
1619
1649
  version: m.matchedVersion
1620
1650
  }, n, !1, s, void 0);
1621
1651
  }
1622
1652
  }
1623
1653
  }
1624
1654
  function generatePreloadAssets(r, t, n, o, s) {
1625
- const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: d } = r, { preloadConfig: p } = t, { depsRemote: m } = p;
1626
- if (traverseModuleInfo(o, n, (g, E, v) => {
1627
- let I;
1628
- if (v)
1629
- I = p;
1655
+ const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: p } = r, { preloadConfig: d } = t, { depsRemote: m } = d;
1656
+ if (traverseModuleInfo(o, n, (g, b, S) => {
1657
+ let v;
1658
+ if (S)
1659
+ v = d;
1630
1660
  else if (Array.isArray(m)) {
1631
- const T = m.find((A) => A.nameOrAlias === E.name || A.nameOrAlias === E.alias);
1661
+ const T = m.find((A) => A.nameOrAlias === b.name || A.nameOrAlias === b.alias);
1632
1662
  if (!T)
1633
1663
  return;
1634
- I = defaultPreloadArgs(T);
1664
+ v = defaultPreloadArgs(T);
1635
1665
  } else if (m === !0)
1636
- I = p;
1666
+ v = d;
1637
1667
  else
1638
1668
  return;
1639
- const S = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1640
- S && i.push({
1641
- name: E.name,
1669
+ const I = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1670
+ I && i.push({
1671
+ name: b.name,
1642
1672
  moduleInfo: {
1643
- name: E.name,
1644
- entry: S,
1673
+ name: b.name,
1674
+ entry: I,
1645
1675
  type: "remoteEntryType" in g ? g.remoteEntryType : "global",
1646
- entryGlobalName: "globalName" in g ? g.globalName : E.name,
1676
+ entryGlobalName: "globalName" in g ? g.globalName : b.name,
1647
1677
  shareScope: "",
1648
1678
  version: "version" in g ? g.version : void 0
1649
1679
  },
1650
- url: S
1680
+ url: I
1651
1681
  });
1652
- let b = "modules" in g ? g.modules : [];
1653
- const $ = normalizePreloadExposes(I.exposes);
1682
+ let R = "modules" in g ? g.modules : [];
1683
+ const $ = normalizePreloadExposes(v.exposes);
1654
1684
  if ($.length && "modules" in g) {
1655
1685
  var w;
1656
- b = g == null || (w = g.modules) == null ? void 0 : w.reduce((T, A) => (($ == null ? void 0 : $.indexOf(A.moduleName)) !== -1 && T.push(A), T), []);
1686
+ R = g == null || (w = g.modules) == null ? void 0 : w.reduce((T, A) => (($ == null ? void 0 : $.indexOf(A.moduleName)) !== -1 && T.push(A), T), []);
1657
1687
  }
1658
1688
  function O(T) {
1659
1689
  const A = T.map((P) => getResourceUrl(g, P));
1660
- return I.filter ? A.filter(I.filter) : A;
1690
+ return v.filter ? A.filter(v.filter) : A;
1661
1691
  }
1662
- if (b) {
1663
- const T = b.length;
1692
+ if (R) {
1693
+ const T = R.length;
1664
1694
  for (let A = 0; A < T; A++) {
1665
- const P = b[A], M = `${E.name}/${P.moduleName}`;
1695
+ const P = R[A], M = `${b.name}/${P.moduleName}`;
1666
1696
  r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1667
- id: P.moduleName === "." ? E.name : M,
1668
- name: E.name,
1697
+ id: P.moduleName === "." ? b.name : M,
1698
+ name: b.name,
1669
1699
  remoteSnapshot: g,
1670
- preloadConfig: I,
1671
- remote: E,
1700
+ preloadConfig: v,
1701
+ remote: b,
1672
1702
  origin: r
1673
- }), !getPreloaded(M) && (I.resourceCategory === "all" ? (a.push(...O(P.assets.css.async)), a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.async)), l.push(...O(P.assets.js.sync))) : (I.resourceCategory = "sync") && (a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.sync))), setPreloaded(M));
1703
+ }), !getPreloaded(M) && (v.resourceCategory === "all" ? (a.push(...O(P.assets.css.async)), a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.async)), l.push(...O(P.assets.js.sync))) : (v.resourceCategory = "sync") && (a.push(...O(P.assets.css.sync)), l.push(...O(P.assets.js.sync))), setPreloaded(M));
1674
1704
  }
1675
1705
  }
1676
1706
  }, !0, {}, s), s.shared) {
1677
- const g = (E, v) => {
1678
- const I = getRegisteredShare(r.shareScopeMap, v.sharedName, E, r.sharedHandler.hooks.lifecycle.resolveShare);
1679
- I && typeof I.lib == "function" && (v.assets.js.sync.forEach((S) => {
1680
- c.add(S);
1681
- }), v.assets.css.sync.forEach((S) => {
1682
- u.add(S);
1707
+ const g = (b, S) => {
1708
+ const v = getRegisteredShare(r.shareScopeMap, S.sharedName, b, r.sharedHandler.hooks.lifecycle.resolveShare);
1709
+ v && typeof v.lib == "function" && (S.assets.js.sync.forEach((I) => {
1710
+ c.add(I);
1711
+ }), S.assets.css.sync.forEach((I) => {
1712
+ u.add(I);
1683
1713
  }));
1684
1714
  };
1685
- s.shared.forEach((E) => {
1686
- var v;
1687
- const I = (v = d.shared) == null ? void 0 : v[E.sharedName];
1688
- if (!I)
1715
+ s.shared.forEach((b) => {
1716
+ var S;
1717
+ const v = (S = p.shared) == null ? void 0 : S[b.sharedName];
1718
+ if (!v)
1689
1719
  return;
1690
- const S = E.version ? I.find(($) => $.version === E.version) : I;
1691
- if (!S)
1720
+ const I = b.version ? v.find(($) => $.version === b.version) : v;
1721
+ if (!I)
1692
1722
  return;
1693
- arrayOptions(S).forEach(($) => {
1694
- g($, E);
1723
+ arrayOptions(I).forEach(($) => {
1724
+ g($, b);
1695
1725
  });
1696
1726
  });
1697
1727
  }
@@ -1791,32 +1821,32 @@ class SnapshotHandler {
1791
1821
  remoteSnapshot: a,
1792
1822
  globalSnapshot: l
1793
1823
  });
1794
- let u, d;
1824
+ let u, p;
1795
1825
  if (i)
1796
1826
  if (isManifestProvider(i)) {
1797
- const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(p, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1827
+ const d = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", m = await this.getManifestJson(d, t, {}), y = setGlobalSnapshotInfoByModuleInfo(_extends$1({}, t, {
1798
1828
  // The global remote may be overridden
1799
1829
  // Therefore, set the snapshot key to the global address of the actual request
1800
- entry: p
1830
+ entry: d
1801
1831
  }), m);
1802
- u = m, d = y;
1832
+ u = m, p = y;
1803
1833
  } else {
1804
- const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1834
+ const { remoteSnapshot: d } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1805
1835
  options: this.HostInstance.options,
1806
1836
  moduleInfo: t,
1807
1837
  remoteSnapshot: i,
1808
1838
  from: "global"
1809
1839
  });
1810
- u = p, d = c;
1840
+ u = d, p = c;
1811
1841
  }
1812
1842
  else if (isRemoteInfoWithEntry(t)) {
1813
- const p = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, p), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1843
+ const d = await this.getManifestJson(t.entry, t, {}), m = setGlobalSnapshotInfoByModuleInfo(t, d), { remoteSnapshot: y } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1814
1844
  options: this.HostInstance.options,
1815
1845
  moduleInfo: t,
1816
- remoteSnapshot: p,
1846
+ remoteSnapshot: d,
1817
1847
  from: "global"
1818
1848
  });
1819
- u = y, d = m;
1849
+ u = y, p = m;
1820
1850
  } else
1821
1851
  error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1822
1852
  hostName: t.name,
@@ -1829,7 +1859,7 @@ class SnapshotHandler {
1829
1859
  remoteSnapshot: u
1830
1860
  }), {
1831
1861
  remoteSnapshot: u,
1832
- globalSnapshot: d
1862
+ globalSnapshot: p
1833
1863
  };
1834
1864
  }
1835
1865
  getGlobalRemoteInfo(t) {
@@ -1920,11 +1950,11 @@ class SharedHandler {
1920
1950
  const u = await i.loading;
1921
1951
  return i.loaded = !0, i.lib || (i.lib = u), c(i), u;
1922
1952
  } else if (i) {
1923
- const d = (async () => {
1924
- const p = await i.get();
1925
- l.lib = p, l.loaded = !0, c(l);
1953
+ const p = (async () => {
1954
+ const d = await i.get();
1955
+ l.lib = d, l.loaded = !0, c(l);
1926
1956
  const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1927
- return m && (m.lib = p, m.loaded = !0), p;
1957
+ return m && (m.lib = d, m.loaded = !0), d;
1928
1958
  })();
1929
1959
  return this.setShared({
1930
1960
  pkgName: t,
@@ -1932,16 +1962,16 @@ class SharedHandler {
1932
1962
  shared: i,
1933
1963
  from: o.options.name,
1934
1964
  lib: null,
1935
- loading: d
1936
- }), d;
1965
+ loading: p
1966
+ }), p;
1937
1967
  } else {
1938
1968
  if (n != null && n.customShareInfo)
1939
1969
  return !1;
1940
- const d = (async () => {
1941
- const p = await l.get();
1942
- l.lib = p, l.loaded = !0, c(l);
1970
+ const p = (async () => {
1971
+ const d = await l.get();
1972
+ l.lib = d, l.loaded = !0, c(l);
1943
1973
  const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1944
- return m && (m.lib = p, m.loaded = !0), p;
1974
+ return m && (m.lib = d, m.loaded = !0), d;
1945
1975
  })();
1946
1976
  return this.setShared({
1947
1977
  pkgName: t,
@@ -1949,8 +1979,8 @@ class SharedHandler {
1949
1979
  shared: l,
1950
1980
  from: o.options.name,
1951
1981
  lib: null,
1952
- loading: d
1953
- }), d;
1982
+ loading: p
1983
+ }), p;
1954
1984
  }
1955
1985
  }
1956
1986
  /**
@@ -1966,44 +1996,44 @@ class SharedHandler {
1966
1996
  if (s !== "build") {
1967
1997
  const { initTokens: _ } = this;
1968
1998
  l || (l = []);
1969
- let R = _[t];
1970
- if (R || (R = _[t] = {
1999
+ let E = _[t];
2000
+ if (E || (E = _[t] = {
1971
2001
  from: this.host.name
1972
- }), l.indexOf(R) >= 0)
2002
+ }), l.indexOf(E) >= 0)
1973
2003
  return i;
1974
- l.push(R);
2004
+ l.push(E);
1975
2005
  }
1976
2006
  const c = this.shareScopeMap, u = o.options.name;
1977
2007
  c[t] || (c[t] = {});
1978
- const d = c[t], p = (_, R) => {
2008
+ const p = c[t], d = (_, E) => {
1979
2009
  var g;
1980
- const { version: E, eager: v } = R;
1981
- d[_] = d[_] || {};
1982
- const I = d[_], S = I[E], b = !!(S && (S.eager || (g = S.shareConfig) != null && g.eager));
1983
- (!S || S.strategy !== "loaded-first" && !S.loaded && (!v != !b ? v : u > S.from)) && (I[E] = R);
2010
+ const { version: b, eager: S } = E;
2011
+ p[_] = p[_] || {};
2012
+ const v = p[_], I = v[b], R = !!(I && (I.eager || (g = I.shareConfig) != null && g.eager));
2013
+ (!I || I.strategy !== "loaded-first" && !I.loaded && (!S != !R ? S : u > I.from)) && (v[b] = E);
1984
2014
  }, m = (_) => _ && _.init && _.init(c[t], l), y = async (_) => {
1985
- const { module: R } = await o.remoteHandler.getRemoteModuleAndOptions({
2015
+ const { module: E } = await o.remoteHandler.getRemoteModuleAndOptions({
1986
2016
  id: _
1987
2017
  });
1988
- if (R.getEntry) {
2018
+ if (E.getEntry) {
1989
2019
  let g;
1990
2020
  try {
1991
- g = await R.getEntry();
1992
- } catch (E) {
2021
+ g = await E.getEntry();
2022
+ } catch (b) {
1993
2023
  g = await o.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({
1994
2024
  id: _,
1995
- error: E,
2025
+ error: b,
1996
2026
  from: "runtime",
1997
2027
  lifecycle: "beforeLoadShare",
1998
2028
  origin: o
1999
2029
  });
2000
2030
  }
2001
- R.inited || (await m(g), R.inited = !0);
2031
+ E.inited || (await m(g), E.inited = !0);
2002
2032
  }
2003
2033
  };
2004
2034
  return Object.keys(o.options.shared).forEach((_) => {
2005
2035
  o.options.shared[_].forEach((g) => {
2006
- g.scope.includes(t) && p(_, g);
2036
+ g.scope.includes(t) && d(_, g);
2007
2037
  });
2008
2038
  }), (o.options.shareStrategy === "version-first" || a === "version-first") && o.options.remotes.forEach((_) => {
2009
2039
  _.shareScope === t && i.push(y(_.name));
@@ -2077,7 +2107,7 @@ class SharedHandler {
2077
2107
  });
2078
2108
  }
2079
2109
  setShared({ pkgName: t, shared: n, from: o, lib: s, loading: a, loaded: l, get: i }) {
2080
- const { version: c, scope: u = "default" } = n, d = _object_without_properties_loose(n, [
2110
+ const { version: c, scope: u = "default" } = n, p = _object_without_properties_loose(n, [
2081
2111
  "version",
2082
2112
  "scope"
2083
2113
  ]);
@@ -2090,7 +2120,7 @@ class SharedHandler {
2090
2120
  scope: [
2091
2121
  "default"
2092
2122
  ]
2093
- }, d, {
2123
+ }, p, {
2094
2124
  lib: s,
2095
2125
  loaded: l,
2096
2126
  loading: a
@@ -2153,10 +2183,10 @@ class RemoteHandler {
2153
2183
  loadFactory: !0
2154
2184
  }, { module: a, moduleOptions: l, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2155
2185
  id: t
2156
- }), { pkgNameOrAlias: c, remote: u, expose: d, id: p, remoteSnapshot: m } = i, y = await a.get(p, d, n, m), _ = await this.hooks.lifecycle.onLoad.emit({
2157
- id: p,
2186
+ }), { pkgNameOrAlias: c, remote: u, expose: p, id: d, remoteSnapshot: m } = i, y = await a.get(d, p, n, m), _ = await this.hooks.lifecycle.onLoad.emit({
2187
+ id: d,
2158
2188
  pkgNameOrAlias: c,
2159
- expose: d,
2189
+ expose: p,
2160
2190
  exposeModule: s ? y : void 0,
2161
2191
  exposeModuleFactory: s ? void 0 : y,
2162
2192
  remote: u,
@@ -2240,14 +2270,14 @@ class RemoteHandler {
2240
2270
  options: n.options,
2241
2271
  origin: n,
2242
2272
  remoteInfo: c
2243
- })), { remote: d, expose: p } = u;
2244
- assert(d && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2245
- let m = n.moduleCache.get(d.name);
2273
+ })), { remote: p, expose: d } = u;
2274
+ assert(p && d, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2275
+ let m = n.moduleCache.get(p.name);
2246
2276
  const y = {
2247
2277
  host: n,
2248
2278
  remoteInfo: c
2249
2279
  };
2250
- return m || (m = new Module(y), n.moduleCache.set(d.name, m)), {
2280
+ return m || (m = new Module(y), n.moduleCache.set(p.name, m)), {
2251
2281
  module: m,
2252
2282
  moduleOptions: y,
2253
2283
  remoteMatchInfo: u
@@ -2298,40 +2328,40 @@ class RemoteHandler {
2298
2328
  }
2299
2329
  const u = getRemoteEntryUniqueKey(l.remoteInfo);
2300
2330
  globalLoading[u] && delete globalLoading[u], o.snapshotHandler.manifestCache.delete(i.entry);
2301
- let d = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2302
- const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === d : y.name === d);
2303
- if (p !== -1) {
2304
- const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
2305
- d = y.options.id || d;
2331
+ let p = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2332
+ const d = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === p : y.name === p);
2333
+ if (d !== -1) {
2334
+ const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[d];
2335
+ p = y.options.id || p;
2306
2336
  const _ = getGlobalShareScope();
2307
- let R = !0;
2337
+ let E = !0;
2308
2338
  const g = [];
2309
- Object.keys(_).forEach((E) => {
2310
- const v = _[E];
2311
- v && Object.keys(v).forEach((I) => {
2312
- const S = v[I];
2313
- S && Object.keys(S).forEach((b) => {
2314
- const $ = S[b];
2339
+ Object.keys(_).forEach((b) => {
2340
+ const S = _[b];
2341
+ S && Object.keys(S).forEach((v) => {
2342
+ const I = S[v];
2343
+ I && Object.keys(I).forEach((R) => {
2344
+ const $ = I[R];
2315
2345
  $ && Object.keys($).forEach((w) => {
2316
2346
  const O = $[w];
2317
- O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? R = !1 : g.push([
2318
- E,
2319
- I,
2347
+ O && typeof O == "object" && O.from === i.name && (O.loaded || O.loading ? (O.useIn = O.useIn.filter((T) => T !== i.name), O.useIn.length ? E = !1 : g.push([
2320
2348
  b,
2349
+ v,
2350
+ R,
2321
2351
  w
2322
2352
  ])) : g.push([
2323
- E,
2324
- I,
2325
2353
  b,
2354
+ v,
2355
+ R,
2326
2356
  w
2327
2357
  ]));
2328
2358
  });
2329
2359
  });
2330
2360
  });
2331
- }), R && (y.shareScopeMap = {}, delete _[d]), g.forEach(([E, v, I, S]) => {
2332
- var b, $, w;
2333
- (w = _[E]) == null || ($ = w[v]) == null || (b = $[I]) == null || delete b[S];
2334
- }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
2361
+ }), E && (y.shareScopeMap = {}, delete _[p]), g.forEach(([b, S, v, I]) => {
2362
+ var R, $, w;
2363
+ (w = _[b]) == null || ($ = w[S]) == null || (R = $[v]) == null || delete R[I];
2364
+ }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(d, 1);
2335
2365
  }
2336
2366
  const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, o);
2337
2367
  if (m) {
@@ -2410,8 +2440,8 @@ class FederationHost {
2410
2440
  }), l = this.remoteHandler.formatAndRegisterRemote(a, s), { shared: i } = this.sharedHandler.registerShared(a, s), c = [
2411
2441
  ...a.plugins
2412
2442
  ];
2413
- s.plugins && s.plugins.forEach((d) => {
2414
- c.includes(d) || c.push(d);
2443
+ s.plugins && s.plugins.forEach((p) => {
2444
+ c.includes(p) || c.push(p);
2415
2445
  });
2416
2446
  const u = _extends$1({}, t, n, {
2417
2447
  plugins: c,
@@ -2424,7 +2454,7 @@ class FederationHost {
2424
2454
  }), u;
2425
2455
  }
2426
2456
  registerPlugins(t) {
2427
- const n = registerPlugins$1(t, [
2457
+ const n = registerPlugins(t, [
2428
2458
  this.hooks,
2429
2459
  this.remoteHandler.hooks,
2430
2460
  this.sharedHandler.hooks,
@@ -2445,7 +2475,7 @@ class FederationHost {
2445
2475
  beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
2446
2476
  // maybe will change, temporarily for internal use only
2447
2477
  initContainer: new AsyncWaterfallHook("initContainer")
2448
- }), this.version = "0.8.5", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2478
+ }), this.version = "0.6.15", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2449
2479
  // FIXME: may not be suitable , not open to the public yet
2450
2480
  getModuleInfo: new SyncHook(),
2451
2481
  createScript: new SyncHook(),
@@ -2484,22 +2514,22 @@ setGlobalFederationConstructor(FederationHost);
2484
2514
  function createBridgeComponent(r) {
2485
2515
  const t = /* @__PURE__ */ new Map(), n = getInstance();
2486
2516
  return () => ({
2487
- __APP_VERSION__: "0.8.5",
2517
+ __APP_VERSION__: "0.8.7",
2488
2518
  async render(o) {
2489
- var c, u, d;
2490
- LoggerInstance.log("createBridgeComponent render Info", o);
2519
+ var c, u, p;
2520
+ LoggerInstance.debug("createBridgeComponent render Info", o);
2491
2521
  const s = Vue.createApp(r.rootComponent);
2492
2522
  t.set(o.dom, s);
2493
- const a = await ((d = (u = (c = n == null ? void 0 : n.bridgeHook) == null ? void 0 : c.lifecycle) == null ? void 0 : u.beforeBridgeRender) == null ? void 0 : d.emit(o)), l = a && typeof a == "object" && (a != null && a.extraProps) ? a == null ? void 0 : a.extraProps : {}, i = r.appOptions({
2523
+ const a = await ((p = (u = (c = n == null ? void 0 : n.bridgeHook) == null ? void 0 : c.lifecycle) == null ? void 0 : u.beforeBridgeRender) == null ? void 0 : p.emit(o)), l = a && typeof a == "object" && (a != null && a.extraProps) ? a == null ? void 0 : a.extraProps : {}, i = r.appOptions({
2494
2524
  app: s,
2495
2525
  basename: o.basename,
2496
2526
  memoryRoute: o.memoryRoute,
2497
2527
  ...l
2498
2528
  });
2499
2529
  if (i != null && i.router) {
2500
- const p = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), m = VueRouter.createRouter({
2530
+ const d = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), m = VueRouter.createRouter({
2501
2531
  ...i.router.options,
2502
- history: p,
2532
+ history: d,
2503
2533
  routes: i.router.getRoutes()
2504
2534
  });
2505
2535
  LoggerInstance.log("createBridgeComponent render router info>>>", {
@@ -2510,7 +2540,7 @@ function createBridgeComponent(r) {
2510
2540
  s.mount(o.dom);
2511
2541
  },
2512
2542
  destroy(o) {
2513
- LoggerInstance.log("createBridgeComponent destroy Info", o);
2543
+ LoggerInstance.debug("createBridgeComponent destroy Info", o);
2514
2544
  const s = t.get(o == null ? void 0 : o.dom);
2515
2545
  s == null || s.unmount();
2516
2546
  }
@@ -2530,8 +2560,8 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2530
2560
  },
2531
2561
  setup(r) {
2532
2562
  const t = ref(null), n = ref(null), o = ref(""), s = useRoute(), a = () => {
2533
- var d;
2534
- const i = (d = r.providerInfo) == null ? void 0 : d.call(r);
2563
+ var p;
2564
+ const i = (p = r.providerInfo) == null ? void 0 : p.call(r);
2535
2565
  n.value = i;
2536
2566
  let c = {
2537
2567
  name: r.moduleName,
@@ -2539,12 +2569,12 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2539
2569
  basename: r.basename,
2540
2570
  memoryRoute: r.memoryRoute
2541
2571
  };
2542
- LoggerInstance.log("createRemoteComponent LazyComponent render >>>", c), c = {
2572
+ LoggerInstance.debug("createRemoteComponent LazyComponent render >>>", c), c = {
2543
2573
  ...c,
2544
2574
  ...{}.extraProps
2545
2575
  }, i.render(c);
2546
2576
  }, l = watch(() => s.path, (i) => {
2547
- i !== s.path && a(), o.value !== "" && o.value !== i && (LoggerInstance.log("createRemoteComponent dispatchPopstateEnv >>>", {
2577
+ i !== s.path && a(), o.value !== "" && o.value !== i && (LoggerInstance.debug("createRemoteComponent dispatchPopstateEnv >>>", {
2548
2578
  ...r,
2549
2579
  pathname: s.path
2550
2580
  }), e()), o.value = i;
@@ -2553,7 +2583,7 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2553
2583
  a();
2554
2584
  }), onBeforeUnmount(() => {
2555
2585
  var i;
2556
- LoggerInstance.log("createRemoteComponent LazyComponent destroy >>>", {
2586
+ LoggerInstance.debug("createRemoteComponent LazyComponent destroy >>>", {
2557
2587
  ...r
2558
2588
  }), l(), (i = n.value) == null || i.destroy({
2559
2589
  dom: t.value
@@ -2565,7 +2595,7 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2565
2595
  });
2566
2596
  function createRemoteComponent(r) {
2567
2597
  return defineAsyncComponent({
2568
- __APP_VERSION__: "0.8.5",
2598
+ __APP_VERSION__: "0.8.7",
2569
2599
  ...r.asyncComponentOptions,
2570
2600
  //@ts-ignore
2571
2601
  loader: async () => {
@@ -2575,12 +2605,12 @@ function createRemoteComponent(r) {
2575
2605
  const o = (c = t.matched[0]) == null ? void 0 : c.path;
2576
2606
  o && (o.endsWith("/:pathMatch(.*)*") ? n = o.replace("/:pathMatch(.*)*", "") : n = t.matched[0].path);
2577
2607
  const s = (r == null ? void 0 : r.export) || "default";
2578
- LoggerInstance.log("createRemoteComponent LazyComponent create >>>", {
2608
+ LoggerInstance.debug("createRemoteComponent LazyComponent create >>>", {
2579
2609
  basename: n,
2580
2610
  info: r
2581
2611
  });
2582
2612
  const a = await r.loader(), l = a && a[Symbol.for("mf_module_id")], i = a[s];
2583
- if (LoggerInstance.log(
2613
+ if (LoggerInstance.debug(
2584
2614
  "createRemoteComponent LazyComponent loadRemote info >>>",
2585
2615
  { name: l, module: a, exportName: s, basename: n, route: t }
2586
2616
  ), s in a && typeof i == "function")