@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
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var import_chrome_devtool = require("@module-federation/observability-plugin/chrome-devtool");
|
|
2
|
+
var import_messages = require("./messages");
|
|
3
|
+
var import_observability_shared = require("./observability-shared");
|
|
4
|
+
const DEVTOOLS_PLUGIN_NAME = "observability-plugin:chrome-extension";
|
|
5
|
+
const LEGACY_DEVTOOLS_PLUGIN_NAME = "observability-plugin-devtools";
|
|
6
|
+
const getFederationWindow = () => window;
|
|
7
|
+
const safeReadStoredConfig = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
try {
|
|
10
|
+
const raw = (_a = window.localStorage) == null ? void 0 : _a.getItem(
|
|
11
|
+
import_messages.OBSERVABILITY_DEVTOOLS_STORAGE_KEY
|
|
12
|
+
);
|
|
13
|
+
if (!raw) {
|
|
14
|
+
return void 0;
|
|
15
|
+
}
|
|
16
|
+
return (0, import_observability_shared.normalizeObservabilityDevtoolsConfig)(JSON.parse(raw));
|
|
17
|
+
} catch (e) {
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const defineWritableGlobal = (key, value) => {
|
|
22
|
+
const targetWindow = getFederationWindow();
|
|
23
|
+
try {
|
|
24
|
+
Object.defineProperty(targetWindow, key, {
|
|
25
|
+
value,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true
|
|
28
|
+
});
|
|
29
|
+
} catch (e) {
|
|
30
|
+
targetWindow[key] = value;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const ensureFederationGlobal = () => {
|
|
34
|
+
var _a;
|
|
35
|
+
const targetWindow = getFederationWindow();
|
|
36
|
+
const federation = targetWindow.__FEDERATION__ || targetWindow.__VMOK__ || {};
|
|
37
|
+
if (!targetWindow.__FEDERATION__) {
|
|
38
|
+
defineWritableGlobal("__FEDERATION__", federation);
|
|
39
|
+
}
|
|
40
|
+
if (!targetWindow.__VMOK__) {
|
|
41
|
+
defineWritableGlobal("__VMOK__", targetWindow.__FEDERATION__);
|
|
42
|
+
}
|
|
43
|
+
if (!((_a = targetWindow.__FEDERATION__) == null ? void 0 : _a.__GLOBAL_PLUGIN__)) {
|
|
44
|
+
targetWindow.__FEDERATION__ = targetWindow.__FEDERATION__ || federation;
|
|
45
|
+
targetWindow.__FEDERATION__.__GLOBAL_PLUGIN__ = [];
|
|
46
|
+
}
|
|
47
|
+
return targetWindow.__FEDERATION__;
|
|
48
|
+
};
|
|
49
|
+
const notifyInstalled = (status, reason, config) => {
|
|
50
|
+
try {
|
|
51
|
+
window.postMessage(
|
|
52
|
+
{
|
|
53
|
+
schemaVersion: 1,
|
|
54
|
+
source: import_messages.OBSERVABILITY_DEVTOOLS_SOURCE,
|
|
55
|
+
kind: status,
|
|
56
|
+
reason,
|
|
57
|
+
config,
|
|
58
|
+
createdAt: Date.now()
|
|
59
|
+
},
|
|
60
|
+
"*"
|
|
61
|
+
);
|
|
62
|
+
} catch (e) {
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const install = () => {
|
|
66
|
+
const config = safeReadStoredConfig();
|
|
67
|
+
if (!(config == null ? void 0 : config.enabled)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const federation = ensureFederationGlobal();
|
|
71
|
+
const globalPlugins = (federation == null ? void 0 : federation.__GLOBAL_PLUGIN__) || [];
|
|
72
|
+
if (globalPlugins.some(
|
|
73
|
+
(plugin2) => (plugin2 == null ? void 0 : plugin2.name) === DEVTOOLS_PLUGIN_NAME || (plugin2 == null ? void 0 : plugin2.name) === LEGACY_DEVTOOLS_PLUGIN_NAME
|
|
74
|
+
)) {
|
|
75
|
+
notifyInstalled("skipped", "already-installed", config);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const plugin = (0, import_chrome_devtool.ChromeObservabilityPlugin)(
|
|
79
|
+
(0, import_observability_shared.createObservabilityPluginOptions)(config)
|
|
80
|
+
);
|
|
81
|
+
globalPlugins.push(plugin);
|
|
82
|
+
federation.__GLOBAL_PLUGIN__ = globalPlugins;
|
|
83
|
+
notifyInstalled("installed", void 0, config);
|
|
84
|
+
};
|
|
85
|
+
install();
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var observability_shared_exports = {};
|
|
19
|
+
__export(observability_shared_exports, {
|
|
20
|
+
CHROME_OBSERVABILITY_SCOPE: () => CHROME_OBSERVABILITY_SCOPE,
|
|
21
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG: () => DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG,
|
|
22
|
+
createObservabilityPluginOptions: () => createObservabilityPluginOptions,
|
|
23
|
+
normalizeObservabilityDevtoolsConfig: () => normalizeObservabilityDevtoolsConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(observability_shared_exports);
|
|
26
|
+
var import_messages = require("./messages");
|
|
27
|
+
const CHROME_OBSERVABILITY_SCOPE = "chrome_extension";
|
|
28
|
+
const MIN_EVENTS = 10;
|
|
29
|
+
const MAX_EVENTS = 1e3;
|
|
30
|
+
const DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG = {
|
|
31
|
+
enabled: true,
|
|
32
|
+
level: "verbose",
|
|
33
|
+
maxEvents: 300,
|
|
34
|
+
console: true,
|
|
35
|
+
browser: {
|
|
36
|
+
enabled: true,
|
|
37
|
+
scope: CHROME_OBSERVABILITY_SCOPE,
|
|
38
|
+
mode: "development"
|
|
39
|
+
},
|
|
40
|
+
trace: {
|
|
41
|
+
printStart: true
|
|
42
|
+
},
|
|
43
|
+
react: {
|
|
44
|
+
injectLoadedCallback: false,
|
|
45
|
+
remoteIds: []
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const isObject = (value) => typeof value === "object" && value !== null;
|
|
49
|
+
const normalizeBoolean = (value, fallback) => typeof value === "boolean" ? value : fallback;
|
|
50
|
+
const normalizeLevel = (value) => value === "error" || value === "summary" || value === "verbose" ? value : DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.level;
|
|
51
|
+
const normalizeMode = (value) => value === "production" || value === "development" ? value : DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.browser.mode;
|
|
52
|
+
const normalizeMaxEvents = (value) => {
|
|
53
|
+
const parsed = Number(value);
|
|
54
|
+
if (!Number.isFinite(parsed)) {
|
|
55
|
+
return DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.maxEvents;
|
|
56
|
+
}
|
|
57
|
+
return Math.max(MIN_EVENTS, Math.min(MAX_EVENTS, Math.floor(parsed)));
|
|
58
|
+
};
|
|
59
|
+
const normalizeScope = (value) => {
|
|
60
|
+
if (typeof value !== "string") {
|
|
61
|
+
return CHROME_OBSERVABILITY_SCOPE;
|
|
62
|
+
}
|
|
63
|
+
const trimmed = value.trim().replace(/[^\w:@.-]+/g, "-");
|
|
64
|
+
return trimmed || CHROME_OBSERVABILITY_SCOPE;
|
|
65
|
+
};
|
|
66
|
+
const normalizeObservabilityDevtoolsConfig = (value) => {
|
|
67
|
+
const source = isObject(value) ? value : {};
|
|
68
|
+
const browser = isObject(source.browser) ? source.browser : {};
|
|
69
|
+
const trace = isObject(source.trace) ? source.trace : {};
|
|
70
|
+
return {
|
|
71
|
+
enabled: normalizeBoolean(
|
|
72
|
+
source.enabled,
|
|
73
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.enabled
|
|
74
|
+
),
|
|
75
|
+
level: normalizeLevel(source.level),
|
|
76
|
+
maxEvents: normalizeMaxEvents(source.maxEvents),
|
|
77
|
+
console: normalizeBoolean(
|
|
78
|
+
source.console,
|
|
79
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.console
|
|
80
|
+
),
|
|
81
|
+
browser: {
|
|
82
|
+
enabled: normalizeBoolean(
|
|
83
|
+
browser.enabled,
|
|
84
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.browser.enabled
|
|
85
|
+
),
|
|
86
|
+
scope: normalizeScope(browser.scope),
|
|
87
|
+
mode: normalizeMode(browser.mode)
|
|
88
|
+
},
|
|
89
|
+
trace: {
|
|
90
|
+
printStart: normalizeBoolean(
|
|
91
|
+
trace.printStart,
|
|
92
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG.trace.printStart
|
|
93
|
+
)
|
|
94
|
+
},
|
|
95
|
+
react: {
|
|
96
|
+
injectLoadedCallback: false,
|
|
97
|
+
remoteIds: []
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
const createObservabilityPluginOptions = (config) => ({
|
|
102
|
+
enabled: config.enabled,
|
|
103
|
+
level: config.level,
|
|
104
|
+
maxEvents: config.maxEvents,
|
|
105
|
+
console: config.console,
|
|
106
|
+
browser: {
|
|
107
|
+
enabled: config.browser.enabled,
|
|
108
|
+
scope: config.browser.scope,
|
|
109
|
+
mode: config.browser.mode
|
|
110
|
+
},
|
|
111
|
+
trace: {
|
|
112
|
+
printStart: config.trace.printStart
|
|
113
|
+
},
|
|
114
|
+
devtools: {
|
|
115
|
+
enabled: true,
|
|
116
|
+
source: import_messages.OBSERVABILITY_DEVTOOLS_SOURCE
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
120
|
+
0 && (module.exports = {
|
|
121
|
+
CHROME_OBSERVABILITY_SCOPE,
|
|
122
|
+
DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG,
|
|
123
|
+
createObservabilityPluginOptions,
|
|
124
|
+
normalizeObservabilityDevtoolsConfig
|
|
125
|
+
});
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var observability_exports = {};
|
|
39
|
+
__export(observability_exports, {
|
|
40
|
+
applyObservabilityConfig: () => applyObservabilityConfig,
|
|
41
|
+
disableObservabilityConfig: () => disableObservabilityConfig,
|
|
42
|
+
getObservabilityReportScopeLabel: () => getObservabilityReportScopeLabel,
|
|
43
|
+
mergeObservabilityReports: () => mergeObservabilityReports,
|
|
44
|
+
readObservabilityConfig: () => readObservabilityConfig,
|
|
45
|
+
readObservabilitySnapshot: () => readObservabilitySnapshot,
|
|
46
|
+
reloadInspectedPage: () => reloadInspectedPage
|
|
47
|
+
});
|
|
48
|
+
module.exports = __toCommonJS(observability_exports);
|
|
49
|
+
var import_index = require("./index");
|
|
50
|
+
var import_messages = require("./messages");
|
|
51
|
+
var import_observability_shared = require("./observability-shared");
|
|
52
|
+
const USER_OBSERVABILITY_PLUGIN_NAME = "observability-plugin";
|
|
53
|
+
const CHROME_OBSERVABILITY_PLUGIN_NAME = "observability-plugin:chrome-extension";
|
|
54
|
+
const LEGACY_CHROME_OBSERVABILITY_PLUGIN_NAME = "observability-plugin-devtools";
|
|
55
|
+
const OBSERVABILITY_SNAPSHOT_CONTEXT = {
|
|
56
|
+
chromeScope: import_observability_shared.CHROME_OBSERVABILITY_SCOPE,
|
|
57
|
+
userPluginName: USER_OBSERVABILITY_PLUGIN_NAME,
|
|
58
|
+
chromePluginNames: [
|
|
59
|
+
CHROME_OBSERVABILITY_PLUGIN_NAME,
|
|
60
|
+
LEGACY_CHROME_OBSERVABILITY_PLUGIN_NAME
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
const readConfigFromPage = (storageKey) => {
|
|
64
|
+
var _a;
|
|
65
|
+
try {
|
|
66
|
+
const raw = (_a = window.localStorage) == null ? void 0 : _a.getItem(storageKey);
|
|
67
|
+
return raw ? JSON.parse(raw) : null;
|
|
68
|
+
} catch (e) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const writeConfigToPage = (storageKey, config) => {
|
|
73
|
+
var _a;
|
|
74
|
+
(_a = window.localStorage) == null ? void 0 : _a.setItem(storageKey, JSON.stringify(config));
|
|
75
|
+
return config;
|
|
76
|
+
};
|
|
77
|
+
const removeConfigFromPage = (storageKey) => {
|
|
78
|
+
var _a;
|
|
79
|
+
(_a = window.localStorage) == null ? void 0 : _a.removeItem(storageKey);
|
|
80
|
+
return true;
|
|
81
|
+
};
|
|
82
|
+
const reloadPage = () => {
|
|
83
|
+
var _a;
|
|
84
|
+
(_a = globalThis.location) == null ? void 0 : _a.reload();
|
|
85
|
+
};
|
|
86
|
+
const readSnapshotFromPage = (storageKey, context) => {
|
|
87
|
+
const chromeScope = typeof (context == null ? void 0 : context.chromeScope) === "string" ? context.chromeScope : "chrome_extension";
|
|
88
|
+
const userPluginName = typeof (context == null ? void 0 : context.userPluginName) === "string" ? context.userPluginName : "observability-plugin";
|
|
89
|
+
const chromePluginNames = Array.isArray(context == null ? void 0 : context.chromePluginNames) ? context.chromePluginNames : [
|
|
90
|
+
"observability-plugin:chrome-extension",
|
|
91
|
+
"observability-plugin-devtools"
|
|
92
|
+
];
|
|
93
|
+
const safeCopy = (value) => {
|
|
94
|
+
try {
|
|
95
|
+
return JSON.parse(JSON.stringify(value));
|
|
96
|
+
} catch (e) {
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const rawConfig = (() => {
|
|
101
|
+
var _a;
|
|
102
|
+
try {
|
|
103
|
+
const raw = (_a = window.localStorage) == null ? void 0 : _a.getItem(storageKey);
|
|
104
|
+
return raw ? JSON.parse(raw) : null;
|
|
105
|
+
} catch (e) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
109
|
+
const federation = window.__FEDERATION__ || window.__VMOK__;
|
|
110
|
+
const readers = (federation == null ? void 0 : federation.__OBSERVABILITY__) || {};
|
|
111
|
+
const reports = [];
|
|
112
|
+
const scopes = Object.keys(readers);
|
|
113
|
+
const isChromeObservabilityPluginName = (name) => chromePluginNames.includes(String(name));
|
|
114
|
+
const hasUserObservabilityPluginFromInstances = Array.isArray(
|
|
115
|
+
federation == null ? void 0 : federation.__INSTANCES__
|
|
116
|
+
) ? federation.__INSTANCES__.some((instance) => {
|
|
117
|
+
var _a;
|
|
118
|
+
const plugins = (_a = instance == null ? void 0 : instance.options) == null ? void 0 : _a.plugins;
|
|
119
|
+
if (!Array.isArray(plugins)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
return plugins.some(
|
|
123
|
+
(plugin) => (plugin == null ? void 0 : plugin.name) === userPluginName && !isChromeObservabilityPluginName(plugin == null ? void 0 : plugin.name)
|
|
124
|
+
);
|
|
125
|
+
}) : false;
|
|
126
|
+
const hasUserObservabilityPluginFromReaders = scopes.some(
|
|
127
|
+
(scope) => scope !== chromeScope
|
|
128
|
+
);
|
|
129
|
+
scopes.forEach((scope) => {
|
|
130
|
+
const reader = readers[scope];
|
|
131
|
+
if (!reader || typeof reader.getReports !== "function") {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const scopeReports = reader.getReports({ limit: 100 });
|
|
136
|
+
if (!Array.isArray(scopeReports)) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
scopeReports.forEach((report) => {
|
|
140
|
+
const copied = safeCopy(report);
|
|
141
|
+
if (copied == null ? void 0 : copied.traceId) {
|
|
142
|
+
copied.__scope = scope;
|
|
143
|
+
reports.push(copied);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
} catch (e) {
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return {
|
|
150
|
+
config: rawConfig,
|
|
151
|
+
stored: Boolean(rawConfig),
|
|
152
|
+
scopes,
|
|
153
|
+
reports,
|
|
154
|
+
hasUserObservabilityPlugin: hasUserObservabilityPluginFromInstances || hasUserObservabilityPluginFromReaders
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const readObservabilityConfig = () => __async(void 0, null, function* () {
|
|
158
|
+
const config = yield (0, import_index.injectScript)(
|
|
159
|
+
readConfigFromPage,
|
|
160
|
+
false,
|
|
161
|
+
import_messages.OBSERVABILITY_DEVTOOLS_STORAGE_KEY
|
|
162
|
+
);
|
|
163
|
+
return (0, import_observability_shared.normalizeObservabilityDevtoolsConfig)(
|
|
164
|
+
config || import_observability_shared.DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
const applyObservabilityConfig = (config) => __async(void 0, null, function* () {
|
|
168
|
+
return (0, import_index.injectScript)(
|
|
169
|
+
writeConfigToPage,
|
|
170
|
+
false,
|
|
171
|
+
import_messages.OBSERVABILITY_DEVTOOLS_STORAGE_KEY,
|
|
172
|
+
(0, import_observability_shared.normalizeObservabilityDevtoolsConfig)(config)
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
const disableObservabilityConfig = () => __async(void 0, null, function* () {
|
|
176
|
+
return (0, import_index.injectScript)(removeConfigFromPage, false, import_messages.OBSERVABILITY_DEVTOOLS_STORAGE_KEY);
|
|
177
|
+
});
|
|
178
|
+
const reloadInspectedPage = () => __async(void 0, null, function* () {
|
|
179
|
+
return (0, import_index.injectScript)(reloadPage, false);
|
|
180
|
+
});
|
|
181
|
+
const readObservabilitySnapshot = () => __async(void 0, null, function* () {
|
|
182
|
+
const snapshot = yield (0, import_index.injectScript)(
|
|
183
|
+
readSnapshotFromPage,
|
|
184
|
+
true,
|
|
185
|
+
import_messages.OBSERVABILITY_DEVTOOLS_STORAGE_KEY,
|
|
186
|
+
OBSERVABILITY_SNAPSHOT_CONTEXT
|
|
187
|
+
);
|
|
188
|
+
return {
|
|
189
|
+
config: (0, import_observability_shared.normalizeObservabilityDevtoolsConfig)(
|
|
190
|
+
(snapshot == null ? void 0 : snapshot.config) || import_observability_shared.DEFAULT_OBSERVABILITY_DEVTOOLS_CONFIG
|
|
191
|
+
),
|
|
192
|
+
stored: Boolean(snapshot == null ? void 0 : snapshot.stored),
|
|
193
|
+
scopes: Array.isArray(snapshot == null ? void 0 : snapshot.scopes) ? snapshot.scopes : [],
|
|
194
|
+
reports: Array.isArray(snapshot == null ? void 0 : snapshot.reports) ? snapshot.reports : [],
|
|
195
|
+
hasUserObservabilityPlugin: Boolean(snapshot == null ? void 0 : snapshot.hasUserObservabilityPlugin)
|
|
196
|
+
};
|
|
197
|
+
});
|
|
198
|
+
const mergeObservabilityReports = (currentReports, incomingReports) => {
|
|
199
|
+
const merged = /* @__PURE__ */ new Map();
|
|
200
|
+
currentReports.forEach((report) => {
|
|
201
|
+
if (report.traceId) {
|
|
202
|
+
merged.set(report.traceId, report);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
incomingReports.forEach((report) => {
|
|
206
|
+
if (report.traceId) {
|
|
207
|
+
merged.set(report.traceId, report);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
return Array.from(merged.values()).sort((left, right) => {
|
|
211
|
+
if ((right.updatedAt || 0) !== (left.updatedAt || 0)) {
|
|
212
|
+
return (right.updatedAt || 0) - (left.updatedAt || 0);
|
|
213
|
+
}
|
|
214
|
+
return (right.startedAt || 0) - (left.startedAt || 0);
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
const getObservabilityReportScopeLabel = (report) => {
|
|
218
|
+
const scope = report.__scope;
|
|
219
|
+
if (!scope || scope === import_observability_shared.CHROME_OBSERVABILITY_SCOPE) {
|
|
220
|
+
return void 0;
|
|
221
|
+
}
|
|
222
|
+
return `custom: ${scope}`;
|
|
223
|
+
};
|
|
224
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
225
|
+
0 && (module.exports = {
|
|
226
|
+
applyObservabilityConfig,
|
|
227
|
+
disableObservabilityConfig,
|
|
228
|
+
getObservabilityReportScopeLabel,
|
|
229
|
+
mergeObservabilityReports,
|
|
230
|
+
readObservabilityConfig,
|
|
231
|
+
readObservabilitySnapshot,
|
|
232
|
+
reloadInspectedPage
|
|
233
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var override_remote_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(override_remote_exports);
|
|
16
|
+
var import_resolve_basic_proxy_core = require("./resolve-basic-proxy-core");
|
|
17
|
+
const basicProxyCore = (0, import_resolve_basic_proxy_core.resolveBasicProxyCore)(
|
|
18
|
+
require("../../vendor/basic-proxy-core.js")
|
|
19
|
+
);
|
|
20
|
+
basicProxyCore.registerOverridePlugin(globalThis);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var import_safe_post_message = require("./safe-post-message");
|
|
2
|
+
var import_messages = require("./messages");
|
|
3
|
+
const isModuleInfoPayload = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
4
|
+
const getMessageData = (data) => Boolean(data) && typeof data === "object" ? data : {};
|
|
5
|
+
if (window.moduleHandler) {
|
|
6
|
+
window.removeEventListener("message", window.moduleHandler);
|
|
7
|
+
} else {
|
|
8
|
+
window.moduleHandler = (event) => {
|
|
9
|
+
const { origin } = event;
|
|
10
|
+
const data = getMessageData(event.data);
|
|
11
|
+
if ((data == null ? void 0 : data.source) === import_messages.OBSERVABILITY_DEVTOOLS_SOURCE) {
|
|
12
|
+
chrome.runtime.sendMessage({
|
|
13
|
+
type: import_messages.MESSAGE_OBSERVABILITY_DEVTOOLS_EVENT,
|
|
14
|
+
origin,
|
|
15
|
+
data: (0, import_safe_post_message.sanitizePostMessagePayload)(data)
|
|
16
|
+
}).catch(() => {
|
|
17
|
+
return false;
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!isModuleInfoPayload(data.moduleInfo)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
chrome.runtime.sendMessage({
|
|
25
|
+
origin,
|
|
26
|
+
data: (0, import_safe_post_message.sanitizePostMessagePayload)({
|
|
27
|
+
moduleInfo: data.moduleInfo,
|
|
28
|
+
updateModule: data.updateModule,
|
|
29
|
+
share: data.share
|
|
30
|
+
})
|
|
31
|
+
}).catch(() => {
|
|
32
|
+
return false;
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
window.addEventListener("message", window.moduleHandler);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var import_safe_post_message = require("./safe-post-message");
|
|
2
|
+
var _a, _b;
|
|
3
|
+
const moduleInfo = (_a = window == null ? void 0 : window.__FEDERATION__) == null ? void 0 : _a.moduleInfo;
|
|
4
|
+
window.postMessage(
|
|
5
|
+
(0, import_safe_post_message.sanitizePostMessagePayload)({
|
|
6
|
+
moduleInfo,
|
|
7
|
+
share: (_b = window == null ? void 0 : window.__FEDERATION__) == null ? void 0 : _b.__SHARE__
|
|
8
|
+
}),
|
|
9
|
+
"*"
|
|
10
|
+
);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
var __copyProps = (to, from, except, desc) => {
|
|
34
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
35
|
+
for (let key of __getOwnPropNames(from))
|
|
36
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
37
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
38
|
+
}
|
|
39
|
+
return to;
|
|
40
|
+
};
|
|
41
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
42
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
43
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
44
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
45
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
46
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
47
|
+
mod
|
|
48
|
+
));
|
|
49
|
+
var import_helpers = __toESM(require("@module-federation/runtime/helpers"));
|
|
50
|
+
var import_sdk = require("../sdk");
|
|
51
|
+
var import_safe_post_message = require("./safe-post-message");
|
|
52
|
+
var _a;
|
|
53
|
+
const getModuleInfo = () => {
|
|
54
|
+
return {
|
|
55
|
+
name: "mf-devtool-getModuleInfo-plugin",
|
|
56
|
+
loadRemoteSnapshot(_a2) {
|
|
57
|
+
var _b = _a2, {
|
|
58
|
+
options,
|
|
59
|
+
moduleInfo,
|
|
60
|
+
remoteSnapshot
|
|
61
|
+
} = _b, res = __objRest(_b, [
|
|
62
|
+
"options",
|
|
63
|
+
"moduleInfo",
|
|
64
|
+
"remoteSnapshot"
|
|
65
|
+
]);
|
|
66
|
+
const globalSnapshot = import_helpers.default.global.getGlobalSnapshot();
|
|
67
|
+
if (!options || options.inBrowser) {
|
|
68
|
+
window.postMessage(
|
|
69
|
+
(0, import_safe_post_message.sanitizePostMessagePayload)({
|
|
70
|
+
moduleInfo: globalSnapshot,
|
|
71
|
+
updateModule: moduleInfo
|
|
72
|
+
}),
|
|
73
|
+
"*"
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return __spreadValues({
|
|
77
|
+
options,
|
|
78
|
+
moduleInfo,
|
|
79
|
+
remoteSnapshot
|
|
80
|
+
}, res);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
if (!(window == null ? void 0 : window.__FEDERATION__)) {
|
|
85
|
+
(0, import_sdk.definePropertyGlobalVal)(window, "__FEDERATION__", {});
|
|
86
|
+
(0, import_sdk.definePropertyGlobalVal)(window, "__VMOK__", window.__FEDERATION__);
|
|
87
|
+
}
|
|
88
|
+
if (!(window == null ? void 0 : window.__FEDERATION__.__GLOBAL_PLUGIN__)) {
|
|
89
|
+
window.__FEDERATION__.__GLOBAL_PLUGIN__ = [];
|
|
90
|
+
}
|
|
91
|
+
(_a = window.__FEDERATION__.__GLOBAL_PLUGIN__) == null ? void 0 : _a.push(getModuleInfo());
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var resolve_basic_proxy_core_exports = {};
|
|
19
|
+
__export(resolve_basic_proxy_core_exports, {
|
|
20
|
+
resolveBasicProxyCore: () => resolveBasicProxyCore
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(resolve_basic_proxy_core_exports);
|
|
23
|
+
const resolveBasicProxyCore = (basicProxyCoreModule) => "default" in basicProxyCoreModule ? basicProxyCoreModule.default : basicProxyCoreModule;
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
resolveBasicProxyCore
|
|
27
|
+
});
|