@module-federation/devtools 2.3.3 → 2.5.0

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 (48) hide show
  1. package/README.md +3 -0
  2. package/dist/es/App.js +17 -2
  3. package/dist/es/App_module.css +3 -3
  4. package/dist/es/component/LoadingTrace/index.js +944 -0
  5. package/dist/es/component/LoadingTrace/index.module.js +5 -0
  6. package/dist/es/component/LoadingTrace/index_module.css +876 -0
  7. package/dist/es/i18n/index.js +178 -0
  8. package/dist/es/utils/chrome/fast-refresh.js +297 -173
  9. package/dist/es/utils/chrome/index.js +3 -4
  10. package/dist/es/utils/chrome/messages.js +7 -1
  11. package/dist/es/utils/chrome/observability-plugin.js +93 -0
  12. package/dist/es/utils/chrome/observability-shared.js +99 -0
  13. package/dist/es/utils/chrome/observability.js +208 -0
  14. package/dist/es/utils/chrome/override-remote.js +2 -42
  15. package/dist/es/utils/chrome/post-message-listener.js +14 -0
  16. package/dist/es/utils/chrome/snapshot-plugin.js +2 -36
  17. package/dist/es/utils/data/index.js +5 -25
  18. package/dist/es/vendor/basic-proxy-core.js +155 -0
  19. package/dist/es/worker/index.js +27 -8
  20. package/dist/lib/App.js +17 -2
  21. package/dist/lib/App_module.css +3 -3
  22. package/dist/lib/component/LoadingTrace/index.js +954 -0
  23. package/dist/lib/component/LoadingTrace/index.module.js +25 -0
  24. package/dist/lib/component/LoadingTrace/index_module.css +876 -0
  25. package/dist/lib/i18n/index.js +178 -0
  26. package/dist/lib/utils/chrome/fast-refresh.js +250 -135
  27. package/dist/lib/utils/chrome/index.js +3 -4
  28. package/dist/lib/utils/chrome/messages.js +11 -2
  29. package/dist/lib/utils/chrome/observability-plugin.js +86 -0
  30. package/dist/lib/utils/chrome/observability-shared.js +126 -0
  31. package/dist/lib/utils/chrome/observability.js +234 -0
  32. package/dist/lib/utils/chrome/override-remote.js +5 -52
  33. package/dist/lib/utils/chrome/post-message-listener.js +11 -0
  34. package/dist/lib/utils/chrome/snapshot-plugin.js +5 -46
  35. package/dist/lib/utils/data/index.js +6 -28
  36. package/dist/lib/vendor/basic-proxy-core.js +147 -0
  37. package/dist/lib/worker/index.js +27 -8
  38. package/dist/types/src/component/LoadingTrace/index.d.ts +6 -0
  39. package/dist/types/src/utils/chrome/messages.d.ts +3 -0
  40. package/dist/types/src/utils/chrome/observability-plugin.d.ts +1 -0
  41. package/dist/types/src/utils/chrome/observability-shared.d.ts +41 -0
  42. package/dist/types/src/utils/chrome/observability.d.ts +110 -0
  43. package/dist/types/src/utils/chrome/snapshot-plugin.d.ts +0 -3
  44. package/dist/types/src/utils/data/index.d.ts +0 -1
  45. package/package.json +4 -3
  46. package/dist/es/utils/data/snapshot.js +0 -82
  47. package/dist/lib/utils/data/snapshot.js +0 -107
  48. package/dist/types/src/utils/data/snapshot.d.ts +0 -3
package/dist/lib/App.js CHANGED
@@ -77,6 +77,7 @@ var import_Layout = __toESM(require("./component/Layout"));
77
77
  var import_DependencyGraph = __toESM(require("./component/DependencyGraph"));
78
78
  var import_ModuleInfo = __toESM(require("./component/ModuleInfo"));
79
79
  var import_SharedDepsExplorer = __toESM(require("./component/SharedDepsExplorer"));
