@module-federation/bridge-react 0.0.0-next-20250925034616 → 0.0.0-perf-devtools-20260106124142

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +81 -3
  2. package/__tests__/bridge.spec.tsx +37 -14
  3. package/dist/base.cjs.js +29 -0
  4. package/dist/base.d.ts +311 -0
  5. package/dist/base.es.js +30 -0
  6. package/dist/{bridge-base-BwHtOqw_.mjs → bridge-base-CPSTBjEp.mjs} +30 -18
  7. package/dist/{bridge-base-Ds850AOx.js → bridge-base-RStDxH71.js} +30 -18
  8. package/dist/createHelpers-B_L612IN.js +190 -0
  9. package/dist/createHelpers-Ui5pt7je.mjs +191 -0
  10. package/dist/data-fetch-server-middleware.cjs.js +2 -2
  11. package/dist/data-fetch-server-middleware.es.js +2 -2
  12. package/dist/data-fetch-utils.cjs.js +2 -2
  13. package/dist/data-fetch-utils.es.js +8 -8
  14. package/dist/{index-eN2xRRXs.js → index-DRSBaSu3.js} +1 -1
  15. package/dist/{index-rAO0Wr0M.mjs → index-DyQNwY2M.mjs} +1 -1
  16. package/dist/index.cjs.js +11 -179
  17. package/dist/index.d.ts +31 -6
  18. package/dist/index.es.js +19 -186
  19. package/dist/{index.esm-Ju4RY-yW.js → index.esm-BWaKho-8.js} +108 -46
  20. package/dist/{index.esm-CtI0uQUR.mjs → index.esm-CPwSeCvw.mjs} +113 -51
  21. package/dist/{lazy-load-component-plugin-CvjXKaT7.js → lazy-load-component-plugin-BbKBABLx.js} +2 -2
  22. package/dist/{lazy-load-component-plugin-DoK4De8-.mjs → lazy-load-component-plugin-CHUcCRrF.mjs} +2 -2
  23. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  24. package/dist/lazy-load-component-plugin.es.js +2 -2
  25. package/dist/lazy-utils.cjs.js +2 -2
  26. package/dist/lazy-utils.es.js +4 -4
  27. package/dist/{prefetch-pdZpIE7_.mjs → prefetch-CBBSKet3.mjs} +43 -141
  28. package/dist/{prefetch-BUT0GL7H.js → prefetch-DcwCyN6i.js} +43 -141
  29. package/dist/router-v5.cjs.js +1 -1
  30. package/dist/router-v5.es.js +1 -1
  31. package/dist/router-v6.cjs.js +1 -1
  32. package/dist/router-v6.es.js +1 -1
  33. package/dist/router-v7.cjs.js +83 -0
  34. package/dist/router-v7.d.ts +20 -0
  35. package/dist/router-v7.es.js +61 -0
  36. package/dist/router.cjs.js +1 -1
  37. package/dist/router.es.js +1 -1
  38. package/dist/{utils-VSOJTX_o.mjs → utils-dUgb9Jkm.mjs} +7 -7
  39. package/dist/{utils-vIpCrZmn.js → utils-tM9yE73c.js} +1 -1
  40. package/dist/v18.cjs.js +1 -1
  41. package/dist/v18.es.js +1 -1
  42. package/dist/v19.cjs.js +1 -1
  43. package/dist/v19.es.js +1 -1
  44. package/package.json +54 -10
  45. package/src/base.ts +50 -0
  46. package/src/index.ts +6 -1
  47. package/src/provider/versions/bridge-base.tsx +45 -17
  48. package/src/provider/versions/legacy.ts +2 -1
  49. package/src/remote/RemoteAppWrapper.tsx +108 -0
  50. package/src/remote/base-component/component.tsx +2 -0
  51. package/src/remote/base-component/create.tsx +23 -0
  52. package/src/remote/base-component/index.tsx +10 -0
  53. package/src/remote/createHelpers.tsx +130 -0
  54. package/src/remote/{component.tsx → router-component/component.tsx} +3 -110
  55. package/src/remote/router-component/create.tsx +23 -0
  56. package/src/remote/router-component/index.tsx +10 -0
  57. package/src/router/v7.tsx +75 -0
  58. package/vite.config.ts +25 -0
  59. package/src/remote/create.tsx +0 -103
