@bundle-stats/ui 3.2.1-alpha.0 → 3.2.1-beta.3
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 +12 -1
- 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/bundle-assets/bundle-assets.js +93 -80
- package/lib-esm/components/bundle-assets-totals-chart-bars/bundle-assets-totals-chart-bars.js +15 -12
- 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 +5 -4
- 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 +44 -32
- 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 +73 -69
- 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/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 +14 -14
- package/src/utils.jsx +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [3.2.1-
|
|
6
|
+
## [3.2.1-beta.3](https://github.com/relative-ci/bundle-stats/compare/v3.2.0...v3.2.1-beta.3) (2021-11-21)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui:** Remove unused icons ([8c337da](https://github.com/relative-ci/bundle-stats/commit/8c337da68a9628d9ef4c9d27f11747b0bc548f29))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [3.2.0-beta.2](https://github.com/relative-ci/bundle-stats/compare/v3.2.0...v3.2.0-beta.2) (2021-11-21)
|
|
7
18
|
|
|
8
19
|
|
|
9
20
|
### Bug Fixes
|
package/lib/utils.js
CHANGED
|
@@ -45,14 +45,17 @@ var getRenderChildWithClassName = function getRenderChildWithClassName(className
|
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
var props = child.props;
|
|
49
|
+
|
|
50
|
+
if (!props) {
|
|
49
51
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
52
|
className: className
|
|
51
53
|
}, child);
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
return /*#__PURE__*/_react["default"].cloneElement(child, _objectSpread(_objectSpread({},
|
|
55
|
-
className: (0, _classnames["default"])(className,
|
|
56
|
+
return /*#__PURE__*/_react["default"].cloneElement(child, _objectSpread(_objectSpread({}, props), {}, {
|
|
57
|
+
className: (0, _classnames["default"])(className, props.className) // eslint-disable-line react/prop-types
|
|
58
|
+
|
|
56
59
|
}));
|
|
57
60
|
};
|
|
58
61
|
};
|
package/lib-esm/app/app.js
CHANGED
|
@@ -33,20 +33,23 @@ const ScrollToTop = () => {
|
|
|
33
33
|
return null;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
const Layout =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
}))
|
|
36
|
+
const Layout = _ref => {
|
|
37
|
+
let {
|
|
38
|
+
jobs,
|
|
39
|
+
version,
|
|
40
|
+
...props
|
|
41
|
+
} = _ref;
|
|
42
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
43
|
+
className: css.root
|
|
44
|
+
}, /*#__PURE__*/React.createElement(Header, {
|
|
45
|
+
className: css.header,
|
|
46
|
+
jobs: jobs
|
|
47
|
+
}), /*#__PURE__*/React.createElement("main", _extends({
|
|
48
|
+
className: css.main
|
|
49
|
+
}, props)), /*#__PURE__*/React.createElement(Footer, {
|
|
50
|
+
version: version
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
50
53
|
|
|
51
54
|
Layout.propTypes = {
|
|
52
55
|
jobs: PropTypes.arrayOf(PropTypes.object),
|
|
@@ -57,10 +60,11 @@ Layout.defaultProps = {
|
|
|
57
60
|
version: null
|
|
58
61
|
};
|
|
59
62
|
|
|
60
|
-
const AppComponent =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
const AppComponent = _ref2 => {
|
|
64
|
+
let {
|
|
65
|
+
version,
|
|
66
|
+
jobs
|
|
67
|
+
} = _ref2;
|
|
64
68
|
const [bundleStatsState, bundleStatsSetState] = useComponentQueryState(COMPONENT.BUNDLE_ASSETS);
|
|
65
69
|
const [bundlePackagesState, bundlePackagesSetState] = useComponentQueryState(COMPONENT.BUNDLE_PACKAGES);
|
|
66
70
|
const [bundleModulesState, bundleModulesSetState] = useComponentQueryState(COMPONENT.BUNDLE_MODULES);
|
|
@@ -112,22 +116,25 @@ const AppComponent = ({
|
|
|
112
116
|
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
|
|
113
117
|
exact: true,
|
|
114
118
|
path: URLS.ASSETS,
|
|
115
|
-
render:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
119
|
+
render: _ref3 => {
|
|
120
|
+
let {
|
|
121
|
+
location
|
|
122
|
+
} = _ref3;
|
|
123
|
+
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
124
|
+
space: "medium"
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
126
|
+
keys: METRICS_WEBPACK_ASSETS,
|
|
127
|
+
data: jobs[0].summary,
|
|
128
|
+
showSummaryItemDelta: jobs.length !== 1
|
|
129
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
130
|
+
outline: true
|
|
131
|
+
}, /*#__PURE__*/React.createElement(BundleAssets, _extends({
|
|
132
|
+
jobs: jobs,
|
|
133
|
+
setState: bundleStatsSetState
|
|
134
|
+
}, bundleStatsState, {
|
|
135
|
+
key: `${location.pathname}_${location.search}`
|
|
136
|
+
})))));
|
|
137
|
+
}
|
|
131
138
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
132
139
|
exact: true,
|
|
133
140
|
path: URLS.MODULES,
|
|
@@ -146,22 +153,25 @@ const AppComponent = ({
|
|
|
146
153
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
147
154
|
exact: true,
|
|
148
155
|
path: URLS.PACKAGES,
|
|
149
|
-
render:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
render: _ref4 => {
|
|
157
|
+
let {
|
|
158
|
+
location
|
|
159
|
+
} = _ref4;
|
|
160
|
+
return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Stack, {
|
|
161
|
+
space: "medium"
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Summary, {
|
|
163
|
+
keys: METRICS_WEBPACK_PACKAGES,
|
|
164
|
+
data: jobs[0].summary,
|
|
165
|
+
showSummaryItemDelta: jobs.length !== 1
|
|
166
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
167
|
+
outline: true
|
|
168
|
+
}, /*#__PURE__*/React.createElement(BundlePackages, _extends({
|
|
169
|
+
jobs: jobs
|
|
170
|
+
}, bundlePackagesState, {
|
|
171
|
+
setState: bundlePackagesSetState,
|
|
172
|
+
key: `${location.pathname}_${location.search}`
|
|
173
|
+
})))));
|
|
174
|
+
}
|
|
165
175
|
}), /*#__PURE__*/React.createElement(Route, {
|
|
166
176
|
exact: true,
|
|
167
177
|
path: URLS.OVERVIEW,
|
|
@@ -5,25 +5,28 @@ import { Container } from '../../ui/container';
|
|
|
5
5
|
import { JobsHeader } from '../../components/jobs-header';
|
|
6
6
|
import { Logo } from '../../ui/logo';
|
|
7
7
|
import css from './header.module.css';
|
|
8
|
-
export const Header =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}, /*#__PURE__*/React.createElement("
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
export const Header = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
className,
|
|
11
|
+
jobs
|
|
12
|
+
} = _ref;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
14
|
+
as: "header",
|
|
15
|
+
className: cx(css.root, className)
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: css.inner
|
|
18
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
19
|
+
className: css.branding,
|
|
20
|
+
href: "https://github.com/relative-ci/bundle-stats",
|
|
21
|
+
target: "_blank",
|
|
22
|
+
rel: "noopener noreferrer nofollow"
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Logo, {
|
|
24
|
+
className: css.brandingLogo
|
|
25
|
+
}, "BundleStats")), /*#__PURE__*/React.createElement(JobsHeader, {
|
|
26
|
+
className: css.jobs,
|
|
27
|
+
jobs: jobs
|
|
28
|
+
})));
|
|
29
|
+
};
|
|
27
30
|
Header.propTypes = {
|
|
28
31
|
className: PropTypes.string,
|
|
29
32
|
jobs: PropTypes.arrayOf(PropTypes.object)
|
|
@@ -12,12 +12,14 @@ import { FileName } from '../../ui/file-name';
|
|
|
12
12
|
import { ComponentLink } from '../component-link';
|
|
13
13
|
import css from './asset-info.module.css';
|
|
14
14
|
|
|
15
|
-
const ChunkModulesLink =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const ChunkModulesLink = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
as: Component,
|
|
18
|
+
chunks,
|
|
19
|
+
chunkId,
|
|
20
|
+
name
|
|
21
|
+
} = _ref;
|
|
22
|
+
|
|
21
23
|
const chunk = _find(chunks, {
|
|
22
24
|
id: chunkId
|
|
23
25
|
});
|
|
@@ -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,19 @@ 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
|
-
export const BundleAssetsTotalsChartBars =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export const BundleAssetsTotalsChartBars = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
className,
|
|
23
|
+
jobs,
|
|
24
|
+
customComponentLink: CustomComponentLink
|
|
25
|
+
} = _ref;
|
|
25
26
|
const rootClassName = cx(css.root, className);
|
|
26
27
|
const items = webpack.compareBySection.sizes(jobs);
|
|
27
28
|
const dataGraphs = [];
|
|
28
|
-
items.forEach(
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
items.forEach(_ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
runs
|
|
32
|
+
} = _ref2;
|
|
31
33
|
runs.forEach((run, runIndex) => {
|
|
32
34
|
dataGraphs[runIndex] = [...(dataGraphs[runIndex] || []), _get(run, 'value', 0)];
|
|
33
35
|
});
|
|
@@ -37,10 +39,11 @@ export const BundleAssetsTotalsChartBars = ({
|
|
|
37
39
|
|
|
38
40
|
const maxValue = _max(maxValues);
|
|
39
41
|
|
|
40
|
-
const labels = items.map(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
const labels = items.map(_ref3 => {
|
|
43
|
+
let {
|
|
44
|
+
key,
|
|
45
|
+
label
|
|
46
|
+
} = _ref3;
|
|
44
47
|
const fileType = ASSETS_SIZES_FILE_TYPE_MAP[key];
|
|
45
48
|
const componentData = getBundleAssetsFileTypeComponentLink(fileType, label);
|
|
46
49
|
return /*#__PURE__*/React.createElement(CustomComponentLink, _extends({
|
|
@@ -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 => {
|