@module-federation/devtools 2.4.0 → 2.5.1
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/README.md +3 -0
- package/dist/es/App.js +17 -2
- package/dist/es/App_module.css +3 -3
- package/dist/es/component/LoadingTrace/index.js +944 -0
- package/dist/es/component/LoadingTrace/index.module.js +5 -0
- package/dist/es/component/LoadingTrace/index_module.css +876 -0
- package/dist/es/i18n/index.js +178 -0
- package/dist/es/utils/chrome/index.js +3 -4
- package/dist/es/utils/chrome/messages.js +7 -1
- package/dist/es/utils/chrome/observability-plugin.js +93 -0
- package/dist/es/utils/chrome/observability-shared.js +99 -0
- package/dist/es/utils/chrome/observability.js +208 -0
- package/dist/es/utils/chrome/override-remote.js +2 -42
- package/dist/es/utils/chrome/post-message-listener.js +14 -0
- package/dist/es/utils/chrome/snapshot-plugin.js +2 -36
- package/dist/es/utils/data/index.js +5 -25
- package/dist/es/vendor/basic-proxy-core.js +155 -0
- package/dist/es/worker/index.js +27 -8
- package/dist/lib/App.js +17 -2
- package/dist/lib/App_module.css +3 -3
- package/dist/lib/component/LoadingTrace/index.js +954 -0
- package/dist/lib/component/LoadingTrace/index.module.js +25 -0
- package/dist/lib/component/LoadingTrace/index_module.css +876 -0
- package/dist/lib/i18n/index.js +178 -0
- package/dist/lib/utils/chrome/index.js +3 -4
- package/dist/lib/utils/chrome/messages.js +11 -2
- package/dist/lib/utils/chrome/observability-plugin.js +86 -0
- package/dist/lib/utils/chrome/observability-shared.js +126 -0
- package/dist/lib/utils/chrome/observability.js +234 -0
- package/dist/lib/utils/chrome/override-remote.js +5 -52
- package/dist/lib/utils/chrome/post-message-listener.js +11 -0
- package/dist/lib/utils/chrome/snapshot-plugin.js +5 -46
- package/dist/lib/utils/data/index.js +6 -28
- package/dist/lib/vendor/basic-proxy-core.js +147 -0
- package/dist/lib/worker/index.js +27 -8
- package/dist/types/src/component/LoadingTrace/index.d.ts +6 -0
- package/dist/types/src/utils/chrome/messages.d.ts +3 -0
- package/dist/types/src/utils/chrome/observability-plugin.d.ts +1 -0
- package/dist/types/src/utils/chrome/observability-shared.d.ts +41 -0
- package/dist/types/src/utils/chrome/observability.d.ts +110 -0
- package/dist/types/src/utils/chrome/snapshot-plugin.d.ts +0 -3
- package/dist/types/src/utils/data/index.d.ts +0 -1
- package/package.json +4 -3
- package/dist/es/utils/data/snapshot.js +0 -82
- package/dist/lib/utils/data/snapshot.js +0 -107
- package/dist/types/src/utils/data/snapshot.d.ts +0 -3
package/README.md
CHANGED
|
@@ -4,5 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
- Proxy online Module Federation remote module to local
|
|
6
6
|
- Let proxied remote module get hmr
|
|
7
|
+
- Inject the Chrome-specific observability runtime plugin from the Loading Trace
|
|
8
|
+
tab, receive page events through `window.postMessage`, and export collected
|
|
9
|
+
loading reports
|
|
7
10
|
|
|
8
11
|
https://module-federation.io/
|
package/dist/es/App.js
CHANGED
|
@@ -46,6 +46,7 @@ import ProxyLayout from "./component/Layout";
|
|
|
46
46
|
import Dependency from "./component/DependencyGraph";
|
|
47
47
|
import ModuleInfo from "./component/ModuleInfo";
|
|
48
48
|
import SharedDepsExplorer from "./component/SharedDepsExplorer";
|
|
49
|
+
import LoadingTrace from "./component/LoadingTrace";
|
|
49
50
|
import LanguageSwitch from "./component/LanguageSwitch";
|
|
50
51
|
import ThemeToggle from "./component/ThemeToggle";
|
|
51
52
|
import {
|
|
@@ -119,6 +120,7 @@ const NAV_ITEMS = [
|
|
|
119
120
|
{ key: "proxy", i18nKey: "app.nav.proxy" },
|
|
120
121
|
{ key: "dependency", i18nKey: "app.nav.dependency" },
|
|
121
122
|
{ key: "share", i18nKey: "app.nav.share" },
|
|
123
|
+
{ key: "loadingTrace", i18nKey: "app.nav.loadingTrace" },
|
|
122
124
|
{ key: "performance", i18nKey: "app.nav.performance" }
|
|
123
125
|
];
|
|
124
126
|
const THEME_STORAGE_KEY = "mf-devtools-theme";
|
|
@@ -151,6 +153,7 @@ const InnerApp = (props) => {
|
|
|
151
153
|
const [inspectedTab, setInspectedTab] = useState(
|
|
152
154
|
window.targetTab
|
|
153
155
|
);
|
|
156
|
+
const [inspectedTabRefreshKey, setInspectedTabRefreshKey] = useState(0);
|
|
154
157
|
const [activePanel, setActivePanel] = useState("proxy");
|
|
155
158
|
const [selectedModuleId, setSelectedModuleId] = useState(null);
|
|
156
159
|
const [refreshing, setRefreshing] = useState(false);
|
|
@@ -258,10 +261,14 @@ const InnerApp = (props) => {
|
|
|
258
261
|
};
|
|
259
262
|
}, [applyModuleUpdate]);
|
|
260
263
|
useEffect(() => {
|
|
261
|
-
const updateActiveTab = (tabId) => __async(void 0, null, function* () {
|
|
264
|
+
const updateActiveTab = (tabId, options) => __async(void 0, null, function* () {
|
|
262
265
|
var _a, _b;
|
|
263
266
|
const tab = yield syncActiveTab(tabId);
|
|
264
267
|
setInspectedTab(tab || void 0);
|
|
268
|
+
if ((options == null ? void 0 : options.status) === "loading") {
|
|
269
|
+
setInspectedTabRefreshKey((key) => key + 1);
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
265
272
|
if ((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) {
|
|
266
273
|
applyModuleUpdate(cloneModuleInfo((_b = window.__FEDERATION__) == null ? void 0 : _b.moduleInfo));
|
|
267
274
|
}
|
|
@@ -269,7 +276,7 @@ const InnerApp = (props) => {
|
|
|
269
276
|
});
|
|
270
277
|
const onMessage = (message, _sender, _sendResponse) => {
|
|
271
278
|
if ((message == null ? void 0 : message.type) === MESSAGE_ACTIVE_TAB_CHANGED) {
|
|
272
|
-
updateActiveTab(message.tabId);
|
|
279
|
+
updateActiveTab(message.tabId, { status: message.status });
|
|
273
280
|
}
|
|
274
281
|
};
|
|
275
282
|
chrome.runtime.onMessage.addListener(onMessage);
|
|
@@ -397,6 +404,14 @@ const InnerApp = (props) => {
|
|
|
397
404
|
)
|
|
398
405
|
}
|
|
399
406
|
);
|
|
407
|
+
case "loadingTrace":
|
|
408
|
+
return /* @__PURE__ */ jsx(
|
|
409
|
+
LoadingTrace,
|
|
410
|
+
{
|
|
411
|
+
tabId: inspectedTab == null ? void 0 : inspectedTab.id,
|
|
412
|
+
resetKey: inspectedTabRefreshKey
|
|
413
|
+
}
|
|
414
|
+
);
|
|
400
415
|
case "performance":
|
|
401
416
|
return /* @__PURE__ */ jsx("div", { className: styles.placeholder, children: t("app.performance.placeholder") });
|
|
402
417
|
default:
|
package/dist/es/App_module.css
CHANGED
|
@@ -76,10 +76,10 @@ body[arco-theme=dark] {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.activeTab_ae2ee {
|
|
79
|
-
border-color: rgba(
|
|
80
|
-
background: linear-gradient(135deg, rgba(
|
|
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(
|
|
82
|
+
box-shadow: 0 12px 28px rgba(24, 24, 27, 0.14);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
.panel_ae2ee {
|