@@ -1,5 +1,5 @@
1
- import { x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger$1, g as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, A as DOWNGRADE_KEY, B as getDowngradeTag, G as callAllDowngrade, H as callDowngrade, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-VSOJTX_o.mjs";
2
- import { b as isDebugMode, c as createLogger, d as createLink, e as createScript, i as isBrowserEnv, a as composeKeyWithSeparator, l as loadScriptNode, f as loadScript } from "./index.esm-CtI0uQUR.mjs";
1
+ import { x as DATA_FETCH_FUNCTION, F as FS_HREF, l as logger$1, e as getDataFetchMap, i as initDataFetchMap, n as getDataFetchItem, M as MF_DATA_FETCH_STATUS, p as MF_DATA_FETCH_TYPE, A as DOWNGRADE_KEY, B as getDowngradeTag, G as callAllDowngrade, H as callDowngrade, k as getDataFetchInfo, m as getDataFetchMapKey } from "./utils-dUgb9Jkm.mjs";
2
+ import { i as isDebugMode, a as createLink, b as createScript, d as isBrowserEnv, c as createLogger, e as composeKeyWithSeparator, l as loadScriptNode, f as loadScript } from "./index.esm-CPwSeCvw.mjs";
3
3
  const dataFetchFunction = async function(options) {
4
4
  var _a, _b;
5
5
  const [id, data, downgrade] = options;
@@ -75,38 +75,6 @@ function injectDataFetch() {
75
75
  globalThis[FS_HREF] = window.location.href;
76
76
  dataFetch.push = dataFetchFunction;
77
77
  }
78
- function _extends$2() {
79
- _extends$2 = Object.assign || function assign(target) {
80
- for (var i = 1; i < arguments.length; i++) {
81
- var source = arguments[i];
82
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
83
- }
84
- return target;
85
- };
86
- return _extends$2.apply(this, arguments);
87
- }
88
- function _extends$1() {
89
- _extends$1 = Object.assign || function assign(target) {
90
- for (var i = 1; i < arguments.length; i++) {
91
- var source = arguments[i];
92
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
93
- }
94
- return target;
95
- };
96
- return _extends$1.apply(this, arguments);
97
- }
98
- function _object_without_properties_loose(source, excluded) {
99
- if (source == null) return {};
100
- var target = {};
101
- var sourceKeys = Object.keys(source);
102
- var key, i;
103
- for (i = 0; i < sourceKeys.length; i++) {
104
- key = sourceKeys[i];
105
- if (excluded.indexOf(key) >= 0) continue;
106
- target[key] = source[key];
107
- }
108
- return target;
109
- }
110
78
  const RUNTIME_001 = "RUNTIME-001";
111
79
  const RUNTIME_002 = "RUNTIME-002";
112
80
  const RUNTIME_003 = "RUNTIME-003";
@@ -116,33 +84,16 @@ const RUNTIME_006 = "RUNTIME-006";
116
84
  const RUNTIME_007 = "RUNTIME-007";
117
85
  const RUNTIME_008 = "RUNTIME-008";
118
86
  const RUNTIME_009 = "RUNTIME-009";
119
- const TYPE_001 = "TYPE-001";
120
- const BUILD_001 = "BUILD-001";
121
- const BUILD_002 = "BUILD-002";
122
87
  const getDocsUrl = (errorCode) => {
123
88
  const type = errorCode.split("-")[0].toLowerCase();
124
89
  return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
125
90
  };
126
91
  const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
127
- const msg = [
128
- `${[
129
- errorDescMap[errorCode]
130
- ]} #${errorCode}`
131
- ];
92
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
132
93
  args && msg.push(`args: ${JSON.stringify(args)}`);
133
94
  msg.push(getDocsUrl(errorCode));
134
95
  return msg.join("\n");
135
96
  };
136
- function _extends() {
137
- _extends = Object.assign || function assign(target) {
138
- for (var i = 1; i < arguments.length; i++) {
139
- var source = arguments[i];
140
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
141
- }
142
- return target;
143
- };
144
- return _extends.apply(this, arguments);
145
- }
146
97
  const runtimeDescMap = {
147
98
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
148
99
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -154,14 +105,9 @@ const runtimeDescMap = {
154
105
  [RUNTIME_008]: "Failed to load script resources.",
155
106
  [RUNTIME_009]: "Please call createInstance first."
156
107
  };
157
- const typeDescMap = {
158
- [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."
159
- };
160
- const buildDescMap = {
161
- [BUILD_001]: "Failed to find expose module.",
162
- [BUILD_002]: "PublicPath is required in prod mode."
163
- };
164
- _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
108
+ ({
109
+ ...runtimeDescMap
110
+ });
165
111
  const LOG_CATEGORY = "[ Federation Runtime ]";
166
112
  const logger = createLogger(LOG_CATEGORY);
167
113
  function assert(condition, msg) {
@@ -201,7 +147,7 @@ const CurrentGlobal = typeof globalThis === "object" ? globalThis : window;
201
147
  const nativeGlobal = (() => {
202
148
  try {
203
149
  return document.defaultView;
204
- } catch (e) {
150
+ } catch {
205
151
  return CurrentGlobal;
206
152
  }
207
153
  })();
@@ -221,7 +167,7 @@ if (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) {
221
167
  }
222
168
  const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
223
169
  function setGlobalDefaultVal(target) {
224
- var _target___FEDERATION__, _target___FEDERATION__1, _target___FEDERATION__2, _target___FEDERATION__3, _target___FEDERATION__4, _target___FEDERATION__5;
170
+ var _a, _b, _c, _d, _e, _f;
225
171
  if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) {
226
172
  definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);
227
173
  }
@@ -236,18 +182,12 @@ function setGlobalDefaultVal(target) {
236
182
  });
237
183
  definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);
238
184
  }
