@bundle-stats/ui 3.2.1-alpha.0 → 3.2.1-beta.10
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/CHANGELOG.md +3 -1
- package/lib/components/browsertime-table/browsertime-table.stories.js +1 -0
- package/lib/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +17 -18
- package/lib/components/job-meta/job-meta.js +1 -1
- package/lib/components/summary/summary.js +52 -34
- package/lib/hooks/search-params.js +1 -1
- package/lib/layout/box/box.js +2 -2
- package/lib/layout/stack/stack.js +13 -3
- package/lib/utils.js +6 -3
- package/lib-esm/app/app.js +60 -50
- package/lib-esm/app/header/header.js +22 -19
- package/lib-esm/components/asset-info/asset-info.js +8 -6
- package/lib-esm/components/browsertime-table/browsertime-table.stories.js +2 -1
- package/lib-esm/components/bundle-assets/bundle-assets.js +93 -80
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +29 -26
- package/lib-esm/components/bundle-assets-totals-table/bundle-assets-totals-table.js +6 -5
- package/lib-esm/components/bundle-modules/bundle-modules.js +82 -67
- package/lib-esm/components/bundle-modules/bundle-modules.utils.js +9 -6
- package/lib-esm/components/bundle-modules/index.js +6 -3
- package/lib-esm/components/bundle-packages/bundle-packages.js +29 -24
- package/lib-esm/components/component-link.js +7 -6
- package/lib-esm/components/delta/delta.js +7 -6
- package/lib-esm/components/job-meta/job-meta.js +6 -5
- package/lib-esm/components/job-name/job-name.js +14 -11
- package/lib-esm/components/metric/metric.js +10 -9
- package/lib-esm/components/metrics-table/metrics-table.js +24 -20
- package/lib-esm/components/metrics-table-options/metrics-table-options.js +7 -5
- package/lib-esm/components/summary/summary.js +60 -30
- package/lib-esm/components/summary/summary.stories.js +11 -8
- package/lib-esm/components/summary-item/summary-item.js +18 -15
- package/lib-esm/components/total-size-type-title/total-size-type-title.js +17 -14
- package/lib-esm/hooks/rows-filter.js +7 -6
- package/lib-esm/hooks/rows-sort.js +8 -7
- package/lib-esm/hooks/search-params.js +74 -70
- package/lib-esm/layout/box/box.js +2 -2
- package/lib-esm/layout/footer/footer.js +33 -30
- package/lib-esm/layout/header/header.js +17 -14
- package/lib-esm/layout/header/header.stories.js +45 -30
- package/lib-esm/layout/stack/stack.js +6 -3
- package/lib-esm/prototypes/typography.stories.js +5 -4
- package/lib-esm/stories/wrapper.js +20 -14
- package/lib-esm/ui/container/container.js +12 -9
- package/lib-esm/ui/dropdown/dropdown.stories.js +9 -6
- package/lib-esm/ui/file-name/file-name.js +10 -7
- package/lib-esm/ui/filters/filters.container.js +14 -8
- package/lib-esm/ui/filters/filters.js +41 -19
- package/lib-esm/ui/filters/filters.stories.js +4 -3
- package/lib-esm/ui/filters/filters.utils.js +12 -6
- package/lib-esm/ui/horizontal-bar-chart/horizontal-bar-chart.js +7 -6
- package/lib-esm/ui/icon/icon.js +16 -13
- package/lib-esm/ui/input/input.js +6 -5
- package/lib-esm/ui/loader/loader.js +10 -7
- package/lib-esm/ui/logo/logo.js +7 -6
- package/lib-esm/ui/logo/logo.stories.js +7 -1
- package/lib-esm/ui/panels/panels.js +10 -7
- package/lib-esm/ui/popover/popover.js +8 -7
- package/lib-esm/ui/sort-dropdown/sort-dropdown.js +10 -7
- package/lib-esm/ui/table/table.js +8 -7
- package/lib-esm/ui/tabs/tabs.js +9 -6
- package/lib-esm/ui/toolbar/toolbar.stories.js +10 -7
- package/lib-esm/utils.js +13 -4
- package/package.json +19 -14
- package/src/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.jsx +15 -15
- package/src/components/job-meta/job-meta.jsx +1 -3
- package/src/components/summary/summary.jsx +26 -10
- package/src/hooks/search-params.js +1 -1
- package/src/layout/box/box.jsx +1 -1
- package/src/layout/stack/stack.jsx +2 -2
- package/src/utils.jsx +5 -3
|
@@ -29,32 +29,39 @@ const RUN_TITLE_CURRENT = 'Current';
|
|
|
29
29
|
const RUN_TITLE_BASELINE = 'Baseline';
|
|
30
30
|
const RUNS_LABELS = [RUN_TITLE_CURRENT, RUN_TITLE_BASELINE];
|
|
31
31
|
|
|
32
|
-
const getFileTypeFilters = filters => Object.entries(FILE_TYPE_LABELS).map(
|
|
33
|
-
[id]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
const getFileTypeFilters = filters => Object.entries(FILE_TYPE_LABELS).map(_ref => {
|
|
33
|
+
let [id, label] = _ref;
|
|
34
|
+
return {
|
|
35
|
+
[id]: {
|
|
36
|
+
label,
|
|
37
|
+
defaultValue: _get(filters, `${ASSET_FILE_TYPE}.${id}`, true)
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}).reduce((agg, current) => ({ ...agg,
|
|
38
41
|
...current
|
|
39
42
|
}), {});
|
|
40
43
|
|
|
41
|
-
const TooltipNotPredictive =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
}, /*#__PURE__*/React.createElement("
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
const TooltipNotPredictive = _ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
runs
|
|
47
|
+
} = _ref2;
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: css.tooltipNotPredictive
|
|
50
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
51
|
+
className: css.tooltipNotPredictiveText
|
|
52
|
+
}, "File name is the same, but the size has changed:"), /*#__PURE__*/React.createElement("table", {
|
|
53
|
+
className: css.tooltipTable
|
|
54
|
+
}, /*#__PURE__*/React.createElement("tr", null, runs.map((_ref3, index) => {
|
|
55
|
+
let {
|
|
56
|
+
name,
|
|
57
|
+
value
|
|
58
|
+
} = _ref3;
|
|
59
|
+
const key = index;
|
|
60
|
+
return /*#__PURE__*/React.createElement("tr", {
|
|
61
|
+
key: key
|
|
62
|
+
}, /*#__PURE__*/React.createElement("th", null, RUNS_LABELS[index]), /*#__PURE__*/React.createElement("td", null, name), /*#__PURE__*/React.createElement("td", null, value));
|
|
63
|
+
}))));
|
|
64
|
+
};
|
|
58
65
|
|
|
59
66
|
TooltipNotPredictive.defaultProps = {
|
|
60
67
|
runs: []
|
|
@@ -64,50 +71,53 @@ TooltipNotPredictive.propTypes = {
|
|
|
64
71
|
|
|
65
72
|
};
|
|
66
73
|
|
|
67
|
-
const getRenderRowHeader =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
74
|
+
const getRenderRowHeader = _ref4 => {
|
|
75
|
+
let {
|
|
76
|
+
labels,
|
|
77
|
+
CustomComponentLink,
|
|
78
|
+
chunks
|
|
79
|
+
} = _ref4;
|
|
80
|
+
return item => {
|
|
81
|
+
const {
|
|
82
|
+
label,
|
|
83
|
+
isNotPredictive,
|
|
84
|
+
runs,
|
|
85
|
+
isChunk,
|
|
86
|
+
isEntry,
|
|
87
|
+
isInitial
|
|
88
|
+
} = item;
|
|
89
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
90
|
+
label: /*#__PURE__*/React.createElement(FileName, {
|
|
91
|
+
name: label
|
|
92
|
+
}),
|
|
93
|
+
icon: /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: css.assetInfoFlags
|
|
95
|
+
}, isNotPredictive && /*#__PURE__*/React.createElement(Tooltip, {
|
|
96
|
+
className: css.notPredictive,
|
|
97
|
+
title: /*#__PURE__*/React.createElement(TooltipNotPredictive, {
|
|
98
|
+
runs: runs
|
|
99
|
+
})
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
101
|
+
className: css.notPredictiveIcon,
|
|
102
|
+
glyph: "warning"
|
|
103
|
+
})), isChunk && /*#__PURE__*/React.createElement("span", {
|
|
104
|
+
title: "Chunk",
|
|
105
|
+
className: css.flagChunk
|
|
106
|
+
}, "c"), isEntry && /*#__PURE__*/React.createElement("span", {
|
|
107
|
+
title: "Entrypoint",
|
|
108
|
+
className: css.flagEntry
|
|
109
|
+
}, "e"), isInitial && /*#__PURE__*/React.createElement("span", {
|
|
110
|
+
title: "Initial",
|
|
111
|
+
className: css.flagInitial
|
|
112
|
+
}, "i"))
|
|
113
|
+
}, /*#__PURE__*/React.createElement(AssetInfo, {
|
|
114
|
+
className: css.assetInfo,
|
|
115
|
+
item: item,
|
|
116
|
+
labels: labels,
|
|
117
|
+
chunks: chunks,
|
|
118
|
+
CustomComponentLink: CustomComponentLink
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
111
121
|
};
|
|
112
122
|
|
|
113
123
|
export const BundleAssets = props => {
|
|
@@ -146,19 +156,22 @@ export const BundleAssets = props => {
|
|
|
146
156
|
className: cx(css.root, className)
|
|
147
157
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
148
158
|
className: css.toolbar,
|
|
149
|
-
renderActions:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
renderActions: _ref5 => {
|
|
160
|
+
let {
|
|
161
|
+
actionClassName
|
|
162
|
+
} = _ref5;
|
|
163
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
164
|
+
space: "xsmall",
|
|
165
|
+
className: cx(css.dropdown, actionClassName)
|
|
166
|
+
}, /*#__PURE__*/React.createElement(SortDropdown, _extends({
|
|
167
|
+
fields: sortFields
|
|
168
|
+
}, sort, {
|
|
169
|
+
onChange: updateSort
|
|
170
|
+
})), /*#__PURE__*/React.createElement(MetricsTableOptions, {
|
|
171
|
+
handleViewAll: resetAllFilters,
|
|
172
|
+
handleResetFilters: resetFilters
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
162
175
|
}, /*#__PURE__*/React.createElement(FlexStack, null, /*#__PURE__*/React.createElement(MetricsTableSearch, {
|
|
163
176
|
className: css.toolbarSearch,
|
|
164
177
|
placeholder: "Search by name",
|
package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js
CHANGED
|
@@ -17,17 +17,32 @@ import { getColors } from '../../utils';
|
|
|
17
17
|
import { Stack } from '../../layout/stack';
|
|
18
18
|
import { SummaryItem } from '../summary-item';
|
|
19
19
|
import css from './bundle-assets-totals-chart-bars.module.css';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
|
|
21
|
+
const getTooltip = (items, jobs, itemIndex, runIndex) => () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
22
|
+
className: css.itemTooltip,
|
|
23
|
+
id: _get(items, [itemIndex, 'key']),
|
|
24
|
+
data: {
|
|
25
|
+
current: _get(items, [itemIndex, 'runs', runIndex, 'value'], 0),
|
|
26
|
+
baseline: _get(items, [itemIndex, 'runs', runIndex + 1, 'value'], 0)
|
|
27
|
+
},
|
|
28
|
+
showDelta: runIndex < jobs.length - 1,
|
|
29
|
+
showBaselineValue: runIndex < jobs.length - 1,
|
|
30
|
+
size: "large"
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const BundleAssetsTotalsChartBars = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
className,
|
|
36
|
+
jobs,
|
|
37
|
+
customComponentLink: CustomComponentLink
|
|
38
|
+
} = _ref;
|
|
25
39
|
const rootClassName = cx(css.root, className);
|
|
26
40
|
const items = webpack.compareBySection.sizes(jobs);
|
|
27
41
|
const dataGraphs = [];
|
|
28
|
-
items.forEach(
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
items.forEach(_ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
runs
|
|
45
|
+
} = _ref2;
|
|
31
46
|
runs.forEach((run, runIndex) => {
|
|
32
47
|
dataGraphs[runIndex] = [...(dataGraphs[runIndex] || []), _get(run, 'value', 0)];
|
|
33
48
|
});
|
|
@@ -37,10 +52,11 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
37
52
|
|
|
38
53
|
const maxValue = _max(maxValues);
|
|
39
54
|
|
|
40
|
-
const labels = items.map(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
const labels = items.map(_ref3 => {
|
|
56
|
+
let {
|
|
57
|
+
key,
|
|
58
|
+
label
|
|
59
|
+
} = _ref3;
|
|
44
60
|
const fileType = ASSETS_SIZES_FILE_TYPE_MAP[key];
|
|
45
61
|
const componentData = getBundleAssetsFileTypeComponentLink(fileType, label);
|
|
46
62
|
return /*#__PURE__*/React.createElement(CustomComponentLink, _extends({
|
|
@@ -48,19 +64,6 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
48
64
|
}, componentData), label);
|
|
49
65
|
});
|
|
50
66
|
const colors = getColors(_max(_map(dataGraphs, values => values.length)));
|
|
51
|
-
|
|
52
|
-
const getTooltip = (itemIndex, runIndex) => () => /*#__PURE__*/React.createElement(SummaryItem, {
|
|
53
|
-
className: css.itemTooltip,
|
|
54
|
-
id: _get(items, [itemIndex, 'key']),
|
|
55
|
-
data: {
|
|
56
|
-
current: _get(items, [itemIndex, 'runs', runIndex, 'value'], 0),
|
|
57
|
-
baseline: _get(items, [itemIndex, 'runs', runIndex + 1, 'value'], 0)
|
|
58
|
-
},
|
|
59
|
-
showDelta: runIndex < jobs.length - 1,
|
|
60
|
-
showBaselineValue: runIndex < jobs.length - 1,
|
|
61
|
-
size: "large"
|
|
62
|
-
});
|
|
63
|
-
|
|
64
67
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
65
68
|
className: rootClassName,
|
|
66
69
|
space: "medium"
|
|
@@ -72,7 +75,7 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
72
75
|
value,
|
|
73
76
|
color: colors[valueIndex],
|
|
74
77
|
label: labels[valueIndex],
|
|
75
|
-
getItemTooltip: getTooltip(valueIndex, runIndex)
|
|
78
|
+
getItemTooltip: getTooltip(items, jobs, valueIndex, runIndex)
|
|
76
79
|
}));
|
|
77
80
|
return /*#__PURE__*/React.createElement("div", {
|
|
78
81
|
key: internalBuildNumber || runIndex,
|
|
@@ -5,11 +5,12 @@ import * as webpack from '@bundle-stats/utils/lib-esm/webpack';
|
|
|
5
5
|
import { ASSETS_SIZES_FILE_TYPE_MAP } from '../../constants';
|
|
6
6
|
import { MetricsTable } from '../metrics-table';
|
|
7
7
|
import { ComponentLink } from '../component-link';
|
|
8
|
-
export const BundleAssetsTotalsTable =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export const BundleAssetsTotalsTable = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
jobs,
|
|
12
|
+
customComponentLink: CustomComponentLink
|
|
13
|
+
} = _ref;
|
|
13
14
|
const items = webpack.compareBySection.sizes(jobs);
|
|
14
15
|
|
|
15
16
|
const renderRowHeader = item => {
|
|
@@ -25,12 +25,14 @@ import { MetricsTableTitle } from '../metrics-table-title';
|
|
|
25
25
|
import { ModuleInfo } from '../module-info';
|
|
26
26
|
import css from './bundle-modules.module.css';
|
|
27
27
|
|
|
28
|
-
const RowHeader =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
const RowHeader = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
row,
|
|
31
|
+
chunks,
|
|
32
|
+
labels,
|
|
33
|
+
CustomComponentLink
|
|
34
|
+
} = _ref;
|
|
35
|
+
|
|
34
36
|
const chunkIds = _map(chunks, 'id');
|
|
35
37
|
|
|
36
38
|
const [showPopopver, setPopover] = useState(false);
|
|
@@ -43,17 +45,20 @@ const RowHeader = ({
|
|
|
43
45
|
}, !showPopopver ? content : /*#__PURE__*/React.createElement(Popover, {
|
|
44
46
|
ariaLabel: "View module info",
|
|
45
47
|
label: content
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
}, _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
popoverToggle
|
|
51
|
+
} = _ref2;
|
|
52
|
+
return /*#__PURE__*/React.createElement(ModuleInfo, {
|
|
53
|
+
className: css.namePopover,
|
|
54
|
+
item: row,
|
|
55
|
+
chunks: chunks,
|
|
56
|
+
chunkIds: chunkIds,
|
|
57
|
+
labels: labels,
|
|
58
|
+
customComponentLink: CustomComponentLink,
|
|
59
|
+
onClick: popoverToggle
|
|
60
|
+
});
|
|
61
|
+
}));
|
|
57
62
|
};
|
|
58
63
|
|
|
59
64
|
RowHeader.propTypes = {
|
|
@@ -71,35 +76,39 @@ RowHeader.defaultProps = {
|
|
|
71
76
|
chunks: []
|
|
72
77
|
};
|
|
73
78
|
|
|
74
|
-
const getRenderRowHeader =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
const getRenderRowHeader = _ref3 => {
|
|
80
|
+
let {
|
|
81
|
+
labels,
|
|
82
|
+
chunks,
|
|
83
|
+
CustomComponentLink
|
|
84
|
+
} = _ref3;
|
|
85
|
+
return row => /*#__PURE__*/React.createElement(RowHeader, {
|
|
86
|
+
row: row,
|
|
87
|
+
chunks: chunks,
|
|
88
|
+
labels: labels,
|
|
89
|
+
CustomComponentLink: CustomComponentLink
|
|
90
|
+
});
|
|
91
|
+
};
|
|
84
92
|
|
|
85
|
-
export const BundleModules =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
93
|
+
export const BundleModules = _ref4 => {
|
|
94
|
+
let {
|
|
95
|
+
className,
|
|
96
|
+
jobs,
|
|
97
|
+
items,
|
|
98
|
+
chunks,
|
|
99
|
+
totalRowCount,
|
|
100
|
+
updateFilters,
|
|
101
|
+
resetFilters,
|
|
102
|
+
resetAllFilters,
|
|
103
|
+
filters,
|
|
104
|
+
sortFields,
|
|
105
|
+
sort,
|
|
106
|
+
updateSort,
|
|
107
|
+
search,
|
|
108
|
+
updateSearch,
|
|
109
|
+
hasActiveFilters,
|
|
110
|
+
customComponentLink: CustomComponentLink
|
|
111
|
+
} = _ref4;
|
|
103
112
|
const rootClassName = cx(css.root, className);
|
|
104
113
|
const labels = useMemo(() => _map(jobs, 'label'), [jobs]);
|
|
105
114
|
const renderRowHeader = useMemo(() => getRenderRowHeader({
|
|
@@ -134,15 +143,18 @@ export const BundleModules = ({
|
|
|
134
143
|
...(!_isEmpty(chunks) && {
|
|
135
144
|
[MODULE_CHUNK]: {
|
|
136
145
|
label: 'Chunk',
|
|
137
|
-
...chunks.reduce((chunkFilters, {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
...chunks.reduce((chunkFilters, _ref5) => {
|
|
147
|
+
let {
|
|
148
|
+
id,
|
|
149
|
+
name
|
|
150
|
+
} = _ref5;
|
|
151
|
+
return { ...chunkFilters,
|
|
152
|
+
[id]: {
|
|
153
|
+
label: name,
|
|
154
|
+
defaultValue: _get(filters, `${MODULE_CHUNK}.${id}`, true)
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}, {})
|
|
146
158
|
}
|
|
147
159
|
}),
|
|
148
160
|
// Module source types
|
|
@@ -160,19 +172,22 @@ export const BundleModules = ({
|
|
|
160
172
|
className: rootClassName
|
|
161
173
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
162
174
|
className: css.toolbar,
|
|
163
|
-
renderActions:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
renderActions: _ref6 => {
|
|
176
|
+
let {
|
|
177
|
+
actionClassName
|
|
178
|
+
} = _ref6;
|
|
179
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
180
|
+
space: "xxsmall",
|
|
181
|
+
className: cx(css.dropdown, actionClassName)
|
|
182
|
+
}, /*#__PURE__*/React.createElement(SortDropdown, _extends({
|
|
183
|
+
className: css.tableDropdown,
|
|
184
|
+
fields: sortFields,
|
|
185
|
+
onChange: updateSort
|
|
186
|
+
}, sort)), /*#__PURE__*/React.createElement(MetricsTableOptions, {
|
|
187
|
+
handleViewAll: resetAllFilters,
|
|
188
|
+
handleResetFilters: resetFilters
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
176
191
|
}, /*#__PURE__*/React.createElement(FlexStack, null, /*#__PURE__*/React.createElement(MetricsTableSearch, {
|
|
177
192
|
className: css.toolbarSearch,
|
|
178
193
|
search: search,
|
|
@@ -49,11 +49,12 @@ export const getRowFilter = filters => row => {
|
|
|
49
49
|
|
|
50
50
|
return true;
|
|
51
51
|
};
|
|
52
|
-
export const useModuleFilterByChunk =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
export const useModuleFilterByChunk = _ref => {
|
|
53
|
+
let {
|
|
54
|
+
jobs,
|
|
55
|
+
filters,
|
|
56
|
+
chunkIds
|
|
57
|
+
} = _ref;
|
|
57
58
|
const filteredJobs = useMemo(() => {
|
|
58
59
|
// List of chunkIds with filter value set to `true`
|
|
59
60
|
const includedChunkIds = chunkIds.reduce((agg, chunkId) => {
|
|
@@ -74,7 +75,9 @@ export const useModuleFilterByChunk = ({
|
|
|
74
75
|
const {
|
|
75
76
|
modules
|
|
76
77
|
} = (job == null ? void 0 : (_job$metrics = job.metrics) == null ? void 0 : _job$metrics.webpack) || {};
|
|
77
|
-
const filteredModules = Object.entries(modules).reduce((agg,
|
|
78
|
+
const filteredModules = Object.entries(modules).reduce((agg, _ref2) => {
|
|
79
|
+
let [moduleId, moduleEntry] = _ref2;
|
|
80
|
+
|
|
78
81
|
const match = _intersection(moduleEntry.chunkIds, includedChunkIds);
|
|
79
82
|
|
|
80
83
|
if (match.length > 0) {
|
|
@@ -28,9 +28,12 @@ export const BundleModules = props => {
|
|
|
28
28
|
var _job$meta, _job$meta$webpack;
|
|
29
29
|
|
|
30
30
|
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
|
-
}).flat(),
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
}).flat(), _ref => {
|
|
32
|
+
let {
|
|
33
|
+
id
|
|
34
|
+
} = _ref;
|
|
35
|
+
return id;
|
|
36
|
+
});
|
|
34
37
|
|
|
35
38
|
const chunkIds = _map(chunks, 'id');
|
|
36
39
|
|
|
@@ -21,13 +21,14 @@ import { MetricsTableOptions } from '../metrics-table-options';
|
|
|
21
21
|
import { MetricsTableTitle } from '../metrics-table-title';
|
|
22
22
|
import css from './bundle-packages.module.css';
|
|
23
23
|
|
|
24
|
-
const PackagePopoverContent =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
const PackagePopoverContent = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
name,
|
|
27
|
+
fullName,
|
|
28
|
+
path,
|
|
29
|
+
duplicate,
|
|
30
|
+
CustomComponentLink
|
|
31
|
+
} = _ref;
|
|
31
32
|
const normalizedPackagePath = path || `node_modules/${fullName.split(PACKAGES_SEPARATOR).join('/node_modules/')}/`;
|
|
32
33
|
const [normalizedName, packageId] = name.split(PACKAGE_ID_SEPARATOR);
|
|
33
34
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -75,10 +76,11 @@ PackagePopoverContent.defaultProps = {
|
|
|
75
76
|
path: ''
|
|
76
77
|
};
|
|
77
78
|
|
|
78
|
-
const PackageRowHeader =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
const PackageRowHeader = _ref2 => {
|
|
80
|
+
let {
|
|
81
|
+
item,
|
|
82
|
+
CustomComponentLink
|
|
83
|
+
} = _ref2;
|
|
82
84
|
const packageNames = item.label.split(PACKAGES_SEPARATOR);
|
|
83
85
|
const {
|
|
84
86
|
path
|
|
@@ -147,19 +149,22 @@ export const BundlePackages = props => {
|
|
|
147
149
|
className: cx(css.root, className)
|
|
148
150
|
}, /*#__PURE__*/React.createElement(Toolbar, {
|
|
149
151
|
className: css.toolbar,
|
|
150
|
-
renderActions:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
152
|
+
renderActions: _ref3 => {
|
|
153
|
+
let {
|
|
154
|
+
actionClassName
|
|
155
|
+
} = _ref3;
|
|
156
|
+
return /*#__PURE__*/React.createElement(FlexStack, {
|
|
157
|
+
space: "xxsmall",
|
|
158
|
+
className: cx(css.dropdown, actionClassName)
|
|
159
|
+
}, /*#__PURE__*/React.createElement(SortDropdown, _extends({
|
|
160
|
+
fields: sortFields
|
|
161
|
+
}, sort, {
|
|
162
|
+
onChange: updateSort
|
|
163
|
+
})), /*#__PURE__*/React.createElement(MetricsTableOptions, {
|
|
164
|
+
handleViewAll: resetAllFilters,
|
|
165
|
+
handleResetFilters: resetFilters
|
|
166
|
+
}));
|
|
167
|
+
}
|
|
163
168
|
}, /*#__PURE__*/React.createElement(FlexStack, null, /*#__PURE__*/React.createElement(MetricsTableSearch, {
|
|
164
169
|
className: css.toolbarSearch,
|
|
165
170
|
placeholder: "Search by name",
|
|
@@ -5,12 +5,13 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { Link } from 'react-router-dom';
|
|
6
6
|
import { getComponentStateQueryString } from '@bundle-stats/utils';
|
|
7
7
|
import { SECTION_URLS } from '../constants';
|
|
8
|
-
export const ComponentLink =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
export const ComponentLink = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
section,
|
|
11
|
+
title,
|
|
12
|
+
params,
|
|
13
|
+
...props
|
|
14
|
+
} = _ref;
|
|
14
15
|
const search = getComponentStateQueryString(params);
|
|
15
16
|
const location = {
|
|
16
17
|
pathname: SECTION_URLS[section],
|
|
@@ -2,12 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import cx from 'classnames';
|
|
4
4
|
import css from './delta.module.css';
|
|
5
|
-
export const Delta =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const Delta = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
className,
|
|
8
|
+
displayValue,
|
|
9
|
+
deltaType,
|
|
10
|
+
inverted
|
|
11
|
+
} = _ref;
|
|
11
12
|
const rootClassName = cx(css.root, className, inverted && css.inverted, css[deltaType]);
|
|
12
13
|
return /*#__PURE__*/React.createElement("span", {
|
|
13
14
|
className: rootClassName
|