@bundle-stats/ui 4.1.1-alpha.1 → 4.1.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/app/app.js +20 -85
- package/lib/app/app.stories.js +2 -20
- package/lib/app/header/header.js +2 -11
- package/lib/app/header/index.js +0 -2
- package/lib/app/index.js +0 -2
- package/lib/components/asset-info/asset-info.js +7 -25
- package/lib/components/asset-info/asset-info.stories.js +0 -5
- package/lib/components/asset-info/index.js +0 -2
- package/lib/components/browsertime-table/browsertime-table.js +1 -12
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -11
- package/lib/components/browsertime-table/index.js +0 -2
- package/lib/components/bundle-assets/bundle-assets.constants.js +0 -3
- package/lib/components/bundle-assets/bundle-assets.js +29 -86
- package/lib/components/bundle-assets/bundle-assets.stories.js +2 -23
- package/lib/components/bundle-assets/bundle-assets.utils.js +0 -26
- package/lib/components/bundle-assets/index.js +21 -49
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +3 -33
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.stories.js +0 -8
- package/lib/components/bundle-assets-totals-chart-bars/index.js +0 -2
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.js +7 -29
- package/lib/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -10
- package/lib/components/bundle-assets-totals-table/index.js +0 -2
- package/lib/components/bundle-modules/bundle-modules.constants.js +0 -3
- package/lib/components/bundle-modules/bundle-modules.js +24 -77
- package/lib/components/bundle-modules/bundle-modules.stories.js +16 -30
- package/lib/components/bundle-modules/bundle-modules.utils.js +19 -54
- package/lib/components/bundle-modules/index.js +25 -56
- package/lib/components/bundle-packages/bundle-packages.constants.js +0 -3
- package/lib/components/bundle-packages/bundle-packages.js +33 -83
- package/lib/components/bundle-packages/bundle-packages.stories.js +2 -22
- package/lib/components/bundle-packages/bundle-packages.utils.js +0 -23
- package/lib/components/bundle-packages/index.js +23 -49
- package/lib/components/component-link.js +4 -17
- package/lib/components/delta/delta.js +3 -10
- package/lib/components/delta/delta.stories.js +0 -5
- package/lib/components/delta/index.js +0 -2
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.js +3 -15
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/lib/components/duplicate-packages-warning/duplicate-packages-warning.stories.js +0 -5
- package/lib/components/duplicate-packages-warning/index.js +0 -2
- package/lib/components/index.js +0 -22
- package/lib/components/job-header/index.js +0 -2
- package/lib/components/job-header/job-header.js +6 -22
- package/lib/components/job-header/job-header.stories.js +0 -5
- package/lib/components/job-meta/index.js +0 -2
- package/lib/components/job-meta/job-meta.js +4 -18
- package/lib/components/job-meta/job-meta.stories.js +0 -5
- package/lib/components/job-name/index.js +0 -2
- package/lib/components/job-name/job-name.js +4 -19
- package/lib/components/job-name/job-name.stories.js +0 -5
- package/lib/components/jobs-header/index.js +0 -2
- package/lib/components/jobs-header/jobs-header.js +1 -12
- package/lib/components/jobs-header/jobs-header.stories.js +0 -5
- package/lib/components/lighthouse-table/index.js +0 -2
- package/lib/components/lighthouse-table/lighthouse-table.js +1 -12
- package/lib/components/lighthouse-table/lighthouse-table.stories.js +0 -7
- package/lib/components/metric/index.js +0 -2
- package/lib/components/metric/metric.js +27 -45
- package/lib/components/metric/metric.stories.js +0 -6
- package/lib/components/metrics-table/index.js +0 -2
- package/lib/components/metrics-table/metrics-table.js +36 -75
- package/lib/components/metrics-table/metrics-table.stories.js +0 -5
- package/lib/components/metrics-table-options/index.js +0 -2
- package/lib/components/metrics-table-options/metrics-table-options.js +5 -19
- package/lib/components/metrics-table-options/metrics-table-options.stories.js +0 -5
- package/lib/components/metrics-table-search/index.js +0 -2
- package/lib/components/metrics-table-search/metrics-table-search.js +9 -28
- package/lib/components/metrics-table-search/metrics-table-search.stories.js +3 -19
- package/lib/components/metrics-table-title/index.js +0 -2
- package/lib/components/metrics-table-title/metrics-table-title.js +4 -16
- package/lib/components/module-info/index.js +0 -2
- package/lib/components/module-info/module-info.js +6 -22
- package/lib/components/module-info/module-info.stories.js +0 -5
- package/lib/components/summary/index.js +0 -2
- package/lib/components/summary/summary.js +9 -33
- package/lib/components/summary/summary.module.css +4 -1
- package/lib/components/summary/summary.stories.js +1 -15
- package/lib/components/summary-item/index.js +0 -2
- package/lib/components/summary-item/summary-item.js +14 -44
- package/lib/components/summary-item/summary-item.stories.js +0 -14
- package/lib/components/total-size-type-title/index.js +0 -2
- package/lib/components/total-size-type-title/total-size-type-title.js +0 -13
- package/lib/constants.js +0 -8
- package/lib/css/default.css +3 -1
- package/lib/css/variables.css +56 -56
- package/lib/hooks/rows-filter.js +3 -7
- package/lib/hooks/rows-sort.js +12 -25
- package/lib/hooks/search-params.js +21 -51
- package/lib/index.js +0 -10
- package/lib/layout/box/box.js +10 -39
- package/lib/layout/box/box.stories.js +0 -5
- package/lib/layout/box/index.js +0 -1
- package/lib/layout/flex-stack/flex-stack.js +4 -18
- package/lib/layout/flex-stack/flex-stack.stories.js +0 -6
- package/lib/layout/flex-stack/index.js +0 -2
- package/lib/layout/footer/footer.js +1 -16
- package/lib/layout/footer/footer.stories.js +0 -5
- package/lib/layout/footer/index.js +0 -1
- package/lib/layout/header/header.js +3 -13
- package/lib/layout/header/header.stories.js +0 -7
- package/lib/layout/header/index.js +0 -1
- package/lib/layout/index.js +0 -7
- package/lib/layout/separator.js +2 -14
- package/lib/layout/stack/index.js +0 -2
- package/lib/layout/stack/stack.js +4 -18
- package/lib/layout/stack/stack.stories.js +0 -6
- package/lib/layout/sub-header/index.js +0 -2
- package/lib/layout/sub-header/sub-header.js +6 -16
- package/lib/layout/sub-header/sub-header.stories.js +0 -6
- package/lib/prototypes/typography.stories.js +29 -12
- package/lib/query-state.js +5 -28
- package/lib/stories/index.js +0 -2
- package/lib/stories/wrapper.js +0 -9
- package/lib/ui/alert/alert.js +2 -10
- package/lib/ui/alert/alert.stories.js +0 -5
- package/lib/ui/alert/index.js +0 -2
- package/lib/ui/container/container.js +2 -15
- package/lib/ui/container/container.stories.js +0 -4
- package/lib/ui/container/index.js +0 -1
- package/lib/ui/dropdown/dropdown.js +5 -20
- package/lib/ui/dropdown/dropdown.stories.js +0 -5
- package/lib/ui/dropdown/index.js +0 -2
- package/lib/ui/empty-set/empty-set.js +3 -17
- package/lib/ui/empty-set/empty-set.stories.js +0 -5
- package/lib/ui/empty-set/index.js +0 -2
- package/lib/ui/file-name/file-name.js +2 -11
- package/lib/ui/file-name/file-name.stories.js +0 -4
- package/lib/ui/file-name/index.js +0 -1
- package/lib/ui/filters/filters.js +29 -73
- package/lib/ui/filters/filters.stories.js +7 -28
- package/lib/ui/filters/filters.utils.js +13 -42
- package/lib/ui/filters/index.js +8 -35
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.js +18 -61
- package/lib/ui/horizontal-bar-chart/horizontal-bar-chart.stories.js +0 -5
- package/lib/ui/horizontal-bar-chart/index.js +0 -2
- package/lib/ui/hover-card/hover-card.js +8 -28
- package/lib/ui/hover-card/hover-card.stories.js +0 -10
- package/lib/ui/hover-card/index.js +0 -2
- package/lib/ui/icon/icon.js +4 -17
- package/lib/ui/icon/icon.stories.js +0 -8
- package/lib/ui/icon/index.js +0 -2
- package/lib/ui/index.js +0 -19
- package/lib/ui/input/index.js +0 -2
- package/lib/ui/input/input.js +2 -14
- package/lib/ui/input/input.stories.js +0 -5
- package/lib/ui/loader/index.js +0 -2
- package/lib/ui/loader/loader.js +2 -15
- package/lib/ui/loader/loader.stories.js +0 -5
- package/lib/ui/logo/index.js +0 -1
- package/lib/ui/logo/logo.js +3 -28
- package/lib/ui/logo/logo.stories.js +1 -10
- package/lib/ui/panels/index.js +0 -1
- package/lib/ui/panels/panels.js +5 -23
- package/lib/ui/panels/panels.stories.js +0 -5
- package/lib/ui/skeleton/index.js +0 -2
- package/lib/ui/skeleton/skeleton.js +3 -15
- package/lib/ui/skeleton/skeleton.stories.js +0 -8
- package/lib/ui/sort-dropdown/index.js +0 -2
- package/lib/ui/sort-dropdown/sort-dropdown.js +18 -50
- package/lib/ui/sort-dropdown/sort-dropdown.stories.js +1 -5
- package/lib/ui/table/index.js +0 -2
- package/lib/ui/table/table.js +4 -13
- package/lib/ui/table/table.stories.js +4 -9
- package/lib/ui/tabs/index.js +0 -1
- package/lib/ui/tabs/tabs.js +5 -21
- package/lib/ui/tabs/tabs.module.css +6 -2
- package/lib/ui/tabs/tabs.stories.js +0 -5
- package/lib/ui/tag/index.js +0 -2
- package/lib/ui/tag/tag.js +8 -21
- package/lib/ui/tag/tag.stories.js +0 -6
- package/lib/ui/toolbar/index.js +0 -2
- package/lib/ui/toolbar/toolbar.js +2 -9
- package/lib/ui/toolbar/toolbar.stories.js +0 -5
- package/lib/ui/tooltip/index.js +0 -2
- package/lib/ui/tooltip/tooltip.js +8 -21
- package/lib/ui/tooltip/tooltip.stories.js +0 -7
- package/lib/utils.js +0 -18
- package/lib-esm/app/app.js +1 -18
- package/lib-esm/app/app.stories.js +3 -5
- package/lib-esm/app/header/header.js +1 -1
- package/lib-esm/components/asset-info/asset-info.js +0 -8
- package/lib-esm/components/browsertime-table/browsertime-table.js +0 -1
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +2 -14
- package/lib-esm/components/bundle-assets/bundle-assets.stories.js +0 -2
- package/lib-esm/components/bundle-assets/bundle-assets.utils.js +4 -11
- package/lib-esm/components/bundle-assets/index.js +0 -1
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +0 -7
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +1 -4
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.stories.js +0 -2
- package/lib-esm/components/bundle-modules/bundle-modules.js +4 -16
- package/lib-esm/components/bundle-modules/bundle-modules.stories.js +4 -2
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +15 -25
- package/lib-esm/components/bundle-modules/index.js +0 -6
- package/lib-esm/components/bundle-packages/bundle-packages.js +2 -11
- package/lib-esm/components/bundle-packages/bundle-packages.utils.js +4 -8
- package/lib-esm/components/bundle-packages/index.js +0 -1
- package/lib-esm/components/component-link.js +1 -2
- package/lib-esm/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/lib-esm/components/job-header/job-header.js +1 -3
- package/lib-esm/components/job-meta/job-meta.js +0 -3
- package/lib-esm/components/job-name/job-name.js +0 -4
- package/lib-esm/components/jobs-header/jobs-header.js +0 -1
- package/lib-esm/components/lighthouse-table/lighthouse-table.js +0 -1
- package/lib-esm/components/metric/metric.js +2 -6
- package/lib-esm/components/metrics-table/metrics-table.js +14 -18
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +0 -3
- package/lib-esm/components/metrics-table-search/metrics-table-search.js +4 -2
- package/lib-esm/components/metrics-table-search/metrics-table-search.stories.js +0 -2
- package/lib-esm/components/module-info/module-info.js +0 -4
- package/lib-esm/components/summary/summary.js +0 -2
- package/lib-esm/components/summary/summary.module.css +4 -1
- package/lib-esm/components/summary/summary.stories.js +0 -1
- package/lib-esm/components/summary-item/summary-item.js +0 -9
- package/lib-esm/constants.js +2 -1
- package/lib-esm/css/default.css +3 -1
- package/lib-esm/css/variables.css +56 -56
- package/lib-esm/hooks/rows-filter.js +0 -1
- package/lib-esm/hooks/search-params.js +9 -17
- package/lib-esm/layout/box/box.js +0 -6
- package/lib-esm/layout/flex-stack/flex-stack.js +0 -1
- package/lib-esm/layout/footer/footer.js +1 -4
- package/lib-esm/layout/header/header.js +0 -3
- package/lib-esm/layout/separator.js +1 -2
- package/lib-esm/layout/stack/stack.js +0 -1
- package/lib-esm/prototypes/typography.stories.js +27 -2
- package/lib-esm/query-state.js +2 -5
- package/lib-esm/stories/wrapper.js +0 -1
- package/lib-esm/ui/container/container.js +0 -2
- package/lib-esm/ui/dropdown/dropdown.js +0 -5
- package/lib-esm/ui/file-name/file-name.js +0 -2
- package/lib-esm/ui/filters/filters.js +4 -14
- package/lib-esm/ui/filters/filters.stories.js +5 -4
- package/lib-esm/ui/filters/filters.utils.js +9 -15
- package/lib-esm/ui/filters/index.js +4 -10
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +0 -12
- package/lib-esm/ui/hover-card/hover-card.js +2 -12
- package/lib-esm/ui/hover-card/hover-card.stories.js +0 -3
- package/lib-esm/ui/icon/icon.js +0 -1
- package/lib-esm/ui/icon/icon.stories.js +0 -2
- package/lib-esm/ui/input/input.js +0 -1
- package/lib-esm/ui/loader/loader.js +0 -2
- package/lib-esm/ui/logo/logo.js +0 -11
- package/lib-esm/ui/logo/logo.stories.js +1 -5
- package/lib-esm/ui/panels/panels.js +2 -5
- package/lib-esm/ui/skeleton/skeleton.js +0 -1
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +0 -8
- package/lib-esm/ui/sort-dropdown/sort-dropdown.stories.js +1 -0
- package/lib-esm/ui/table/table.js +0 -2
- package/lib-esm/ui/tabs/tabs.js +0 -4
- package/lib-esm/ui/tabs/tabs.module.css +6 -2
- package/lib-esm/ui/tag/tag.js +0 -1
- package/lib-esm/ui/tooltip/tooltip.js +1 -2
- package/lib-esm/ui/tooltip/tooltip.stories.js +0 -2
- package/lib-esm/utils.js +2 -9
- package/package.json +15 -15
- package/src/components/duplicate-packages-warning/duplicate-packages-warning.module.css +1 -0
- package/src/components/summary/summary.module.css +4 -1
- package/src/css/default.css +3 -1
- package/src/css/variables.css +56 -56
- package/src/ui/tabs/tabs.module.css +6 -2
|
@@ -9,11 +9,12 @@ export const addRowSourceFlag = row => {
|
|
|
9
9
|
const {
|
|
10
10
|
key,
|
|
11
11
|
runs
|
|
12
|
-
} = row;
|
|
13
|
-
// eslint-disable-next-line no-param-reassign
|
|
14
|
-
|
|
15
|
-
row.thirdParty = Boolean(key.match(MODULE_PATH_PACKAGES)); // eslint-disable-next-line no-param-reassign
|
|
12
|
+
} = row;
|
|
16
13
|
|
|
14
|
+
// @NOTE Assign instead destructuring for perf reasons
|
|
15
|
+
// eslint-disable-next-line no-param-reassign
|
|
16
|
+
row.thirdParty = Boolean(key.match(MODULE_PATH_PACKAGES));
|
|
17
|
+
// eslint-disable-next-line no-param-reassign
|
|
17
18
|
row.duplicated = Boolean(runs.find(run => (run == null ? void 0 : run.duplicated) === true));
|
|
18
19
|
return row;
|
|
19
20
|
};
|
|
@@ -21,40 +22,35 @@ export const getCustomSort = sortBy => item => {
|
|
|
21
22
|
if (sortBy === SORT_BY_NAME) {
|
|
22
23
|
return item.key;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
25
|
if (sortBy === SORT_BY_SIZE) {
|
|
26
26
|
return _get(item, 'runs[0].value', 0);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
if (sortBy === SORT_BY_DELTA) {
|
|
30
29
|
return _get(item, 'runs[0].deltaPercentage', 0);
|
|
31
30
|
}
|
|
32
|
-
|
|
33
31
|
return [!item.changed, item.key];
|
|
34
32
|
};
|
|
35
33
|
export const getRowFilter = filters => row => {
|
|
36
34
|
// Skip not changed rows
|
|
37
35
|
if (filters[MODULE_FILTERS.CHANGED] && !row.changed) {
|
|
38
36
|
return false;
|
|
39
|
-
}
|
|
40
|
-
|
|
37
|
+
}
|
|
41
38
|
|
|
39
|
+
// Skip not duplicated rows
|
|
42
40
|
if (filters[MODULE_FILTERS.DUPLICATED] && !row.duplicated) {
|
|
43
41
|
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
42
|
+
}
|
|
46
43
|
|
|
44
|
+
// Skip not matching source type
|
|
47
45
|
if (!(filters[`${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.FIRST_PARTY}`] && row.thirdParty === false || filters[`${MODULE_SOURCE_TYPE}.${MODULE_FILTERS.THIRD_PARTY}`] && row.thirdParty === true)) {
|
|
48
46
|
return false;
|
|
49
|
-
}
|
|
50
|
-
|
|
47
|
+
}
|
|
51
48
|
|
|
49
|
+
// Skip not matching source file types
|
|
52
50
|
const fileType = getModuleSourceFileType(row.key);
|
|
53
|
-
|
|
54
51
|
if (!filters[`${MODULE_FILE_TYPE}.${fileType}`]) {
|
|
55
52
|
return false;
|
|
56
53
|
}
|
|
57
|
-
|
|
58
54
|
return true;
|
|
59
55
|
};
|
|
60
56
|
export const useModuleFilterByChunk = _ref => {
|
|
@@ -69,37 +65,31 @@ export const useModuleFilterByChunk = _ref => {
|
|
|
69
65
|
if (_get(filters, `${MODULE_CHUNK}.${chunkId}`)) {
|
|
70
66
|
return [...agg, chunkId];
|
|
71
67
|
}
|
|
72
|
-
|
|
73
68
|
return agg;
|
|
74
|
-
}, []);
|
|
69
|
+
}, []);
|
|
75
70
|
|
|
71
|
+
// If all the filters are included, return jobs as they are
|
|
76
72
|
if (includedChunkIds.length === chunkIds.length) {
|
|
77
73
|
return jobs;
|
|
78
74
|
}
|
|
79
|
-
|
|
80
75
|
const jobsWithFilteredData = jobs.map(job => {
|
|
81
76
|
var _job$metrics, _job$metrics$webpack;
|
|
82
|
-
|
|
83
77
|
const modules = job == null ? void 0 : (_job$metrics = job.metrics) == null ? void 0 : (_job$metrics$webpack = _job$metrics.webpack) == null ? void 0 : _job$metrics$webpack.modules;
|
|
84
|
-
|
|
85
78
|
if (!modules) {
|
|
86
79
|
return job;
|
|
87
80
|
}
|
|
88
|
-
|
|
89
81
|
const filteredModules = Object.entries(modules).reduce((agg, _ref2) => {
|
|
90
82
|
let [moduleId, moduleEntry] = _ref2;
|
|
91
|
-
|
|
92
83
|
const match = _intersection(moduleEntry.chunkIds, includedChunkIds);
|
|
93
|
-
|
|
94
84
|
if (match.length > 0) {
|
|
95
85
|
agg[moduleId] = moduleEntry; // eslint-disable-line no-param-reassign
|
|
96
86
|
}
|
|
97
87
|
|
|
98
88
|
return agg;
|
|
99
|
-
}, {});
|
|
89
|
+
}, {});
|
|
100
90
|
|
|
91
|
+
// Copy job data into a new object to prevent mutations of the original data
|
|
101
92
|
const newJob = _merge({}, job);
|
|
102
|
-
|
|
103
93
|
newJob.metrics.webpack.modules = filteredModules;
|
|
104
94
|
return newJob;
|
|
105
95
|
});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _map from "lodash/map";
|
|
2
2
|
import _uniqBy from "lodash/uniqBy";
|
|
3
|
-
|
|
4
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
|
|
6
4
|
import React, { useMemo } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
8
6
|
import { MODULE_FILTERS, getModuleChunkFilters, getModuleSourceTypeFilters, getModuleFileTypeFilters } from '@bundle-stats/utils';
|
|
@@ -23,10 +21,8 @@ export const BundleModules = props => {
|
|
|
23
21
|
direction,
|
|
24
22
|
...restProps
|
|
25
23
|
} = props;
|
|
26
|
-
|
|
27
24
|
const chunks = _uniqBy(jobs.map(job => {
|
|
28
25
|
var _job$meta, _job$meta$webpack;
|
|
29
|
-
|
|
30
26
|
return (job == null ? void 0 : (_job$meta = job.meta) == null ? void 0 : (_job$meta$webpack = _job$meta.webpack) == null ? void 0 : _job$meta$webpack.chunks) || [];
|
|
31
27
|
}).flat(), _ref => {
|
|
32
28
|
let {
|
|
@@ -34,9 +30,7 @@ export const BundleModules = props => {
|
|
|
34
30
|
} = _ref;
|
|
35
31
|
return id;
|
|
36
32
|
});
|
|
37
|
-
|
|
38
33
|
const chunkIds = _map(chunks, 'id');
|
|
39
|
-
|
|
40
34
|
const {
|
|
41
35
|
defaultFilters,
|
|
42
36
|
allEntriesFilters
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -21,7 +20,6 @@ import { MetricsTableSearch } from '../metrics-table-search';
|
|
|
21
20
|
import { MetricsTableOptions } from '../metrics-table-options';
|
|
22
21
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
23
22
|
import css from './bundle-packages.module.css';
|
|
24
|
-
|
|
25
23
|
const getDropdownFilters = _ref => {
|
|
26
24
|
let {
|
|
27
25
|
compareMode,
|
|
@@ -39,7 +37,6 @@ const getDropdownFilters = _ref => {
|
|
|
39
37
|
}
|
|
40
38
|
};
|
|
41
39
|
};
|
|
42
|
-
|
|
43
40
|
const PackagePopoverContent = _ref2 => {
|
|
44
41
|
let {
|
|
45
42
|
name,
|
|
@@ -84,7 +81,6 @@ const PackagePopoverContent = _ref2 => {
|
|
|
84
81
|
className: css.packageHoverCardActions
|
|
85
82
|
}, duplicate && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CustomComponentLink, getBundlePackagesByNameComponentLink(normalizedName), "View all duplicate instances")), /*#__PURE__*/React.createElement(CustomComponentLink, getBundleModulesBySearch(normalizedPackagePath), "Search modules by package path")));
|
|
86
83
|
};
|
|
87
|
-
|
|
88
84
|
PackagePopoverContent.propTypes = {
|
|
89
85
|
name: PropTypes.string.isRequired,
|
|
90
86
|
path: PropTypes.string,
|
|
@@ -95,7 +91,6 @@ PackagePopoverContent.propTypes = {
|
|
|
95
91
|
PackagePopoverContent.defaultProps = {
|
|
96
92
|
path: ''
|
|
97
93
|
};
|
|
98
|
-
|
|
99
94
|
const PackageName = _ref3 => {
|
|
100
95
|
let {
|
|
101
96
|
packageName,
|
|
@@ -114,14 +109,12 @@ const PackageName = _ref3 => {
|
|
|
114
109
|
}), /*#__PURE__*/React.createElement("span", {
|
|
115
110
|
className: css.packageNameLabel
|
|
116
111
|
}, packageName)), [packageName, showDuplicateFlag, row]);
|
|
117
|
-
|
|
118
112
|
if (!showHoverCard) {
|
|
119
113
|
return /*#__PURE__*/React.createElement("span", {
|
|
120
114
|
className: css.packageName,
|
|
121
115
|
onMouseEnter: handleOnMouseEnter
|
|
122
116
|
}, label);
|
|
123
117
|
}
|
|
124
|
-
|
|
125
118
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
126
119
|
className: css.packageName,
|
|
127
120
|
label: /*#__PURE__*/React.createElement("span", {
|
|
@@ -135,7 +128,6 @@ const PackageName = _ref3 => {
|
|
|
135
128
|
CustomComponentLink: CustomComponentLink
|
|
136
129
|
}));
|
|
137
130
|
};
|
|
138
|
-
|
|
139
131
|
PackageName.propTypes = {
|
|
140
132
|
packageName: PropTypes.string.isRequired,
|
|
141
133
|
path: PropTypes.string.isRequired,
|
|
@@ -149,7 +141,6 @@ PackageName.propTypes = {
|
|
|
149
141
|
}).isRequired,
|
|
150
142
|
CustomComponentLink: PropTypes.elementType.isRequired
|
|
151
143
|
};
|
|
152
|
-
|
|
153
144
|
const RowHeader = _ref4 => {
|
|
154
145
|
let {
|
|
155
146
|
row,
|
|
@@ -163,14 +154,14 @@ const RowHeader = _ref4 => {
|
|
|
163
154
|
className: css.packageNames
|
|
164
155
|
}, packageNames.map((packageName, index) => /*#__PURE__*/React.createElement(PackageName, {
|
|
165
156
|
packageName: packageName,
|
|
166
|
-
path: path
|
|
157
|
+
path: path
|
|
158
|
+
// Render duplicate flag only for the last entry
|
|
167
159
|
,
|
|
168
160
|
showDuplicateFlag: index === packageNames.length - 1,
|
|
169
161
|
row: row,
|
|
170
162
|
CustomComponentLink: CustomComponentLink
|
|
171
163
|
})));
|
|
172
164
|
};
|
|
173
|
-
|
|
174
165
|
RowHeader.propTypes = {
|
|
175
166
|
row: PropTypes.shape({
|
|
176
167
|
label: PropTypes.string,
|
|
@@ -2,12 +2,12 @@ import _uniq from "lodash/uniq";
|
|
|
2
2
|
import _flatten from "lodash/flatten";
|
|
3
3
|
import _get from "lodash/get";
|
|
4
4
|
import { PACKAGE_FILTERS } from '@bundle-stats/utils';
|
|
5
|
-
import { SORT_BY_NAME, SORT_BY_DELTA, SORT_BY_SIZE } from './bundle-packages.constants';
|
|
5
|
+
import { SORT_BY_NAME, SORT_BY_DELTA, SORT_BY_SIZE } from './bundle-packages.constants';
|
|
6
6
|
|
|
7
|
+
// Get a list of duplicate packages across jobs
|
|
7
8
|
export const getDuplicatePackages = jobs => {
|
|
8
9
|
const jobsDuplicatePackages = jobs.map(job => {
|
|
9
10
|
var _job$insights, _job$insights$webpack, _job$insights$webpack2;
|
|
10
|
-
|
|
11
11
|
const insightsData = (job == null ? void 0 : (_job$insights = job.insights) == null ? void 0 : (_job$insights$webpack = _job$insights.webpack) == null ? void 0 : (_job$insights$webpack2 = _job$insights$webpack.duplicatePackages) == null ? void 0 : _job$insights$webpack2.data) || {};
|
|
12
12
|
return Object.values(insightsData).flat();
|
|
13
13
|
});
|
|
@@ -17,28 +17,24 @@ export const getRowFilter = filters => item => {
|
|
|
17
17
|
if (filters[PACKAGE_FILTERS.CHANGED] && !item.changed) {
|
|
18
18
|
return false;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
20
|
if (filters[PACKAGE_FILTERS.DUPLICATE] && !item.duplicate) {
|
|
22
21
|
return false;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
return true;
|
|
26
24
|
};
|
|
27
25
|
export const getCustomSort = sortId => item => {
|
|
28
26
|
if (sortId === SORT_BY_NAME) {
|
|
29
27
|
return item.key;
|
|
30
28
|
}
|
|
31
|
-
|
|
32
29
|
if (sortId === SORT_BY_DELTA) {
|
|
33
30
|
return _get(item, 'runs[0].deltaPercentage', 0);
|
|
34
31
|
}
|
|
35
|
-
|
|
36
32
|
if (sortId === SORT_BY_SIZE) {
|
|
37
33
|
return _get(item, 'runs[0].value', 0);
|
|
38
34
|
}
|
|
39
|
-
|
|
40
35
|
return [!item.changed, item.key];
|
|
41
36
|
};
|
|
42
|
-
export const getAddRowDuplicateFlag = duplicateJobs => row => ({
|
|
37
|
+
export const getAddRowDuplicateFlag = duplicateJobs => row => ({
|
|
38
|
+
...row,
|
|
43
39
|
duplicate: duplicateJobs.includes(row.key)
|
|
44
40
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React, { useMemo } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { PACKAGE_FILTERS } from '@bundle-stats/utils';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { Link } from 'react-router-dom';
|
|
@@ -26,8 +25,8 @@ ComponentLink.propTypes = {
|
|
|
26
25
|
section: PropTypes.string.isRequired,
|
|
27
26
|
title: PropTypes.string,
|
|
28
27
|
params: PropTypes.object // eslint-disable-line react/forbid-prop-types
|
|
29
|
-
|
|
30
28
|
};
|
|
29
|
+
|
|
31
30
|
ComponentLink.defaultProps = {
|
|
32
31
|
title: '',
|
|
33
32
|
params: {}
|
|
@@ -16,12 +16,10 @@ export const JobHeader = props => {
|
|
|
16
16
|
job,
|
|
17
17
|
children
|
|
18
18
|
} = props;
|
|
19
|
-
|
|
20
19
|
const {
|
|
21
20
|
builtAt,
|
|
22
21
|
hash
|
|
23
22
|
} = _get(job, `meta.${SOURCE_PATH_WEBPACK_STATS}`, {});
|
|
24
|
-
|
|
25
23
|
const rootClassName = cx(css.root, className);
|
|
26
24
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
27
25
|
className: rootClassName,
|
|
@@ -64,8 +62,8 @@ JobHeader.propTypes = {
|
|
|
64
62
|
builtAt: PropTypes.string
|
|
65
63
|
}),
|
|
66
64
|
summary: PropTypes.object // eslint-disable-line react/forbid-prop-types
|
|
67
|
-
|
|
68
65
|
}),
|
|
66
|
+
|
|
69
67
|
children: PropTypes.element
|
|
70
68
|
};
|
|
71
69
|
JobHeader.defaultProps = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import cx from 'classnames';
|
|
@@ -31,13 +30,11 @@ export const JobMeta = props => {
|
|
|
31
30
|
JobMeta.propTypes = {
|
|
32
31
|
/** Adopted child class name */
|
|
33
32
|
className: PropTypes.string,
|
|
34
|
-
|
|
35
33
|
/** Contrnt */
|
|
36
34
|
meta: PropTypes.arrayOf(PropTypes.shape({
|
|
37
35
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
38
36
|
content: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.element]))
|
|
39
37
|
})).isRequired,
|
|
40
|
-
|
|
41
38
|
/** Render component */
|
|
42
39
|
as: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
43
40
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { Tooltip } from '../../ui/tooltip';
|
|
@@ -27,13 +26,10 @@ JobName.defaultProps = {
|
|
|
27
26
|
JobName.propTypes = {
|
|
28
27
|
/** Rendered component */
|
|
29
28
|
as: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
30
|
-
|
|
31
29
|
/** Tooltip title */
|
|
32
30
|
title: PropTypes.string,
|
|
33
|
-
|
|
34
31
|
/** Job internal build number */
|
|
35
32
|
internalBuildNumber: PropTypes.number,
|
|
36
|
-
|
|
37
33
|
/** Render function */
|
|
38
34
|
children: PropTypes.node
|
|
39
35
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
|
-
import css from './metric.module.css';
|
|
4
|
+
import css from './metric.module.css';
|
|
5
5
|
|
|
6
|
+
// Separate value and unit
|
|
6
7
|
const EXTRACT_VALUE_UNIT_PATTERN = /([\d|.|,| ]*)(\w*|%)$/;
|
|
7
8
|
export const Metric = _ref => {
|
|
8
9
|
let {
|
|
@@ -18,27 +19,22 @@ export const Metric = _ref => {
|
|
|
18
19
|
displayUnit
|
|
19
20
|
} = useMemo(() => {
|
|
20
21
|
const formattedValue = formatter == null ? void 0 : formatter(value);
|
|
21
|
-
|
|
22
22
|
if (!formattedValue) {
|
|
23
23
|
return {
|
|
24
24
|
displayValue: value
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
if (!enhanced) {
|
|
29
28
|
return {
|
|
30
29
|
displayValue: formattedValue
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
|
|
34
32
|
const matches = formattedValue.match(EXTRACT_VALUE_UNIT_PATTERN);
|
|
35
|
-
|
|
36
33
|
if (!matches) {
|
|
37
34
|
return {
|
|
38
35
|
displayValue: value
|
|
39
36
|
};
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
return {
|
|
43
39
|
displayUnit: matches[2],
|
|
44
40
|
displayValue: matches[1]
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _sum from "lodash/sum";
|
|
2
2
|
import _isEmpty from "lodash/isEmpty";
|
|
3
3
|
import _get from "lodash/get";
|
|
4
|
-
|
|
5
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
-
|
|
7
5
|
import React, { useMemo } from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import cx from 'classnames';
|
|
@@ -14,13 +12,10 @@ import { Delta } from '../delta';
|
|
|
14
12
|
import { JobName } from '../job-name';
|
|
15
13
|
import styles from './metrics-table.module.css';
|
|
16
14
|
const METRIC_TYPE_DATA = getGlobalMetricType(null, METRIC_TYPE_FILE_SIZE);
|
|
17
|
-
|
|
18
15
|
const getRowsRunTotal = (rows, runIndex) => _sum(rows.map(row => _get(row, `runs[${runIndex}].value`, 0)));
|
|
19
|
-
|
|
20
16
|
const getHeaderLabelCells = rows => (run, runIndex, runs) => {
|
|
21
17
|
const isBaseline = runIndex === runs.length - 1;
|
|
22
18
|
const className = cx(styles.value, isBaseline ? styles.baseline : styles.current);
|
|
23
|
-
|
|
24
19
|
if (!run) {
|
|
25
20
|
return [{
|
|
26
21
|
children: '-',
|
|
@@ -30,7 +25,6 @@ const getHeaderLabelCells = rows => (run, runIndex, runs) => {
|
|
|
30
25
|
className: styles.delta
|
|
31
26
|
}] : [])];
|
|
32
27
|
}
|
|
33
|
-
|
|
34
28
|
const {
|
|
35
29
|
label,
|
|
36
30
|
internalBuildNumber
|
|
@@ -40,31 +34,34 @@ const getHeaderLabelCells = rows => (run, runIndex, runs) => {
|
|
|
40
34
|
internalBuildNumber: internalBuildNumber,
|
|
41
35
|
className: styles.jobName
|
|
42
36
|
}, label);
|
|
43
|
-
return [
|
|
37
|
+
return [
|
|
38
|
+
// Value column
|
|
44
39
|
{
|
|
45
40
|
children: jobName,
|
|
46
41
|
className
|
|
47
|
-
},
|
|
42
|
+
},
|
|
43
|
+
// Delta column
|
|
48
44
|
...(!isBaseline ? [{
|
|
49
45
|
children: ' ',
|
|
50
46
|
className: cx(styles.delta)
|
|
51
47
|
}] : [])];
|
|
52
48
|
};
|
|
53
|
-
|
|
54
49
|
const getHeaderTotalCells = rows => (run, runIndex, runs) => {
|
|
55
50
|
const isBaseline = runIndex === runs.length - 1;
|
|
56
51
|
const className = cx(styles.value, isBaseline ? styles.baseline : styles.current);
|
|
57
52
|
const currentRunTotal = getRowsRunTotal(rows, runIndex);
|
|
58
53
|
const baselineRunTotal = !isBaseline && getRowsRunTotal(rows, runIndex + 1);
|
|
59
54
|
const infoTotal = getMetricRunInfo(METRIC_TYPE_DATA, currentRunTotal, baselineRunTotal);
|
|
60
|
-
return [
|
|
55
|
+
return [
|
|
56
|
+
// Value column
|
|
61
57
|
{
|
|
62
58
|
children: /*#__PURE__*/React.createElement(Metric, {
|
|
63
59
|
className: styles.tableHeaderRunMetric,
|
|
64
60
|
value: infoTotal.displayValue
|
|
65
61
|
}),
|
|
66
62
|
className
|
|
67
|
-
},
|
|
63
|
+
},
|
|
64
|
+
// Delta column
|
|
68
65
|
...(!isBaseline ? [{
|
|
69
66
|
children: /*#__PURE__*/React.createElement(Delta, {
|
|
70
67
|
displayValue: infoTotal.displayDeltaPercentage,
|
|
@@ -73,21 +70,21 @@ const getHeaderTotalCells = rows => (run, runIndex, runs) => {
|
|
|
73
70
|
className: styles.delta
|
|
74
71
|
}] : [])];
|
|
75
72
|
};
|
|
76
|
-
|
|
77
73
|
const getHeaderRows = (runs, items, showHeaderSum, title) => [{
|
|
78
74
|
className: styles.headerRowColumns,
|
|
79
|
-
cells: [
|
|
75
|
+
cells: [
|
|
76
|
+
// Metric name column - one empty strying to render the column
|
|
80
77
|
{
|
|
81
78
|
children: title || ' ',
|
|
82
79
|
className: styles.metricName,
|
|
83
80
|
rowSpan: showHeaderSum ? 2 : 1
|
|
84
|
-
},
|
|
81
|
+
},
|
|
82
|
+
// Runs
|
|
85
83
|
...runs.map(getHeaderLabelCells(items)).flat()]
|
|
86
84
|
}, ...(showHeaderSum ? [{
|
|
87
85
|
className: styles.headerRowTotals,
|
|
88
86
|
cells: runs.map(getHeaderTotalCells(items)).flat()
|
|
89
87
|
}] : [])];
|
|
90
|
-
|
|
91
88
|
const MetricsTableRow = _ref => {
|
|
92
89
|
let {
|
|
93
90
|
item,
|
|
@@ -99,8 +96,9 @@ const MetricsTableRow = _ref => {
|
|
|
99
96
|
className: styles.metricName
|
|
100
97
|
}, renderRowHeader(item)), item.runs.map((run, index) => {
|
|
101
98
|
const isBaseline = index === item.runs.length - 1;
|
|
102
|
-
const valueClassName = cx(styles.value, !isBaseline && styles.current);
|
|
99
|
+
const valueClassName = cx(styles.value, !isBaseline && styles.current);
|
|
103
100
|
|
|
101
|
+
// Empty cells if no value
|
|
104
102
|
if (!run || typeof run.value === 'undefined') {
|
|
105
103
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table.Td, {
|
|
106
104
|
className: valueClassName
|
|
@@ -108,7 +106,6 @@ const MetricsTableRow = _ref => {
|
|
|
108
106
|
className: styles.delta
|
|
109
107
|
}));
|
|
110
108
|
}
|
|
111
|
-
|
|
112
109
|
const {
|
|
113
110
|
displayValue,
|
|
114
111
|
deltaPercentage,
|
|
@@ -127,7 +124,6 @@ const MetricsTableRow = _ref => {
|
|
|
127
124
|
})));
|
|
128
125
|
}));
|
|
129
126
|
};
|
|
130
|
-
|
|
131
127
|
MetricsTableRow.propTypes = {
|
|
132
128
|
item: PropTypes.shape({
|
|
133
129
|
changed: PropTypes.bool,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import I18N from '../../i18n';
|
|
@@ -20,12 +19,10 @@ export const MetricsTableOptions = props => {
|
|
|
20
19
|
menu,
|
|
21
20
|
menuItemClassName
|
|
22
21
|
} = _ref;
|
|
23
|
-
|
|
24
22
|
const getButtonOnClick = handler => () => {
|
|
25
23
|
handler();
|
|
26
24
|
menu.toggle();
|
|
27
25
|
};
|
|
28
|
-
|
|
29
26
|
return /*#__PURE__*/React.createElement(React.Fragment, null, handleResetFilters && /*#__PURE__*/React.createElement(MenuItem, _extends({}, menu, {
|
|
30
27
|
className: menuItemClassName,
|
|
31
28
|
onClick: getButtonOnClick(handleResetFilters)
|
|
@@ -13,16 +13,18 @@ export const MetricsTableSearch = props => {
|
|
|
13
13
|
updateSearch
|
|
14
14
|
} = props;
|
|
15
15
|
const rootClassname = cx(css.root, className);
|
|
16
|
-
const [value, setValue] = useState(search);
|
|
16
|
+
const [value, setValue] = useState(search);
|
|
17
17
|
|
|
18
|
+
// Update local state when initial value has changed
|
|
18
19
|
useEffect(() => {
|
|
19
20
|
setValue(search);
|
|
20
21
|
}, [search]);
|
|
21
22
|
const debouncedUpdateSearch = useCallback(_debounce(updateSearch, 500), []);
|
|
22
23
|
const handleChangeValue = useCallback(event => {
|
|
23
24
|
const newValue = event.target.value;
|
|
24
|
-
setValue(newValue);
|
|
25
|
+
setValue(newValue);
|
|
25
26
|
|
|
27
|
+
// Update parent state when the local value has changed
|
|
26
28
|
if (newValue !== search) {
|
|
27
29
|
debouncedUpdateSearch(newValue);
|
|
28
30
|
}
|
|
@@ -4,7 +4,6 @@ import { getWrapperDecorator } from '../../stories';
|
|
|
4
4
|
import { MetricsTableSearch } from '.';
|
|
5
5
|
const stories = storiesOf('Components/MetricsTableSearch', module);
|
|
6
6
|
stories.addDecorator(getWrapperDecorator());
|
|
7
|
-
|
|
8
7
|
const MetricsTableWithState = () => {
|
|
9
8
|
const [search, updateSearch] = useState('');
|
|
10
9
|
return /*#__PURE__*/React.createElement(MetricsTableSearch, {
|
|
@@ -13,5 +12,4 @@ const MetricsTableWithState = () => {
|
|
|
13
12
|
updateSearch: updateSearch
|
|
14
13
|
});
|
|
15
14
|
};
|
|
16
|
-
|
|
17
15
|
stories.add('default', () => /*#__PURE__*/React.createElement(MetricsTableWithState, null));
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _noop from "lodash/noop";
|
|
2
2
|
import _find from "lodash/find";
|
|
3
3
|
import _isEmpty from "lodash/isEmpty";
|
|
4
|
-
|
|
5
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
-
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
9
7
|
import { getBundleModulesByChunk } from '@bundle-stats/utils';
|
|
@@ -38,11 +36,9 @@ export const ModuleInfo = props => {
|
|
|
38
36
|
const chunk = _find(chunks, {
|
|
39
37
|
id: chunkId
|
|
40
38
|
});
|
|
41
|
-
|
|
42
39
|
if (!chunk) {
|
|
43
40
|
return null;
|
|
44
41
|
}
|
|
45
|
-
|
|
46
42
|
return /*#__PURE__*/React.createElement(CustomComponentLink, _extends({}, getBundleModulesByChunk(chunkIds, chunkId), {
|
|
47
43
|
onClick: onClick,
|
|
48
44
|
className: css.chunksItem
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
-
|
|
3
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
3
|
import React from 'react';
|
|
6
4
|
import PropTypes from 'prop-types';
|
|
7
5
|
import cx from 'classnames';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { storiesOf } from '@storybook/react';
|
|
5
4
|
import { createJobs } from '@bundle-stats/utils';
|