239
- var ___GLOBAL_PLUGIN__;
240
- (___GLOBAL_PLUGIN__ = (_target___FEDERATION__ = target.__FEDERATION__).__GLOBAL_PLUGIN__) != null ? ___GLOBAL_PLUGIN__ : _target___FEDERATION__.__GLOBAL_PLUGIN__ = [];
241
- var ___INSTANCES__;
242
- (___INSTANCES__ = (_target___FEDERATION__1 = target.__FEDERATION__).__INSTANCES__) != null ? ___INSTANCES__ : _target___FEDERATION__1.__INSTANCES__ = [];
243
- var _moduleInfo;
244
- (_moduleInfo = (_target___FEDERATION__2 = target.__FEDERATION__).moduleInfo) != null ? _moduleInfo : _target___FEDERATION__2.moduleInfo = {};
245
- var ___SHARE__;
246
- (___SHARE__ = (_target___FEDERATION__3 = target.__FEDERATION__).__SHARE__) != null ? ___SHARE__ : _target___FEDERATION__3.__SHARE__ = {};
247
- var ___MANIFEST_LOADING__;
248
- (___MANIFEST_LOADING__ = (_target___FEDERATION__4 = target.__FEDERATION__).__MANIFEST_LOADING__) != null ? ___MANIFEST_LOADING__ : _target___FEDERATION__4.__MANIFEST_LOADING__ = {};
249
- var ___PRELOADED_MAP__;
250
- (___PRELOADED_MAP__ = (_target___FEDERATION__5 = target.__FEDERATION__).__PRELOADED_MAP__) != null ? ___PRELOADED_MAP__ : _target___FEDERATION__5.__PRELOADED_MAP__ = /* @__PURE__ */ new Map();
185
+ (_a = target.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (_a.__GLOBAL_PLUGIN__ = []);
186
+ (_b = target.__FEDERATION__).__INSTANCES__ ?? (_b.__INSTANCES__ = []);
187
+ (_c = target.__FEDERATION__).moduleInfo ?? (_c.moduleInfo = {});
188
+ (_d = target.__FEDERATION__).__SHARE__ ?? (_d.__SHARE__ = {});
189
+ (_e = target.__FEDERATION__).__MANIFEST_LOADING__ ?? (_e.__MANIFEST_LOADING__ = {});
190
+ (_f = target.__FEDERATION__).__PRELOADED_MAP__ ?? (_f.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
251
191
  }
252
192
  setGlobalDefaultVal(CurrentGlobal);
253
193
  setGlobalDefaultVal(nativeGlobal);
@@ -270,7 +210,7 @@ function getGlobalFederationConstructor() {
270
210
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
271
211
  if (isDebug) {
272
212
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
273
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-next-20250925034616";
213
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-perf-devtools-20260106124142";
274
214
  }
275
215
  }
276
216
  function getInfoWithoutType(target, key) {
@@ -314,9 +254,7 @@ const getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot) => {
314
254
  return getModuleInfo;
315
255
  }
316
256
  if ("version" in moduleInfo && moduleInfo["version"]) {
317
- const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [
318
- "version"
319
- ]);
257
+ const { version, ...resModuleInfo } = moduleInfo;
320
258
  const moduleKeyWithoutVersion = getFMId(resModuleInfo);
321
259
  const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion).value;
322
260
  if ((getModuleInfoWithoutVersion == null ? void 0 : getModuleInfoWithoutVersion.version) === version) {
@@ -332,7 +270,10 @@ const setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo) => {
332
270
  return nativeGlobal.__FEDERATION__.moduleInfo;
333
271
  };
