@module-federation/devtools 0.0.0-perf-devtools-20260107043700 → 0.0.0-perf-website-code-usage-20260914033703
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.css +6 -5
- package/dist/es/App.js +211 -63
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +41 -39
- package/dist/es/component/DependencyGraph/index.js +11 -12
- package/dist/es/component/DependencyGraph/index_module.css +20 -17
- package/dist/es/component/DependencyGraphItem/index.js +23 -10
- package/dist/es/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/es/component/Form/index.js +24 -31
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +22 -25
- package/dist/es/component/LanguageSwitch.js +50 -0
- package/dist/es/component/Layout/index.js +27 -10
- package/dist/es/component/Layout/index_module.css +7 -7
- 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/component/ModuleInfo/index.js +65 -41
- package/dist/es/component/ModuleInfo/index_module.css +12 -11
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +5 -3
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/es/component/SharedDepsExplorer/index.js +223 -96
- package/dist/es/component/SharedDepsExplorer/index_module.css +12 -2
- package/dist/es/component/SharedDepsExplorer/share-utils.js +21 -5
- package/dist/es/component/ThemeToggle.js +19 -0
- package/dist/es/component/ThemeToggle.module.js +5 -0
- package/dist/es/component/ThemeToggle_module.css +12 -0
- package/dist/es/hooks/useDevtoolsTheme.js +77 -0
- package/dist/es/i18n/index.js +688 -0
- package/dist/es/utils/chrome/fast-refresh.js +297 -173
- package/dist/es/utils/chrome/index.js +42 -22
- 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 +7 -0
- package/dist/es/utils/chrome/post-message-listener.js +22 -4
- package/dist/es/utils/chrome/post-message-start.js +4 -10
- package/dist/es/utils/chrome/post-message.js +12 -3
- package/dist/es/utils/chrome/resolve-basic-proxy-core.js +4 -0
- package/dist/es/utils/chrome/safe-post-message.js +124 -0
- package/dist/es/utils/chrome/snapshot-plugin.js +2 -36
- package/dist/es/utils/data/index.js +5 -25
- package/dist/es/utils/sdk/graph.js +25 -11
- package/dist/es/vendor/basic-proxy-core.js +155 -0
- package/dist/es/worker/index.js +27 -8
- package/dist/lib/App.css +6 -5
- package/dist/lib/App.js +208 -64
- package/dist/lib/App.module.js +1 -2
- package/dist/lib/App_module.css +41 -39
- package/dist/lib/component/DependencyGraph/index.js +11 -13
- package/dist/lib/component/DependencyGraph/index.module.js +0 -1
- package/dist/lib/component/DependencyGraph/index_module.css +20 -17
- package/dist/lib/component/DependencyGraphItem/index.js +23 -11
- package/dist/lib/component/DependencyGraphItem/index.module.js +0 -1
- package/dist/lib/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/lib/component/Form/index.js +24 -32
- package/dist/lib/component/Form/index.module.js +1 -2
- package/dist/lib/component/Form/index_module.css +22 -25
- package/dist/lib/component/LanguageSwitch.js +79 -0
- package/dist/lib/component/Layout/index.js +27 -11
- package/dist/lib/component/Layout/index.module.js +0 -1
- package/dist/lib/component/Layout/index_module.css +7 -7
- package/dist/lib/component/LoadingTrace/index.js +953 -0
- package/dist/lib/component/LoadingTrace/index.module.js +24 -0
- package/dist/lib/component/LoadingTrace/index_module.css +876 -0
- package/dist/lib/component/ModuleInfo/index.js +65 -42
- package/dist/lib/component/ModuleInfo/index.module.js +0 -1
- package/dist/lib/component/ModuleInfo/index_module.css +12 -11
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +5 -4
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +0 -1
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/lib/component/SharedDepsExplorer/index.js +217 -95
- package/dist/lib/component/SharedDepsExplorer/index.module.js +0 -1
- package/dist/lib/component/SharedDepsExplorer/index_module.css +12 -2
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +21 -6
- package/dist/lib/component/ThemeToggle.js +48 -0
- package/dist/lib/component/ThemeToggle.module.js +24 -0
- package/dist/lib/component/ThemeToggle_module.css +12 -0
- package/dist/lib/hooks/useDevtoolsTheme.js +100 -0
- package/dist/lib/i18n/index.js +721 -0
- package/dist/lib/init.js +0 -1
- package/dist/lib/template/constant.js +0 -1
- package/dist/lib/template/index.js +0 -1
- package/dist/lib/utils/chrome/fast-refresh.js +250 -136
- package/dist/lib/utils/chrome/index.js +43 -23
- package/dist/lib/utils/chrome/messages.js +11 -3
- package/dist/lib/utils/chrome/observability-plugin.js +85 -0
- package/dist/lib/utils/chrome/observability-shared.js +125 -0
- package/dist/lib/utils/chrome/observability.js +233 -0
- package/dist/lib/utils/chrome/override-remote.js +20 -0
- package/dist/lib/utils/chrome/post-message-init.js +0 -1
- package/dist/lib/utils/chrome/post-message-listener.js +19 -5
- package/dist/lib/utils/chrome/post-message-start.js +4 -11
- package/dist/lib/utils/chrome/post-message.js +12 -4
- package/dist/lib/utils/chrome/resolve-basic-proxy-core.js +27 -0
- package/dist/lib/utils/chrome/safe-post-message.js +147 -0
- package/dist/lib/utils/chrome/snapshot-plugin.js +5 -47
- package/dist/lib/utils/chrome/storage.js +0 -1
- package/dist/lib/utils/data/index.js +6 -29
- package/dist/lib/utils/index.js +0 -1
- package/dist/lib/utils/sdk/graph.js +25 -12
- package/dist/lib/utils/sdk/index.js +0 -1
- package/dist/lib/utils/types/common.js +0 -1
- package/dist/lib/utils/types/index.js +0 -1
- package/dist/lib/vendor/basic-proxy-core.js +147 -0
- package/dist/lib/worker/index.js +27 -9
- package/dist/types/App.css +13 -0
- package/dist/types/App.js +519 -0
- package/dist/types/App.module.js +24 -0
- package/dist/types/App_module.css +307 -0
- package/dist/types/component/DependencyGraph/index.js +225 -0
- package/dist/types/component/DependencyGraph/index.module.js +24 -0
- package/dist/types/component/DependencyGraph/index_module.css +100 -0
- package/dist/types/component/DependencyGraphItem/index.js +124 -0
- package/dist/types/component/DependencyGraphItem/index.module.js +24 -0
- package/dist/types/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/types/component/Form/index.js +372 -0
- package/dist/types/component/Form/index.module.js +24 -0
- package/dist/types/component/Form/index_module.css +198 -0
- package/dist/types/component/LanguageSwitch.js +79 -0
- package/dist/types/component/Layout/index.js +471 -0
- package/dist/types/component/Layout/index.module.js +24 -0
- package/dist/types/component/Layout/index_module.css +68 -0
- package/dist/types/component/LoadingTrace/index.js +953 -0
- package/dist/types/component/LoadingTrace/index.module.js +24 -0
- package/dist/types/component/LoadingTrace/index_module.css +876 -0
- package/dist/types/component/ModuleInfo/index.js +342 -0
- package/dist/types/component/ModuleInfo/index.module.js +24 -0
- package/dist/types/component/ModuleInfo/index_module.css +184 -0
- package/dist/types/component/SharedDepsExplorer/FocusResultDisplay.js +64 -0
- package/dist/types/component/SharedDepsExplorer/FocusResultDisplay.module.js +24 -0
- package/dist/types/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
- package/dist/types/component/SharedDepsExplorer/index.js +635 -0
- package/dist/types/component/SharedDepsExplorer/index.module.js +24 -0
- package/dist/types/component/SharedDepsExplorer/index_module.css +467 -0
- package/dist/types/component/SharedDepsExplorer/share-utils.js +252 -0
- package/dist/types/component/ThemeToggle.js +48 -0
- package/dist/types/component/ThemeToggle.module.js +24 -0
- package/dist/types/component/ThemeToggle_module.css +12 -0
- package/dist/types/hooks/useDevtoolsTheme.js +100 -0
- package/dist/types/i18n/index.js +721 -0
- package/dist/types/init.js +8 -0
- package/dist/types/src/App.d.ts +1 -1
- package/dist/types/src/component/DependencyGraph/index.d.ts +1 -1
- package/dist/types/src/component/DependencyGraphItem/index.d.ts +1 -1
- package/dist/types/src/component/Form/index.d.ts +1 -1
- package/dist/types/src/component/LanguageSwitch.d.ts +2 -0
- package/dist/types/src/component/Layout/index.d.ts +1 -1
- package/dist/types/src/component/LoadingTrace/index.d.ts +6 -0
- package/dist/types/src/component/ModuleInfo/index.d.ts +1 -1
- package/dist/types/src/component/SharedDepsExplorer/index.d.ts +1 -1
- package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +3 -2
- package/dist/types/src/component/ThemeToggle.d.ts +8 -0
- package/dist/types/src/hooks/useDevtoolsTheme.d.ts +2 -0
- package/dist/types/src/i18n/index.d.ts +5 -0
- package/dist/types/src/template/constant.d.ts +1 -1
- package/dist/types/src/utils/chrome/index.d.ts +2 -1
- 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/override-remote.d.ts +1 -0
- package/dist/types/src/utils/chrome/post-message-listener.d.ts +1 -0
- package/dist/types/src/utils/chrome/post-message-start.d.ts +1 -1
- package/dist/types/src/utils/chrome/resolve-basic-proxy-core.d.ts +6 -0
- package/dist/types/src/utils/chrome/safe-post-message.d.ts +1 -0
- package/dist/types/src/utils/chrome/snapshot-plugin.d.ts +0 -3
- package/dist/types/src/utils/data/index.d.ts +1 -2
- package/dist/types/src/utils/sdk/graph.d.ts +1 -1
- package/dist/types/src/utils/sdk/index.d.ts +2 -2
- package/dist/types/stories/index.stories.d.ts +2 -1
- package/dist/types/template/constant.js +84 -0
- package/dist/types/template/index.js +21 -0
- package/dist/types/utils/chrome/fast-refresh.js +329 -0
- package/dist/types/utils/chrome/index.js +321 -0
- package/dist/types/utils/chrome/messages.js +39 -0
- package/dist/types/utils/chrome/observability-plugin.js +85 -0
- package/dist/types/utils/chrome/observability-shared.js +125 -0
- package/dist/types/utils/chrome/observability.js +233 -0
- package/dist/types/utils/chrome/override-remote.js +20 -0
- package/dist/types/utils/chrome/post-message-init.js +5 -0
- package/dist/types/utils/chrome/post-message-listener.js +36 -0
- package/dist/types/utils/chrome/post-message-start.js +10 -0
- package/dist/types/utils/chrome/post-message.js +91 -0
- package/dist/types/utils/chrome/resolve-basic-proxy-core.js +27 -0
- package/dist/types/utils/chrome/safe-post-message.js +147 -0
- package/dist/types/utils/chrome/snapshot-plugin.js +17 -0
- package/dist/types/utils/chrome/storage.js +71 -0
- package/dist/types/utils/data/index.js +83 -0
- package/dist/types/utils/index.js +27 -0
- package/dist/types/utils/sdk/graph.js +213 -0
- package/dist/types/utils/sdk/index.js +104 -0
- package/dist/types/utils/types/common.js +15 -0
- package/dist/types/utils/types/index.js +21 -0
- package/dist/types/vendor/basic-proxy-core.js +147 -0
- package/dist/types/worker/index.js +175 -0
- package/install-deps.bash +7 -3
- package/package.json +47 -28
- 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
|
@@ -18,7 +18,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
const basicProxyCore = require("../../vendor/basic-proxy-core.js");
|
|
22
22
|
const separateType = (moduleInfo) => {
|
|
23
23
|
const consumers = {};
|
|
24
24
|
const producer = [];
|
|
@@ -48,31 +48,11 @@ const separateType = (moduleInfo) => {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
const getModuleInfo = (proxyRules) => __async(void 0, null, function* () {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const isMicroMode = Object.keys(consumers).some((moduleId) => {
|
|
56
|
-
const subApps = consumers[moduleId].consumerList;
|
|
57
|
-
return Array.isArray(subApps) && subApps.length;
|
|
58
|
-
});
|
|
59
|
-
proxyRules.forEach((rule) => {
|
|
60
|
-
const { key, value } = rule;
|
|
61
|
-
overrides[key] = value;
|
|
62
|
-
});
|
|
63
|
-
if (isMicroMode) {
|
|
64
|
-
freshModuleInfo = calculateMicroAppSnapshot(moduleInfo, overrides);
|
|
65
|
-
} else {
|
|
66
|
-
freshModuleInfo = calculateSnapshot(moduleInfo, overrides);
|
|
67
|
-
}
|
|
68
|
-
console.debug("New Snapshot: ", freshModuleInfo);
|
|
69
|
-
return {
|
|
70
|
-
status: "success",
|
|
71
|
-
moduleInfo: freshModuleInfo,
|
|
72
|
-
overrides
|
|
73
|
-
};
|
|
51
|
+
return basicProxyCore.getModuleInfo(
|
|
52
|
+
proxyRules,
|
|
53
|
+
window.__FEDERATION__.moduleInfo
|
|
54
|
+
);
|
|
74
55
|
});
|
|
75
|
-
export * from "./snapshot";
|
|
76
56
|
export {
|
|
77
57
|
getModuleInfo,
|
|
78
58
|
separateType
|
|
@@ -20,26 +20,38 @@ const validateSemver = (schema) => {
|
|
|
20
20
|
return reg.test(schema);
|
|
21
21
|
};
|
|
22
22
|
const validatePort = (schema) => !isNaN(Number(schema));
|
|
23
|
-
const
|
|
23
|
+
const isEntrySegment = (segment) => segment.startsWith("http") || segment.startsWith("//");
|
|
24
|
+
const parseModuleId = (target) => {
|
|
24
25
|
const array = target.split(":");
|
|
25
26
|
const { length } = array;
|
|
27
|
+
const result = {
|
|
28
|
+
name: target,
|
|
29
|
+
version: ""
|
|
30
|
+
};
|
|
26
31
|
if (length === 1) {
|
|
27
|
-
return
|
|
32
|
+
return result;
|
|
28
33
|
} else if (length >= 3) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
+
const idx = array.findIndex(isEntrySegment);
|
|
35
|
+
if (idx > 0) {
|
|
36
|
+
result.name = array[idx - 1];
|
|
37
|
+
result.version = array.slice(idx).join(":");
|
|
38
|
+
return result;
|
|
34
39
|
}
|
|
40
|
+
result.name = array[1];
|
|
41
|
+
result.version = array.slice(2).join(":");
|
|
42
|
+
return result;
|
|
35
43
|
} else {
|
|
36
44
|
const nameOrVersion = array[length - 1];
|
|
37
|
-
if (nameOrVersion === "*" || nameOrVersion === "latest" || validateSemver(nameOrVersion)) {
|
|
38
|
-
|
|
45
|
+
if (nameOrVersion === "*" || nameOrVersion === "latest" || validateSemver(nameOrVersion) || isEntrySegment(nameOrVersion) || nameOrVersion.endsWith(".json") || nameOrVersion.endsWith(".js")) {
|
|
46
|
+
result.name = array[0];
|
|
47
|
+
result.version = nameOrVersion;
|
|
48
|
+
return result;
|
|
39
49
|
} else {
|
|
40
|
-
|
|
50
|
+
result.name = nameOrVersion;
|
|
51
|
+
return result;
|
|
41
52
|
}
|
|
42
53
|
}
|
|
54
|
+
return result;
|
|
43
55
|
};
|
|
44
56
|
class DependencyGraph {
|
|
45
57
|
constructor(snapshot, initTarget) {
|
|
@@ -112,12 +124,14 @@ class DependencyGraph {
|
|
|
112
124
|
if (!targetGraph || !((_a = Object.keys(targetGraph)) == null ? void 0 : _a.length)) {
|
|
113
125
|
return;
|
|
114
126
|
}
|
|
115
|
-
const name =
|
|
127
|
+
const { name, version } = parseModuleId(target);
|
|
116
128
|
const targetWithoutType = name;
|
|
117
129
|
let info = name;
|
|
118
130
|
const remote = this.snapshot[target];
|
|
119
131
|
if (remote && ("version" in remote || "remoteEntry" in remote)) {
|
|
120
132
|
info += `:${remote.version || remote.remoteEntry}`;
|
|
133
|
+
} else if (version) {
|
|
134
|
+
info += `:${version}`;
|
|
121
135
|
}
|
|
122
136
|
if (!this.identifyMap.has(targetWithoutType)) {
|
|
123
137
|
this.identifyMap.set(targetWithoutType, this.identify());
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
3
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
|
+
};
|
|
5
|
+
var require_basic_proxy_core = __commonJS({
|
|
6
|
+
"src/vendor/basic-proxy-core.js"(exports) {
|
|
7
|
+
var P = "__MF_DEVTOOLS_MODULE_INFO__", f = "__MF_DEVTOOLS__", G = "MF_ENV", h = "mf-chrome-devtools-inject-snapshot-plugin", L = "mf-chrome-devtools-override-remotes-plugin", l = () => globalThis, y = (e) => Object.prototype.toString.call(e) === "[object Object]", O = (e) => JSON.parse(JSON.stringify(e || {})), d = (e, t, o) => {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
9
|
+
e[t] = o;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(e, t, { value: o, configurable: false, writable: true });
|
|
13
|
+
}, g = (e = l()) => {
|
|
14
|
+
!e.__FEDERATION__ && e.__VMOK__ && d(e, "__FEDERATION__", e.__VMOK__), e.__FEDERATION__ || d(e, "__FEDERATION__", {}), e.__VMOK__ || d(e, "__VMOK__", e.__FEDERATION__);
|
|
15
|
+
let t = e.__FEDERATION__;
|
|
16
|
+
return Array.isArray(t.__GLOBAL_PLUGIN__) || (t.__GLOBAL_PLUGIN__ = []), y(t.moduleInfo) || (t.moduleInfo = {}), t;
|
|
17
|
+
}, p = (e, t) => {
|
|
18
|
+
if (!e)
|
|
19
|
+
return t;
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(e);
|
|
22
|
+
} catch (o) {
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
}, x = (e = l()) => {
|
|
26
|
+
var t;
|
|
27
|
+
return e.localStorage || ((t = e.window) == null ? void 0 : t.localStorage);
|
|
28
|
+
}, M = (e = l()) => {
|
|
29
|
+
let t = x(e);
|
|
30
|
+
return t ? p(t.getItem(P), null) : null;
|
|
31
|
+
}, I = (e) => {
|
|
32
|
+
let t = {};
|
|
33
|
+
return y(e) && Object.keys(e).forEach((o) => {
|
|
34
|
+
typeof e[o] == "string" && e[o] && (t[o] = e[o]);
|
|
35
|
+
}), t;
|
|
36
|
+
}, N = (e = l()) => {
|
|
37
|
+
let t = x(e);
|
|
38
|
+
if (!t)
|
|
39
|
+
return {};
|
|
40
|
+
let o = p(t.getItem(f), {});
|
|
41
|
+
return y(o.overrides) ? I(o.overrides) : I(o);
|
|
42
|
+
}, S = (e) => e.indexOf("http://") === 0 || e.indexOf("https://") === 0 || e.indexOf("//") === 0, m = (e, t) => {
|
|
43
|
+
Reflect.deleteProperty(e, t);
|
|
44
|
+
}, T = (e) => {
|
|
45
|
+
let t = {}, o = [];
|
|
46
|
+
return Object.keys(e || {}).forEach((s) => {
|
|
47
|
+
var r;
|
|
48
|
+
let i = (r = e[s]) == null ? void 0 : r.remotesInfo;
|
|
49
|
+
if (i) {
|
|
50
|
+
let n = Object.keys(i);
|
|
51
|
+
n.length && (n.forEach((c) => {
|
|
52
|
+
let a = c;
|
|
53
|
+
c.indexOf(":") !== -1 && (a = c.split(":").pop()), o.indexOf(a) === -1 && o.push(c);
|
|
54
|
+
}), t[s] = e[s]);
|
|
55
|
+
}
|
|
56
|
+
}), { consumers: t, producer: o };
|
|
57
|
+
}, R = (e, t) => {
|
|
58
|
+
let o = Object.keys(t || {}).reduce((i, r) => (r.indexOf(":") !== -1 && (i[r.split(":")[1]] = t[r]), i), {}), s = O(e);
|
|
59
|
+
return Object.keys(e || {}).forEach((i) => {
|
|
60
|
+
let r = e[i];
|
|
61
|
+
r != null && r.remotesInfo && Object.keys(r.remotesInfo).forEach((n) => {
|
|
62
|
+
let c = n.split(":")[1], a = t[n] || o[n] || t[c] || o[c];
|
|
63
|
+
a && (s[i].remotesInfo[n].matchedVersion = a, s[`${n}:${a}`] = { remoteEntry: a, version: a });
|
|
64
|
+
});
|
|
65
|
+
}), s;
|
|
66
|
+
}, v = (e, t) => {
|
|
67
|
+
let o = null, s = O(e);
|
|
68
|
+
if (Object.keys(e || {}).forEach((r) => {
|
|
69
|
+
let n = s[r];
|
|
70
|
+
n && Array.isArray(n.consumerList) && n.consumerList.length > 0 && (o = n);
|
|
71
|
+
}), !o)
|
|
72
|
+
return s;
|
|
73
|
+
let i = o.consumerList;
|
|
74
|
+
for (let r = 0; r < i.length; r++) {
|
|
75
|
+
let n = "", c = i[r];
|
|
76
|
+
if (Object.keys(t || {}).find((_) => {
|
|
77
|
+
let u = _;
|
|
78
|
+
return _.indexOf(":") !== -1 && (u = _.split(":")[1]), c.indexOf(u) !== -1 ? (n = _, true) : false;
|
|
79
|
+
})) {
|
|
80
|
+
let _ = t[n], u = c.split(":");
|
|
81
|
+
u[u.length - 1] = _, i[r] = u.join(":"), s[`${n}:${_}`] = { remoteEntry: _, version: _ };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return R(s, t);
|
|
85
|
+
}, F = (e = [], t) => {
|
|
86
|
+
var n;
|
|
87
|
+
let o = t || ((n = l().__FEDERATION__) == null ? void 0 : n.moduleInfo) || {}, s = {}, { consumers: i } = T(o), r = Object.keys(i).some((c) => {
|
|
88
|
+
var _;
|
|
89
|
+
let a = (_ = i[c]) == null ? void 0 : _.consumerList;
|
|
90
|
+
return Array.isArray(a) && a.length > 0;
|
|
91
|
+
});
|
|
92
|
+
return e.forEach((c) => {
|
|
93
|
+
c != null && c.key && (c != null && c.value) && (s[c.key] = c.value);
|
|
94
|
+
}), { status: "success", moduleInfo: r ? v(o, s) : R(o, s), overrides: s };
|
|
95
|
+
}, E = (e = l()) => {
|
|
96
|
+
let t = e, o = false;
|
|
97
|
+
return { name: h, beforeLoadRemoteSnapshot: (s) => {
|
|
98
|
+
var c;
|
|
99
|
+
let i = s == null ? void 0 : s.options;
|
|
100
|
+
if (i && i.inBrowser === false)
|
|
101
|
+
return;
|
|
102
|
+
let r = M(t);
|
|
103
|
+
if (!r || o)
|
|
104
|
+
return;
|
|
105
|
+
let n = g(t);
|
|
106
|
+
n.moduleInfo = Object.assign({}, n.moduleInfo || {}, r), o = true, (c = t.console) == null || c.warn("[Module Federation Devtools]: You are using the chrome devtool to proxy online module");
|
|
107
|
+
} };
|
|
108
|
+
}, B = (e = l()) => {
|
|
109
|
+
let t = e;
|
|
110
|
+
return { name: L, beforeRegisterRemote: (o) => {
|
|
111
|
+
var s;
|
|
112
|
+
try {
|
|
113
|
+
let i = o == null ? void 0 : o.remote;
|
|
114
|
+
if (!i)
|
|
115
|
+
return o;
|
|
116
|
+
let r = N(t), n = r[i.name] || r[i.alias || ""];
|
|
117
|
+
if (!n)
|
|
118
|
+
return o;
|
|
119
|
+
S(n) ? (m(i, "version"), i.entry = n) : (m(i, "entry"), i.version = n);
|
|
120
|
+
} catch (i) {
|
|
121
|
+
(s = t.console) == null || s.error(i);
|
|
122
|
+
}
|
|
123
|
+
return o;
|
|
124
|
+
} };
|
|
125
|
+
}, b = (e = l()) => {
|
|
126
|
+
let t = g(e);
|
|
127
|
+
return [B(e), E(e)].forEach((s) => {
|
|
128
|
+
var r, n;
|
|
129
|
+
((r = t.__GLOBAL_PLUGIN__) == null ? void 0 : r.some((c) => c.name === s.name)) || (n = t.__GLOBAL_PLUGIN__) == null || n.push(s);
|
|
130
|
+
}), t.__GLOBAL_PLUGIN__ || [];
|
|
131
|
+
}, A = (e, t) => {
|
|
132
|
+
var r, n;
|
|
133
|
+
let o = g(e), s = t(e);
|
|
134
|
+
return ((r = o.__GLOBAL_PLUGIN__) == null ? void 0 : r.some((c) => c.name === s.name)) || (n = o.__GLOBAL_PLUGIN__) == null || n.push(s), s;
|
|
135
|
+
}, k = (e = l()) => A(e, B), D = (e = l()) => A(e, E), V = (e = l()) => {
|
|
136
|
+
let t = x(e);
|
|
137
|
+
if (!t)
|
|
138
|
+
return;
|
|
139
|
+
t.removeItem(P), t.removeItem(G);
|
|
140
|
+
let o = p(t.getItem(f), {});
|
|
141
|
+
y(o) && (m(o, "overrides"), Object.keys(o).length ? t.setItem(f, JSON.stringify(o)) : t.removeItem(f));
|
|
142
|
+
};
|
|
143
|
+
exports.calculateMicroAppSnapshot = v;
|
|
144
|
+
exports.calculateSnapshot = R;
|
|
145
|
+
exports.createOverridePlugin = B;
|
|
146
|
+
exports.createSnapshotPlugin = E;
|
|
147
|
+
exports.getModuleInfo = F;
|
|
148
|
+
exports.registerOverridePlugin = k;
|
|
149
|
+
exports.registerRuntimePlugins = b;
|
|
150
|
+
exports.registerSnapshotPlugin = D;
|
|
151
|
+
exports.resetProxyStorage = V;
|
|
152
|
+
exports.separateType = T;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
export default require_basic_proxy_core();
|
package/dist/es/worker/index.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
1
2
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
2
18
|
var __commonJS = (cb, mod) => function __require() {
|
|
3
19
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
4
20
|
};
|
|
@@ -40,12 +56,12 @@ var require_worker = __commonJS({
|
|
|
40
56
|
});
|
|
41
57
|
return activeTab == null ? void 0 : activeTab.id;
|
|
42
58
|
});
|
|
43
|
-
const broadcastActiveTab = (tabId) => {
|
|
59
|
+
const broadcastActiveTab = (tabId, payload) => {
|
|
44
60
|
try {
|
|
45
|
-
chrome.runtime.sendMessage({
|
|
61
|
+
chrome.runtime.sendMessage(__spreadValues({
|
|
46
62
|
type: MESSAGE_ACTIVE_TAB_CHANGED,
|
|
47
63
|
tabId
|
|
48
|
-
});
|
|
64
|
+
}, payload));
|
|
49
65
|
} catch (error) {
|
|
50
66
|
console.warn(
|
|
51
67
|
"[Module Federation Devtools] Failed to broadcast active tab",
|
|
@@ -70,11 +86,11 @@ var require_worker = __commonJS({
|
|
|
70
86
|
if (sidePanel.open) {
|
|
71
87
|
yield sidePanel.open({ tabId: targetTabId });
|
|
72
88
|
}
|
|
73
|
-
broadcastActiveTab(targetTabId);
|
|
89
|
+
broadcastActiveTab(targetTabId, { reason: "side-panel" });
|
|
74
90
|
if (sidePanel.getOptions) {
|
|
75
91
|
try {
|
|
76
92
|
const options = yield sidePanel.getOptions({ tabId: targetTabId });
|
|
77
|
-
broadcastActiveTab(targetTabId);
|
|
93
|
+
broadcastActiveTab(targetTabId, { reason: "side-panel" });
|
|
78
94
|
return options;
|
|
79
95
|
} catch (error) {
|
|
80
96
|
console.warn("[Module Federation Devtools] getOptions failed", error);
|
|
@@ -121,7 +137,7 @@ var require_worker = __commonJS({
|
|
|
121
137
|
return;
|
|
122
138
|
}
|
|
123
139
|
try {
|
|
124
|
-
broadcastActiveTab(tabId);
|
|
140
|
+
broadcastActiveTab(tabId, { reason: "activated" });
|
|
125
141
|
} catch (error) {
|
|
126
142
|
console.warn(
|
|
127
143
|
"[Module Federation Devtools] Failed to handle tab activation",
|
|
@@ -130,12 +146,15 @@ var require_worker = __commonJS({
|
|
|
130
146
|
}
|
|
131
147
|
}));
|
|
132
148
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
|
133
|
-
if (changeInfo.status !== "complete") {
|
|
149
|
+
if (changeInfo.status !== "loading" && changeInfo.status !== "complete") {
|
|
134
150
|
return;
|
|
135
151
|
}
|
|
136
152
|
if (tab == null ? void 0 : tab.active) {
|
|
137
153
|
try {
|
|
138
|
-
broadcastActiveTab(tabId
|
|
154
|
+
broadcastActiveTab(tabId, {
|
|
155
|
+
reason: "updated",
|
|
156
|
+
status: changeInfo.status
|
|
157
|
+
});
|
|
139
158
|
} catch (error) {
|
|
140
159
|
console.warn(
|
|
141
160
|
"[Module Federation Devtools] Failed to handle tab update",
|
package/dist/lib/App.css
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
.loaded-status-tag {
|
|
2
|
-
color: white !important;
|
|
3
|
-
background-color: black !important;
|
|
2
|
+
color: var(--color-bg-1, white) !important;
|
|
3
|
+
background-color: var(--color-neutral-10, black) !important;
|
|
4
4
|
}
|
|
5
5
|
.reused-status-tag {
|
|
6
6
|
background-color: greenyellow !important;
|
|
7
|
+
color: black !important;
|
|
7
8
|
}
|
|
8
9
|
.common-tag {
|
|
9
|
-
color:
|
|
10
|
-
background-color: #
|
|
11
|
-
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
10
|
+
color: var(--color-text-2, #71717a) !important;
|
|
11
|
+
background-color: var(--color-bg-1, #ffffff) !important;
|
|
12
|
+
border-color: var(--color-border-2, rgba(228, 228, 231, 0.5)) !important;
|
|
12
13
|
}
|