@module-federation/bridge-vue3 0.8.6 → 0.8.8

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
@@ -76,46 +76,46 @@ function validateOptions(r) {
76
76
  }
77
77
  var createLogger$1 = (r = {}, { getLabel: t, handleError: n, finalLog: o, greet: s, LOG_TYPES: a }) => {
78
78
  const l = validateOptions(r);
79
- let i = l.level || "log", c = l.labels || {}, u = (p, d, ...y) => {
80
- if (LOG_LEVEL[a[p].level] > LOG_LEVEL[i])
79
+ let i = l.level || "log", c = l.labels || {}, u = (d, m, ...y) => {
80
+ if (LOG_LEVEL[a[d].level] > LOG_LEVEL[i])
81
81
  return;
82
- if (d == null)
82
+ if (m == null)
83
83
  return console.log();
84
- let _ = a[p], E = "";
85
- const g = t(p, _, c);
86
- if (d instanceof Error)
87
- if (d.stack) {
88
- let [b, ...S] = d.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(`
89
89
  `);
90
90
  b.startsWith("Error: ") && (b = b.slice(7)), E = `${b}
91
91
  ${n(S.join(`
92
92
  `))}`;
93
93
  } else
94
- E = d.message;
94
+ E = m.message;
95
95
  else
96
- _.level === "error" && typeof d == "string" ? E = d.split(`
96
+ _.level === "error" && typeof m == "string" ? E = m.split(`
97
97
  `).map((S) => isErrorStackMessage(S) ? n(S) : S).join(`
98
- `) : E = `${d}`;
99
- o(g, E, y, d);
100
- }, m = {
98
+ `) : E = `${m}`;
99
+ o(g, E, y, m);
100
+ }, p = {
101
101
  // greet
102
- greet: (p) => u("log", s(p))
102
+ greet: (d) => u("log", s(d))
103
103
  };
104
- return Object.keys(a).forEach((p) => {
105
- m[p] = (...d) => u(p, ...d);
106
- }), Object.defineProperty(m, "level", {
104
+ return Object.keys(a).forEach((d) => {
105
+ p[d] = (...m) => u(d, ...m);
106
+ }), Object.defineProperty(p, "level", {
107
107
  get: () => i,
108
- set(p) {
109
- i = p;
108
+ set(d) {
109
+ i = d;
110
110
  }
111
- }), Object.defineProperty(m, "labels", {
111
+ }), Object.defineProperty(p, "labels", {
112
112
  get: () => c,
113
- set(p) {
114
- c = p;
113
+ set(d) {
114
+ c = d;
115
115
  }
116
- }), m.override = (p) => {
117
- Object.assign(m, p);
118
- }, m;
116
+ }), p.override = (d) => {
117
+ Object.assign(p, d);
118
+ }, p;
119
119
  }, startColor = [189, 255, 243], endColor = [74, 194, 154], isWord = (r) => !/[\s\n]/.test(r);
120
120
  function gradient(r) {
121
121
  if (!supportColor())
@@ -126,8 +126,8 @@ function gradient(r) {
126
126
  let s = "", a = [];
127
127
  return t.forEach((l) => {
128
128
  if (isWord(l)) {
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), m = Math.round(startColor[2] + (endColor[2] - startColor[2]) * i);
130
- s += `%c${l}`, a.push(`color: rgb(${c},${u},${m}); 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;`);
131
131
  } else
132
132
  s += l;
133
133
  }), [s, ...a];
@@ -284,10 +284,10 @@ function generateSnapshotFromManifest(r, t = {}) {
284
284
  const { remotes: s = {}, overrides: a = {}, version: l } = t;
285
285
  let i;
286
286
  const c = () => "publicPath" in r.metaData ? r.metaData.publicPath === "auto" && l ? inferAutoPublicPath(l) : r.metaData.publicPath : r.metaData.getPublicPath, u = Object.keys(a);
287
- let m = {};
287
+ let p = {};
288
288
  if (!Object.keys(s).length) {
289
- var p;
290
- m = ((p = r.remotes) == null ? void 0 : p.reduce((R, $) => {
289
+ var d;
290
+ p = ((d = r.remotes) == null ? void 0 : d.reduce((R, $) => {
291
291
  let w;
292
292
  const O = $.federationContainerName;
293
293
  return u.includes(O) ? w = a[O] : "version" in $ ? w = $.version : w = $.entry, R[O] = {
@@ -295,27 +295,27 @@ function generateSnapshotFromManifest(r, t = {}) {
295
295
  }, R;
296
296
  }, {})) || {};
297
297
  }
298
- Object.keys(s).forEach((R) => m[R] = {
298
+ Object.keys(s).forEach((R) => p[R] = {
299
299
  // overrides will override dependencies
300
300
  matchedVersion: u.includes(R) ? a[R] : s[R]
301
301
  });
302
- const { remoteEntry: { path: d, name: y, type: _ }, types: E, buildInfo: { buildVersion: g }, globalName: b, ssrRemoteEntry: S } = r.metaData, { exposes: I } = r;
303
- let v = {
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 = {
304
304
  version: l || "",
305
305
  buildVersion: g,
306
306
  globalName: b,
307
- remoteEntry: simpleJoinRemoteEntry(d, y),
307
+ remoteEntry: simpleJoinRemoteEntry(m, y),
308
308
  remoteEntryType: _,
309
309
  remoteTypes: simpleJoinRemoteEntry(E.path, E.name),
310
310
  remoteTypesZip: E.zip || "",
311
311
  remoteTypesAPI: E.api || "",
312
- remotesInfo: m,
312
+ remotesInfo: p,
313
313
  shared: r == null ? void 0 : r.shared.map((R) => ({
314
314
  assets: R.assets,
315
315
  sharedName: R.name,
316
316
  version: R.version
317
317
  })),
318
- modules: I == null ? void 0 : I.map((R) => ({
318
+ modules: v == null ? void 0 : v.map((R) => ({
319
319
  moduleName: R.name,
320
320
  modulePath: R.path,
321
321
  assets: R.assets
@@ -323,20 +323,20 @@ function generateSnapshotFromManifest(r, t = {}) {
323
323
  };
324
324
  if ((n = r.metaData) != null && n.prefetchInterface) {
325
325
  const R = r.metaData.prefetchInterface;
326
- v = _extends$2({}, v, {
326
+ I = _extends$2({}, I, {
327
327
  prefetchInterface: R
328
328
  });
329
329
  }
330
330
  if ((o = r.metaData) != null && o.prefetchEntry) {
331
331
  const { path: R, name: $, type: w } = r.metaData.prefetchEntry;
332
- v = _extends$2({}, v, {
332
+ I = _extends$2({}, I, {
333
333
  prefetchEntry: simpleJoinRemoteEntry(R, $),
334
334
  prefetchEntryType: w
335
335
  });
336
336
  }
337
- if ("publicPath" in r.metaData ? i = _extends$2({}, v, {
337
+ if ("publicPath" in r.metaData ? i = _extends$2({}, I, {
338
338
  publicPath: c()
339
- }) : i = _extends$2({}, v, {
339
+ }) : i = _extends$2({}, I, {
340
340
  getPublicPath: c()
341
341
  }), S) {
342
342
  const R = simpleJoinRemoteEntry(S.path, S.name);
@@ -378,21 +378,22 @@ function createScript(r) {
378
378
  });
379
379
  }
380
380
  const l = async (i, c) => {
381
- var u;
382
- if (clearTimeout(s), t && (t.onerror = null, t.onload = null, safeWrapper(() => {
383
- const { needDeleteScript: d = !0 } = r;
384
- d && 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);
385
388
  }), i && typeof i == "function")) {
386
- var m;
387
- const d = i(c);
388
- if (d instanceof Promise) {
389
- var p;
390
- const y = await d;
391
- 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;
392
393
  }
393
- return r == null || (m = r.cb) == null || m.call(r), d;
394
+ return u(), p;
394
395
  }
395
- r == null || (u = r.cb) == null || u.call(r);
396
+ u();
396
397
  };
397
398
  return t.onerror = l.bind(null, t.onerror), t.onload = l.bind(null, t.onload), s = setTimeout(() => {
398
399
  l(null, new Error(`Remote script "${r.url}" time-outed.`));
@@ -420,14 +421,17 @@ function createLink(r) {
420
421
  });
421
422
  }
422
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
+ };
423
427
  if (t && (t.onerror = null, t.onload = null, safeWrapper(() => {
424
- const { needDeleteLink: i = !0 } = r;
425
- 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);
426
430
  }), a)) {
427
- const i = a(l);
428
- return r.cb(), i;
431
+ const c = a(l);
432
+ return i(), c;
429
433
  }
430
- r.cb();
434
+ i();
431
435
  };
432
436
  return t.onerror = s.bind(null, t.onerror), t.onload = s.bind(null, t.onload), {
433
437
  link: t,
@@ -440,6 +444,7 @@ function loadScript(r, t) {
440
444
  const { script: l, needAttach: i } = createScript({
441
445
  url: r,
442
446
  cb: s,
447
+ onErrorCallback: a,
443
448
  attrs: _extends$2({
444
449
  fetchpriority: "high"
445
450
  }, n),
@@ -565,9 +570,41 @@ function _object_without_properties_loose(r, t) {
565
570
  s = o[a], !(t.indexOf(s) >= 0) && (n[s] = r[s]);
566
571
  return n;
567
572
  }
568
- function getBuilderId() {
569
- 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);
570
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);
571
608
  const LOG_CATEGORY = "[ Federation Runtime ]", logger = createLogger(LOG_CATEGORY);
572
609
  function assert(r, t) {
573
610
  r || error(t);
@@ -656,17 +693,17 @@ function setGlobalDefaultVal(r) {
656
693
  (c = (n = r.__FEDERATION__).__INSTANCES__) != null || (n.__INSTANCES__ = []);
657
694
  var u;
658
695
  (u = (o = r.__FEDERATION__).moduleInfo) != null || (o.moduleInfo = {});
659
- var m;
660
- (m = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
661
696
  var p;
662
- (p = (a = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
697
+ (p = (s = r.__FEDERATION__).__SHARE__) != null || (s.__SHARE__ = {});
663
698
  var d;
664
- (d = (l = r.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
699
+ (d = (a = r.__FEDERATION__).__MANIFEST_LOADING__) != null || (a.__MANIFEST_LOADING__ = {});
700
+ var m;
701
+ (m = (l = r.__FEDERATION__).__PRELOADED_MAP__) != null || (l.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
665
702
  }
666
703
  setGlobalDefaultVal(CurrentGlobal);
667
704
  setGlobalDefaultVal(nativeGlobal);
668
705
  function setGlobalFederationConstructor(r, t = isDebugMode()) {
669
- t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.8.6");
706
+ t && (CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = r, CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.6.16");
670
707
  }
671
708
  function getInfoWithoutType(r, t) {
672
709
  if (typeof t == "string") {
@@ -735,7 +772,7 @@ function combineVersion(r, t, n, o) {
735
772
  return o ? `${s}-${o}` : s;
736
773
  }
737
774
  function parseHyphen(r) {
738
- return r.replace(parseRegex(hyphenRange), (t, n, o, s, a, l, i, c, u, m, p, d) => (isXVersion(o) ? n = "" : isXVersion(s) ? n = `>=${o}.0.0` : isXVersion(a) ? n = `>=${o}.${s}.0` : n = `>=${n}`, isXVersion(u) ? c = "" : isXVersion(m) ? c = `<${Number(u) + 1}.0.0-0` : isXVersion(p) ? c = `<${u}.${Number(m) + 1}.0-0` : d ? c = `<=${u}.${m}.${p}-${d}` : 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()));
739
776
  }
740
777
  function parseComparatorTrim(r) {
741
778
  return r.replace(parseRegex(comparatorTrim), "$1$2$3");
@@ -754,8 +791,8 @@ function parseTildes(r) {
754
791
  }
755
792
  function parseXRanges(r) {
756
793
  return r.split(/\s+/).map((t) => t.trim().replace(parseRegex(xRange), (n, o, s, a, l, i) => {
757
- const c = isXVersion(s), u = c || isXVersion(a), m = u || isXVersion(l);
758
- return o === "=" && m && (o = ""), i = "", c ? o === ">" || o === "<" ? "<0.0.0-0" : "*" : o && m ? (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` : m ? `>=${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;
759
796
  })).join(" ");
760
797
  }
761
798
  function parseStar(r) {
@@ -848,22 +885,22 @@ function parseRange(r) {
848
885
  function satisfy(r, t) {
849
886
  if (!r)
850
887
  return !1;
851
- const s = parseRange(t).split(" ").map((d) => parseComparatorString(d)).join(" ").split(/\s+/).map((d) => parseGTE0(d)), a = extractComparator(r);
888
+ const s = parseRange(t).split(" ").map((m) => parseComparatorString(m)).join(" ").split(/\s+/).map((m) => parseGTE0(m)), a = extractComparator(r);
852
889
  if (!a)
853
890
  return !1;
854
- const [, l, , i, c, u, m] = a, p = {
891
+ const [, l, , i, c, u, p] = a, d = {
855
892
  operator: l,
856
- version: combineVersion(i, c, u, m),
893
+ version: combineVersion(i, c, u, p),
857
894
  major: i,
858
895
  minor: c,
859
896
  patch: u,
860
- preRelease: m == null ? void 0 : m.split(".")
897
+ preRelease: p == null ? void 0 : p.split(".")
861
898
  };
862
- for (const d of s) {
863
- const y = extractComparator(d);
899
+ for (const m of s) {
900
+ const y = extractComparator(m);
864
901
  if (!y)
865
902
  return !1;
866
- const [, _, , E, g, b, S] = y, I = {
903
+ const [, _, , E, g, b, S] = y, v = {
867
904
  operator: _,
868
905
  version: combineVersion(E, g, b, S),
869
906
  major: E,
@@ -871,7 +908,7 @@ function satisfy(r, t) {
871
908
  patch: b,
872
909
  preRelease: S == null ? void 0 : S.split(".")
873
910
  };
874
- if (!compare(I, p))
911
+ if (!compare(v, d))
875
912
  return !1;
876
913
  }
877
914
  return !0;
@@ -962,16 +999,16 @@ function getRegisteredShare(r, t, n, o) {
962
999
  ];
963
1000
  for (const c of i)
964
1001
  if (s && r[c] && r[c][t]) {
965
- const { requiredVersion: u } = s, p = getFindShareFunction(l)(r, c, t), d = () => {
1002
+ const { requiredVersion: u } = s, d = getFindShareFunction(l)(r, c, t), m = () => {
966
1003
  if (s.singleton) {
967
- if (typeof u == "string" && !satisfy(p, u)) {
968
- const E = `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})`;
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})`;
969
1006
  s.strictVersion ? error(E) : warn(E);
970
1007
  }
971
- return r[c][t][p];
1008
+ return r[c][t][d];
972
1009
  } else {
973
- if (u === !1 || u === "*" || satisfy(p, u))
974
- return r[c][t][p];
1010
+ if (u === !1 || u === "*" || satisfy(d, u))
1011
+ return r[c][t][d];
975
1012
  for (const [E, g] of Object.entries(r[c][t]))
976
1013
  if (satisfy(E, u))
977
1014
  return g;
@@ -980,9 +1017,9 @@ function getRegisteredShare(r, t, n, o) {
980
1017
  shareScopeMap: r,
981
1018
  scope: c,
982
1019
  pkgName: t,
983
- version: p,
1020
+ version: d,
984
1021
  GlobalFederation: Global.__FEDERATION__,
985
- resolver: d
1022
+ resolver: m
986
1023
  };
987
1024
  return (o.emit(y) || y).resolver();
988
1025
  }
@@ -995,50 +1032,21 @@ function getTargetSharedOptions(r) {
995
1032
  if (!i)
996
1033
  return;
997
1034
  const c = {};
998
- i.forEach((p) => {
999
- c[p.version] = p;
1035
+ i.forEach((d) => {
1036
+ c[d.version] = d;
1000
1037
  });
1001
- const m = findVersion(c, function(p, d) {
1002
- return !isLoaded(c[p]) && versionLt(p, d);
1038
+ const p = findVersion(c, function(d, m) {
1039
+ return !isLoaded(c[d]) && versionLt(d, m);
1003
1040
  });
1004
- return c[m];
1041
+ return c[p];
1005
1042
  };
1006
1043
  var a;
1007
1044
  const l = (a = n == null ? void 0 : n.resolver) != null ? a : s;
1008
1045
  return Object.assign({}, l(o[t]), n == null ? void 0 : n.customShareInfo);
1009
1046
  }
1010
- 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) => {
1011
- const s = [
1012
- `${[
1013
- t[r]
1014
- ]} #${r}`
1015
- ];
1016
- return n && s.push(`args: ${JSON.stringify(n)}`), s.push(getDocsUrl(r)), o && s.push(`Original Error Message:
1017
- ${o}`), s.join(`
1018
- `);
1019
- };
1020
- function _extends() {
1021
- return _extends = Object.assign || function(t) {
1022
- for (var n = 1; n < arguments.length; n++) {
1023
- var o = arguments[n];
1024
- for (var s in o)
1025
- Object.prototype.hasOwnProperty.call(o, s) && (t[s] = o[s]);
1026
- }
1027
- return t;
1028
- }, _extends.apply(this, arguments);
1047
+ function getBuilderId() {
1048
+ return typeof FEDERATION_BUILD_IDENTIFIER < "u" ? FEDERATION_BUILD_IDENTIFIER : "";
1029
1049
  }
1030
- const runtimeDescMap = {
1031
- [RUNTIME_001]: "Failed to get remoteEntry exports.",
1032
- [RUNTIME_002]: 'The remote entry interface does not contain "init"',
1033
- [RUNTIME_003]: "Failed to get manifest.",
1034
- [RUNTIME_004]: "Failed to locate remote.",
1035
- [RUNTIME_005]: "Invalid loadShareSync function call from bundler runtime",
1036
- [RUNTIME_006]: "Invalid loadShareSync function call from runtime",
1037
- [RUNTIME_007]: "Failed to get remote snapshot."
1038
- }, typeDescMap = {
1039
- [TYPE_001]: "Failed to generate type declaration."
1040
- };
1041
- _extends({}, runtimeDescMap, typeDescMap);
1042
1050
  function matchRemoteWithNameAndExpose(r, t) {
1043
1051
  for (const n of r) {
1044
1052
  const o = t.startsWith(n.name);
@@ -1082,7 +1090,7 @@ function matchRemote(r, t) {
1082
1090
  if (t === n.name || n.alias && t === n.alias)
1083
1091
  return n;
1084
1092
  }
1085
- function registerPlugins$1(r, t) {
1093
+ function registerPlugins(r, t) {
1086
1094
  const n = getGlobalHostPlugins();
1087
1095
  return n.length > 0 && n.forEach((o) => {
1088
1096
  r != null && r.find((s) => s.name !== o.name) && r.push(o);
@@ -1140,7 +1148,10 @@ async function loadEntryScript({ name: r, globalName: t, entry: n, loaderHook: o
1140
1148
  remoteEntryKey: a
1141
1149
  })), l;
1142
1150
  }).catch((a) => {
1143
- throw a;
1151
+ throw assert(void 0, getShortErrorMsg(RUNTIME_008, runtimeDescMap, {
1152
+ remoteName: r,
1153
+ resourceUrl: n
1154
+ })), a;
1144
1155
  });
1145
1156
  }
1146
1157
  async function loadEntryDom({ remoteInfo: r, remoteEntryExports: t, loaderHook: n }) {
@@ -1259,13 +1270,13 @@ let Module = class {
1259
1270
  loadFactory: !0
1260
1271
  }, l = await this.getEntry();
1261
1272
  if (!this.inited) {
1262
- const p = this.host.shareScopeMap, d = this.remoteInfo.shareScope || "default";
1263
- p[d] || (p[d] = {});
1264
- const y = p[d], _ = [], E = {
1273
+ const d = this.host.shareScopeMap, m = this.remoteInfo.shareScope || "default";
1274
+ d[m] || (d[m] = {});
1275
+ const y = d[m], _ = [], E = {
1265
1276
  version: this.remoteInfo.version || ""
1266
1277
  };
1267
1278
  Object.defineProperty(E, "shareScopeMap", {
1268
- value: p,
1279
+ value: d,
1269
1280
  // remoteEntryInitOptions will be traversed and assigned during container init, ,so this attribute is not allowed to be traversed
1270
1281
  enumerable: !1
1271
1282
  });
@@ -1482,21 +1493,21 @@ function preloadAssets(r, t, n, o = !0) {
1482
1493
  as: "style"
1483
1494
  };
1484
1495
  s.forEach((c) => {
1485
- const { link: u, needAttach: m } = createLink({
1496
+ const { link: u, needAttach: p } = createLink({
1486
1497
  url: c,
1487
1498
  cb: () => {
1488
1499
  },
1489
1500
  attrs: i,
1490
- createLinkHook: (p, d) => {
1501
+ createLinkHook: (d, m) => {
1491
1502
  const y = t.loaderHook.lifecycle.createLink.emit({
1492
- url: p,
1493
- attrs: d
1503
+ url: d,
1504
+ attrs: m
1494
1505
  });
1495
1506
  if (y instanceof HTMLLinkElement)
1496
1507
  return y;
1497
1508
  }
1498
1509
  });
1499
- m && document.head.appendChild(u);
1510
+ p && document.head.appendChild(u);
1500
1511
  });
1501
1512
  } else {
1502
1513
  const i = {
@@ -1504,22 +1515,22 @@ function preloadAssets(r, t, n, o = !0) {
1504
1515
  type: "text/css"
1505
1516
  };
1506
1517
  s.forEach((c) => {
1507
- const { link: u, needAttach: m } = createLink({
1518
+ const { link: u, needAttach: p } = createLink({
1508
1519
  url: c,
1509
1520
  cb: () => {
1510
1521
  },
1511
1522
  attrs: i,
1512
- createLinkHook: (p, d) => {
1523
+ createLinkHook: (d, m) => {
1513
1524
  const y = t.loaderHook.lifecycle.createLink.emit({
1514
- url: p,
1515
- attrs: d
1525
+ url: d,
1526
+ attrs: m
1516
1527
  });
1517
1528
  if (y instanceof HTMLLinkElement)
1518
1529
  return y;
1519
1530
  },
1520
1531
  needDeleteLink: !1
1521
1532
  });
1522
- m && document.head.appendChild(u);
1533
+ p && document.head.appendChild(u);
1523
1534
  });
1524
1535
  }
1525
1536
  if (o) {
@@ -1528,21 +1539,21 @@ function preloadAssets(r, t, n, o = !0) {
1528
1539
  as: "script"
1529
1540
  };
1530
1541
  a.forEach((c) => {
1531
- const { link: u, needAttach: m } = createLink({
1542
+ const { link: u, needAttach: p } = createLink({
1532
1543
  url: c,
1533
1544
  cb: () => {
1534
1545
  },
1535
1546
  attrs: i,
1536
- createLinkHook: (p, d) => {
1547
+ createLinkHook: (d, m) => {
1537
1548
  const y = t.loaderHook.lifecycle.createLink.emit({
1538
- url: p,
1539
- attrs: d
1549
+ url: d,
1550
+ attrs: m
1540
1551
  });
1541
1552
  if (y instanceof HTMLLinkElement)
1542
1553
  return y;
1543
1554
  }
1544
1555
  });
1545
- m && document.head.appendChild(u);
1556
+ p && document.head.appendChild(u);
1546
1557
  });
1547
1558
  } else {
1548
1559
  const i = {
@@ -1550,22 +1561,22 @@ function preloadAssets(r, t, n, o = !0) {
1550
1561
  type: (r == null ? void 0 : r.type) === "module" ? "module" : "text/javascript"
1551
1562
  };
1552
1563
  a.forEach((c) => {
1553
- const { script: u, needAttach: m } = createScript({
1564
+ const { script: u, needAttach: p } = createScript({
1554
1565
  url: c,
1555
1566
  cb: () => {
1556
1567
  },
1557
1568
  attrs: i,
1558
- createScriptHook: (p, d) => {
1569
+ createScriptHook: (d, m) => {
1559
1570
  const y = t.loaderHook.lifecycle.createScript.emit({
1560
- url: p,
1561
- attrs: d
1571
+ url: d,
1572
+ attrs: m
1562
1573
  });
1563
1574
  if (y instanceof HTMLScriptElement)
1564
1575
  return y;
1565
1576
  },
1566
1577
  needDeleteScript: !0
1567
1578
  });
1568
- m && document.head.appendChild(u);
1579
+ p && document.head.appendChild(u);
1569
1580
  });
1570
1581
  }
1571
1582
  }
@@ -1628,88 +1639,88 @@ function traverseModuleInfo(r, t, n, o, s = {}, a) {
1628
1639
  const l = getFMId(t), { value: i } = getInfoWithoutType(r, l), c = a || i;
1629
1640
  if (c && !isManifestProvider(c) && (n(c, t, o), c.remotesInfo)) {
1630
1641
  const u = Object.keys(c.remotesInfo);
1631
- for (const m of u) {
1632
- if (s[m])
1642
+ for (const p of u) {
1643
+ if (s[p])
1633
1644
  continue;
1634
- s[m] = !0;
1635
- const p = splitId(m), d = c.remotesInfo[m];
1645
+ s[p] = !0;
1646
+ const d = splitId(p), m = c.remotesInfo[p];
1636
1647
  traverseModuleInfo(r, {
1637
- name: p.name,
1638
- version: d.matchedVersion
1648
+ name: d.name,
1649
+ version: m.matchedVersion
1639
1650
  }, n, !1, s, void 0);
1640
1651
  }
1641
1652
  }
1642
1653
  }
1643
1654
  function generatePreloadAssets(r, t, n, o, s) {
1644
- const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: m } = r, { preloadConfig: p } = t, { depsRemote: d } = p;
1655
+ const a = [], l = [], i = [], c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), { options: p } = r, { preloadConfig: d } = t, { depsRemote: m } = d;
1645
1656
  if (traverseModuleInfo(o, n, (g, b, S) => {
1646
- let I;
1657
+ let v;
1647
1658
  if (S)
1648
- I = p;
1649
- else if (Array.isArray(d)) {
1650
- const T = d.find((A) => A.nameOrAlias === b.name || A.nameOrAlias === b.alias);
1659
+ v = d;
1660
+ else if (Array.isArray(m)) {
1661
+ const T = m.find((A) => A.nameOrAlias === b.name || A.nameOrAlias === b.alias);
1651
1662
  if (!T)
1652
1663
  return;
1653
- I = defaultPreloadArgs(T);
1654
- } else if (d === !0)
1655
- I = p;
1664
+ v = defaultPreloadArgs(T);
1665
+ } else if (m === !0)
1666
+ v = d;
1656
1667
  else
1657
1668
  return;
1658
- const v = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1659
- v && i.push({
1669
+ const I = getResourceUrl(g, getRemoteEntryInfoFromSnapshot(g).url);
1670
+ I && i.push({
1660
1671
  name: b.name,
1661
1672
  moduleInfo: {
1662
1673
  name: b.name,
1663
- entry: v,
1674
+ entry: I,
1664
1675
  type: "remoteEntryType" in g ? g.remoteEntryType : "global",
1665
1676
  entryGlobalName: "globalName" in g ? g.globalName : b.name,
1666
1677
  shareScope: "",
1667
1678
  version: "version" in g ? g.version : void 0
1668
1679
  },
1669
- url: v
1680
+ url: I
1670
1681
  });
1671
1682
  let R = "modules" in g ? g.modules : [];
1672
- const $ = normalizePreloadExposes(I.exposes);
1683
+ const $ = normalizePreloadExposes(v.exposes);
1673
1684
  if ($.length && "modules" in g) {
1674
1685
  var w;
1675
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), []);
1676
1687
  }
1677
1688
  function O(T) {
1678
1689
  const A = T.map((P) => getResourceUrl(g, P));
1679
- return I.filter ? A.filter(I.filter) : A;
1690
+ return v.filter ? A.filter(v.filter) : A;
1680
1691
  }
1681
1692
  if (R) {
1682
1693
  const T = R.length;
1683
1694
  for (let A = 0; A < T; A++) {
1684
- const P = R[A], L = `${b.name}/${P.moduleName}`;
1695
+ const P = R[A], M = `${b.name}/${P.moduleName}`;
1685
1696
  r.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({
1686
- id: P.moduleName === "." ? b.name : L,
1697
+ id: P.moduleName === "." ? b.name : M,
1687
1698
  name: b.name,
1688
1699
  remoteSnapshot: g,
1689
- preloadConfig: I,
1700
+ preloadConfig: v,
1690
1701
  remote: b,
1691
1702
  origin: r
1692
- }), !getPreloaded(L) && (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(L));
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));
1693
1704
  }
1694
1705
  }
1695
1706
  }, !0, {}, s), s.shared) {
1696
1707
  const g = (b, S) => {
1697
- const I = getRegisteredShare(r.shareScopeMap, S.sharedName, b, r.sharedHandler.hooks.lifecycle.resolveShare);
1698
- I && typeof I.lib == "function" && (S.assets.js.sync.forEach((v) => {
1699
- c.add(v);
1700
- }), S.assets.css.sync.forEach((v) => {
1701
- u.add(v);
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);
1702
1713
  }));
1703
1714
  };
1704
1715
  s.shared.forEach((b) => {
1705
1716
  var S;
1706
- const I = (S = m.shared) == null ? void 0 : S[b.sharedName];
1707
- if (!I)
1708
- return;
1709
- const v = b.version ? I.find(($) => $.version === b.version) : I;
1717
+ const v = (S = p.shared) == null ? void 0 : S[b.sharedName];
1710
1718
  if (!v)
1711
1719
  return;
1712
- arrayOptions(v).forEach(($) => {
1720
+ const I = b.version ? v.find(($) => $.version === b.version) : v;
1721
+ if (!I)
1722
+ return;
1723
+ arrayOptions(I).forEach(($) => {
1713
1724
  g($, b);
1714
1725
  });
1715
1726
  });
@@ -1810,32 +1821,32 @@ class SnapshotHandler {
1810
1821
  remoteSnapshot: a,
1811
1822
  globalSnapshot: l
1812
1823
  });
1813
- let u, m;
1824
+ let u, p;
1814
1825
  if (i)
1815
1826
  if (isManifestProvider(i)) {
1816
- const p = isBrowserEnv() ? i.remoteEntry : i.ssrRemoteEntry || i.remoteEntry || "", d = 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, {
1817
1828
  // The global remote may be overridden
1818
1829
  // Therefore, set the snapshot key to the global address of the actual request
1819
- entry: p
1820
- }), d);
1821
- u = d, m = y;
1830
+ entry: d
1831
+ }), m);
1832
+ u = m, p = y;
1822
1833
  } else {
1823
- const { remoteSnapshot: p } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1834
+ const { remoteSnapshot: d } = await this.hooks.lifecycle.loadRemoteSnapshot.emit({
1824
1835
  options: this.HostInstance.options,
1825
1836
  moduleInfo: t,
1826
1837
  remoteSnapshot: i,
1827
1838
  from: "global"
1828
1839
  });
1829
- u = p, m = c;
1840
+ u = d, p = c;
1830
1841
  }
1831
1842
  else if (isRemoteInfoWithEntry(t)) {
1832
- const p = await this.getManifestJson(t.entry, t, {}), d = 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({
1833
1844
  options: this.HostInstance.options,
1834
1845
  moduleInfo: t,
1835
- remoteSnapshot: p,
1846
+ remoteSnapshot: d,
1836
1847
  from: "global"
1837
1848
  });
1838
- u = y, m = d;
1849
+ u = y, p = m;
1839
1850
  } else
1840
1851
  error(getShortErrorMsg(RUNTIME_007, runtimeDescMap, {
1841
1852
  hostName: t.name,
@@ -1848,7 +1859,7 @@ class SnapshotHandler {
1848
1859
  remoteSnapshot: u
1849
1860
  }), {
1850
1861
  remoteSnapshot: u,
1851
- globalSnapshot: m
1862
+ globalSnapshot: p
1852
1863
  };
1853
1864
  }
1854
1865
  getGlobalRemoteInfo(t) {
@@ -1939,11 +1950,11 @@ class SharedHandler {
1939
1950
  const u = await i.loading;
1940
1951
  return i.loaded = !0, i.lib || (i.lib = u), c(i), u;
1941
1952
  } else if (i) {
1942
- const m = (async () => {
1943
- const p = await i.get();
1944
- l.lib = p, l.loaded = !0, c(l);
1945
- const d = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1946
- return d && (d.lib = p, d.loaded = !0), p;
1953
+ const p = (async () => {
1954
+ const d = await i.get();
1955
+ l.lib = d, l.loaded = !0, c(l);
1956
+ const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1957
+ return m && (m.lib = d, m.loaded = !0), d;
1947
1958
  })();
1948
1959
  return this.setShared({
1949
1960
  pkgName: t,
@@ -1951,16 +1962,16 @@ class SharedHandler {
1951
1962
  shared: i,
1952
1963
  from: o.options.name,
1953
1964
  lib: null,
1954
- loading: m
1955
- }), m;
1965
+ loading: p
1966
+ }), p;
1956
1967
  } else {
1957
1968
  if (n != null && n.customShareInfo)
1958
1969
  return !1;
1959
- const m = (async () => {
1960
- const p = await l.get();
1961
- l.lib = p, l.loaded = !0, c(l);
1962
- const d = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1963
- return d && (d.lib = p, d.loaded = !0), p;
1970
+ const p = (async () => {
1971
+ const d = await l.get();
1972
+ l.lib = d, l.loaded = !0, c(l);
1973
+ const m = getRegisteredShare(this.shareScopeMap, t, l, this.hooks.lifecycle.resolveShare);
1974
+ return m && (m.lib = d, m.loaded = !0), d;
1964
1975
  })();
1965
1976
  return this.setShared({
1966
1977
  pkgName: t,
@@ -1968,8 +1979,8 @@ class SharedHandler {
1968
1979
  shared: l,
1969
1980
  from: o.options.name,
1970
1981
  lib: null,
1971
- loading: m
1972
- }), m;
1982
+ loading: p
1983
+ }), p;
1973
1984
  }
1974
1985
  }
1975
1986
  /**
@@ -1994,13 +2005,13 @@ class SharedHandler {
1994
2005
  }
1995
2006
  const c = this.shareScopeMap, u = o.options.name;
1996
2007
  c[t] || (c[t] = {});
1997
- const m = c[t], p = (_, E) => {
2008
+ const p = c[t], d = (_, E) => {
1998
2009
  var g;
1999
2010
  const { version: b, eager: S } = E;
2000
- m[_] = m[_] || {};
2001
- const I = m[_], v = I[b], R = !!(v && (v.eager || (g = v.shareConfig) != null && g.eager));
2002
- (!v || v.strategy !== "loaded-first" && !v.loaded && (!S != !R ? S : u > v.from)) && (I[b] = E);
2003
- }, d = (_) => _ && _.init && _.init(c[t], l), y = async (_) => {
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);
2014
+ }, m = (_) => _ && _.init && _.init(c[t], l), y = async (_) => {
2004
2015
  const { module: E } = await o.remoteHandler.getRemoteModuleAndOptions({
2005
2016
  id: _
2006
2017
  });
@@ -2017,12 +2028,12 @@ class SharedHandler {
2017
2028
  origin: o
2018
2029
  });
2019
2030
  }
2020
- E.inited || (await d(g), E.inited = !0);
2031
+ E.inited || (await m(g), E.inited = !0);
2021
2032
  }
2022
2033
  };
2023
2034
  return Object.keys(o.options.shared).forEach((_) => {
2024
2035
  o.options.shared[_].forEach((g) => {
2025
- g.scope.includes(t) && p(_, g);
2036
+ g.scope.includes(t) && d(_, g);
2026
2037
  });
2027
2038
  }), (o.options.shareStrategy === "version-first" || a === "version-first") && o.options.remotes.forEach((_) => {
2028
2039
  _.shareScope === t && i.push(y(_.name));
@@ -2096,27 +2107,27 @@ class SharedHandler {
2096
2107
  });
2097
2108
  }
2098
2109
  setShared({ pkgName: t, shared: n, from: o, lib: s, loading: a, loaded: l, get: i }) {
2099
- const { version: c, scope: u = "default" } = n, m = _object_without_properties_loose(n, [
2110
+ const { version: c, scope: u = "default" } = n, p = _object_without_properties_loose(n, [
2100
2111
  "version",
2101
2112
  "scope"
2102
2113
  ]);
2103
2114
  (Array.isArray(u) ? u : [
2104
2115
  u
2105
- ]).forEach((d) => {
2106
- if (this.shareScopeMap[d] || (this.shareScopeMap[d] = {}), this.shareScopeMap[d][t] || (this.shareScopeMap[d][t] = {}), !this.shareScopeMap[d][t][c]) {
2107
- this.shareScopeMap[d][t][c] = _extends$1({
2116
+ ]).forEach((m) => {
2117
+ if (this.shareScopeMap[m] || (this.shareScopeMap[m] = {}), this.shareScopeMap[m][t] || (this.shareScopeMap[m][t] = {}), !this.shareScopeMap[m][t][c]) {
2118
+ this.shareScopeMap[m][t][c] = _extends$1({
2108
2119
  version: c,
2109
2120
  scope: [
2110
2121
  "default"
2111
2122
  ]
2112
- }, m, {
2123
+ }, p, {
2113
2124
  lib: s,
2114
2125
  loaded: l,
2115
2126
  loading: a
2116
- }), i && (this.shareScopeMap[d][t][c].get = i);
2127
+ }), i && (this.shareScopeMap[m][t][c].get = i);
2117
2128
  return;
2118
2129
  }
2119
- const y = this.shareScopeMap[d][t][c];
2130
+ const y = this.shareScopeMap[m][t][c];
2120
2131
  a && !y.loading && (y.loading = a);
2121
2132
  });
2122
2133
  }
@@ -2172,10 +2183,10 @@ class RemoteHandler {
2172
2183
  loadFactory: !0
2173
2184
  }, { module: a, moduleOptions: l, remoteMatchInfo: i } = await this.getRemoteModuleAndOptions({
2174
2185
  id: t
2175
- }), { pkgNameOrAlias: c, remote: u, expose: m, id: p, remoteSnapshot: d } = i, y = await a.get(p, m, n, d), _ = await this.hooks.lifecycle.onLoad.emit({
2176
- 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,
2177
2188
  pkgNameOrAlias: c,
2178
- expose: m,
2189
+ expose: p,
2179
2190
  exposeModule: s ? y : void 0,
2180
2191
  exposeModuleFactory: s ? void 0 : y,
2181
2192
  remote: u,
@@ -2259,15 +2270,15 @@ class RemoteHandler {
2259
2270
  options: n.options,
2260
2271
  origin: n,
2261
2272
  remoteInfo: c
2262
- })), { remote: m, expose: p } = u;
2263
- assert(m && p, `The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);
2264
- let d = n.moduleCache.get(m.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);
2265
2276
  const y = {
2266
2277
  host: n,
2267
2278
  remoteInfo: c
2268
2279
  };
2269
- return d || (d = new Module(y), n.moduleCache.set(m.name, d)), {
2270
- module: d,
2280
+ return m || (m = new Module(y), n.moduleCache.set(p.name, m)), {
2281
+ module: m,
2271
2282
  moduleOptions: y,
2272
2283
  remoteMatchInfo: u
2273
2284
  };
@@ -2317,45 +2328,45 @@ class RemoteHandler {
2317
2328
  }
2318
2329
  const u = getRemoteEntryUniqueKey(l.remoteInfo);
2319
2330
  globalLoading[u] && delete globalLoading[u], o.snapshotHandler.manifestCache.delete(i.entry);
2320
- let m = i.buildVersion ? composeKeyWithSeparator(i.name, i.buildVersion) : i.name;
2321
- const p = CurrentGlobal.__FEDERATION__.__INSTANCES__.findIndex((y) => i.buildVersion ? y.options.id === m : y.name === m);
2322
- if (p !== -1) {
2323
- const y = CurrentGlobal.__FEDERATION__.__INSTANCES__[p];
2324
- m = y.options.id || m;
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;
2325
2336
  const _ = getGlobalShareScope();
2326
2337
  let E = !0;
2327
2338
  const g = [];
2328
2339
  Object.keys(_).forEach((b) => {
2329
2340
  const S = _[b];
2330
- S && Object.keys(S).forEach((I) => {
2331
- const v = S[I];
2332
- v && Object.keys(v).forEach((R) => {
2333
- const $ = v[R];
2341
+ S && Object.keys(S).forEach((v) => {
2342
+ const I = S[v];
2343
+ I && Object.keys(I).forEach((R) => {
2344
+ const $ = I[R];
2334
2345
  $ && Object.keys($).forEach((w) => {
2335
2346
  const O = $[w];
2336
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([
2337
2348
  b,
2338
- I,
2349
+ v,
2339
2350
  R,
2340
2351
  w
2341
2352
  ])) : g.push([
2342
2353
  b,
2343
- I,
2354
+ v,
2344
2355
  R,
2345
2356
  w
2346
2357
  ]));
2347
2358
  });
2348
2359
  });
2349
2360
  });
2350
- }), E && (y.shareScopeMap = {}, delete _[m]), g.forEach(([b, S, I, v]) => {
2361
+ }), E && (y.shareScopeMap = {}, delete _[p]), g.forEach(([b, S, v, I]) => {
2351
2362
  var R, $, w;
2352
- (w = _[b]) == null || ($ = w[S]) == null || (R = $[I]) == null || delete R[v];
2353
- }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(p, 1);
2363
+ (w = _[b]) == null || ($ = w[S]) == null || (R = $[v]) == null || delete R[I];
2364
+ }), CurrentGlobal.__FEDERATION__.__INSTANCES__.splice(d, 1);
2354
2365
  }
2355
- const { hostGlobalSnapshot: d } = getGlobalRemoteInfo(t, o);
2356
- if (d) {
2357
- const y = d && "remotesInfo" in d && d.remotesInfo && getInfoWithoutType(d.remotesInfo, t.name).key;
2358
- y && (delete d.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2366
+ const { hostGlobalSnapshot: m } = getGlobalRemoteInfo(t, o);
2367
+ if (m) {
2368
+ const y = m && "remotesInfo" in m && m.remotesInfo && getInfoWithoutType(m.remotesInfo, t.name).key;
2369
+ y && (delete m.remotesInfo[y], Global.__FEDERATION__.__MANIFEST_LOADING__[y] && delete Global.__FEDERATION__.__MANIFEST_LOADING__[y]);
2359
2370
  }
2360
2371
  o.moduleCache.delete(t.name);
2361
2372
  }
@@ -2429,8 +2440,8 @@ class FederationHost {
2429
2440
  }), l = this.remoteHandler.formatAndRegisterRemote(a, s), { shared: i } = this.sharedHandler.registerShared(a, s), c = [
2430
2441
  ...a.plugins
2431
2442
  ];
2432
- s.plugins && s.plugins.forEach((m) => {
2433
- c.includes(m) || c.push(m);
2443
+ s.plugins && s.plugins.forEach((p) => {
2444
+ c.includes(p) || c.push(p);
2434
2445
  });
2435
2446
  const u = _extends$1({}, t, n, {
2436
2447
  plugins: c,
@@ -2443,7 +2454,7 @@ class FederationHost {
2443
2454
  }), u;
2444
2455
  }
2445
2456
  registerPlugins(t) {
2446
- const n = registerPlugins$1(t, [
2457
+ const n = registerPlugins(t, [
2447
2458
  this.hooks,
2448
2459
  this.remoteHandler.hooks,
2449
2460
  this.sharedHandler.hooks,
@@ -2464,7 +2475,7 @@ class FederationHost {
2464
2475
  beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
2465
2476
  // maybe will change, temporarily for internal use only
2466
2477
  initContainer: new AsyncWaterfallHook("initContainer")
2467
- }), this.version = "0.8.6", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2478
+ }), this.version = "0.6.16", this.moduleCache = /* @__PURE__ */ new Map(), this.loaderHook = new PluginSystem({
2468
2479
  // FIXME: may not be suitable , not open to the public yet
2469
2480
  getModuleInfo: new SyncHook(),
2470
2481
  createScript: new SyncHook(),
@@ -2503,28 +2514,28 @@ setGlobalFederationConstructor(FederationHost);
2503
2514
  function createBridgeComponent(r) {
2504
2515
  const t = /* @__PURE__ */ new Map(), n = getInstance();
2505
2516
  return () => ({
2506
- __APP_VERSION__: "0.8.6",
2517
+ __APP_VERSION__: "0.8.8",
2507
2518
  async render(o) {
2508
- var c, u, m;
2519
+ var c, u, p;
2509
2520
  LoggerInstance.debug("createBridgeComponent render Info", o);
2510
2521
  const s = Vue.createApp(r.rootComponent);
2511
2522
  t.set(o.dom, s);
2512
- const a = await ((m = (u = (c = n == null ? void 0 : n.bridgeHook) == null ? void 0 : c.lifecycle) == null ? void 0 : u.beforeBridgeRender) == null ? void 0 : m.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({
2513
2524
  app: s,
2514
2525
  basename: o.basename,
2515
2526
  memoryRoute: o.memoryRoute,
2516
2527
  ...l
2517
2528
  });
2518
2529
  if (i != null && i.router) {
2519
- const p = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), d = VueRouter.createRouter({
2530
+ const d = o.memoryRoute ? VueRouter.createMemoryHistory(o.basename) : VueRouter.createWebHistory(o.basename), m = VueRouter.createRouter({
2520
2531
  ...i.router.options,
2521
- history: p,
2532
+ history: d,
2522
2533
  routes: i.router.getRoutes()
2523
2534
  });
2524
2535
  LoggerInstance.log("createBridgeComponent render router info>>>", {
2525
2536
  name: o.moduleName,
2526
- router: d
2527
- }), o.memoryRoute && await d.push(o.memoryRoute.entryPath), s.use(d);
2537
+ router: m
2538
+ }), o.memoryRoute && await m.push(o.memoryRoute.entryPath), s.use(m);
2528
2539
  }
2529
2540
  s.mount(o.dom);
2530
2541
  },
@@ -2549,8 +2560,8 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2549
2560
  },
2550
2561
  setup(r) {
2551
2562
  const t = ref(null), n = ref(null), o = ref(""), s = useRoute(), a = () => {
2552
- var m;
2553
- const i = (m = r.providerInfo) == null ? void 0 : m.call(r);
2563
+ var p;
2564
+ const i = (p = r.providerInfo) == null ? void 0 : p.call(r);
2554
2565
  n.value = i;
2555
2566
  let c = {
2556
2567
  name: r.moduleName,
@@ -2584,7 +2595,7 @@ const RemoteApp = /* @__PURE__ */ defineComponent({
2584
2595
  });
2585
2596
  function createRemoteComponent(r) {
2586
2597
  return defineAsyncComponent({
2587
- __APP_VERSION__: "0.8.6",
2598
+ __APP_VERSION__: "0.8.8",
2588
2599
  ...r.asyncComponentOptions,
2589
2600
  //@ts-ignore
2590
2601
  loader: async () => {