334
272
  const addGlobalSnapshot = (moduleInfos) => {
335
- nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
273
+ nativeGlobal.__FEDERATION__.moduleInfo = {
274
+ ...nativeGlobal.__FEDERATION__.moduleInfo,
275
+ ...moduleInfos
276
+ };
336
277
  return () => {
337
278
  const keys = Object.keys(moduleInfos);
338
279
  for (const key of keys) {
@@ -666,6 +607,7 @@ function satisfy(version, range) {
666
607
  const versionAtom = {
667
608
  operator: versionOperator,
668
609
  version: combineVersion(versionMajor, versionMinor, versionPatch, versionPreRelease),
610
+ // exclude build atom
669
611
  major: versionMajor,
670
612
  minor: versionMinor,
671
613
  patch: versionPatch,
@@ -804,9 +746,7 @@ function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare
804
746
  return;
805
747
  }
806
748
  const { shareConfig, scope = DEFAULT_SCOPE, strategy } = shareInfo;
807
- const scopes = Array.isArray(scope) ? scope : [
808
- scope
809
- ];
749
+ const scopes = Array.isArray(scope) ? scope : [scope];
810
750
  for (const sc of scopes) {
811
751
  if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
812
752
  const { requiredVersion } = shareConfig;
@@ -928,10 +868,7 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
928
868
  if (typeof __system_context__ === "undefined") {
929
869
  System.import(entry).then(resolve).catch(reject);
930
870
  } else {
931
- new Function("callbacks", `System.import("${entry}")${importCallback}`)([
932
- resolve,
933
- reject
934
- ]);
871
+ new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
935
872
  }
936
873
  } else {
937
874
  resolve(remoteEntryExports);
@@ -959,11 +896,9 @@ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUr
959
896
  return loadScript(url, {
960
897
  attrs: {},
961
898
  createScriptHook: (url2, attrs) => {
962
- const res = loaderHook.lifecycle.createScript.emit({
963
- url: url2,
964
- attrs
965
- });
966
- if (!res) return;
899
+ const res = loaderHook.lifecycle.createScript.emit({ url: url2, attrs });
900
+ if (!res)
901
+ return;
967
902
  if (res instanceof HTMLScriptElement) {
968
903
  return res;
969
904
  }
@@ -987,15 +922,9 @@ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEnt
987
922
  switch (type) {
988
923
  case "esm":
989
924
  case "module":
990
- return loadEsmEntry({
991
- entry,
992
- remoteEntryExports
993
- });
925
+ return loadEsmEntry({ entry, remoteEntryExports });
994
926
  case "system":
995
- return loadSystemJsEntry({
996
- entry,
997
- remoteEntryExports
998
- });
927
+ return loadSystemJsEntry({ entry, remoteEntryExports });
999
928
  default:
1000
929
  return loadEntryScript({
1001
930
  entry,
@@ -1013,18 +942,12 @@ async function loadEntryNode({ remoteInfo, loaderHook }) {
1013
942
  return remoteEntryExports;
1014
943
  }
1015
944
  return loadScriptNode(entry, {
1016
- attrs: {
1017
- name,
1018
- globalName,
1019
- type
1020
- },
945
+ attrs: { name, globalName, type },
1021
946
  loaderHook: {
1022
947
  createScriptHook: (url, attrs = {}) => {
1023
- const res = loaderHook.lifecycle.createScript.emit({
1024
- url,
1025
- attrs
1026
- });
1027
- if (!res) return;
948
+ const res = loaderHook.lifecycle.createScript.emit({ url, attrs });
949
+ if (!res)
950
+ return;
1028
951
  if ("url" in res) {
1029
952
  return res;
1030
953
  }
@@ -1064,18 +987,13 @@ async function getRemoteEntry(params) {
1064
987
  remoteEntryExports,
1065
988
  loaderHook,
1066
989
  getEntryUrl
1067
- }) : loadEntryNode({
1068
- remoteInfo,
1069
- loaderHook
1070
- });
990
+ }) : loadEntryNode({ remoteInfo, loaderHook });
1071
991
  }).catch(async (err) => {
1072
992
  const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);
1073
993
  const isScriptLoadError = err instanceof Error && err.message.includes(RUNTIME_008);
1074
994
  if (isScriptLoadError && !_inErrorHandling) {
1075
995
  const wrappedGetRemoteEntry = (params2) => {
1076
- return getRemoteEntry(_extends$1({}, params2, {
1077
- _inErrorHandling: true
1078
- }));
996
+ return getRemoteEntry({ ...params2, _inErrorHandling: true });
1079
997
  };
1080
998
  const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({
1081
999
  getRemoteEntry: wrappedGetRemoteEntry,
@@ -1095,12 +1013,13 @@ async function getRemoteEntry(params) {
1095
1013
  return globalLoading[uniqueKey];
1096
1014
  }
1097
1015
  function getRemoteInfo(remote) {
1098
- return _extends$1({}, remote, {
1016
+ return {
1017
+ ...remote,
1099
1018
  entry: "entry" in remote ? remote.entry : "",
1100
1019
  type: remote.type || DEFAULT_REMOTE_TYPE,
1101
1020
  entryGlobalName: remote.entryGlobalName || remote.name,
1102
1021
  shareScope: remote.shareScope || DEFAULT_SCOPE
1103
- });
1022
+ };
1104
1023
  }
1105
1024
  function preloadAssets(remoteInfo, host, assets, useLinkPreload = true) {
1106
1025
  const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
@@ -1257,29 +1176,12 @@ var helpers$1 = {
1257
1176
  }
1258
1177
  };
1259
1178
  typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;
1260
- function getBuilderId() {
1261
- return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
1262
- }
1263
- function getGlobalFederationInstance(name, version) {
1264
- const buildId = getBuilderId();
1265
- return CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
1266
- if (buildId && GMInstance.options.id === buildId) {
1267
- return true;
1268
- }
1269
- if (GMInstance.options.name === name && !GMInstance.options.version && !version) {
1270
- return true;
1271
- }
1272
- if (GMInstance.options.name === name && version && GMInstance.options.version === version) {
1273
- return true;
1274
- }
1275
- return false;
1276
- });
1277
- }
1278
- var helpers = _extends$2({}, helpers$1, {
1279
- global: _extends$2({}, helpers$1.global, {
1280
- getGlobalFederationInstance
1281
- })
1282
- });
1179
+ var helpers = {
1180
+ ...helpers$1,
1181
+ global: {
1182
+ ...helpers$1.global
1183
+ }
1184
+ };
1283
1185
  async function prefetch(options) {
1284
1186
  const { instance, id, dataFetchParams, preloadComponentResource } = options;
1285
1187
  if (!id) {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const lazyUtils = require("./utils-vIpCrZmn.js");
3
- const index_esm = require("./index.esm-Ju4RY-yW.js");
2
+ const lazyUtils = require("./utils-tM9yE73c.js");
3
+ const index_esm = require("./index.esm-BWaKho-8.js");
4
4
  const dataFetchFunction = async function(options) {
5
5
  var _a, _b;
6
6
  const [id, data, downgrade] = options;
@@ -76,38 +76,6 @@ function injectDataFetch() {
76
76
  globalThis[lazyUtils.FS_HREF] = window.location.href;
77
77
  dataFetch.push = dataFetchFunction;
78
78
  }
79
- function _extends$2() {
80
- _extends$2 = Object.assign || function assign(target) {
81
- for (var i = 1; i < arguments.length; i++) {
82
- var source = arguments[i];
83
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
84
- }
85
- return target;
86
- };
87
- return _extends$2.apply(this, arguments);
88
- }
89
- function _extends$1() {
90
- _extends$1 = Object.assign || function assign(target) {
91
- for (var i = 1; i < arguments.length; i++) {
92
- var source = arguments[i];
93
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
94
- }
95
- return target;
96
- };
97
- return _extends$1.apply(this, arguments);
98
- }
99
- function _object_without_properties_loose(source, excluded) {
100
- if (source == null) return {};
101
- var target = {};
102
- var sourceKeys = Object.keys(source);
103
- var key, i;
104
- for (i = 0; i < sourceKeys.length; i++) {
105
- key = sourceKeys[i];
106
- if (excluded.indexOf(key) >= 0) continue;
107
- target[key] = source[key];
108
- }
109
- return target;
110
- }
111
79
  const RUNTIME_001 = "RUNTIME-001";
112
80
  const RUNTIME_002 = "RUNTIME-002";
113
81
  const RUNTIME_003 = "RUNTIME-003";
@@ -117,33 +85,16 @@ const RUNTIME_006 = "RUNTIME-006";
117
85
  const RUNTIME_007 = "RUNTIME-007";
118
86
  const RUNTIME_008 = "RUNTIME-008";
119
87
  const RUNTIME_009 = "RUNTIME-009";
120
- const TYPE_001 = "TYPE-001";
121
- const BUILD_001 = "BUILD-001";
122
- const BUILD_002 = "BUILD-002";
123
88
  const getDocsUrl = (errorCode) => {
124
89
  const type = errorCode.split("-")[0].toLowerCase();
125
90
  return `View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${type}/${errorCode}`;
126
91
  };
127
92
  const getShortErrorMsg = (errorCode, errorDescMap, args, originalErrorMsg) => {
128
- const msg = [
129
- `${[
130
- errorDescMap[errorCode]
131
- ]} #${errorCode}`
132
- ];
93
+ const msg = [`${[errorDescMap[errorCode]]} #${errorCode}`];
133
94
  args && msg.push(`args: ${JSON.stringify(args)}`);
134
95
  msg.push(getDocsUrl(errorCode));
135
96
  return msg.join("\n");
136
97
  };
137
- function _extends() {
138
- _extends = Object.assign || function assign(target) {
139
- for (var i = 1; i < arguments.length; i++) {
140
- var source = arguments[i];
141
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
142
- }
143
- return target;
144
- };
145
- return _extends.apply(this, arguments);
146
- }
147
98
  const runtimeDescMap = {
148
99
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
149
100
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -155,14 +106,9 @@ const runtimeDescMap = {
155
106
  [RUNTIME_008]: "Failed to load script resources.",
156
107
  [RUNTIME_009]: "Please call createInstance first."
157
108
  };
158
- const typeDescMap = {
159
- [TYPE_001]: "Failed to generate type declaration. Execute the below cmd to reproduce and fix the error."
160
- };
161
- const buildDescMap = {
162
- [BUILD_001]: "Failed to find expose module.",
163
- [BUILD_002]: "PublicPath is required in prod mode."
164
- };
165
- _extends({}, runtimeDescMap, typeDescMap, buildDescMap);
109
+ ({
110
+ ...runtimeDescMap
111
+ });
166
112
  const LOG_CATEGORY = "[ Federation Runtime ]";
167
113
  const logger = index_esm.createLogger(LOG_CATEGORY);
168
114
  function assert(condition, msg) {
@@ -202,7 +148,7 @@ const CurrentGlobal = typeof globalThis === "object" ? globalThis : window;
202
148
  const nativeGlobal = (() => {
203
149
  try {
204
150
  return document.defaultView;
205
- } catch (e) {
151
+ } catch {
206
152
  return CurrentGlobal;
207
153
  }
208
154
  })();
@@ -222,7 +168,7 @@ if (!includeOwnProperty(CurrentGlobal, "__GLOBAL_LOADING_REMOTE_ENTRY__")) {
222
168
  }
223
169
  const globalLoading = CurrentGlobal.__GLOBAL_LOADING_REMOTE_ENTRY__;
224
170
  function setGlobalDefaultVal(target) {
225
- var _target___FEDERATION__, _target___FEDERATION__1, _target___FEDERATION__2, _target___FEDERATION__3, _target___FEDERATION__4, _target___FEDERATION__5;
171
+ var _a, _b, _c, _d, _e, _f;
226
172
  if (includeOwnProperty(target, "__VMOK__") && !includeOwnProperty(target, "__FEDERATION__")) {
227
173
  definePropertyGlobalVal(target, "__FEDERATION__", target.__VMOK__);
228
174
  }
@@ -237,18 +183,12 @@ function setGlobalDefaultVal(target) {
237
183
  });
238
184
  definePropertyGlobalVal(target, "__VMOK__", target.__FEDERATION__);
239
185
  }
240
- var ___GLOBAL_PLUGIN__;
241
- (___GLOBAL_PLUGIN__ = (_target___FEDERATION__ = target.__FEDERATION__).__GLOBAL_PLUGIN__) != null ? ___GLOBAL_PLUGIN__ : _target___FEDERATION__.__GLOBAL_PLUGIN__ = [];
242
- var ___INSTANCES__;
243
- (___INSTANCES__ = (_target___FEDERATION__1 = target.__FEDERATION__).__INSTANCES__) != null ? ___INSTANCES__ : _target___FEDERATION__1.__INSTANCES__ = [];
244
- var _moduleInfo;
245
- (_moduleInfo = (_target___FEDERATION__2 = target.__FEDERATION__).moduleInfo) != null ? _moduleInfo : _target___FEDERATION__2.moduleInfo = {};
246
- var ___SHARE__;
247
- (___SHARE__ = (_target___FEDERATION__3 = target.__FEDERATION__).__SHARE__) != null ? ___SHARE__ : _target___FEDERATION__3.__SHARE__ = {};
248
- var ___MANIFEST_LOADING__;
249
- (___MANIFEST_LOADING__ = (_target___FEDERATION__4 = target.__FEDERATION__).__MANIFEST_LOADING__) != null ? ___MANIFEST_LOADING__ : _target___FEDERATION__4.__MANIFEST_LOADING__ = {};
250
- var ___PRELOADED_MAP__;
251
- (___PRELOADED_MAP__ = (_target___FEDERATION__5 = target.__FEDERATION__).__PRELOADED_MAP__) != null ? ___PRELOADED_MAP__ : _target___FEDERATION__5.__PRELOADED_MAP__ = /* @__PURE__ */ new Map();
186
+ (_a = target.__FEDERATION__).__GLOBAL_PLUGIN__ ?? (_a.__GLOBAL_PLUGIN__ = []);
187
+ (_b = target.__FEDERATION__).__INSTANCES__ ?? (_b.__INSTANCES__ = []);
188
+ (_c = target.__FEDERATION__).moduleInfo ?? (_c.moduleInfo = {});
189
+ (_d = target.__FEDERATION__).__SHARE__ ?? (_d.__SHARE__ = {});
190
+ (_e = target.__FEDERATION__).__MANIFEST_LOADING__ ?? (_e.__MANIFEST_LOADING__ = {});
191
+ (_f = target.__FEDERATION__).__PRELOADED_MAP__ ?? (_f.__PRELOADED_MAP__ = /* @__PURE__ */ new Map());
252
192
  }
253
193
  setGlobalDefaultVal(CurrentGlobal);
254
194
  setGlobalDefaultVal(nativeGlobal);
@@ -271,7 +211,7 @@ function getGlobalFederationConstructor() {
271
211
  function setGlobalFederationConstructor(FederationConstructor, isDebug = index_esm.isDebugMode()) {
272
212
  if (isDebug) {
273
213
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
274
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-next-20250925034616";
214
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-perf-devtools-20260106124142";
275
215
  }
276
216
  }
277
217
  function getInfoWithoutType(target, key) {
@@ -315,9 +255,7 @@ const getTargetSnapshotInfoByModuleInfo = (moduleInfo, snapshot) => {
315
255
  return getModuleInfo;
316
256
  }
317
257
  if ("version" in moduleInfo && moduleInfo["version"]) {
318
- const { version } = moduleInfo, resModuleInfo = _object_without_properties_loose(moduleInfo, [
319
- "version"
320
- ]);
258
+ const { version, ...resModuleInfo } = moduleInfo;
321
259
  const moduleKeyWithoutVersion = getFMId(resModuleInfo);
322
260
  const getModuleInfoWithoutVersion = getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo, moduleKeyWithoutVersion).value;
323
261
  if ((getModuleInfoWithoutVersion == null ? void 0 : getModuleInfoWithoutVersion.version) === version) {
@@ -333,7 +271,10 @@ const setGlobalSnapshotInfoByModuleInfo = (remoteInfo, moduleDetailInfo) => {
333
271
  return nativeGlobal.__FEDERATION__.moduleInfo;
334
272
  };
335
273
  const addGlobalSnapshot = (moduleInfos) => {
336
- nativeGlobal.__FEDERATION__.moduleInfo = _extends$1({}, nativeGlobal.__FEDERATION__.moduleInfo, moduleInfos);
274
+ nativeGlobal.__FEDERATION__.moduleInfo = {
275
+ ...nativeGlobal.__FEDERATION__.moduleInfo,
276
+ ...moduleInfos
277
+ };
337
278
  return () => {
338
279
  const keys = Object.keys(moduleInfos);
339
280
  for (const key of keys) {
@@ -667,6 +608,7 @@ function satisfy(version, range) {
667
608
  const versionAtom = {
668
609
  operator: versionOperator,
669
610
  version: combineVersion(versionMajor, versionMinor, versionPatch, versionPreRelease),
611
+ // exclude build atom
670
612
  major: versionMajor,
671
613
  minor: versionMinor,
672
614
  patch: versionPatch,
@@ -805,9 +747,7 @@ function getRegisteredShare(localShareScopeMap, pkgName, shareInfo, resolveShare
805
747
  return;
806
748
  }
807
749
  const { shareConfig, scope = DEFAULT_SCOPE, strategy } = shareInfo;
808
- const scopes = Array.isArray(scope) ? scope : [
809
- scope
810
- ];
750
+ const scopes = Array.isArray(scope) ? scope : [scope];
811
751
  for (const sc of scopes) {
812
752
  if (shareConfig && localShareScopeMap[sc] && localShareScopeMap[sc][pkgName]) {
813
753
  const { requiredVersion } = shareConfig;
@@ -929,10 +869,7 @@ async function loadSystemJsEntry({ entry, remoteEntryExports }) {
929
869
  if (typeof __system_context__ === "undefined") {
930
870
  System.import(entry).then(resolve).catch(reject);
931
871
  } else {
932
- new Function("callbacks", `System.import("${entry}")${importCallback}`)([
933
- resolve,
934
- reject
935
- ]);
872
+ new Function("callbacks", `System.import("${entry}")${importCallback}`)([resolve, reject]);
936
873
  }
937
874
  } else {
938
875
  resolve(remoteEntryExports);
@@ -960,11 +897,9 @@ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUr
960
897
  return index_esm.loadScript(url, {
961
898
  attrs: {},
962
899
  createScriptHook: (url2, attrs) => {
963
- const res = loaderHook.lifecycle.createScript.emit({
964
- url: url2,
965
- attrs
966
- });
967
- if (!res) return;
900
+ const res = loaderHook.lifecycle.createScript.emit({ url: url2, attrs });
901
+ if (!res)
902
+ return;
968
903
  if (res instanceof HTMLScriptElement) {
969
904
  return res;
970
905
  }
@@ -988,15 +923,9 @@ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEnt
988
923
  switch (type) {
989
924
  case "esm":
990
925
  case "module":
991
- return loadEsmEntry({
992
- entry,
993
- remoteEntryExports
994
- });
926
+ return loadEsmEntry({ entry, remoteEntryExports });
995
927
  case "system":
996
- return loadSystemJsEntry({
997
- entry,
998
- remoteEntryExports
999
- });
928
+ return loadSystemJsEntry({ entry, remoteEntryExports });
1000
929
  default:
1001
930
  return loadEntryScript({
1002
931
  entry,
@@ -1014,18 +943,12 @@ async function loadEntryNode({ remoteInfo, loaderHook }) {
1014
943
  return remoteEntryExports;
1015
944
  }
1016
945
  return index_esm.loadScriptNode(entry, {
1017
- attrs: {
1018
- name,
1019
- globalName,
1020
- type
1021
- },
946
+ attrs: { name, globalName, type },
1022
947
  loaderHook: {
1023
948
  createScriptHook: (url, attrs = {}) => {
1024
- const res = loaderHook.lifecycle.createScript.emit({
1025
- url,
1026
- attrs
1027
- });
1028
- if (!res) return;
949
+ const res = loaderHook.lifecycle.createScript.emit({ url, attrs });
950
+ if (!res)
951
+ return;
1029
952
  if ("url" in res) {
1030
953
  return res;
1031
954
  }
@@ -1065,18 +988,13 @@ async function getRemoteEntry(params) {
1065
988
  remoteEntryExports,
1066
989
  loaderHook,
1067
990
  getEntryUrl
1068
- }) : loadEntryNode({
1069
- remoteInfo,
1070
- loaderHook
1071
- });
991
+ }) : loadEntryNode({ remoteInfo, loaderHook });
1072
992
  }).catch(async (err) => {
1073
993
  const uniqueKey2 = getRemoteEntryUniqueKey(remoteInfo);
1074
994
  const isScriptLoadError = err instanceof Error && err.message.includes(RUNTIME_008);
1075
995
  if (isScriptLoadError && !_inErrorHandling) {
1076
996
  const wrappedGetRemoteEntry = (params2) => {
1077
- return getRemoteEntry(_extends$1({}, params2, {
1078
- _inErrorHandling: true
1079
- }));
997
+ return getRemoteEntry({ ...params2, _inErrorHandling: true });
1080
998
  };
1081
999
  const RemoteEntryExports = await origin.loaderHook.lifecycle.loadEntryError.emit({
1082
1000
  getRemoteEntry: wrappedGetRemoteEntry,
@@ -1096,12 +1014,13 @@ async function getRemoteEntry(params) {
1096
1014
  return globalLoading[uniqueKey];
1097
1015
  }
1098
1016
  function getRemoteInfo(remote) {
1099
- return _extends$1({}, remote, {
1017
+ return {
1018
+ ...remote,
1100
1019
  entry: "entry" in remote ? remote.entry : "",
1101
1020
  type: remote.type || DEFAULT_REMOTE_TYPE,
1102
1021
  entryGlobalName: remote.entryGlobalName || remote.name,
1103
1022
  shareScope: remote.shareScope || DEFAULT_SCOPE
1104
- });
1023
+ };
1105
1024
  }
1106
1025
  function preloadAssets(remoteInfo, host, assets, useLinkPreload = true) {
1107
1026
  const { cssAssets, jsAssetsWithoutEntry, entryAssets } = assets;
@@ -1258,29 +1177,12 @@ var helpers$1 = {
1258
1177
  }
1259
1178
  };
1260
1179
  typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN === "boolean" ? !FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN : true;
1261
- function getBuilderId() {
1262
- return typeof FEDERATION_BUILD_IDENTIFIER !== "undefined" ? FEDERATION_BUILD_IDENTIFIER : "";
1263
- }
1264
- function getGlobalFederationInstance(name, version) {
1265
- const buildId = getBuilderId();
1266
- return CurrentGlobal.__FEDERATION__.__INSTANCES__.find((GMInstance) => {
1267
- if (buildId && GMInstance.options.id === buildId) {
1268
- return true;
1269
- }
1270
- if (GMInstance.options.name === name && !GMInstance.options.version && !version) {
1271
- return true;
1272
- }
1273
- if (GMInstance.options.name === name && version && GMInstance.options.version === version) {
1274
- return true;
1275
- }
1276
- return false;
1277
- });
1278
- }
1279
- var helpers = _extends$2({}, helpers$1, {
1280
- global: _extends$2({}, helpers$1.global, {
1281
- getGlobalFederationInstance
1282
- })
1283
- });
1180
+ var helpers = {
1181
+ ...helpers$1,
1182
+ global: {
1183
+ ...helpers$1.global
1184
+ }
1185
+ };
1284
1186
  async function prefetch(options) {
1285
1187
  const { instance, id, dataFetchParams, preloadComponentResource } = options;
1286
1188
  if (!id) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const React = require("react");
4
4
  const ReactRouterDom$1 = require("react-router-dom/index.js");
5
- const index = require("./index-eN2xRRXs.js");
5
+ const index = require("./index-DRSBaSu3.js");
6
6
  const ReactRouterDom = require("react-router-dom/index.js");
7
7
  function _interopNamespaceDefault(e) {
8
8
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -1,6 +1,6 @@
1
1
  import React__default, { useContext } from "react";
2
2
  import * as ReactRouterDom$1 from "react-router-dom/index.js";
3
- import { R as RouterContext, L as LoggerInstance } from "./index-rAO0Wr0M.mjs";
3
+ import { R as RouterContext, L as LoggerInstance } from "./index-DyQNwY2M.mjs";
4
4
  export * from "react-router-dom/index.js";
5
5
  function WraperRouter(props) {
6
6
  const { basename, ...propsRes } = props;