@module-federation/bridge-react 0.0.0-next-20250926024003 → 0.0.0-refactor-manifest-20251015072237

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 (35) hide show
  1. package/CHANGELOG.md +13 -3
  2. package/__tests__/bridge.spec.tsx +37 -14
  3. package/dist/{bridge-base-Ds850AOx.js → bridge-base-Bn6DO0Fi.js} +1 -1
  4. package/dist/{bridge-base-BwHtOqw_.mjs → bridge-base-DxcR1fja.mjs} +1 -1
  5. package/dist/data-fetch-server-middleware.cjs.js +2 -2
  6. package/dist/data-fetch-server-middleware.es.js +2 -2
  7. package/dist/data-fetch-utils.cjs.js +2 -2
  8. package/dist/data-fetch-utils.es.js +4 -4
  9. package/dist/{index-rAO0Wr0M.mjs → index-Dm-M9ouh.mjs} +1 -1
  10. package/dist/{index-eN2xRRXs.js → index-DqCpgmgH.js} +1 -1
  11. package/dist/index.cjs.js +5 -5
  12. package/dist/index.es.js +5 -5
  13. package/dist/{index.esm-Ju4RY-yW.js → index.esm-CzoIcLts.js} +76 -46
  14. package/dist/{index.esm-CtI0uQUR.mjs → index.esm-JLwyxgUK.mjs} +81 -51
  15. package/dist/{lazy-load-component-plugin-D6tEPyvX.mjs → lazy-load-component-plugin-C3L-oG4p.mjs} +2 -2
  16. package/dist/{lazy-load-component-plugin-CWNzJM0v.js → lazy-load-component-plugin-DAsjv2E-.js} +2 -2
  17. package/dist/lazy-load-component-plugin.cjs.js +2 -2
  18. package/dist/lazy-load-component-plugin.es.js +2 -2
  19. package/dist/lazy-utils.cjs.js +2 -2
  20. package/dist/lazy-utils.es.js +2 -2
  21. package/dist/{prefetch-hTVJ80G6.js → prefetch-G-4bxrmL.js} +43 -141
  22. package/dist/{prefetch-DCF_oa3O.mjs → prefetch-vPEGI9aw.mjs} +43 -141
  23. package/dist/router-v5.cjs.js +1 -1
  24. package/dist/router-v5.es.js +1 -1
  25. package/dist/router-v6.cjs.js +1 -1
  26. package/dist/router-v6.es.js +1 -1
  27. package/dist/router.cjs.js +1 -1
  28. package/dist/router.es.js +1 -1
  29. package/dist/{utils-vIpCrZmn.js → utils-0HFFqmd4.js} +1 -1
  30. package/dist/{utils-VSOJTX_o.mjs → utils-BTpxHmva.mjs} +1 -1
  31. package/dist/v18.cjs.js +1 -1
  32. package/dist/v18.es.js +1 -1
  33. package/dist/v19.cjs.js +1 -1
  34. package/dist/v19.es.js +1 -1
  35. package/package.json +6 -6
@@ -1,13 +1,3 @@
1
- function _extends() {
2
- _extends = Object.assign || function assign(target) {
3
- for (var i = 1; i < arguments.length; i++) {
4
- var source = arguments[i];
5
- for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
6
- }
7
- return target;
8
- };
9
- return _extends.apply(this, arguments);
10
- }
11
1
  const MANIFEST_EXT = ".json";
12
2
  const BROWSER_LOG_KEY = "FEDERATION_DEBUG";
13
3
  const SEPARATOR = ":";