80
+ var import_LoadingTrace = __toESM(require("./component/LoadingTrace"));
80
81
  var import_LanguageSwitch = __toESM(require("./component/LanguageSwitch"));
81
82
  var import_ThemeToggle = __toESM(require("./component/ThemeToggle"));
82
83
  var import_utils = require("./utils");
@@ -145,6 +146,7 @@ const NAV_ITEMS = [
145
146
  { key: "proxy", i18nKey: "app.nav.proxy" },
146
147
  { key: "dependency", i18nKey: "app.nav.dependency" },
147
148
  { key: "share", i18nKey: "app.nav.share" },
149
+ { key: "loadingTrace", i18nKey: "app.nav.loadingTrace" },
148
150
  { key: "performance", i18nKey: "app.nav.performance" }
149
151
  ];
150
152
  const THEME_STORAGE_KEY = "mf-devtools-theme";
@@ -177,6 +179,7 @@ const InnerApp = (props) => {
177
179
  const [inspectedTab, setInspectedTab] = (0, import_react.useState)(
178
180
  window.targetTab
179
181
  );
182
+ const [inspectedTabRefreshKey, setInspectedTabRefreshKey] = (0, import_react.useState)(0);
180
183
  const [activePanel, setActivePanel] = (0, import_react.useState)("proxy");
181
184
  const [selectedModuleId, setSelectedModuleId] = (0, import_react.useState)(null);
182
185
  const [refreshing, setRefreshing] = (0, import_react.useState)(false);
@@ -284,10 +287,14 @@ const InnerApp = (props) => {
284
287
  };
285
288
  }, [applyModuleUpdate]);
286
289
  (0, import_react.useEffect)(() => {
287
- const updateActiveTab = (tabId) => __async(void 0, null, function* () {
290
+ const updateActiveTab = (tabId, options) => __async(void 0, null, function* () {
288
291
  var _a, _b;
289
292
  const tab = yield (0, import_utils.syncActiveTab)(tabId);
290
293
  setInspectedTab(tab || void 0);
294
+ if ((options == null ? void 0 : options.status) === "loading") {
295
+ setInspectedTabRefreshKey((key) => key + 1);
296
+ return;
297
+ }
291
298
  if ((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) {
292
299
  applyModuleUpdate(cloneModuleInfo((_b = window.__FEDERATION__) == null ? void 0 : _b.moduleInfo));
293
300
  }
@@ -295,7 +302,7 @@ const InnerApp = (props) => {
295
302
  });
296
303
  const onMessage = (message, _sender, _sendResponse) => {
297
304
  if ((message == null ? void 0 : message.type) === import_messages.MESSAGE_ACTIVE_TAB_CHANGED) {
298
- updateActiveTab(message.tabId);
305
+ updateActiveTab(message.tabId, { status: message.status });
299
306
  }
300
307
  };
301
308
  chrome.runtime.onMessage.addListener(onMessage);
@@ -423,6 +430,14 @@ const InnerApp = (props) => {
423
430
  )
424
431
  }
425
432
  );
433
+ case "loadingTrace":
434
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
435
+ import_LoadingTrace.default,
436
+ {
437
+ tabId: inspectedTab == null ? void 0 : inspectedTab.id,
438
+ resetKey: inspectedTabRefreshKey
439
+ }
440
+ );
426
441
  case "performance":
427
442
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.placeholder, children: t("app.performance.placeholder") });
428
443
  default:
@@ -76,10 +76,10 @@ body[arco-theme=dark] {
76
76
  }
77
77
 
78
78
  .activeTab_ae2ee {
79
- border-color: rgba(99, 102, 241, 0.65);
80
- background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
79
+ border-color: rgba(24, 24, 27, 0.28);
80
+ background: linear-gradient(135deg, rgba(24, 24, 27, 0.08), rgba(113, 113, 122, 0.08));
81
81
  color: var(--color-text-1, #1e293b);
82
- box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
82
+ box-shadow: 0 12px 28px rgba(24, 24, 27, 0.14);
83
83
  }
84
84
 
85
85
  .panel_ae2ee {