@bundle-stats/ui 4.10.1 → 4.12.0-beta.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/lib/components/bundle-modules/bundle-modules.constants.js +9 -0
- package/lib/components/bundle-modules/bundle-modules.constants.js.map +1 -0
- package/lib/components/bundle-modules/bundle-modules.js +13 -3
- package/lib/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib/components/bundle-modules/bundle-modules.module.css +4 -0
- package/lib/components/bundle-modules/index.js +27 -4
- package/lib/components/bundle-modules/index.js.map +1 -1
- package/lib/components/module-info/module-info.js +11 -8
- package/lib/components/module-info/module-info.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.constants.js +6 -0
- package/lib-esm/components/bundle-modules/bundle-modules.constants.js.map +1 -0
- package/lib-esm/components/bundle-modules/bundle-modules.js +13 -3
- package/lib-esm/components/bundle-modules/bundle-modules.js.map +1 -1
- package/lib-esm/components/bundle-modules/bundle-modules.module.css +4 -0
- package/lib-esm/components/bundle-modules/index.js +27 -4
- package/lib-esm/components/bundle-modules/index.js.map +1 -1
- package/lib-esm/components/module-info/module-info.js +12 -9
- package/lib-esm/components/module-info/module-info.js.map +1 -1
- package/package.json +8 -8
- package/src/components/bundle-modules/bundle-modules.constants.ts +4 -0
- package/src/components/bundle-modules/bundle-modules.module.css +4 -0
- package/src/components/bundle-modules/bundle-modules.tsx +33 -2
- package/src/components/bundle-modules/bundle-modules.types.d.ts +1 -1
- package/src/components/bundle-modules/index.tsx +41 -4
- package/src/components/module-info/module-info.tsx +22 -19
- package/types/components/bundle-modules/bundle-modules.constants.d.ts +4 -0
- package/types/components/bundle-modules/bundle-modules.d.ts +3 -0
- package/types/components/bundle-modules/index.d.ts +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModuleMetric = void 0;
|
|
4
|
+
var ModuleMetric;
|
|
5
|
+
(function (ModuleMetric) {
|
|
6
|
+
ModuleMetric["SIZE"] = "value";
|
|
7
|
+
ModuleMetric["TOTAL_SIZE"] = "totalSize";
|
|
8
|
+
})(ModuleMetric || (exports.ModuleMetric = ModuleMetric = {}));
|
|
9
|
+
//# sourceMappingURL=bundle-modules.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-modules.constants.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/bundle-modules.constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAc,CAAA;IACd,wCAAwB,CAAA;AAC1B,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB"}
|
|
@@ -32,19 +32,23 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
32
32
|
const utils_1 = require("@bundle-stats/utils");
|
|
33
33
|
const config_json_1 = __importDefault(require("../../config.json"));
|
|
34
34
|
const i18n_1 = __importDefault(require("../../i18n"));
|
|
35
|
-
const
|
|
35
|
+
const box_1 = require("../../layout/box");
|
|
36
36
|
const flex_stack_1 = require("../../layout/flex-stack");
|
|
37
|
-
const
|
|
37
|
+
const button_1 = require("../../ui/button");
|
|
38
38
|
const empty_set_1 = require("../../ui/empty-set");
|
|
39
39
|
const file_name_1 = require("../../ui/file-name");
|
|
40
40
|
const filters_1 = require("../../ui/filters");
|
|
41
|
+
const input_search_1 = require("../../ui/input-search");
|
|
41
42
|
const tag_1 = require("../../ui/tag");
|
|
42
43
|
const toolbar_1 = require("../../ui/toolbar");
|
|
44
|
+
const tooltip_1 = require("../../ui/tooltip");
|
|
45
|
+
const component_link_1 = require("../component-link");
|
|
43
46
|
const metrics_table_1 = require("../metrics-table");
|
|
44
47
|
const metrics_table_options_1 = require("../metrics-table-options");
|
|
45
48
|
const metrics_table_title_1 = require("../metrics-table-title");
|
|
46
49
|
const module_info_1 = require("../module-info");
|
|
47
50
|
const bundle_modules_utils_1 = require("./bundle-modules.utils");
|
|
51
|
+
const bundle_modules_constants_1 = require("./bundle-modules.constants");
|
|
48
52
|
const I18N_MODULES = __importStar(require("./bundle-modules.i18n"));
|
|
49
53
|
const bundle_modules_module_css_1 = __importDefault(require("./bundle-modules.module.css"));
|
|
50
54
|
const RowHeader = (props) => {
|
|
@@ -54,7 +58,7 @@ const RowHeader = (props) => {
|
|
|
54
58
|
react_1.default.createElement(file_name_1.FileName, { className: bundle_modules_module_css_1.default.nameText, name: row.label })));
|
|
55
59
|
};
|
|
56
60
|
const BundleModules = (props) => {
|
|
57
|
-
const { className = '', jobs = [], items = [], allItems = [], chunks = [], totalRowCount = 0, updateFilters, resetFilters, resetAllFilters, filters, sort, updateSort, search, updateSearch, entryId, hideEntryInfo, customComponentLink: CustomComponentLink = component_link_1.ComponentLink, } = props;
|
|
61
|
+
const { className = '', jobs = [], items = [], allItems = [], chunks = [], totalRowCount = 0, updateFilters, resetFilters, resetAllFilters, filters, sort, updateSort, search, updateSearch, entryId, hideEntryInfo, moduleMetric, setModuleMetric, customComponentLink: CustomComponentLink = component_link_1.ComponentLink, } = props;
|
|
58
62
|
const rootClassName = (0, classnames_1.default)(bundle_modules_module_css_1.default.root, className);
|
|
59
63
|
const jobLabels = jobs?.map((job) => job?.label);
|
|
60
64
|
const filterFieldsData = (0, react_1.useMemo)(() => (0, bundle_modules_utils_1.generateFilterFieldsData)({ filters, chunks, compareMode: jobs.length > 1 }), [jobs, filters, chunks]);
|
|
@@ -74,6 +78,12 @@ const BundleModules = (props) => {
|
|
|
74
78
|
react_1.default.createElement(flex_stack_1.FlexStack, { space: "xxsmall" },
|
|
75
79
|
react_1.default.createElement(input_search_1.InputSearch, { className: bundle_modules_module_css_1.default.toolbarSearch, placeholder: I18N_MODULES.SEARCH, defaultValue: search, onChange: updateSearch }),
|
|
76
80
|
react_1.default.createElement(filters_1.Filters, { className: bundle_modules_module_css_1.default.tableDropdown, filters: filterFieldsData, onChange: updateFilters }))),
|
|
81
|
+
react_1.default.createElement(box_1.Box, { padding: ['xsmall', 'small'], className: bundle_modules_module_css_1.default.metricSelector },
|
|
82
|
+
react_1.default.createElement(flex_stack_1.FlexStack, { space: "xxsmall", as: "nav" },
|
|
83
|
+
react_1.default.createElement(button_1.Button, { outline: true, active: moduleMetric === bundle_modules_constants_1.ModuleMetric.SIZE, size: "small", type: "button", onClick: () => setModuleMetric(bundle_modules_constants_1.ModuleMetric.SIZE) },
|
|
84
|
+
react_1.default.createElement(tooltip_1.Tooltip, { title: "Size (excluding duplicate modules)" }, "Module size")),
|
|
85
|
+
react_1.default.createElement(button_1.Button, { outline: true, active: moduleMetric === bundle_modules_constants_1.ModuleMetric.TOTAL_SIZE, size: "small", type: "button", onClick: () => setModuleMetric(bundle_modules_constants_1.ModuleMetric.TOTAL_SIZE) },
|
|
86
|
+
react_1.default.createElement(tooltip_1.Tooltip, { title: "Size (including duplicate modules)" }, "Module total size")))),
|
|
77
87
|
react_1.default.createElement(metrics_table_1.MetricsTable, { className: bundle_modules_module_css_1.default.table, items: items, runs: jobs, renderRowHeader: renderRowHeader, emptyMessage: emptyMessage, showHeaderSum: true, title: metricsTableTitle, sort: sort, updateSort: updateSort })),
|
|
78
88
|
entryItem && (react_1.default.createElement(module_info_1.ModuleInfo, { className: bundle_modules_module_css_1.default.moduleInfo, item: entryItem, chunks: chunks, chunkIds: chunks?.map(({ id }) => id), labels: jobLabels, customComponentLink: CustomComponentLink, onClose: hideEntryInfo }))));
|
|
79
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-modules.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/bundle-modules.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoD;AACpD,4DAA4B;AAC5B,+CAA0D;AAG1D,oEAAuC;AACvC,sDAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"bundle-modules.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/bundle-modules.tsx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G,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EACrC,MAAM,EAAE,SAAS,EACjB,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,aAAa,GACtB,CACH,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAtJW,QAAA,aAAa,iBAsJxB"}
|
|
@@ -31,8 +31,25 @@ const rows_sort_1 = require("../../hooks/rows-sort");
|
|
|
31
31
|
const search_params_1 = require("../../hooks/search-params");
|
|
32
32
|
const bundle_modules_1 = require("./bundle-modules");
|
|
33
33
|
const bundle_modules_utils_1 = require("./bundle-modules.utils");
|
|
34
|
+
const bundle_modules_constants_1 = require("./bundle-modules.constants");
|
|
35
|
+
function useModuleMetric(params) {
|
|
36
|
+
const { metric, setState } = params;
|
|
37
|
+
const moduleMetric = (0, react_1.useMemo)(() => {
|
|
38
|
+
if (Object.values(bundle_modules_constants_1.ModuleMetric).includes(metric)) {
|
|
39
|
+
return metric;
|
|
40
|
+
}
|
|
41
|
+
return bundle_modules_constants_1.ModuleMetric.SIZE;
|
|
42
|
+
}, [metric]);
|
|
43
|
+
const setModuleMetric = (0, react_1.useCallback)((newModuleMetric) => {
|
|
44
|
+
if (newModuleMetric !== metric) {
|
|
45
|
+
setState({ metric: newModuleMetric });
|
|
46
|
+
}
|
|
47
|
+
}, [metric, setState]);
|
|
48
|
+
return (0, react_1.useMemo)(() => [moduleMetric, setModuleMetric], [moduleMetric, setModuleMetric]);
|
|
49
|
+
}
|
|
34
50
|
const BundleModules = (props) => {
|
|
35
|
-
const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
|
|
51
|
+
const { jobs, filters, search, setState, sortBy, direction, metric = '', ...restProps } = props;
|
|
52
|
+
const [moduleMetric, setModuleMetric] = useModuleMetric({ metric, setState });
|
|
36
53
|
const { chunks, chunkIds } = (0, react_1.useMemo)(() => (0, bundle_modules_utils_1.extractChunkData)(jobs), [jobs]);
|
|
37
54
|
const { defaultFilters, allEntriesFilters } = (0, react_1.useMemo)(() => (0, bundle_modules_utils_1.generateFilters)(chunkIds, jobs.length > 1), [chunkIds, jobs]);
|
|
38
55
|
const searchParams = (0, search_params_1.useSearchParams)({
|
|
@@ -43,12 +60,18 @@ const BundleModules = (props) => {
|
|
|
43
60
|
setState,
|
|
44
61
|
});
|
|
45
62
|
const { rows, totalRowCount } = (0, react_1.useMemo)(() => {
|
|
46
|
-
|
|
63
|
+
let result;
|
|
64
|
+
if (moduleMetric === bundle_modules_constants_1.ModuleMetric.TOTAL_SIZE) {
|
|
65
|
+
result = webpack.compareModuleDuplicateSize(jobs, [bundle_modules_utils_1.addRowFlags]);
|
|
66
|
+
}
|
|
67
|
+
else if (moduleMetric === bundle_modules_constants_1.ModuleMetric.SIZE) {
|
|
68
|
+
result = webpack.compareBySection.modules(jobs, [bundle_modules_utils_1.addRowFlags]);
|
|
69
|
+
}
|
|
47
70
|
return {
|
|
48
71
|
rows: result,
|
|
49
72
|
totalRowCount: result.length,
|
|
50
73
|
};
|
|
51
|
-
}, [jobs]);
|
|
74
|
+
}, [jobs, moduleMetric]);
|
|
52
75
|
const filteredRows = (0, rows_filter_1.useRowsFilter)({
|
|
53
76
|
rows,
|
|
54
77
|
searchPattern: searchParams.searchPattern,
|
|
@@ -64,7 +87,7 @@ const BundleModules = (props) => {
|
|
|
64
87
|
const hideEntryInfo = (0, react_1.useCallback)(() => {
|
|
65
88
|
setState({ entryId: '' });
|
|
66
89
|
}, [setState]);
|
|
67
|
-
return (react_1.default.createElement(bundle_modules_1.BundleModules, { jobs: jobs, chunks: chunks, ...restProps, ...searchParams, ...sortParams, allItems: rows, totalRowCount: totalRowCount, hideEntryInfo: hideEntryInfo }));
|
|
90
|
+
return (react_1.default.createElement(bundle_modules_1.BundleModules, { jobs: jobs, chunks: chunks, ...restProps, ...searchParams, ...sortParams, allItems: rows, totalRowCount: totalRowCount, hideEntryInfo: hideEntryInfo, moduleMetric: moduleMetric, setModuleMetric: setModuleMetric }));
|
|
68
91
|
};
|
|
69
92
|
exports.BundleModules = BundleModules;
|
|
70
93
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoD;AAEpD,6EAA+D;AAG/D,yDAAwD;AACxD,qDAAoD;AACpD,6DAA4D;AAC5D,qDAAkE;AAClE,iEAMgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAoD;AAEpD,6EAA+D;AAG/D,yDAAwD;AACxD,qDAAoD;AACpD,6DAA4D;AAC5D,qDAAkE;AAClE,iEAMgC;AAChC,yEAA0D;AAQ1D,SAAS,eAAe,CAAC,MAAuB;IAC9C,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAEpC,MAAM,YAAY,GAAiB,IAAA,eAAO,EAAC,GAAG,EAAE;QAC9C,IAAI,MAAM,CAAC,MAAM,CAAC,uCAAY,CAAC,CAAC,QAAQ,CAAC,MAAsB,CAAC,EAAE;YAChE,OAAO,MAAsB,CAAC;SAC/B;QACD,OAAO,uCAAY,CAAC,IAAI,CAAC;IAC3B,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,MAAM,eAAe,GAAG,IAAA,mBAAW,EACjC,CAAC,eAA6B,EAAE,EAAE;QAChC,IAAI,eAAe,KAAK,MAAM,EAAE;YAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,CAAC;SACvC;IACH,CAAC,EACD,CAAC,MAAM,EAAE,QAAQ,CAAC,CACnB,CAAC;IAEF,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,EAAE,CAAC,YAA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ChE;QACD,OAAO;YACL,IAAI,EAAE,MAA4C;YAClD,aAAa,EAAE,MAAM,CAAC,MAAM;SAC7B,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IAEzB,MAAM,YAAY,GAAG,IAAA,2BAAa,EAAC;QACjC,IAAI;QACJ,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,YAAY,EAAE,IAAA,2CAAoB,EAAC,EAAE,QAAQ,EAAE,CAAC;KACjD,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,IAAA,uBAAW,EAAC;QAC7B,IAAI,EAAE,YAAY;QAClB,YAAY,EAAE,MAAM;QACpB,gBAAgB,EAAE,SAAS;QAC3B,aAAa,EAAb,oCAAa;KACd,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACrC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,8BAAC,8BAAa,IACZ,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,KACV,SAAS,KACT,YAAY,KACZ,UAAU,EACd,QAAQ,EAAE,IAAI,EACd,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;AACJ,CAAC,CAAC;AAjEW,QAAA,aAAa,iBAiExB"}
|
|
@@ -40,7 +40,6 @@ const module_info_module_css_1 = __importDefault(require("./module-info.module.c
|
|
|
40
40
|
const ModuleInfo = (props) => {
|
|
41
41
|
const { className = '', item, labels, chunks = [], chunkIds = [], customComponentLink: CustomComponentLink = component_link_1.ComponentLink, onClick = noop_1.default, onClose, } = props;
|
|
42
42
|
const rootClassName = (0, classnames_1.default)(module_info_module_css_1.default.root, className);
|
|
43
|
-
const currentRun = item.runs?.[0];
|
|
44
43
|
const tags = (0, react_1.useMemo)(() => {
|
|
45
44
|
if (!item.duplicated) {
|
|
46
45
|
return null;
|
|
@@ -54,13 +53,17 @@ const ModuleInfo = (props) => {
|
|
|
54
53
|
: utils_1.MODULE_SOURCE_TYPE_LABELS.FIRST_PARTY;
|
|
55
54
|
return (react_1.default.createElement(entry_info_1.EntryInfo, { item: item, labels: labels, tags: tags, onClose: onClose, className: rootClassName },
|
|
56
55
|
react_1.default.createElement(stack_1.Stack, { space: "xxxsmall" },
|
|
57
|
-
!(0, isEmpty_1.default)(currentRun?.chunkIds) && (react_1.default.createElement(entry_info_1.EntryInfo.Meta, { label: "Chunks", className: module_info_module_css_1.default.chunks },
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
item.runs?.map((currentRun, index) => !(0, isEmpty_1.default)(currentRun?.chunkIds) && (react_1.default.createElement(entry_info_1.EntryInfo.Meta, { label: "Chunks", className: module_info_module_css_1.default.chunks },
|
|
57
|
+
"Job #",
|
|
58
|
+
index + 1,
|
|
59
|
+
":",
|
|
60
|
+
currentRun.chunkIds.map((chunkId) => {
|
|
61
|
+
const chunk = chunks?.find(({ id }) => id === chunkId);
|
|
62
|
+
if (!chunk) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return (react_1.default.createElement(entry_info_1.EntryInfoMetaLink, { as: CustomComponentLink, ...(0, utils_1.getBundleModulesByChunk)(chunkIds, chunkId), className: module_info_module_css_1.default.chunksItem }, chunk.name));
|
|
66
|
+
})))),
|
|
64
67
|
item?.fileType && (react_1.default.createElement(entry_info_1.EntryInfo.Meta, { label: "File type" },
|
|
65
68
|
react_1.default.createElement(entry_info_1.EntryInfoMetaLink, { as: CustomComponentLink, ...(0, utils_1.getBundleModulesByFileTpe)(item.fileType, fileTypeLabel) }, fileTypeLabel))),
|
|
66
69
|
react_1.default.createElement(entry_info_1.EntryInfo.Meta, { label: "Source" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-info.js","sourceRoot":"","sources":["../../../src/components/module-info/module-info.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AACvC,4DAA4B;AAC5B,6DAAqC;AACrC,uDAA+B;AAC/B,+CAQ6B;AAG7B,8CAA2C;AAC3C,sCAAmC;AACnC,sDAAkD;AAClD,8CAA6D;AAC7D,sFAA2C;AAkBpC,MAAM,UAAU,GAAG,CAAC,KAAoD,EAAE,EAAE;IACjF,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,MAAM,EACN,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,EAAE,EACb,mBAAmB,EAAE,mBAAmB,GAAG,8BAAa,EACxD,OAAO,GAAG,cAAI,EACd,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,IAAA,oBAAE,EAAC,gCAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-info.js","sourceRoot":"","sources":["../../../src/components/module-info/module-info.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAuC;AACvC,4DAA4B;AAC5B,6DAAqC;AACrC,uDAA+B;AAC/B,+CAQ6B;AAG7B,8CAA2C;AAC3C,sCAAmC;AACnC,sDAAkD;AAClD,8CAA6D;AAC7D,sFAA2C;AAkBpC,MAAM,UAAU,GAAG,CAAC,KAAoD,EAAE,EAAE;IACjF,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,MAAM,EACN,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,EAAE,EACb,mBAAmB,EAAE,mBAAmB,GAAG,8BAAa,EACxD,OAAO,GAAG,cAAI,EACd,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,IAAA,oBAAE,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OAAO,IAAI,CAAC;qBACb;oBAED,OAAO,CACL,8BAAC,8BAAiB,IAChB,EAAE,EAAE,mBAAmB,KACnB,IAAA,+BAAuB,EAAC,QAAQ,EAAE,OAAO,CAAC,EAC9C,SAAS,EAAE,gCAAG,CAAC,UAAU,IAExB,KAAK,CAAC,IAAI,CACO,CACrB,CAAC;gBACJ,CAAC,CAAC,CACa,CACpB,CACF;YAEA,IAAI,EAAE,QAAQ,IAAI,CACjB,8BAAC,sBAAS,CAAC,IAAI,IAAC,KAAK,EAAC,WAAW;gBAC/B,8BAAC,8BAAiB,IAChB,EAAE,EAAE,mBAAmB,KACnB,IAAA,iCAAyB,EAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,IAE1D,aAAa,CACI,CACL,CAClB;YAED,8BAAC,sBAAS,CAAC,IAAI,IAAC,KAAK,EAAC,QAAQ;gBAC5B,8BAAC,8BAAiB,IAChB,EAAE,EAAE,mBAAmB,KACnB,IAAA,gCAAwB,EAAC,IAAI,CAAC,UAAU,IAAI,KAAK,EAAE,eAAe,CAAC,EACvE,OAAO,EAAE,OAAO,IAEf,eAAe,CACE,CACL,CACX,CACE,CACb,CAAC;AACJ,CAAC,CAAC;AAtFW,QAAA,UAAU,cAsFrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle-modules.constants.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/bundle-modules.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,8BAAc,CAAA;IACd,wCAAwB,CAAA;AAC1B,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB"}
|
|
@@ -3,19 +3,23 @@ import cx from 'classnames';
|
|
|
3
3
|
import { SECTIONS, COMPONENT } from '@bundle-stats/utils';
|
|
4
4
|
import config from '../../config.json';
|
|
5
5
|
import I18N from '../../i18n';
|
|
6
|
-
import {
|
|
6
|
+
import { Box } from '../../layout/box';
|
|
7
7
|
import { FlexStack } from '../../layout/flex-stack';
|
|
8
|
-
import {
|
|
8
|
+
import { Button } from '../../ui/button';
|
|
9
9
|
import { EmptySet } from '../../ui/empty-set';
|
|
10
10
|
import { FileName } from '../../ui/file-name';
|
|
11
11
|
import { Filters } from '../../ui/filters';
|
|
12
|
+
import { InputSearch } from '../../ui/input-search';
|
|
12
13
|
import { Tag } from '../../ui/tag';
|
|
13
14
|
import { Toolbar } from '../../ui/toolbar';
|
|
15
|
+
import { Tooltip } from '../../ui/tooltip';
|
|
16
|
+
import { ComponentLink } from '../component-link';
|
|
14
17
|
import { MetricsTable } from '../metrics-table';
|
|
15
18
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
16
19
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
17
20
|
import { ModuleInfo } from '../module-info';
|
|
18
21
|
import { generateFilterFieldsData } from './bundle-modules.utils';
|
|
22
|
+
import { ModuleMetric } from './bundle-modules.constants';
|
|
19
23
|
import * as I18N_MODULES from './bundle-modules.i18n';
|
|
20
24
|
import css from './bundle-modules.module.css';
|
|
21
25
|
const RowHeader = (props) => {
|
|
@@ -25,7 +29,7 @@ const RowHeader = (props) => {
|
|
|
25
29
|
React.createElement(FileName, { className: css.nameText, name: row.label })));
|
|
26
30
|
};
|
|
27
31
|
export const BundleModules = (props) => {
|
|
28
|
-
const { className = '', jobs = [], items = [], allItems = [], chunks = [], totalRowCount = 0, updateFilters, resetFilters, resetAllFilters, filters, sort, updateSort, search, updateSearch, entryId, hideEntryInfo, customComponentLink: CustomComponentLink = ComponentLink, } = props;
|
|
32
|
+
const { className = '', jobs = [], items = [], allItems = [], chunks = [], totalRowCount = 0, updateFilters, resetFilters, resetAllFilters, filters, sort, updateSort, search, updateSearch, entryId, hideEntryInfo, moduleMetric, setModuleMetric, customComponentLink: CustomComponentLink = ComponentLink, } = props;
|
|
29
33
|
const rootClassName = cx(css.root, className);
|
|
30
34
|
const jobLabels = jobs === null || jobs === void 0 ? void 0 : jobs.map((job) => job === null || job === void 0 ? void 0 : job.label);
|
|
31
35
|
const filterFieldsData = useMemo(() => generateFilterFieldsData({ filters, chunks, compareMode: jobs.length > 1 }), [jobs, filters, chunks]);
|
|
@@ -45,6 +49,12 @@ export const BundleModules = (props) => {
|
|
|
45
49
|
React.createElement(FlexStack, { space: "xxsmall" },
|
|
46
50
|
React.createElement(InputSearch, { className: css.toolbarSearch, placeholder: I18N_MODULES.SEARCH, defaultValue: search, onChange: updateSearch }),
|
|
47
51
|
React.createElement(Filters, { className: css.tableDropdown, filters: filterFieldsData, onChange: updateFilters }))),
|
|
52
|
+
React.createElement(Box, { padding: ['xsmall', 'small'], className: css.metricSelector },
|
|
53
|
+
React.createElement(FlexStack, { space: "xxsmall", as: "nav" },
|
|
54
|
+
React.createElement(Button, { outline: true, active: moduleMetric === ModuleMetric.SIZE, size: "small", type: "button", onClick: () => setModuleMetric(ModuleMetric.SIZE) },
|
|
55
|
+
React.createElement(Tooltip, { title: "Size (excluding duplicate modules)" }, "Module size")),
|
|
56
|
+
React.createElement(Button, { outline: true, active: moduleMetric === ModuleMetric.TOTAL_SIZE, size: "small", type: "button", onClick: () => setModuleMetric(ModuleMetric.TOTAL_SIZE) },
|
|
57
|
+
React.createElement(Tooltip, { title: "Size (including duplicate modules)" }, "Module total size")))),
|
|
48
58
|
React.createElement(MetricsTable, { className: css.table, items: items, runs: jobs, renderRowHeader: renderRowHeader, emptyMessage: emptyMessage, showHeaderSum: true, title: metricsTableTitle, sort: sort, updateSort: updateSort })),
|
|
49
59
|
entryItem && (React.createElement(ModuleInfo, { className: css.moduleInfo, item: entryItem, chunks: chunks, chunkIds: chunks === null || chunks === void 0 ? void 0 : chunks.map(({ id }) => id), labels: jobLabels, customComponentLink: CustomComponentLink, onClose: hideEntryInfo }))));
|
|
50
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-modules.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/bundle-modules.tsx"],"names":[],"mappings":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rC,MAAM,EAAE,SAAS,EACjB,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE,aAAa,GACtB,CACH,CACA,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -5,8 +5,25 @@ import { useRowsSort } from '../../hooks/rows-sort';
|
|
|
5
5
|
import { useSearchParams } from '../../hooks/search-params';
|
|
6
6
|
import { BundleModules as BaseComponent } from './bundle-modules';
|
|
7
7
|
import { addRowFlags, extractChunkData, generateGetRowFilter, generateFilters, getCustomSort, } from './bundle-modules.utils';
|
|
8
|
+
import { ModuleMetric } from './bundle-modules.constants';
|
|
9
|
+
function useModuleMetric(params) {
|
|
10
|
+
const { metric, setState } = params;
|
|
11
|
+
const moduleMetric = useMemo(() => {
|
|
12
|
+
if (Object.values(ModuleMetric).includes(metric)) {
|
|
13
|
+
return metric;
|
|
14
|
+
}
|
|
15
|
+
return ModuleMetric.SIZE;
|
|
16
|
+
}, [metric]);
|
|
17
|
+
const setModuleMetric = useCallback((newModuleMetric) => {
|
|
18
|
+
if (newModuleMetric !== metric) {
|
|
19
|
+
setState({ metric: newModuleMetric });
|
|
20
|
+
}
|
|
21
|
+
}, [metric, setState]);
|
|
22
|
+
return useMemo(() => [moduleMetric, setModuleMetric], [moduleMetric, setModuleMetric]);
|
|
23
|
+
}
|
|
8
24
|
export const BundleModules = (props) => {
|
|
9
|
-
const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
|
|
25
|
+
const { jobs, filters, search, setState, sortBy, direction, metric = '', ...restProps } = props;
|
|
26
|
+
const [moduleMetric, setModuleMetric] = useModuleMetric({ metric, setState });
|
|
10
27
|
const { chunks, chunkIds } = useMemo(() => extractChunkData(jobs), [jobs]);
|
|
11
28
|
const { defaultFilters, allEntriesFilters } = useMemo(() => generateFilters(chunkIds, jobs.length > 1), [chunkIds, jobs]);
|
|
12
29
|
const searchParams = useSearchParams({
|
|
@@ -17,12 +34,18 @@ export const BundleModules = (props) => {
|
|
|
17
34
|
setState,
|
|
18
35
|
});
|
|
19
36
|
const { rows, totalRowCount } = useMemo(() => {
|
|
20
|
-
|
|
37
|
+
let result;
|
|
38
|
+
if (moduleMetric === ModuleMetric.TOTAL_SIZE) {
|
|
39
|
+
result = webpack.compareModuleDuplicateSize(jobs, [addRowFlags]);
|
|
40
|
+
}
|
|
41
|
+
else if (moduleMetric === ModuleMetric.SIZE) {
|
|
42
|
+
result = webpack.compareBySection.modules(jobs, [addRowFlags]);
|
|
43
|
+
}
|
|
21
44
|
return {
|
|
22
45
|
rows: result,
|
|
23
46
|
totalRowCount: result.length,
|
|
24
47
|
};
|
|
25
|
-
}, [jobs]);
|
|
48
|
+
}, [jobs, moduleMetric]);
|
|
26
49
|
const filteredRows = useRowsFilter({
|
|
27
50
|
rows,
|
|
28
51
|
searchPattern: searchParams.searchPattern,
|
|
@@ -38,6 +61,6 @@ export const BundleModules = (props) => {
|
|
|
38
61
|
const hideEntryInfo = useCallback(() => {
|
|
39
62
|
setState({ entryId: '' });
|
|
40
63
|
}, [setState]);
|
|
41
|
-
return (React.createElement(BaseComponent, { jobs: jobs, chunks: chunks, ...restProps, ...searchParams, ...sortParams, allItems: rows, totalRowCount: totalRowCount, hideEntryInfo: hideEntryInfo }));
|
|
64
|
+
return (React.createElement(BaseComponent, { jobs: jobs, chunks: chunks, ...restProps, ...searchParams, ...sortParams, allItems: rows, totalRowCount: totalRowCount, hideEntryInfo: hideEntryInfo, moduleMetric: moduleMetric, setModuleMetric: setModuleMetric }));
|
|
42
65
|
};
|
|
43
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/bundle-modules/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAC;AAG/D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,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
const { className = '', item, labels, chunks = [], chunkIds = [], customComponentLink: CustomComponentLink = ComponentLink, onClick = noop, onClose, } = props;
|
|
14
14
|
const rootClassName = cx(css.root, className);
|
|
15
|
-
const currentRun = (_a = item.runs) === null || _a === void 0 ? void 0 : _a[0];
|
|
16
15
|
const tags = useMemo(() => {
|
|
17
16
|
if (!item.duplicated) {
|
|
18
17
|
return null;
|
|
@@ -25,14 +24,18 @@ export const ModuleInfo = (props) => {
|
|
|
25
24
|
? MODULE_SOURCE_TYPE_LABELS.THIRD_PARTY
|
|
26
25
|
: MODULE_SOURCE_TYPE_LABELS.FIRST_PARTY;
|
|
27
26
|
return (React.createElement(EntryInfo, { item: item, labels: labels, tags: tags, onClose: onClose, className: rootClassName },
|
|
28
|
-
React.createElement(Stack, { space: "xxxsmall" },
|
|
29
|
-
!isEmpty(currentRun === null || currentRun === void 0 ? void 0 : currentRun.chunkIds) && (React.createElement(EntryInfo.Meta, { label: "Chunks", className: css.chunks },
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
React.createElement(Stack, { space: "xxxsmall" }, (_a = item.runs) === null || _a === void 0 ? void 0 :
|
|
28
|
+
_a.map((currentRun, index) => !isEmpty(currentRun === null || currentRun === void 0 ? void 0 : currentRun.chunkIds) && (React.createElement(EntryInfo.Meta, { label: "Chunks", className: css.chunks },
|
|
29
|
+
"Job #",
|
|
30
|
+
index + 1,
|
|
31
|
+
":",
|
|
32
|
+
currentRun.chunkIds.map((chunkId) => {
|
|
33
|
+
const chunk = chunks === null || chunks === void 0 ? void 0 : chunks.find(({ id }) => id === chunkId);
|
|
34
|
+
if (!chunk) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return (React.createElement(EntryInfoMetaLink, { as: CustomComponentLink, ...getBundleModulesByChunk(chunkIds, chunkId), className: css.chunksItem }, chunk.name));
|
|
38
|
+
})))),
|
|
36
39
|
(item === null || item === void 0 ? void 0 : item.fileType) && (React.createElement(EntryInfo.Meta, { label: "File type" },
|
|
37
40
|
React.createElement(EntryInfoMetaLink, { as: CustomComponentLink, ...getBundleModulesByFileTpe(item.fileType, fileTypeLabel) }, fileTypeLabel))),
|
|
38
41
|
React.createElement(EntryInfo.Meta, { label: "Source" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-info.js","sourceRoot":"","sources":["../../../src/components/module-info/module-info.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AACrC,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,yBAAyB,EAEzB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAkB3C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAoD,EAAE,EAAE;;IACjF,MAAM,EACJ,SAAS,GAAG,EAAE,EACd,IAAI,EACJ,MAAM,EACN,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,EAAE,EACb,mBAAmB,EAAE,mBAAmB,GAAG,aAAa,EACxD,OAAO,GAAG,IAAI,EACd,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,MAAM,aAAa,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"module-info.js","sourceRo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AQ,KAAI,CACjB,oBAAC,SAAS,CAAC,IAAI,IAAC,KAAK,EAAC,WAAW;gBAC/B,oBAAC,iBAAiB,IAChB,EAAE,EAAE,mBAAmB,KACnB,yBAAyB,CAAC,IAAI,CAAC,QAAQ,EAAE,aAAa,CAAC,IAE1D,aAAa,CACI,CACL,CAClB;YAED,oBAAC,SAAS,CAAC,IAAI,IAAC,KAAK,EAAC,QAAQ;gBAC5B,oBAAC,iBAAiB,IAChB,EAAE,EAAE,mBAAmB,KACnB,wBAAwB,CAAC,IAAI,CAAC,UAAU,IAAI,KAAK,EAAE,eAAe,CAAC,EACvE,OAAO,EAAE,OAAO,IAEf,eAAe,CACE,CACL,CACX,CACE,CACb,CAAC;AACJ,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bundle-stats/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0-beta.1",
|
|
4
4
|
"description": "UI components for BundleStats projects.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-esm/index.js",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@babel/preset-env": "7.23.9",
|
|
40
40
|
"@babel/preset-react": "7.23.3",
|
|
41
41
|
"@babel/preset-typescript": "7.23.3",
|
|
42
|
-
"@storybook/addon-essentials": "7.6.
|
|
43
|
-
"@storybook/react": "7.6.
|
|
44
|
-
"@storybook/react-webpack5": "7.6.
|
|
45
|
-
"@types/react": "18.2.
|
|
42
|
+
"@storybook/addon-essentials": "7.6.17",
|
|
43
|
+
"@storybook/react": "7.6.17",
|
|
44
|
+
"@storybook/react-webpack5": "7.6.17",
|
|
45
|
+
"@types/react": "18.2.57",
|
|
46
46
|
"@types/react-router-dom": "5.3.3",
|
|
47
47
|
"babel-plugin-require-context-hook": "1.0.0",
|
|
48
48
|
"classnames": "2.5.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"react-dom": "18.2.0",
|
|
60
60
|
"react-router-dom": "5.3.4",
|
|
61
61
|
"rimraf": "5.0.5",
|
|
62
|
-
"storybook": "7.6.
|
|
62
|
+
"storybook": "7.6.17",
|
|
63
63
|
"typescript": "5.1.6",
|
|
64
64
|
"typescript-plugin-css-modules": "5.1.0"
|
|
65
65
|
},
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"react-router-dom": "^5.0.0"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@bundle-stats/utils": "
|
|
75
|
+
"@bundle-stats/utils": "4.12.0-beta.1",
|
|
76
76
|
"ariakit": "2.0.0-next.44",
|
|
77
77
|
"modern-css-reset": "1.4.0",
|
|
78
78
|
"use-query-params": "2.2.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "84b4e914f0840ca7c50761506562a3eeeb2919ef"
|
|
81
81
|
}
|
|
@@ -5,19 +5,23 @@ import { SECTIONS, COMPONENT } from '@bundle-stats/utils';
|
|
|
5
5
|
import type { SortAction } from '../../types';
|
|
6
6
|
import config from '../../config.json';
|
|
7
7
|
import I18N from '../../i18n';
|
|
8
|
-
import {
|
|
8
|
+
import { Box } from '../../layout/box';
|
|
9
9
|
import { FlexStack } from '../../layout/flex-stack';
|
|
10
|
-
import {
|
|
10
|
+
import { Button } from '../../ui/button';
|
|
11
11
|
import { EmptySet } from '../../ui/empty-set';
|
|
12
12
|
import { FileName } from '../../ui/file-name';
|
|
13
13
|
import { Filters } from '../../ui/filters';
|
|
14
|
+
import { InputSearch } from '../../ui/input-search';
|
|
14
15
|
import { Tag } from '../../ui/tag';
|
|
15
16
|
import { Toolbar } from '../../ui/toolbar';
|
|
17
|
+
import { Tooltip } from '../../ui/tooltip';
|
|
18
|
+
import { ComponentLink } from '../component-link';
|
|
16
19
|
import { MetricsTable } from '../metrics-table';
|
|
17
20
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
18
21
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
19
22
|
import { ModuleInfo } from '../module-info';
|
|
20
23
|
import { generateFilterFieldsData } from './bundle-modules.utils';
|
|
24
|
+
import { ModuleMetric } from './bundle-modules.constants';
|
|
21
25
|
import type { Chunk, Job, ReportMetricModuleRow } from './bundle-modules.types';
|
|
22
26
|
import * as I18N_MODULES from './bundle-modules.i18n';
|
|
23
27
|
import css from './bundle-modules.module.css';
|
|
@@ -68,6 +72,9 @@ interface BundleModulesProps extends React.ComponentProps<'div'> {
|
|
|
68
72
|
entryId?: string;
|
|
69
73
|
hideEntryInfo: () => void;
|
|
70
74
|
|
|
75
|
+
moduleMetric: ModuleMetric;
|
|
76
|
+
setModuleMetric: (newValue: ModuleMetric) => void;
|
|
77
|
+
|
|
71
78
|
customComponentLink: React.ElementType;
|
|
72
79
|
}
|
|
73
80
|
|
|
@@ -89,6 +96,8 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
89
96
|
updateSearch,
|
|
90
97
|
entryId,
|
|
91
98
|
hideEntryInfo,
|
|
99
|
+
moduleMetric,
|
|
100
|
+
setModuleMetric,
|
|
92
101
|
customComponentLink: CustomComponentLink = ComponentLink,
|
|
93
102
|
} = props;
|
|
94
103
|
|
|
@@ -172,6 +181,28 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
172
181
|
/>
|
|
173
182
|
</FlexStack>
|
|
174
183
|
</Toolbar>
|
|
184
|
+
<Box padding={['xsmall', 'small']} className={css.metricSelector}>
|
|
185
|
+
<FlexStack space="xxsmall" as="nav">
|
|
186
|
+
<Button
|
|
187
|
+
outline
|
|
188
|
+
active={moduleMetric === ModuleMetric.SIZE}
|
|
189
|
+
size="small"
|
|
190
|
+
type="button"
|
|
191
|
+
onClick={() => setModuleMetric(ModuleMetric.SIZE)}
|
|
192
|
+
>
|
|
193
|
+
<Tooltip title="Size (excluding duplicate modules)">Module size</Tooltip>
|
|
194
|
+
</Button>
|
|
195
|
+
<Button
|
|
196
|
+
outline
|
|
197
|
+
active={moduleMetric === ModuleMetric.TOTAL_SIZE}
|
|
198
|
+
size="small"
|
|
199
|
+
type="button"
|
|
200
|
+
onClick={() => setModuleMetric(ModuleMetric.TOTAL_SIZE)}
|
|
201
|
+
>
|
|
202
|
+
<Tooltip title="Size (including duplicate modules)">Module total size</Tooltip>
|
|
203
|
+
</Button>
|
|
204
|
+
</FlexStack>
|
|
205
|
+
</Box>
|
|
175
206
|
<MetricsTable
|
|
176
207
|
className={css.table}
|
|
177
208
|
items={items}
|
|
@@ -14,8 +14,36 @@ import {
|
|
|
14
14
|
generateFilters,
|
|
15
15
|
getCustomSort,
|
|
16
16
|
} from './bundle-modules.utils';
|
|
17
|
+
import { ModuleMetric } from './bundle-modules.constants';
|
|
17
18
|
import * as types from './bundle-modules.types';
|
|
18
19
|
|
|
20
|
+
interface UseMetricParams {
|
|
21
|
+
metric?: string;
|
|
22
|
+
setState: ({ metric }: { metric: ModuleMetric }) => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function useModuleMetric(params: UseMetricParams): [ModuleMetric, (value: ModuleMetric) => void] {
|
|
26
|
+
const { metric, setState } = params;
|
|
27
|
+
|
|
28
|
+
const moduleMetric: ModuleMetric = useMemo(() => {
|
|
29
|
+
if (Object.values(ModuleMetric).includes(metric as ModuleMetric)) {
|
|
30
|
+
return metric as ModuleMetric;
|
|
31
|
+
}
|
|
32
|
+
return ModuleMetric.SIZE;
|
|
33
|
+
}, [metric]);
|
|
34
|
+
|
|
35
|
+
const setModuleMetric = useCallback(
|
|
36
|
+
(newModuleMetric: ModuleMetric) => {
|
|
37
|
+
if (newModuleMetric !== metric) {
|
|
38
|
+
setState({ metric: newModuleMetric });
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
[metric, setState],
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
return useMemo(() => [moduleMetric, setModuleMetric], [moduleMetric, setModuleMetric]);
|
|
45
|
+
}
|
|
46
|
+
|
|
19
47
|
interface BundleModulesProps
|
|
20
48
|
extends Omit<
|
|
21
49
|
React.ComponentProps<typeof BaseComponent>,
|
|
@@ -30,7 +58,6 @@ interface BundleModulesProps
|
|
|
30
58
|
| 'updateSort'
|
|
31
59
|
| 'search'
|
|
32
60
|
| 'updateSearch'
|
|
33
|
-
| 'entryId'
|
|
34
61
|
| 'allItems'
|
|
35
62
|
| 'totalRowCount'
|
|
36
63
|
| 'hideEntryInfo'
|
|
@@ -38,13 +65,16 @@ interface BundleModulesProps
|
|
|
38
65
|
jobs: Array<types.Job>;
|
|
39
66
|
filters: Record<string, boolean>;
|
|
40
67
|
search?: string;
|
|
68
|
+
metric?: string;
|
|
41
69
|
setState: (params: any) => void;
|
|
42
70
|
sortBy?: string;
|
|
43
71
|
direction?: SortAction['direction'];
|
|
44
72
|
}
|
|
45
73
|
|
|
46
74
|
export const BundleModules = (props: BundleModulesProps) => {
|
|
47
|
-
const { jobs, filters, search, setState, sortBy, direction, ...restProps } = props;
|
|
75
|
+
const { jobs, filters, search, setState, sortBy, direction, metric = '', ...restProps } = props;
|
|
76
|
+
|
|
77
|
+
const [moduleMetric, setModuleMetric] = useModuleMetric({ metric, setState });
|
|
48
78
|
|
|
49
79
|
const { chunks, chunkIds } = useMemo(() => extractChunkData(jobs), [jobs]);
|
|
50
80
|
|
|
@@ -62,12 +92,17 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
62
92
|
});
|
|
63
93
|
|
|
64
94
|
const { rows, totalRowCount } = useMemo(() => {
|
|
65
|
-
|
|
95
|
+
let result;
|
|
96
|
+
if (moduleMetric === ModuleMetric.TOTAL_SIZE) {
|
|
97
|
+
result = webpack.compareModuleDuplicateSize(jobs, [addRowFlags]);
|
|
98
|
+
} else if (moduleMetric === ModuleMetric.SIZE) {
|
|
99
|
+
result = webpack.compareBySection.modules(jobs, [addRowFlags]);
|
|
100
|
+
}
|
|
66
101
|
return {
|
|
67
102
|
rows: result as Array<types.ReportMetricModuleRow>,
|
|
68
103
|
totalRowCount: result.length,
|
|
69
104
|
};
|
|
70
|
-
}, [jobs]);
|
|
105
|
+
}, [jobs, moduleMetric]);
|
|
71
106
|
|
|
72
107
|
const filteredRows = useRowsFilter({
|
|
73
108
|
rows,
|
|
@@ -97,6 +132,8 @@ export const BundleModules = (props: BundleModulesProps) => {
|
|
|
97
132
|
allItems={rows}
|
|
98
133
|
totalRowCount={totalRowCount}
|
|
99
134
|
hideEntryInfo={hideEntryInfo}
|
|
135
|
+
moduleMetric={moduleMetric}
|
|
136
|
+
setModuleMetric={setModuleMetric}
|
|
100
137
|
/>
|
|
101
138
|
);
|
|
102
139
|
};
|
|
@@ -48,7 +48,6 @@ export const ModuleInfo = (props: ModuleInfoProps & React.ComponentProps<'div'>)
|
|
|
48
48
|
} = props;
|
|
49
49
|
|
|
50
50
|
const rootClassName = cx(css.root, className);
|
|
51
|
-
const currentRun = item.runs?.[0];
|
|
52
51
|
|
|
53
52
|
const tags = useMemo(() => {
|
|
54
53
|
if (!item.duplicated) {
|
|
@@ -73,26 +72,30 @@ export const ModuleInfo = (props: ModuleInfoProps & React.ComponentProps<'div'>)
|
|
|
73
72
|
return (
|
|
74
73
|
<EntryInfo item={item} labels={labels} tags={tags} onClose={onClose} className={rootClassName}>
|
|
75
74
|
<Stack space="xxxsmall">
|
|
76
|
-
{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
{item.runs?.map(
|
|
76
|
+
(currentRun, index) =>
|
|
77
|
+
!isEmpty(currentRun?.chunkIds) && (
|
|
78
|
+
<EntryInfo.Meta label="Chunks" className={css.chunks}>
|
|
79
|
+
Job #{index + 1}:
|
|
80
|
+
{currentRun.chunkIds.map((chunkId) => {
|
|
81
|
+
const chunk = chunks?.find(({ id }) => id === chunkId);
|
|
80
82
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (!chunk) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
return (
|
|
88
|
+
<EntryInfoMetaLink
|
|
89
|
+
as={CustomComponentLink}
|
|
90
|
+
{...getBundleModulesByChunk(chunkIds, chunkId)}
|
|
91
|
+
className={css.chunksItem}
|
|
92
|
+
>
|
|
93
|
+
{chunk.name}
|
|
94
|
+
</EntryInfoMetaLink>
|
|
95
|
+
);
|
|
96
|
+
})}
|
|
97
|
+
</EntryInfo.Meta>
|
|
98
|
+
),
|
|
96
99
|
)}
|
|
97
100
|
|
|
98
101
|
{item?.fileType && (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { SortAction } from '../../types';
|
|
3
|
+
import { ModuleMetric } from './bundle-modules.constants';
|
|
3
4
|
import type { Chunk, Job, ReportMetricModuleRow } from './bundle-modules.types';
|
|
4
5
|
interface BundleModulesProps extends React.ComponentProps<'div'> {
|
|
5
6
|
jobs?: Array<Job>;
|
|
@@ -17,6 +18,8 @@ interface BundleModulesProps extends React.ComponentProps<'div'> {
|
|
|
17
18
|
updateSearch: (newSerarch: string) => void;
|
|
18
19
|
entryId?: string;
|
|
19
20
|
hideEntryInfo: () => void;
|
|
21
|
+
moduleMetric: ModuleMetric;
|
|
22
|
+
setModuleMetric: (newValue: ModuleMetric) => void;
|
|
20
23
|
customComponentLink: React.ElementType;
|
|
21
24
|
}
|
|
22
25
|
export declare const BundleModules: (props: BundleModulesProps) => React.JSX.Element;
|
|
@@ -2,10 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import type { SortAction } from '../../types';
|
|
3
3
|
import { BundleModules as BaseComponent } from './bundle-modules';
|
|
4
4
|
import * as types from './bundle-modules.types';
|
|
5
|
-
interface BundleModulesProps extends Omit<React.ComponentProps<typeof BaseComponent>, 'jobs' | 'items' | 'chunks' | 'updateFilters' | 'resetFilters' | 'resetAllFilters' | 'filters' | 'sort' | 'updateSort' | 'search' | 'updateSearch' | '
|
|
5
|
+
interface BundleModulesProps extends Omit<React.ComponentProps<typeof BaseComponent>, 'jobs' | 'items' | 'chunks' | 'updateFilters' | 'resetFilters' | 'resetAllFilters' | 'filters' | 'sort' | 'updateSort' | 'search' | 'updateSearch' | 'allItems' | 'totalRowCount' | 'hideEntryInfo'> {
|
|
6
6
|
jobs: Array<types.Job>;
|
|
7
7
|
filters: Record<string, boolean>;
|
|
8
8
|
search?: string;
|
|
9
|
+
metric?: string;
|
|
9
10
|
setState: (params: any) => void;
|
|
10
11
|
sortBy?: string;
|
|
11
12
|
direction?: SortAction['direction'];
|