@@ -51,40 +41,88 @@ const composeKeyWithSeparator = function(...args) {
51
41
  const warn = (msg) => {
52
42
  console.warn(`${LOG_CATEGORY}: ${msg}`);
53
43
  };
54
- let Logger = class Logger2 {
44
+ const PREFIX = "[ Module Federation ]";
45
+ const DEFAULT_DELEGATE = console;
46
+ class Logger {
47
+ constructor(prefix, delegate = DEFAULT_DELEGATE) {
48
+ this.prefix = prefix;
49
+ this.delegate = delegate ?? DEFAULT_DELEGATE;
50
+ }
55
51
  setPrefix(prefix) {
56
52
  this.prefix = prefix;
57
53
  }
54
+ setDelegate(delegate) {
55
+ this.delegate = delegate ?? DEFAULT_DELEGATE;
56
+ }
57
+ emit(method, args) {
58
+ const delegate = this.delegate;
59
+ const order = (() => {
60
+ switch (method) {
61
+ case "log":
62
+ return ["log", "info"];
63
+ case "info":
64
+ return ["info", "log"];
65
+ case "warn":
66
+ return ["warn", "info", "log"];
67
+ case "error":
68
+ return ["error", "warn", "log"];
69
+ case "debug":
70
+ default:
71
+ return ["debug", "log"];
72
+ }
73
+ })();
74
+ for (const candidate of order) {
75
+ const handler = delegate[candidate];
76
+ if (typeof handler === "function") {
77
+ handler.call(delegate, this.prefix, ...args);
78
+ return;
79
+ }
80
+ }
81
+ for (const candidate of order) {
82
+ const handler = DEFAULT_DELEGATE[candidate];
83
+ if (typeof handler === "function") {
84
+ handler.call(DEFAULT_DELEGATE, this.prefix, ...args);
85
+ return;
86
+ }
87
+ }
88
+ }
58
89
  log(...args) {
59
- console.log(this.prefix, ...args);
90
+ this.emit("log", args);
60
91
  }
61
92
  warn(...args) {
62
- console.log(this.prefix, ...args);
93
+ this.emit("warn", args);
63
94
  }
64
95
  error(...args) {
65
- console.log(this.prefix, ...args);
96
+ this.emit("error", args);
66
97
  }
67
98
  success(...args) {
68
- console.log(this.prefix, ...args);
99
+ this.emit("info", args);
69
100
  }
70
101
  info(...args) {
71
- console.log(this.prefix, ...args);
102
+ this.emit("info", args);
72
103
  }
73
104
  ready(...args) {
74
- console.log(this.prefix, ...args);
105
+ this.emit("info", args);
75
106
  }
76
107
  debug(...args) {
77
108
  if (isDebugMode()) {
78
- console.log(this.prefix, ...args);
109
+ this.emit("debug", args);
79
110
  }
80
111
  }
81
- constructor(prefix) {
82
- this.prefix = prefix;
83
- }
84
- };
112
+ }
85
113
  function createLogger(prefix) {
86
114
  return new Logger(prefix);
87
115
  }
116
+ function createInfrastructureLogger(prefix) {
117
+ const infrastructureLogger = new Logger(prefix);
118
+ Object.defineProperty(infrastructureLogger, "__mf_infrastructure_logger__", {
119
+ value: true,
120
+ enumerable: false,
121
+ configurable: false
122
+ });
123
+ return infrastructureLogger;
124
+ }
125
+ createInfrastructureLogger(PREFIX);
88
126
  async function safeWrapper(callback, disableWarn) {
89
127
  try {
90
128
  const res2 = await callback();
@@ -184,10 +222,7 @@ function createScript(info) {
184
222
  timeoutId = setTimeout(() => {
185
223
  onScriptComplete(null, new Error(`Remote script "${info.url}" time-outed.`));
186
224
  }, timeout);
187
- return {
188
- script: script2,
189
- needAttach
190
- };
225
+ return { script: script2, needAttach };
191
226
  }
192
227
  function createLink(info) {
193
228
  let link = null;
@@ -249,10 +284,7 @@ function createLink(info) {
249
284
  };
250
285
  link.onerror = onLinkComplete.bind(null, link.onerror);
251
286
  link.onload = onLinkComplete.bind(null, link.onload);
252
- return {
253
- link,
254
- needAttach
255
- };
287
+ return { link, needAttach };
256
288
  }
257
289
  function loadScript(url2, info) {
258
290
  const { attrs: attrs2 = {}, createScriptHook } = info;
@@ -261,9 +293,10 @@ function loadScript(url2, info) {
261
293
  url: url2,
262
294
  cb: resolve,
263
295
  onErrorCallback: reject,
264
- attrs: _extends({
265
- fetchpriority: "high"
266
- }, attrs2),
296
+ attrs: {
297
+ fetchpriority: "high",
298
+ ...attrs2
299
+ },
267
300
  createScriptHook,
268
301
  needDeleteScript: true
269
302
  });
@@ -324,27 +357,24 @@ const createScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "we
324
357
  return typeof fetch === "undefined" ? loadNodeFetch() : fetch;
325
358
  };
326
359
  const handleScriptFetch = async (f, urlObj) => {
360
+ var _a;
327
361
  try {
328
- var _vm_constants;
329
362
  const res = await f(urlObj.href);
330
363
  const data = await res.text();
331
364
  const [path, vm] = await Promise.all([
332
365
  importNodeModule("path"),
333
366
  importNodeModule("vm")
334
367
  ]);
335
- const scriptContext = {
336
- exports: {},
337
- module: {
338
- exports: {}
339
- }
340
- };
368
+ const scriptContext = { exports: {}, module: { exports: {} } };
341
369
  const urlDirname = urlObj.pathname.split("/").slice(0, -1).join("/");
342
370
  const filename = path.basename(urlObj.pathname);
343
- var _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER;
344
371
  const script = new vm.Script(`(function(exports, module, require, __dirname, __filename) {${data}
345
372
  })`, {
346
373
  filename,
347
- importModuleDynamically: (_vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER = (_vm_constants = vm.constants) == null ? void 0 : _vm_constants.USE_MAIN_CONTEXT_DEFAULT_LOADER) != null ? _vm_constants_USE_MAIN_CONTEXT_DEFAULT_LOADER : importNodeModule
374
+ importModuleDynamically: (
375
+ //@ts-ignore
376
+ ((_a = vm.constants) == null ? void 0 : _a.USE_MAIN_CONTEXT_DEFAULT_LOADER) ?? importNodeModule
377
+ )
348
378
  });
349
379
  script.runInThisContext()(scriptContext.exports, scriptContext.module, eval("require"), urlDirname, filename);
350
380
  const exportedInterface = scriptContext.module.exports || scriptContext.exports;
@@ -380,11 +410,11 @@ const createScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "we
380
410
  const loadScriptNode = typeof ENV_TARGET === "undefined" || ENV_TARGET !== "web" ? (url2, info) => {
381
411
  return new Promise((resolve, reject) => {
382
412
  createScriptNode(url2, (error, scriptContext2) => {
413
+ var _a, _b;
383
414
  if (error) {
384
415
  reject(error);
385
416
  } else {
386
- var _info_attrs, _info_attrs1;
387
- const remoteEntryKey = (info == null ? void 0 : (_info_attrs = info.attrs) == null ? void 0 : _info_attrs["globalName"]) || `__FEDERATION_${info == null ? void 0 : (_info_attrs1 = info.attrs) == null ? void 0 : _info_attrs1["name"]}:custom__`;
417
+ const remoteEntryKey = ((_a = info == null ? void 0 : info.attrs) == null ? void 0 : _a["globalName"]) || `__FEDERATION_${(_b = info == null ? void 0 : info.attrs) == null ? void 0 : _b["name"]}:custom__`;
388
418
  const entryExports = globalThis[remoteEntryKey] = scriptContext2;
389
419
  resolve(entryExports);
390
420
  }
@@ -398,8 +428,8 @@ async function loadModule(url2, options) {
398
428
  if (esmModuleCache.has(url2)) {
399
429
  return esmModuleCache.get(url2);
400
430
  }
401
- const { fetch: fetch1, vm: vm2 } = options;
402
- const response = await fetch1(url2);
431
+ const { fetch: fetch2, vm: vm2 } = options;
432
+ const response = await fetch2(url2);
403
433
  const code = await response.text();
404
434
  const module = new vm2.SourceTextModule(code, {
405
435
  // @ts-ignore
@@ -419,12 +449,12 @@ async function loadModule(url2, options) {
419
449
  export {
420
450
  MANIFEST_EXT as M,
421
451
  SEPARATOR as S,
422
- composeKeyWithSeparator as a,
423
- isDebugMode as b,
452
+ createLink as a,
453
+ createScript as b,
424
454
  createLogger as c,
425
- createLink as d,
426
- createScript as e,
455
+ isBrowserEnv as d,
456
+ composeKeyWithSeparator as e,
427
457
  loadScript as f,
428
- isBrowserEnv as i,
458
+ isDebugMode as i,
429
459
  loadScriptNode as l
430
460
  };
@@ -1,5 +1,5 @@
1
- import { i as injectDataFetch, p as prefetch } from "./prefetch-DCF_oa3O.mjs";
2
- import { i as initDataFetchMap, j as isDataLoaderExpose, k as getDataFetchInfo, m as getDataFetchMapKey, l as logger, n as getDataFetchItem, o as DATA_FETCH_CLIENT_SUFFIX, p as MF_DATA_FETCH_TYPE, q as isCSROnly, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g as getDataFetchMap, t as isServerEnv, u as getDataFetchIdWithErrorMsgs, v as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, w as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, x as DATA_FETCH_FUNCTION, y as getLoadedRemoteInfos, f as fetchData$1, z as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-VSOJTX_o.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-vPEGI9aw.mjs";
2
+ import { i as initDataFetchMap, j as isDataLoaderExpose, k as getDataFetchInfo, m as getDataFetchMapKey, l as logger, n as getDataFetchItem, o as DATA_FETCH_CLIENT_SUFFIX, p as MF_DATA_FETCH_TYPE, q as isCSROnly, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g as getDataFetchMap, t as isServerEnv, u as getDataFetchIdWithErrorMsgs, v as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, w as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, x as DATA_FETCH_FUNCTION, y as getLoadedRemoteInfos, f as fetchData$1, z as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-BTpxHmva.mjs";
3
3
  import React__default, { useRef, useState, Suspense, useEffect } from "react";
4
4
  const autoFetchData = () => {
5
5
  initDataFetchMap();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-hTVJ80G6.js");
3
- const lazyUtils = require("./utils-vIpCrZmn.js");
2
+ const prefetch = require("./prefetch-G-4bxrmL.js");
3
+ const lazyUtils = require("./utils-0HFFqmd4.js");
4
4
  const React = require("react");
5
5
  const autoFetchData = () => {
6
6
  lazyUtils.initDataFetchMap();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-CWNzJM0v.js");
4
- require("./prefetch-hTVJ80G6.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-DAsjv2E-.js");
4
+ require("./prefetch-G-4bxrmL.js");
5
5
  exports.default = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
6
6
  exports.lazyLoadComponentPlugin = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
@@ -1,5 +1,5 @@
1
- import { l, l as l2 } from "./lazy-load-component-plugin-D6tEPyvX.mjs";
2
- import "./prefetch-DCF_oa3O.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-C3L-oG4p.mjs";
2
+ import "./prefetch-vPEGI9aw.mjs";
3
3
  export {
4
4
  l as default,
5
5
  l2 as lazyLoadComponentPlugin
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("./index.esm-Ju4RY-yW.js");
4
- const lazyUtils = require("./utils-vIpCrZmn.js");
3
+ require("./index.esm-CzoIcLts.js");
4
+ const lazyUtils = require("./utils-0HFFqmd4.js");
5
5
  exports.callAllDowngrade = lazyUtils.callAllDowngrade;
6
6
  exports.callDowngrade = lazyUtils.callDowngrade;
7
7
  exports.fetchData = lazyUtils.fetchData;
@@ -1,5 +1,5 @@
1
- import "./index.esm-CtI0uQUR.mjs";
2
- import { G, H, f, J, I, u, k, n, g, m, B, y, i, q, j, t, a, z, s, w } from "./utils-VSOJTX_o.mjs";
1
+ import "./index.esm-JLwyxgUK.mjs";
2
+ import { G, H, f, J, I, u, k, n, g, m, B, y, i, q, j, t, a, z, s, w } from "./utils-BTpxHmva.mjs";
3
3
  export {
4
4
  G as callAllDowngrade,
5
5
  H as callDowngrade,
@@ -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-0HFFqmd4.js");
3
+ const index_esm = require("./index.esm-CzoIcLts.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-20250926024003";
214
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.0.0-refactor-manifest-20251015072237";
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) {