@parca/profile 0.14.29 → 0.14.30
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 +11 -0
- package/package.json +2 -2
- package/src/ProfileView.tsx +2 -2
- package/src/TopTable.tsx +6 -6
- package/src/components/DiffLegend.tsx +1 -1
- package/src/useDelayedLoader.ts +1 -1
- package/src/useQuery.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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
|
+
## [0.14.30](https://github.com/parca-dev/parca/compare/ui-v0.14.29...ui-v0.14.30) (2022-08-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui:** run eslint --fix ([#1542](https://github.com/parca-dev/parca/issues/1542)) ([e522131](https://github.com/parca-dev/parca/commit/e5221318fc1140d661c45d2d04b096bfebba4af4))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [0.14.29](https://github.com/parca-dev/parca/compare/ui-v0.14.28...ui-v0.14.29) (2022-08-15)
|
|
7
18
|
|
|
8
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parca/profile",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.30",
|
|
4
4
|
"description": "Profile viewing libraries",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@iconify/react": "^3.2.2",
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"access": "public",
|
|
23
23
|
"registry": "https://registry.npmjs.org/"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "9c8d0ec834d23db619a26b999d543c6bc40f7e16"
|
|
26
26
|
}
|
package/src/ProfileView.tsx
CHANGED
|
@@ -126,7 +126,7 @@ export const ProfileView = ({
|
|
|
126
126
|
|
|
127
127
|
const downloadPProf = async (e: React.MouseEvent<HTMLElement>) => {
|
|
128
128
|
e.preventDefault();
|
|
129
|
-
if (
|
|
129
|
+
if (profileSource == null || queryClient == null) {
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
132
|
|
|
@@ -169,7 +169,7 @@ export const ProfileView = ({
|
|
|
169
169
|
<div className="flex py-3 w-full">
|
|
170
170
|
<div className="w-2/5 flex space-x-4">
|
|
171
171
|
<div className="flex space-x-1">
|
|
172
|
-
{profileSource && queryClient ? (
|
|
172
|
+
{profileSource != null && queryClient != null ? (
|
|
173
173
|
<ProfileShareButton
|
|
174
174
|
queryRequest={profileSource.QueryRequest()}
|
|
175
175
|
queryClient={queryClient}
|
package/src/TopTable.tsx
CHANGED
|
@@ -46,7 +46,7 @@ const useSortableData = (top?: Top, config = {key: 'cumulative', direction: 'des
|
|
|
46
46
|
config
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
const rawTableReport = top ? top.list : [];
|
|
49
|
+
const rawTableReport = top != null ? top.list : [];
|
|
50
50
|
|
|
51
51
|
const items = rawTableReport.map(node => ({
|
|
52
52
|
...node,
|
|
@@ -59,7 +59,7 @@ const useSortableData = (top?: Top, config = {key: 'cumulative', direction: 'des
|
|
|
59
59
|
const sortedItems = React.useMemo(() => {
|
|
60
60
|
if (!items) return;
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
const sortableItems = [...items];
|
|
63
63
|
if (sortConfig !== null) {
|
|
64
64
|
sortableItems.sort((a, b) => {
|
|
65
65
|
if (a[sortConfig.key] < b[sortConfig.key]) {
|
|
@@ -76,7 +76,7 @@ const useSortableData = (top?: Top, config = {key: 'cumulative', direction: 'des
|
|
|
76
76
|
|
|
77
77
|
const requestSort = key => {
|
|
78
78
|
let direction = 'desc';
|
|
79
|
-
if (sortConfig && sortConfig.key === key && sortConfig.direction === 'desc') {
|
|
79
|
+
if (sortConfig != null && sortConfig.key === key && sortConfig.direction === 'desc') {
|
|
80
80
|
direction = 'asc';
|
|
81
81
|
}
|
|
82
82
|
setSortConfig({key, direction});
|
|
@@ -96,7 +96,7 @@ export const RowLabel = (meta: TopNodeMeta | undefined): string => {
|
|
|
96
96
|
return `${mapping} ${meta.function.name}`;
|
|
97
97
|
|
|
98
98
|
const address = hexifyAddress(meta.location?.address);
|
|
99
|
-
const fallback = `${mapping} ${address
|
|
99
|
+
const fallback = `${mapping} ${address}`;
|
|
100
100
|
|
|
101
101
|
return fallback === '' ? '<unknown>' : fallback;
|
|
102
102
|
};
|
|
@@ -109,11 +109,11 @@ export const TopTable = ({data: top, sampleUnit}: TopTableProps): JSX.Element =>
|
|
|
109
109
|
|
|
110
110
|
const unit = sampleUnit;
|
|
111
111
|
|
|
112
|
-
const total = top ? top.list.length : 0;
|
|
112
|
+
const total = top != null ? top.list.length : 0;
|
|
113
113
|
if (total === 0) return <>Profile has no samples</>;
|
|
114
114
|
|
|
115
115
|
const getClassNamesFor = name => {
|
|
116
|
-
if (
|
|
116
|
+
if (sortConfig == null) {
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
return sortConfig.key === name ? sortConfig.direction : undefined;
|
|
@@ -57,7 +57,7 @@ const DiffLegendBar = ({
|
|
|
57
57
|
const DiffLegend = () => {
|
|
58
58
|
const [showLegendTooltip, setShowLegendTooltip] = useState(false);
|
|
59
59
|
const [popperElement, setPopperElement] = useState<HTMLDivElement | null>(null);
|
|
60
|
-
|
|
60
|
+
const [referenceElement, setReferenceElement] = useState<HTMLDivElement | null>(null);
|
|
61
61
|
|
|
62
62
|
const {styles, attributes, ...popperProps} = usePopper(referenceElement, popperElement, {
|
|
63
63
|
placement: 'auto-start',
|
package/src/useDelayedLoader.ts
CHANGED
|
@@ -18,7 +18,7 @@ interface DelayedLoaderOptions {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const useDelayedLoader = (isLoading = false, options?: DelayedLoaderOptions) => {
|
|
21
|
-
const {delay = 500} = options || {};
|
|
21
|
+
const {delay = 500} = options != null || {};
|
|
22
22
|
const [isLoaderVisible, setIsLoaderVisible] = useState<boolean>(false);
|
|
23
23
|
useEffect(() => {
|
|
24
24
|
let showLoaderTimeout;
|
package/src/useQuery.tsx
CHANGED
|
@@ -35,7 +35,7 @@ export const useQuery = (
|
|
|
35
35
|
reportType: QueryRequest_ReportType,
|
|
36
36
|
options?: UseQueryOptions
|
|
37
37
|
): IQueryResult => {
|
|
38
|
-
const {skip = false} = options || {};
|
|
38
|
+
const {skip = false} = options != null || {};
|
|
39
39
|
const [result, setResult] = useState<IQueryResult>({
|
|
40
40
|
response: null,
|
|
41
41
|
error: null,
|
|
@@ -58,8 +58,8 @@ export const useQuery = (
|
|
|
58
58
|
const call = client.query(req, {meta: metadata});
|
|
59
59
|
|
|
60
60
|
call.response
|
|
61
|
-
.then(response => setResult({response
|
|
62
|
-
.catch(error => setResult({error
|
|
61
|
+
.then(response => setResult({response, error: null, isLoading: false}))
|
|
62
|
+
.catch(error => setResult({error, response: null, isLoading: false}));
|
|
63
63
|
}, [client, profileSource, metadata, reportType]);
|
|
64
64
|
|
|
65
65
|
return result;
|